[vlc-devel] [PATCH 23/24] [packetizer/dirac] Enable frame size metadata

davidf+nntp at woaf.net davidf+nntp at woaf.net
Thu Oct 30 12:29:52 CET 2008


From: Jonathan Rosser <jrosser at rd.bbc.co.uk>

Signed-off-by: David Flynn <davidf at rd.bbc.co.uk>
---
 modules/packetizer/dirac.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/modules/packetizer/dirac.c b/modules/packetizer/dirac.c
index f92390b..f589c8a 100644
--- a/modules/packetizer/dirac.c
+++ b/modules/packetizer/dirac.c
@@ -245,10 +245,10 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             p_es->p_extra = malloc( p_pic->i_buffer );
             memcpy( p_es->p_extra, p_pic->p_buffer, p_pic->i_buffer);
             p_es->i_extra = p_pic->i_buffer;
-#if 0
+
             p_es->video.i_width  = p_sys->m_seq_hdr.u_width;
             p_es->video.i_height = p_sys->m_seq_hdr.u_height;
-#endif
+
             vlc_ureduce( &p_es->video.i_frame_rate, &p_es->video.i_frame_rate_base
                        , p_sys->m_seq_hdr.u_fps_num, p_sys->m_seq_hdr.u_fps_den, 0 );
 
@@ -308,9 +308,20 @@ static void dirac_UnpackSeqHdr( struct seq_hdr_t *p_sh, block_t *p_block )
 
     uint32_t u_video_format = dirac_uint( &bs ); /* index */
 
+    static const struct {
+        uint32_t u_w, u_h;
+    } dirac_size_tbl[] = {
+        {640,480}, {176,120}, {176,144}, {352,240}, {352,288}, {704,480},
+        {704,576}, {720,480}, {720,576}, {1280,720}, {1280,720}, {1920,1080},
+        {1920,1080}, {1920,1080}, {1920,1080}, {2048,1080}, {4096,2160},
+        {3840,2160}, {3840,2160}, {7680,4320}, {7680,4320},
+    };
+
+    p_sh->u_width = dirac_size_tbl[u_video_format].u_w;
+    p_sh->u_height = dirac_size_tbl[u_video_format].u_h;
     if (dirac_bool( &bs )) {
-        dirac_uint( &bs ); /* frame_width */
-        dirac_uint( &bs ); /* frame_height */
+        p_sh->u_width = dirac_uint( &bs ); /* frame_width */
+        p_sh->u_height = dirac_uint( &bs ); /* frame_height */
     }
 
     if (dirac_bool( &bs )) {
-- 
1.5.6.5




More information about the vlc-devel mailing list