]> git.sesse.net Git - vlc/commitdiff
Replaced vout_InitPicture/Format with their equivalent.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 16 May 2009 19:42:28 +0000 (21:42 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 16 May 2009 20:17:10 +0000 (22:17 +0200)
18 files changed:
include/vlc_vout.h
modules/access/dc1394.c
modules/access/screen/screen.c
modules/access/v4l.c
modules/codec/mash.cpp
modules/codec/rawvideo.c
modules/demux/rawvid.c
modules/stream_out/switcher.c
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
modules/video_output/fb.c
modules/video_output/hd1000v.cpp
modules/video_output/vmem.c
modules/video_output/x11/xcommon.c
modules/video_output/xcb/x11.c
modules/video_output/xcb/xvideo.c
modules/visualization/galaktos/plugin.c
src/libvlccore.sym
src/video_output/vout_pictures.c

index c7f9624ea01acc4f252c3aa7fd2a420474dd3cb6..4a706fcfd4172f5ea8183317685c033a76b228fe 100644 (file)
@@ -74,19 +74,6 @@ struct picture_heap_t
  * Prototypes
  *****************************************************************************/
 
-/**
- * Initialise different fields of a picture_t (but does not allocate memory).
- * \param p_this a vlc object
- * \param p_pic pointer to the picture structure.
- * \param i_chroma the wanted chroma for the picture.
- * \param i_width the wanted width for the picture.
- * \param i_height the wanted height for the picture.
- * \param i_aspect the wanted aspect ratio for the picture.
- */
-#define vout_InitPicture(a,b,c,d,e,f) \
-        __vout_InitPicture(VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( int, __vout_InitPicture, ( vlc_object_t *p_this, picture_t *p_pic, uint32_t i_chroma, int i_width, int i_height, int i_aspect ) );
-
 /**
  * Initialise different fields of a picture_t and allocates the picture buffer.
  * \param p_this a vlc object
@@ -317,7 +304,6 @@ VLC_EXPORT( int, vout_GetSnapshot, ( vout_thread_t *p_vout,
 VLC_EXPORT( int,             vout_ChromaCmp,      ( uint32_t, uint32_t ) );
 
 VLC_EXPORT( picture_t *,     vout_CreatePicture,  ( vout_thread_t *, bool, bool, unsigned int ) );
-VLC_EXPORT( void,            vout_InitFormat,     ( video_frame_format_t *, uint32_t, int, int, int ) );
 VLC_EXPORT( void,            vout_DestroyPicture, ( vout_thread_t *, picture_t * ) );
 VLC_EXPORT( void,            vout_DisplayPicture, ( vout_thread_t *, picture_t * ) );
 VLC_EXPORT( void,            vout_LinkPicture,    ( vout_thread_t *, picture_t * ) );
index ab2cd1d42450dc16dda98e5f28b86886eeff6aca..b79d38a50549071a892b11364812107e801a3c7b 100644 (file)
@@ -33,7 +33,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_input.h>
-#include <vlc_vout.h>
 #include <vlc_demux.h>
 
 
@@ -215,7 +214,6 @@ static int Open( vlc_object_t *p_this )
     int i;
     int i_width;
     int i_height;
-    int i_aspect;
     int result = 0;
 
     if( strncmp(p_demux->psz_access, "dc1394", 6) != 0 )
@@ -477,10 +475,14 @@ static int Open( vlc_object_t *p_this )
     i_width = p_sys->camera.frame_width;
     i_height = p_sys->camera.frame_height;
 
-    i_aspect = vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic,
-                    VLC_CODEC_UYVY,
-                    i_width, i_height,
-                    i_width * VOUT_ASPECT_FACTOR / i_height );
+    if( picture_Setup( &p_sys->pic, VLC_CODEC_UYVY,
+                       i_width, i_height,
+                       i_width * VOUT_ASPECT_FACTOR / i_height ) )
+    {
+        msg_Err( p_demux ,"unknown chroma" );
+        Close( p_this );
+        return VLC_EGENERIC;
+    }
 
     es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_UYVY );
 
index 173823c4334c29725db0669a032918fe5c8972f7..55169f02782f9d8f505da4b1edce9180acb4d95e 100644 (file)
@@ -336,11 +336,11 @@ void RenderCursor( demux_t *p_demux, int i_x, int i_y,
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     if( !p_sys->dst.i_planes )
-        vout_InitPicture( p_demux, &p_sys->dst,
-                          p_sys->fmt.video.i_chroma,
-                          p_sys->fmt.video.i_width,
-                          p_sys->fmt.video.i_height,
-                          p_sys->fmt.video.i_aspect );
+        picture_Setup( &p_sys->dst,
+                       p_sys->fmt.video.i_chroma,
+                       p_sys->fmt.video.i_width,
+                       p_sys->fmt.video.i_height,
+                       p_sys->fmt.video.i_aspect );
     if( !p_sys->p_blend )
     {
         p_sys->p_blend = vlc_object_create( p_demux, sizeof(filter_t) );
index 16e408a7920992bb70c22f76ae7096cd6563502e..b564ad21dc47bf2f9f1d8975e1b354c354b602ad 100644 (file)
@@ -37,7 +37,7 @@
 #include <vlc_input.h>
 #include <vlc_demux.h>
 #include <vlc_access.h>
-#include <vlc_vout.h>
+#include <vlc_picture.h>
 
 #include <sys/ioctl.h>
 #include <sys/mman.h>
@@ -1072,10 +1072,9 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
     else
     {
         /* Fill in picture_t fields */
-        vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic, p_sys->i_fourcc,
-                          p_sys->i_width, p_sys->i_height, p_sys->i_width *
-                          VOUT_ASPECT_FACTOR / p_sys->i_height );
-        if( !p_sys->pic.i_planes )
+        if( picture_Setup( &p_sys->pic, p_sys->i_fourcc,
+                           p_sys->i_width, p_sys->i_height, p_sys->i_width *
+                           VOUT_ASPECT_FACTOR / p_sys->i_height ) )
         {
             msg_Err( p_demux, "unsupported chroma" );
             goto vdev_failed;
index d4dac4805985cb28a5bc8ba013936a2f1789a67f..c5dce5bfe35fb08226108e8085e09dddef81b735 100644 (file)
@@ -190,9 +190,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     {
         msg_Dbg( p_dec, "video size is perhaps %dx%d", i_width,
                   i_height);
-        vout_InitFormat( &p_dec->fmt_out.video, VLC_CODEC_I420,
-                         i_width, i_height,
-                         VOUT_ASPECT_FACTOR * i_width / i_height );
+        video_format_Setup( &p_dec->fmt_out.video, VLC_CODEC_I420,
+                            i_width, i_height,
+                            VOUT_ASPECT_FACTOR * i_width / i_height );
         p_sys->b_inited = true;
     }
     p_pic = NULL;
index db610289791b3849b68c8806d67cfb4d839d6396..d6998325d1d73fb7cdd63c013a5dba9b417ac706 100644 (file)
@@ -31,7 +31,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
-#include <vlc_vout.h>
 
 /*****************************************************************************
  * decoder_sys_t : raw video decoder descriptor
@@ -157,10 +156,10 @@ static int OpenDecoder( vlc_object_t *p_this )
     }
 
     /* Find out p_vdec->i_raw_size */
-    vout_InitFormat( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
-                     p_dec->fmt_in.video.i_width,
-                     p_dec->fmt_in.video.i_height,
-                     p_dec->fmt_in.video.i_aspect );
+    video_format_Setup( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
+                        p_dec->fmt_in.video.i_width,
+                        p_dec->fmt_in.video.i_height,
+                        p_dec->fmt_in.video.i_aspect );
     p_sys->i_raw_size = p_dec->fmt_out.video.i_bits_per_pixel *
         p_dec->fmt_out.video.i_width * p_dec->fmt_out.video.i_height / 8;
 
@@ -321,9 +320,9 @@ static block_t *SendFrame( decoder_t *p_dec, block_t *p_block )
         int i, j;
 
         /* Fill in picture_t fields */
-        vout_InitPicture( VLC_OBJECT(p_dec), &pic, p_dec->fmt_out.i_codec,
-                          p_dec->fmt_out.video.i_width,
-                          p_dec->fmt_out.video.i_height, VOUT_ASPECT_FACTOR );
+        picture_Setup( &pic, p_dec->fmt_out.i_codec,
+                       p_dec->fmt_out.video.i_width,
+                       p_dec->fmt_out.video.i_height, VOUT_ASPECT_FACTOR );
 
         if( !pic.i_planes )
         {
index 8a127275a0c7a90d0e404e58458ed5a47e6f22a1..85b3a8642df94676c193883999478e241e0b0b0a 100644 (file)
@@ -33,7 +33,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_demux.h>
-#include <vlc_vout.h>                                     /* vout_InitFormat */
 #include <assert.h>
 
 /*****************************************************************************
@@ -357,8 +356,8 @@ static int Open( vlc_object_t * p_this )
     }
 
     es_format_Init( &p_sys->fmt_video, VIDEO_ES, i_chroma );
-    vout_InitFormat( &p_sys->fmt_video.video, i_chroma, i_width, i_height,
-                     i_aspect );
+    video_format_Setup( &p_sys->fmt_video.video,
+                        i_chroma, i_width, i_height, i_aspect );
 
     vlc_ureduce( &p_sys->fmt_video.video.i_frame_rate,
                  &p_sys->fmt_video.video.i_frame_rate_base,
index 9dd28759135a1844b711d6c05b5c07a7c1656738..63aca6f81cb87322c275d309c28f32d42618daef 100644 (file)
@@ -33,7 +33,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_vout.h>
 #include <vlc_avcodec.h>
 
 #include <vlc_block.h>
@@ -613,9 +612,13 @@ static int UnpackFromFile( sout_stream_t *p_stream, const char *psz_file,
         return -1;
     }
 
-    vout_InitPicture( VLC_OBJECT(p_stream), p_pic, VLC_CODEC_I420,
-                      i_width, i_height,
-                      i_width * VOUT_ASPECT_FACTOR / i_height );
+    if( picture_Setup( p_pic, VLC_CODEC_I420,
+                       i_width, i_height,
+                       i_width * VOUT_ASPECT_FACTOR / i_height ) )
+    {
+        msg_Err( p_stream, "unknown chroma" );
+        return -1;
+    }
     for ( i = 0; i < p_pic->i_planes; i++ )
     {
         p_pic->p[i].p_pixels = malloc( p_pic->p[i].i_lines *
index 02710b94afbefd97a70f8c493bc309c81e8c6e1f..58c9fcdfaa55bc61f62b84ceb1603f6aff7e70df 100644 (file)
@@ -56,8 +56,8 @@ overlay_t *OverlayCreate( void )
     p_ovl->i_x = p_ovl->i_y = 0;
     p_ovl->i_alpha = 0xFF;
     p_ovl->b_active = false;
-    vout_InitFormat( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
-                     VOUT_ASPECT_FACTOR );
+    video_format_Setup( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
+                        VOUT_ASPECT_FACTOR );
     p_ovl->p_fontstyle = text_style_New();
     p_ovl->data.p_text = NULL;
 
@@ -465,8 +465,8 @@ static int exec_DataSharedMem( filter_t *p_filter,
             return VLC_ENOMEM;
         }
 
-        vout_InitFormat( &p_ovl->format, VLC_CODEC_TEXT,
-                         0, 0, 0 );
+        video_format_Setup( &p_ovl->format, VLC_CODEC_TEXT,
+                            0, 0, 0 );
 
         p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
         if( p_data == NULL )
@@ -489,9 +489,9 @@ static int exec_DataSharedMem( filter_t *p_filter,
         if( p_ovl->data.p_pic == NULL )
             return VLC_ENOMEM;
 
-        vout_InitFormat( &p_ovl->format, p_params->fourcc,
-                         p_params->i_width, p_params->i_height,
-                         VOUT_ASPECT_FACTOR );
+        video_format_Setup( &p_ovl->format, p_params->fourcc,
+                            p_params->i_width, p_params->i_height,
+                            VOUT_ASPECT_FACTOR );
         if( vout_AllocatePicture( p_filter, p_ovl->data.p_pic,
                                   p_ovl->format.i_chroma, p_params->i_width,
                                   p_params->i_height, p_ovl->format.i_aspect ) )
index 95f17c1d36d5221ac12e43158a1b3fa176f9295e..cd4486e09c0fdab60cc13249c565346b7826ddec 100644 (file)
@@ -415,9 +415,13 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
     }
 
     /* Fill in picture_t fields */
-    vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
-                      p_vout->output.i_width, p_vout->output.i_height,
-                      p_vout->output.i_aspect );
+    if( picture_Setup( p_pic, p_vout->output.i_chroma,
+                       p_vout->output.i_width, p_vout->output.i_height,
+                       p_vout->output.i_aspect ) )
+    {
+        free( p_pic );
+        return VLC_EGENERIC;
+    }
 
     p_pic->p_sys->p_data = malloc( p_vout->p_sys->i_page_size );
     if( !p_pic->p_sys->p_data )
index 37695a3b4202ff56e369dc09825cde21a3300e28..56392a3be049955d2d3f837a2c6af0cb3597d081 100644 (file)
@@ -257,9 +257,9 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
     }
 
     /* Fill in picture_t fields */
-    vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
-                      p_vout->output.i_width, p_vout->output.i_height,
-                      p_vout->output.i_aspect );
+    picture_Setup( p_pic, p_vout->output.i_chroma,
+                   p_vout->output.i_width, p_vout->output.i_height,
+                   p_vout->output.i_aspect );
 
     p_pic->p_sys->p_image = new CascadeSharedMemZone();
     if( p_pic->p_sys->p_image == NULL )
index 21bd8b622b0aa3207a41811e934339f78879dc7a..57e05303e5c39c35cc1954f9fc5d846b9a269571 100644 (file)
@@ -231,9 +231,13 @@ static int Init( vout_thread_t *p_vout )
         return VLC_SUCCESS;
     }
 
-    vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
-                      p_vout->output.i_width, p_vout->output.i_height,
-                      p_vout->output.i_aspect );
+    if( picture_Setup( p_pic, p_vout->output.i_chroma,
+                       p_vout->output.i_width, p_vout->output.i_height,
+                       p_vout->output.i_aspect ) )
+    {
+        free( p_pic );
+        return VLC_EGENERIC;
+    }
 
     p_pic->p->i_pitch = i_pitch;
 
index 1838e25979171bd56ff591253898cbc60b8e0249..ffe6de9fecd1faf62292b6a358d757e5f426ad68 100644 (file)
@@ -1865,9 +1865,10 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 #endif
 
     /* Fill in picture_t fields */
-    vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
-                      p_vout->output.i_width, p_vout->output.i_height,
-                      p_vout->output.i_aspect );
+    if( picture_Setup( p_pic, p_vout->output.i_chroma,
+                       p_vout->output.i_width, p_vout->output.i_height,
+                       p_vout->output.i_aspect ) )
+        return -1;
 
 #ifdef HAVE_SYS_SHM_H
     if( p_vout->p_sys->i_shm_opcode )
@@ -1965,7 +1966,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
             p_pic->p->i_pitch = p_pic->p_sys->p_image->bytes_per_line;
 
             /* p_pic->p->i_pixel_pitch = 4 for RV24 but this should be set
-             * properly by vout_InitPicture() */
+             * properly by picture_Setup() */
             p_pic->p->i_visible_pitch = p_pic->p->i_pixel_pitch
                                          * p_pic->p_sys->p_image->width;
             break;
index 6ee3f963d3d0e6853863b7a260ce8ebe2b560b4d..2196fb26438141e040ad596e0a060d7f3d70c2a2 100644 (file)
@@ -346,9 +346,9 @@ static int Init (vout_thread_t *vout)
         if (pic->i_status != FREE_PICTURE)
             continue;
 
-        vout_InitPicture (vout, pic, vout->output.i_chroma,
-                          vout->output.i_width, vout->output.i_height,
-                          vout->output.i_aspect);
+        picture_Setup (pic, vout->output.i_chroma,
+                       vout->output.i_width, vout->output.i_height,
+                       vout->output.i_aspect);
         if (PictureAlloc (vout, pic, pic->p->i_pitch * pic->p->i_lines,
                           p_sys->shm ? p_sys->conn : NULL))
             break;
index ceffaf979cb9614d71f391d53facd606b01dc7e0..f460c4afad8f3cd2ebd0c42e30e3634ef417d269 100644 (file)
@@ -456,9 +456,9 @@ found_adaptor:
         if (pic->i_status != FREE_PICTURE)
             continue;
 
-        vout_InitPicture (vout, pic, vout->output.i_chroma,
-                          att->width, att->height,
-                          vout->fmt_in.i_aspect);
+        picture_Setup (pic, vout->output.i_chroma,
+                       att->width, att->height,
+                       vout->fmt_in.i_aspect);
         if (PictureAlloc (vout, pic, att->data_size,
                           p_sys->shm ? p_sys->conn : NULL))
             break;
index 97cfca3ec621c4cc086c8d68dbefc6f257baf545..5f7dfdae4e8ad6f635696be3ceefae97bd979208 100644 (file)
@@ -210,8 +210,8 @@ static void* Thread( vlc_object_t *p_this )
     vlc_object_attach( p_thread->p_opengl, p_this );
 
     /* Initialize vout parameters */
-    vout_InitFormat( &p_thread->p_opengl->fmt_in,
-                     VLC_CODEC_RGB32, p_thread->i_width, p_thread->i_height, 1 );
+    video_format_Setup( &p_thread->p_opengl->fmt_in,
+                        VLC_CODEC_RGB32, p_thread->i_width, p_thread->i_height, 1 );
     p_thread->p_opengl->i_window_width = p_thread->i_width;
     p_thread->p_opengl->i_window_height = p_thread->i_height;
     p_thread->p_opengl->render.i_width = p_thread->i_width;
index d18db7eb84f9a715ce63025a768192e453ac1ab3..fc42f05cc5b011dd401573aa1896b8c845c41762 100644 (file)
@@ -529,8 +529,6 @@ vout_DestroyPicture
 vout_DisplayPicture
 vout_EnableFilter
 vout_GetSnapshot
-vout_InitFormat
-__vout_InitPicture
 vout_LinkPicture
 vout_OSDIcon
 __vout_OSDMessage
index 29b250054acc56734b2cb2dd7fffa53ed8838425..791c49abaffdba4a58ec2b3d3fcbe01b71431ee5 100644 (file)
@@ -560,8 +560,8 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
     i_width_aligned = (i_width + 15) >> 4 << 4;
     i_height_aligned = (i_height + 15) >> 4 << 4;
 
-    if( vout_InitPicture( p_this, p_pic, i_chroma,
-                          i_width, i_height, i_aspect ) != VLC_SUCCESS )
+    if( picture_Setup( p_pic, i_chroma,
+                       i_width, i_height, i_aspect ) != VLC_SUCCESS )
     {
         p_pic->i_planes = 0;
         return VLC_EGENERIC;
@@ -591,284 +591,6 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
     return VLC_SUCCESS;
 }
 
-/**
- * Initialise the video format fields given chroma/size.
- *
- * This function initializes all the video_frame_format_t fields given the
- * static properties of a picture (chroma and size).
- * \param p_format Pointer to the format structure to initialize
- * \param i_chroma Chroma to set
- * \param i_width Width to set
- * \param i_height Height to set
- * \param i_aspect Aspect ratio
- */
-void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma,
-                      int i_width, int i_height, int i_aspect )
-{
-    video_format_Setup( p_format, i_chroma, i_width, i_height, i_aspect );
-}
-
-/**
- * Initialise the picture_t fields given chroma/size.
- *
- * This function initializes most of the picture_t fields given a chroma and
- * size. It makes the assumption that stride == width.
- * \param p_this The calling object
- * \param p_pic Pointer to the picture to initialize
- * \param i_chroma The chroma fourcc to set
- * \param i_width The width of the picture
- * \param i_height The height of the picture
- * \param i_aspect The aspect ratio of the picture
- */
-int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic,
-                        vlc_fourcc_t i_chroma,
-                        int i_width, int i_height, int i_aspect )
-{
-    int i_index, i_width_aligned, i_height_aligned;
-
-    /* Store default values */
-    for( i_index = 0; i_index < VOUT_MAX_PLANES; i_index++ )
-    {
-        p_pic->p[i_index].p_pixels = NULL;
-        p_pic->p[i_index].i_pixel_pitch = 1;
-    }
-
-    p_pic->pf_release = NULL;
-    p_pic->pf_lock = NULL;
-    p_pic->pf_unlock = NULL;
-    p_pic->i_refcount = 0;
-
-    p_pic->i_qtype = QTYPE_NONE;
-    p_pic->i_qstride = 0;
-    p_pic->p_q = NULL;
-
-    vout_InitFormat( &p_pic->format, i_chroma, i_width, i_height, i_aspect );
-
-    /* Make sure the real dimensions are a multiple of 16 */
-    i_width_aligned = (i_width + 15) >> 4 << 4;
-    i_height_aligned = (i_height + 15) >> 4 << 4;
-
-    /* Calculate coordinates */
-    switch( vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ) )
-    {
-        case VLC_CODEC_I411:
-            p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ U_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
-            p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 4;
-            p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ V_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
-            p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 4;
-            p_pic->i_planes = 3;
-            break;
-
-        case VLC_CODEC_I410:
-            p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 4;
-            p_pic->p[ U_PLANE ].i_visible_lines = i_height / 4;
-            p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
-            p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 4;
-            p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 4;
-            p_pic->p[ V_PLANE ].i_visible_lines = i_height / 4;
-            p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
-            p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 4;
-            p_pic->i_planes = 3;
-            break;
-
-        case VLC_CODEC_YV12:
-        case VLC_CODEC_I420:
-        case VLC_CODEC_J420:
-            p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 2;
-            p_pic->p[ U_PLANE ].i_visible_lines = i_height / 2;
-            p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
-            p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 2;
-            p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 2;
-            p_pic->p[ V_PLANE ].i_visible_lines = i_height / 2;
-            p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
-            p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 2;
-            p_pic->i_planes = 3;
-            break;
-
-        case VLC_CODEC_I422:
-        case VLC_CODEC_J422:
-            p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ U_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
-            p_pic->p[ U_PLANE ].i_visible_pitch = i_width / 2;
-            p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ V_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
-            p_pic->p[ V_PLANE ].i_visible_pitch = i_width / 2;
-            p_pic->i_planes = 3;
-            break;
-
-        case VLC_CODEC_I440:
-        case VLC_CODEC_J440:
-            p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_lines = i_height_aligned / 2;
-            p_pic->p[ U_PLANE ].i_visible_lines = i_height / 2;
-            p_pic->p[ U_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ U_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ V_PLANE ].i_lines = i_height_aligned / 2;
-            p_pic->p[ V_PLANE ].i_visible_lines = i_height / 2;
-            p_pic->p[ V_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ V_PLANE ].i_visible_pitch = i_width;
-            p_pic->i_planes = 3;
-            break;
-
-        case VLC_CODEC_I444:
-        case VLC_CODEC_J444:
-            p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ U_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ U_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ U_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ V_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ V_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ V_PLANE ].i_visible_pitch = i_width;
-            p_pic->i_planes = 3;
-            break;
-
-        case VLC_CODEC_YUVA:
-            p_pic->p[ Y_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ Y_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ Y_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ U_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ U_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ U_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ V_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ V_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ V_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ V_PLANE ].i_visible_pitch = i_width;
-            p_pic->p[ A_PLANE ].i_lines = i_height_aligned;
-            p_pic->p[ A_PLANE ].i_visible_lines = i_height;
-            p_pic->p[ A_PLANE ].i_pitch = i_width_aligned;
-            p_pic->p[ A_PLANE ].i_visible_pitch = i_width;
-            p_pic->i_planes = 4;
-            break;
-
-        case VLC_CODEC_YUVP:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned;
-            p_pic->p->i_visible_pitch = i_width;
-            p_pic->p->i_pixel_pitch = 8;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_Y211:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned;
-            p_pic->p->i_visible_pitch = i_width;
-            p_pic->p->i_pixel_pitch = 4;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_UYVY:
-        case VLC_CODEC_VYUY:
-        case VLC_CODEC_YUYV:
-        case VLC_CODEC_YVYU:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned * 2;
-            p_pic->p->i_visible_pitch = i_width * 2;
-            p_pic->p->i_pixel_pitch = 4;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_RGB8:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned;
-            p_pic->p->i_visible_pitch = i_width;
-            p_pic->p->i_pixel_pitch = 1;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_RGB15:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned * 2;
-            p_pic->p->i_visible_pitch = i_width * 2;
-            p_pic->p->i_pixel_pitch = 2;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_RGB16:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned * 2;
-            p_pic->p->i_visible_pitch = i_width * 2;
-            p_pic->p->i_pixel_pitch = 2;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_RGB24:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned * 3;
-            p_pic->p->i_visible_pitch = i_width * 3;
-            p_pic->p->i_pixel_pitch = 3;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_RGB32:
-        case VLC_CODEC_RGBA:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned * 4;
-            p_pic->p->i_visible_pitch = i_width * 4;
-            p_pic->p->i_pixel_pitch = 4;
-            p_pic->i_planes = 1;
-            break;
-
-        case VLC_CODEC_GREY:
-        case VLC_CODEC_RGBP:
-            p_pic->p->i_lines = i_height_aligned;
-            p_pic->p->i_visible_lines = i_height;
-            p_pic->p->i_pitch = i_width_aligned;
-            p_pic->p->i_visible_pitch = i_width;
-            p_pic->p->i_pixel_pitch = 1;
-            p_pic->i_planes = 1;
-            break;
-
-        default:
-            if( p_this )
-                msg_Err( p_this, "unknown chroma type 0x%.8x (%4.4s)",
-                                 i_chroma, (char*)&i_chroma );
-            p_pic->i_planes = 0;
-            return VLC_EGENERIC;
-    }
-
-    return VLC_SUCCESS;
-}
-
 /**
  * Compare two chroma values
  *