mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
ffmpegviddec: Correctly flag interlaced state
If the context interlaced state is indicated, the picture interlaced state can be used to correctly indicate GST_VIDEO_BUFFER_FLAG_INTERLACED on output buffers.
This commit is contained in:
parent
899fd3d76e
commit
1638344081
1 changed files with 12 additions and 7 deletions
|
@ -1130,11 +1130,16 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec,
|
||||||
if (G_UNLIKELY (*ret != GST_FLOW_OK))
|
if (G_UNLIKELY (*ret != GST_FLOW_OK))
|
||||||
goto no_output;
|
goto no_output;
|
||||||
|
|
||||||
/* set interlaced flags */
|
if (ffmpegdec->ctx_interlaced) {
|
||||||
if (ffmpegdec->picture->repeat_pict)
|
/* set interlaced flags */
|
||||||
GST_BUFFER_FLAG_SET (out_frame->output_buffer, GST_VIDEO_BUFFER_FLAG_RFF);
|
if (ffmpegdec->picture->repeat_pict)
|
||||||
if (ffmpegdec->picture->top_field_first)
|
GST_BUFFER_FLAG_SET (out_frame->output_buffer, GST_VIDEO_BUFFER_FLAG_RFF);
|
||||||
GST_BUFFER_FLAG_SET (out_frame->output_buffer, GST_VIDEO_BUFFER_FLAG_TFF);
|
if (ffmpegdec->picture->top_field_first)
|
||||||
|
GST_BUFFER_FLAG_SET (out_frame->output_buffer, GST_VIDEO_BUFFER_FLAG_TFF);
|
||||||
|
if (ffmpegdec->picture->interlaced_frame)
|
||||||
|
GST_BUFFER_FLAG_SET (out_frame->output_buffer,
|
||||||
|
GST_VIDEO_BUFFER_FLAG_INTERLACED);
|
||||||
|
}
|
||||||
|
|
||||||
*ret =
|
*ret =
|
||||||
gst_video_decoder_finish_frame (GST_VIDEO_DECODER (ffmpegdec), out_frame);
|
gst_video_decoder_finish_frame (GST_VIDEO_DECODER (ffmpegdec), out_frame);
|
||||||
|
@ -1452,8 +1457,8 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
|
||||||
avcodec_align_dimensions2 (ffmpegdec->context, &width, &height,
|
avcodec_align_dimensions2 (ffmpegdec->context, &width, &height,
|
||||||
linesize_align);
|
linesize_align);
|
||||||
edge =
|
edge =
|
||||||
ffmpegdec->context->
|
ffmpegdec->
|
||||||
flags & CODEC_FLAG_EMU_EDGE ? 0 : avcodec_get_edge_width ();
|
context->flags & CODEC_FLAG_EMU_EDGE ? 0 : avcodec_get_edge_width ();
|
||||||
/* increase the size for the padding */
|
/* increase the size for the padding */
|
||||||
width += edge << 1;
|
width += edge << 1;
|
||||||
height += edge << 1;
|
height += edge << 1;
|
||||||
|
|
Loading…
Reference in a new issue