loggerd/encoder: refactor constructors to take EncoderInfo as parameter (#28921)

* refactor constructors to take EncoderInfo as parameter

* remove last arg codec

* use macro to init function pointers
old-commit-hash: 713d2ec5865e4d64b5bb543f6641783e75e72d0b
This commit is contained in:
Dean Lee
2023-07-16 01:39:40 +08:00
committed by GitHub
parent 8f7729809d
commit b59b27e01e
9 changed files with 57 additions and 86 deletions
+3 -6
View File
@@ -15,12 +15,9 @@ extern "C" {
#include "system/loggerd/loggerd.h"
class FfmpegEncoder : public VideoEncoder {
public:
FfmpegEncoder(const char* filename, CameraType type, int in_width, int in_height, int fps,
int bitrate, cereal::EncodeIndex::Type codec, int out_width, int out_height,
const char* publish_name) :
VideoEncoder(filename, type, in_width, in_height, fps, bitrate, cereal::EncodeIndex::Type::BIG_BOX_LOSSLESS, out_width, out_height, publish_name) { encoder_init(); }
public:
FfmpegEncoder(const EncoderInfo &encoder_info, int in_width, int in_height)
: VideoEncoder(encoder_info, in_width, in_height) { encoder_init(); }
~FfmpegEncoder();
void encoder_init();
int encode_frame(VisionBuf* buf, VisionIpcBufExtra *extra);