encoderd: get frame size over vipc (#31276)

* encoderd: get frame size over vipc

* bump cereal

* fix ffmpeg

* no print
old-commit-hash: a5766e27967707d51c4e7181a3509c78b3671d16
This commit is contained in:
Adeeb Shihadeh
2024-02-02 12:53:12 -08:00
committed by GitHub
parent 2852e61e40
commit 2632a41c1e
7 changed files with 21 additions and 14 deletions
+7 -7
View File
@@ -29,16 +29,16 @@ FfmpegEncoder::FfmpegEncoder(const EncoderInfo &encoder_info, int in_width, int
frame = av_frame_alloc();
assert(frame);
frame->format = AV_PIX_FMT_YUV420P;
frame->width = encoder_info.frame_width;
frame->height = encoder_info.frame_height;
frame->linesize[0] = encoder_info.frame_width;
frame->linesize[1] = encoder_info.frame_width/2;
frame->linesize[2] = encoder_info.frame_width/2;
frame->width = out_width;
frame->height = out_height;
frame->linesize[0] = out_width;
frame->linesize[1] = out_width/2;
frame->linesize[2] = out_width/2;
convert_buf.resize(in_width * in_height * 3 / 2);
if (in_width != encoder_info.frame_width || in_height != encoder_info.frame_height) {
downscale_buf.resize(encoder_info.frame_width * encoder_info.frame_height * 3 / 2);
if (in_width != out_width || in_height != out_height) {
downscale_buf.resize(out_width * out_height * 3 / 2);
}
}