[vlc-commits] mux: mp4: encode spsext

Francois Cartegnie git at videolan.org
Fri May 27 12:02:00 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 27 10:56:42 2016 +0200| [f86359895011a20cff2ace69825b1a89acabf677] | committer: Francois Cartegnie

mux: mp4: encode spsext

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

 modules/mux/mp4/libmp4mux.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index 10fbc34..30cc46f 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -839,6 +839,31 @@ static bo_t *GetAvcCTag(es_format_t *p_fmt)
         bo_add_mem(avcC, i_pps_size, p_pps);
     }
 
+    if( p_sps[1] == PROFILE_H264_HIGH ||
+        p_sps[1] == PROFILE_H264_HIGH_10 ||
+        p_sps[1] == PROFILE_H264_HIGH_422 ||
+        p_sps[1] == PROFILE_H264_HIGH_444 ||
+        p_sps[1] == PROFILE_H264_HIGH_444_PREDICTIVE )
+    {
+        h264_sequence_parameter_set_t *p_spsdata = h264_decode_sps( p_sps, i_sps_size, true );
+        if( p_spsdata )
+        {
+            uint8_t data[3];
+            if( h264_get_chroma_luma( p_spsdata, &data[0], &data[1], &data[2]) )
+            {
+                bo_add_8(avcC, 0xFC | data[0]);
+                bo_add_8(avcC, 0xF8 | (data[1] - 8));
+                bo_add_8(avcC, 0xF8 | (data[2] - 8));
+                bo_add_8(avcC, (i_ext_size > 0 ? 1 : 0));
+                if (i_ext_size > 0) {
+                    bo_add_16be(avcC, i_ext_size);
+                    bo_add_mem(avcC, i_ext_size, p_ext);
+                }
+            }
+            h264_release_sps( p_spsdata );
+        }
+    }
+
     return avcC;
 }
 



More information about the vlc-commits mailing list