mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 04:22:09 +08:00
a053d070be
* enable encoderd * correct enable line * fix loggerd tests * fix power draw and cpu tests * correct cpu for encoderd * fix a bug, video_writer is shared * fix issue with not recording dcam * add recording state * wooo tests pass. encode id keeps counting * core 3 * loggerd then encoderd * stop loggerd first * core 3 always online * see the camera when we see encoder packet * encoderd on small core uses 37% * remove encoder logic from loggerd * delete unit test that doesn't really make sense anymore Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: 94b9972eb798408a3c412716b8d9eb8ddb9354bc
26 lines
603 B
C++
26 lines
603 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, raw;
|
|
}; |