From 9cdafffe7f4e3b9e64ee7692ca2ed31d6093bbcd Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 22 May 2014 11:50:16 -0400 Subject: [PATCH] Revert "h264parser: Remove unused fps_num/fps_den fields" This breaks the build since mss has not been ported. This reverts commit aeb6a520742fd82888e41ea23f9a39add51125a0. --- gst-libs/gst/codecparsers/gsth264parser.c | 21 ++++++++++++++++++++- gst-libs/gst/codecparsers/gsth264parser.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c index 026e7a108c..a4ae3a618f 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: diff --git a/gst-libs/gst/codecparsers/gsth264parser.h b/gst-libs/gst/codecparsers/gsth264parser.h index 60af0c4801..397d9a5e0e 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.h +++ b/gst-libs/gst/codecparsers/gsth264parser.h @@ -485,6 +485,7 @@ struct _GstH264SPS gint width, height; gint crop_rect_width, crop_rect_height; gint crop_rect_x, crop_rect_y; + gint fps_num, fps_den; gboolean valid; }; -- 2.34.1