summaryrefslogtreecommitdiff
path: root/gst-libs/gst/codecparsers/gsth264parser.c
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2014-05-22 11:50:16 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2014-05-22 13:03:33 -0400
commit9cdafffe7f4e3b9e64ee7692ca2ed31d6093bbcd (patch)
treeeccb64faa4b69912a39e56f16e6c8443ddb26f23 /gst-libs/gst/codecparsers/gsth264parser.c
parentaeb6a520742fd82888e41ea23f9a39add51125a0 (diff)
downloadgstreamer-plugins-bad-9cdafffe7f4e3b9e64ee7692ca2ed31d6093bbcd.tar.gz
Revert "h264parser: Remove unused fps_num/fps_den fields"
This breaks the build since mss has not been ported. This reverts commit aeb6a520742fd82888e41ea23f9a39add51125a0.
Diffstat (limited to 'gst-libs/gst/codecparsers/gsth264parser.c')
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c
index 026e7a108..a4ae3a618 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.c
+++ b/gst-libs/gst/codecparsers/gsth264parser.c
@@ -1347,7 +1347,26 @@ gst_h264_parse_sps_data (NalReader * nr, GstH264SPS * sps,
GST_LOG ("crop_rectangle x=%u y=%u width=%u, height=%u", sps->crop_rect_x,
sps->crop_rect_y, width, height);
}
-
+ sps->fps_num = 0;
+ sps->fps_den = 1;
+
+ if (vui && vui->timing_info_present_flag) {
+ /* derive framerate */
+ /* FIXME verify / also handle other cases */
+ GST_LOG ("Framerate: %u %u %u %u", parse_vui_params,
+ vui->fixed_frame_rate_flag, sps->frame_mbs_only_flag,
+ vui->pic_struct_present_flag);
+
+ if (parse_vui_params && vui->fixed_frame_rate_flag) {
+ sps->fps_num = vui->time_scale;
+ sps->fps_den = vui->num_units_in_tick;
+ /* picture is a frame = 2 fields */
+ sps->fps_den *= 2;
+ GST_LOG ("framerate %d/%d", sps->fps_num, sps->fps_den);
+ }
+ } else {
+ GST_LOG ("No VUI, unknown framerate");
+ }
return TRUE;
error: