Files
onepilot/system/loggerd/video_writer.h
Dean Lee 9bb3316925 encoder/VideoWriter: remove unnecessary call to avcodec_close (#29039)
old-commit-hash: 95e9232963ad2deed377a3d840f25e40f921b8ca
2023-08-23 20:08:19 -07:00

26 lines
598 B
C++

#pragma once
#include <string>
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
}
#include "cereal/messaging/messaging.h"
class VideoWriter {
public:
VideoWriter(const char *path, const char *filename, bool remuxing, int width, int height, int fps, cereal::EncodeIndex::Type codec);
void write(uint8_t *data, int len, long long timestamp, bool codecconfig, bool keyframe);
~VideoWriter();
private:
std::string vid_path, lock_path;
FILE *of = nullptr;
AVCodecContext *codec_ctx;
AVFormatContext *ofmt_ctx;
AVStream *out_stream;
bool remuxing;
};