[vlc-commits] packetizer: h264: rename and constify h264_get_spspps

Francois Cartegnie git at videolan.org
Thu Sep 22 11:57:36 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 22 11:56:17 2016 +0200| [734d698e30bd090d6569df20edd2bf92a8183223] | committer: Francois Cartegnie

packetizer: h264: rename and constify h264_get_spspps

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

 modules/codec/omxil/mediacodec.c |  4 ++--
 modules/codec/videotoolbox.m     |  4 ++--
 modules/mux/mp4/libmp4mux.c      | 12 ++++++------
 modules/packetizer/h264_nal.c    |  8 ++++----
 modules/packetizer/h264_nal.h    |  8 ++++----
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 285a395..b0afcc0 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -263,11 +263,11 @@ static int H264SetCSD(decoder_t *p_dec, void *p_buf, size_t i_size,
                       bool *p_size_changed)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
-    uint8_t *p_sps_buf = NULL, *p_pps_buf = NULL, *p_ext_buf = NULL;
+    const uint8_t *p_sps_buf = NULL, *p_pps_buf = NULL, *p_ext_buf = NULL;
     size_t i_sps_size = 0, i_pps_size = 0, i_ext_size = 0;
 
     /* Check if p_buf contains a valid SPS PPS */
-    if (h264_get_spspps(p_buf, i_size,
+    if (h264_AnnexB_get_spspps(p_buf, i_size,
                         &p_sps_buf, &i_sps_size,
                         &p_pps_buf, &i_pps_size,
                         &p_ext_buf, &i_ext_size) == 0 )
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 0df8fbb..00745d5 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -414,9 +414,9 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t *p_block)
 
         /* get the SPS and PPS units from the NAL unit which is either
          * part of the demuxer's avvC atom or the mid stream data block */
-        uint8_t *p_sps_ab = NULL, *p_pps_ab = NULL, *p_ext_ab = NULL;
+        const uint8_t *p_sps_ab = NULL, *p_pps_ab = NULL, *p_ext_ab = NULL;
         size_t i_sps_absize = 0, i_pps_absize = 0, i_ext_absize = 0;
-        i_ret = h264_get_spspps(p_buf, i_buf,
+        i_ret = h264_AnnexB_get_spspps(p_buf, i_buf,
                                 &p_sps_ab, &i_sps_absize,
                                 &p_pps_ab, &i_pps_absize,
                                 &p_ext_ab, &i_ext_absize);
diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index c3326cd..e89a206 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -27,7 +27,7 @@
 #include "libmp4mux.h"
 #include "../demux/mp4/libmp4.h" /* flags */
 #include "../packetizer/hevc_nal.h"
-#include "../packetizer/h264_nal.h" /* h264_get_spspps */
+#include "../packetizer/h264_nal.h" /* h264_AnnexB_get_spspps */
 #include "../packetizer/hxxx_nal.h"
 
 #include <vlc_es.h>
@@ -874,10 +874,10 @@ static bo_t *GetAvcCTag(es_format_t *p_fmt)
     bo_t    *avcC = box_new("avcC");/* FIXME use better value */
     if(!avcC)
         return NULL;
-    uint8_t *p_sps, *p_pps, *p_ext;
+    const uint8_t *p_sps, *p_pps, *p_ext;
     size_t i_sps_size, i_pps_size, i_ext_size;
 
-    if( h264_get_spspps(p_fmt->p_extra, p_fmt->i_extra,
+    if( h264_AnnexB_get_spspps(p_fmt->p_extra, p_fmt->i_extra,
                         &p_sps, &i_sps_size,
                         &p_pps, &i_pps_size,
                         &p_ext, &i_ext_size ) != 0 )
@@ -886,9 +886,9 @@ static bo_t *GetAvcCTag(es_format_t *p_fmt)
         i_sps_size = i_pps_size = i_ext_size = 0;
     }
 
-    (void) hxxx_strip_AnnexB_startcode( (const uint8_t **) &p_sps, &i_sps_size );
-    (void) hxxx_strip_AnnexB_startcode( (const uint8_t **) &p_sps, &i_sps_size );
-    (void) hxxx_strip_AnnexB_startcode( (const uint8_t **) &p_ext, &i_ext_size );
+    (void) hxxx_strip_AnnexB_startcode( &p_sps, &i_sps_size );
+    (void) hxxx_strip_AnnexB_startcode( &p_sps, &i_sps_size );
+    (void) hxxx_strip_AnnexB_startcode( &p_ext, &i_ext_size );
 
     bo_add_8(avcC, 1);      /* configuration version */
     bo_add_8(avcC, i_sps_size > 3 ? p_sps[1] : PROFILE_H264_MAIN);
diff --git a/modules/packetizer/h264_nal.c b/modules/packetizer/h264_nal.c
index 6c5aa47..11f237d 100644
--- a/modules/packetizer/h264_nal.c
+++ b/modules/packetizer/h264_nal.c
@@ -160,10 +160,10 @@ void h264_AVC_to_AnnexB( uint8_t *p_buf, uint32_t i_len,
     }
 }
 
-int h264_get_spspps( uint8_t *p_buf, size_t i_buf,
-                     uint8_t **pp_sps, size_t *p_sps_size,
-                     uint8_t **pp_pps, size_t *p_pps_size,
-                     uint8_t **pp_ext, size_t *p_ext_size )
+int h264_AnnexB_get_spspps( const uint8_t *p_buf, size_t i_buf,
+                            const uint8_t **pp_sps, size_t *p_sps_size,
+                            const uint8_t **pp_pps, size_t *p_pps_size,
+                            const uint8_t **pp_ext, size_t *p_ext_size )
 {
     uint8_t *p_sps = NULL, *p_pps = NULL, *p_ext = NULL;
     size_t i_sps_size = 0, i_pps_size = 0, i_ext_size = 0;
diff --git a/modules/packetizer/h264_nal.h b/modules/packetizer/h264_nal.h
index f47f29c..f8f2cd2 100644
--- a/modules/packetizer/h264_nal.h
+++ b/modules/packetizer/h264_nal.h
@@ -158,10 +158,10 @@ void h264_AVC_to_AnnexB( uint8_t *p_buf, uint32_t i_len,
 
 /* Get the SPS/PPS pointers from an Annex B buffer
  * Returns 0 if a SPS and/or a PPS is found */
-int h264_get_spspps( uint8_t *p_buf, size_t i_buf,
-                     uint8_t **pp_sps, size_t *p_sps_size,
-                     uint8_t **pp_pps, size_t *p_pps_size,
-                     uint8_t **pp_ext, size_t *p_ext_size );
+int h264_AnnexB_get_spspps( const uint8_t *p_buf, size_t i_buf,
+                            const uint8_t **pp_sps, size_t *p_sps_size,
+                            const uint8_t **pp_pps, size_t *p_pps_size,
+                            const uint8_t **pp_ext, size_t *p_ext_size );
 
 /* Create a AVCDecoderConfigurationRecord from SPS/PPS
  * Returns a valid block_t on success, must be freed with block_Release */



More information about the vlc-commits mailing list