mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 10:10:32 +00:00
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:
parent
e35bc2c2b4
commit
7d46d67c59
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
parseres = gst_h264_parse_sps (&nalu, &sps_struct, TRUE);
|
||||||
if (parseres == GST_H264_PARSER_OK) {
|
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,
|
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);
|
buffer = _make_h264_codec_data (sps, pps);
|
||||||
|
|
Loading…
Reference in a new issue