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
This commit is contained in:
Tim-Philipp Müller 2016-05-25 10:59:00 +01:00
parent e35bc2c2b4
commit 7d46d67c59

View file

@ -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);