From 7d46d67c59eab6cfda24d43220dfba2b0f9131d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 25 May 2016 10:59:00 +0100 Subject: [PATCH] smoothstreaming: update fps calculation for h264 codec parser API changes Use new gst_h264_video_calculate_framerate() API instead of fps_n/fps_d fields in SPS struct which are to be removed. Apparently H264 content in MSS is always non-interlaced/progressive, so we can just pass 0 for field_pic_flag and don't need to parse any slice headers first if there's no external signalling. But even if that's not the case the new code is not worse than the existing code. https://msdn.microsoft.com/en-us/library/cc189080%28VS.95%29.aspx https://bugzilla.gnome.org/show_bug.cgi?id=723352 --- ext/smoothstreaming/gstmssmanifest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c index 02e559cf9c..1b72e8de19 100644 --- a/ext/smoothstreaming/gstmssmanifest.c +++ b/ext/smoothstreaming/gstmssmanifest.c @@ -569,8 +569,13 @@ _gst_mss_stream_add_h264_codec_data (GstCaps * caps, const gchar * codecdatastr) parseres = gst_h264_parse_sps (&nalu, &sps_struct, TRUE); if (parseres == GST_H264_PARSER_OK) { + gint fps_num, fps_den; + + /* MSS apparently only supports non-interlaced/progressive H.264 content */ + gst_h264_video_calculate_framerate (&sps_struct, 0, 0, &fps_num, &fps_den); + gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, - sps_struct.fps_num, sps_struct.fps_den, NULL); + fps_num, fps_den, NULL); } buffer = _make_h264_codec_data (sps, pps);