encoder: remove public function `encoder_init` (#28971)

pull/28972/head
Dean Lee 2 years ago committed by GitHub
parent c933fbb074
commit 06aef9edd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      system/loggerd/encoder/ffmpeg_encoder.cc
  2. 4
      system/loggerd/encoder/ffmpeg_encoder.h
  3. 3
      system/loggerd/encoder/v4l_encoder.cc
  4. 4
      system/loggerd/encoder/v4l_encoder.h

@ -24,7 +24,8 @@ extern "C" {
const int env_debug_encoder = (getenv("DEBUG_ENCODER") != NULL) ? atoi(getenv("DEBUG_ENCODER")) : 0;
void FfmpegEncoder::encoder_init() {
FfmpegEncoder::FfmpegEncoder(const EncoderInfo &encoder_info, int in_width, int in_height)
: VideoEncoder(encoder_info, in_width, in_height) {
frame = av_frame_alloc();
assert(frame);
frame->format = AV_PIX_FMT_YUV420P;

@ -16,10 +16,8 @@ extern "C" {
class FfmpegEncoder : public VideoEncoder {
public:
FfmpegEncoder(const EncoderInfo &encoder_info, int in_width, int in_height)
: VideoEncoder(encoder_info, in_width, in_height) { encoder_init(); }
FfmpegEncoder(const EncoderInfo &encoder_info, int in_width, int in_height);
~FfmpegEncoder();
void encoder_init();
int encode_frame(VisionBuf* buf, VisionIpcBufExtra *extra);
void encoder_open(const char* path);
void encoder_close();

@ -131,7 +131,8 @@ void V4LEncoder::dequeue_handler(V4LEncoder *e) {
}
}
void V4LEncoder::encoder_init() {
V4LEncoder::V4LEncoder(const EncoderInfo &encoder_info, int in_width, int in_height)
: VideoEncoder(encoder_info, in_width, in_height) {
fd = open("/dev/v4l/by-path/platform-aa00000.qcom_vidc-video-index1", O_RDWR|O_NONBLOCK);
assert(fd >= 0);

@ -8,10 +8,8 @@
class V4LEncoder : public VideoEncoder {
public:
V4LEncoder(const EncoderInfo &encoder_info, int in_width, int in_height)
: VideoEncoder(encoder_info, in_width, in_height) { encoder_init(); }
V4LEncoder(const EncoderInfo &encoder_info, int in_width, int in_height);
~V4LEncoder();
void encoder_init();
int encode_frame(VisionBuf* buf, VisionIpcBufExtra *extra);
void encoder_open(const char* path);
void encoder_close();

Loading…
Cancel
Save