From f3587c61ba83c332795849006ced5f80a6adbd31 Mon Sep 17 00:00:00 2001 From: Fuwei Tang Date: Sat, 3 Aug 2019 11:31:21 +0800 Subject: [PATCH] h264parse: fix issue that caps "interlace-mode" can't be updated correctly Upstream overrides the info "interlace-mode", otherwise update it with SPS info. --- gst/videoparsers/gsth264parse.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index abf6bab15e..d7605bbff0 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -2074,12 +2074,17 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps) } } - if (sps->frame_mbs_only_flag == 0) + + /* upstream overrides or uses sps info */ + if (s && gst_structure_has_field (s, "interlace-mode")) + imode = + gst_video_interlace_mode_from_string (gst_structure_get_string (s, + "interlace-mode")); + else if (sps->frame_mbs_only_flag == 0) imode = GST_VIDEO_INTERLACE_MODE_MIXED; - if (s && !gst_structure_has_field (s, "interlace-mode")) - gst_caps_set_simple (caps, "interlace-mode", G_TYPE_STRING, - gst_video_interlace_mode_to_string (imode), NULL); + gst_caps_set_simple (caps, "interlace-mode", G_TYPE_STRING, + gst_video_interlace_mode_to_string (imode), NULL); bit_depth_chroma = sps->bit_depth_chroma_minus8 + 8;