mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-02 13:29:30 +08:00
b872fe92ab
* seperate writer from encoder
* video writer in release
* confirm loggerd on PC works, add YUV option to compressed_vipc
* make raw_logger use video_writer
* put this back to master
* close codec
* put this back
* use unique_ptr
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 8d24655787
25 lines
546 B
C++
25 lines
546 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
extern "C" {
|
|
#include <libavformat/avformat.h>
|
|
}
|
|
|
|
class VideoWriter {
|
|
public:
|
|
VideoWriter(const char *path, const char *filename, bool remuxing, int width, int height, int fps, bool h265, bool raw);
|
|
void write(uint8_t *data, int len, long long timestamp, bool codecconfig, bool keyframe);
|
|
~VideoWriter();
|
|
AVCodecContext *codec_ctx;
|
|
private:
|
|
std::string vid_path, lock_path;
|
|
|
|
FILE *of = nullptr;
|
|
|
|
AVFormatContext *ofmt_ctx;
|
|
AVStream *out_stream;
|
|
bool remuxing, raw;
|
|
|
|
bool wrote_codec_config;
|
|
}; |