mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 12:32:06 +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: 8d2465578707022ca4a54defe171103955026a65
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;
|
|
}; |