[vlc-devel] [PATCH 3/3] packetizer: h264: fill colour_desc if present

Thomas Guillem thomas at gllm.fr
Sat Apr 16 14:58:44 CEST 2016


---
 modules/packetizer/h264_nal.c | 7 ++++++-
 modules/packetizer/h264_nal.h | 6 ++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/packetizer/h264_nal.c b/modules/packetizer/h264_nal.c
index 71d946f..b97b58d 100644
--- a/modules/packetizer/h264_nal.c
+++ b/modules/packetizer/h264_nal.c
@@ -431,7 +431,12 @@ static bool h264_parse_sequence_parameter_set_rbsp( bs_t *p_bs,
             /* colour desc */
             i_tmp = bs_read( p_bs, 1 );
             if ( i_tmp )
-                bs_read( p_bs, 24 );
+            {
+                p_sps->vui.colour_desc.b_valid = true;
+                p_sps->vui.colour_desc.i_colour_primaries = bs_read( p_bs, 8 );
+                p_sps->vui.colour_desc.i_transfer_characteristics = bs_read( p_bs, 8 );
+                p_sps->vui.colour_desc.i_matrix_coefficients = bs_read( p_bs, 8 );
+            }
         }
 
         /* chroma loc info */
diff --git a/modules/packetizer/h264_nal.h b/modules/packetizer/h264_nal.h
index f59148a..f4e6356 100644
--- a/modules/packetizer/h264_nal.h
+++ b/modules/packetizer/h264_nal.h
@@ -112,6 +112,12 @@ struct h264_sequence_parameter_set_t
     struct {
         bool b_valid;
         int i_sar_num, i_sar_den;
+        struct {
+            bool b_valid;
+            uint8_t i_colour_primaries;
+            uint8_t i_transfer_characteristics;
+            uint8_t i_matrix_coefficients;
+        } colour_desc;
         bool b_timing_info_present_flag;
         uint32_t i_num_units_in_tick;
         uint32_t i_time_scale;
-- 
2.8.0.rc3



More information about the vlc-devel mailing list