[vlc-commits] hevc_nal: add hevc_get_frame_rate

Francois Cartegnie git at videolan.org
Tue Dec 15 17:23:48 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 14 23:12:26 2015 +0100| [5f88e3bdaa275c851bd2ab0d7719a66f40d13b35] | committer: Francois Cartegnie

hevc_nal: add hevc_get_frame_rate

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5f88e3bdaa275c851bd2ab0d7719a66f40d13b35
---

 modules/packetizer/hevc_nal.c |   20 ++++++++++++++++++++
 modules/packetizer/hevc_nal.h |    3 +++
 2 files changed, 23 insertions(+)

diff --git a/modules/packetizer/hevc_nal.c b/modules/packetizer/hevc_nal.c
index 0d74381..0212125 100644
--- a/modules/packetizer/hevc_nal.c
+++ b/modules/packetizer/hevc_nal.c
@@ -1026,6 +1026,26 @@ static bool hevc_get_picture_CtbsYsize( const hevc_sequence_parameter_set_t *p_s
     return true;
 }
 
+bool hevc_get_frame_rate( const hevc_sequence_parameter_set_t *p_sps,
+                          const hevc_video_parameter_set_t **pp_vps,
+                          unsigned *pi_num, unsigned *pi_den )
+{
+    if( p_sps->vui_parameters_present_flag && p_sps->vui.vui_timing_info_present_flag )
+    {
+        *pi_den = p_sps->vui.timing.vui_num_units_in_tick;
+        *pi_num = p_sps->vui.timing.vui_time_scale;
+        return true;
+    }
+    else if( pp_vps && pp_vps[p_sps->sps_video_parameter_set_id] &&
+             pp_vps[p_sps->sps_video_parameter_set_id]->vps_timing_info_present_flag )
+    {
+        *pi_den = pp_vps[p_sps->sps_video_parameter_set_id]->vps_num_units_in_tick;
+        *pi_num = pp_vps[p_sps->sps_video_parameter_set_id]->vps_time_scale;
+        return true;
+    }
+    return false;
+}
+
 static bool hevc_parse_slice_segment_header_rbsp( bs_t *p_bs,
                                                   const hevc_sequence_parameter_set_t **pp_sps,
                                                   const hevc_picture_parameter_set_t **pp_pps,
diff --git a/modules/packetizer/hevc_nal.h b/modules/packetizer/hevc_nal.h
index 7d98417..68fa3ce 100644
--- a/modules/packetizer/hevc_nal.h
+++ b/modules/packetizer/hevc_nal.h
@@ -160,5 +160,8 @@ uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf,
 bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id);
 bool hevc_get_picture_size( const hevc_sequence_parameter_set_t *, unsigned *p_w, unsigned *p_h,
                             unsigned *p_vw, unsigned *p_vh );
+bool hevc_get_frame_rate( const hevc_sequence_parameter_set_t *,
+                          const hevc_video_parameter_set_t ** /* HEVC_MAX_VPS || NULL */,
+                          unsigned *pi_num, unsigned *pi_den );
 
 #endif /* HEVC_NAL_H */



More information about the vlc-commits mailing list