From: Laurent Aimar Date: Sat, 16 May 2009 19:42:28 +0000 (+0200) Subject: Replaced vout_InitPicture/Format with their equivalent. X-Git-Tag: 1.1.0-ff~5907 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0ba8129efb11bde8bab50e35ccda27717f2b91b3;p=vlc Replaced vout_InitPicture/Format with their equivalent. --- diff --git a/include/vlc_vout.h b/include/vlc_vout.h index c7f9624ea0..4a706fcfd4 100644 --- a/include/vlc_vout.h +++ b/include/vlc_vout.h @@ -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 * ) ); diff --git a/modules/access/dc1394.c b/modules/access/dc1394.c index ab2cd1d424..b79d38a505 100644 --- a/modules/access/dc1394.c +++ b/modules/access/dc1394.c @@ -33,7 +33,6 @@ #include #include #include -#include #include @@ -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 ); diff --git a/modules/access/screen/screen.c b/modules/access/screen/screen.c index 173823c433..55169f0278 100644 --- a/modules/access/screen/screen.c +++ b/modules/access/screen/screen.c @@ -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) ); diff --git a/modules/access/v4l.c b/modules/access/v4l.c index 16e408a792..b564ad21dc 100644 --- a/modules/access/v4l.c +++ b/modules/access/v4l.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -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; diff --git a/modules/codec/mash.cpp b/modules/codec/mash.cpp index d4dac48059..c5dce5bfe3 100644 --- a/modules/codec/mash.cpp +++ b/modules/codec/mash.cpp @@ -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; diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c index db61028979..d6998325d1 100644 --- a/modules/codec/rawvideo.c +++ b/modules/codec/rawvideo.c @@ -31,7 +31,6 @@ #include #include #include -#include /***************************************************************************** * 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 ) { diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c index 8a127275a0..85b3a8642d 100644 --- a/modules/demux/rawvid.c +++ b/modules/demux/rawvid.c @@ -33,7 +33,6 @@ #include #include #include -#include /* vout_InitFormat */ #include /***************************************************************************** @@ -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, diff --git a/modules/stream_out/switcher.c b/modules/stream_out/switcher.c index 9dd2875913..63aca6f81c 100644 --- a/modules/stream_out/switcher.c +++ b/modules/stream_out/switcher.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -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 * diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c index 02710b94af..58c9fcdfaa 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c @@ -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 ) ) diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c index 95f17c1d36..cd4486e09c 100644 --- a/modules/video_output/fb.c +++ b/modules/video_output/fb.c @@ -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 ) diff --git a/modules/video_output/hd1000v.cpp b/modules/video_output/hd1000v.cpp index 37695a3b42..56392a3be0 100644 --- a/modules/video_output/hd1000v.cpp +++ b/modules/video_output/hd1000v.cpp @@ -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 ) diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c index 21bd8b622b..57e05303e5 100644 --- a/modules/video_output/vmem.c +++ b/modules/video_output/vmem.c @@ -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; diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c index 1838e25979..ffe6de9fec 100644 --- a/modules/video_output/x11/xcommon.c +++ b/modules/video_output/x11/xcommon.c @@ -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; diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c index 6ee3f963d3..2196fb2643 100644 --- a/modules/video_output/xcb/x11.c +++ b/modules/video_output/xcb/x11.c @@ -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; diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c index ceffaf979c..f460c4afad 100644 --- a/modules/video_output/xcb/xvideo.c +++ b/modules/video_output/xcb/xvideo.c @@ -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; diff --git a/modules/visualization/galaktos/plugin.c b/modules/visualization/galaktos/plugin.c index 97cfca3ec6..5f7dfdae4e 100644 --- a/modules/visualization/galaktos/plugin.c +++ b/modules/visualization/galaktos/plugin.c @@ -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; diff --git a/src/libvlccore.sym b/src/libvlccore.sym index d18db7eb84..fc42f05cc5 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -529,8 +529,6 @@ vout_DestroyPicture vout_DisplayPicture vout_EnableFilter vout_GetSnapshot -vout_InitFormat -__vout_InitPicture vout_LinkPicture vout_OSDIcon __vout_OSDMessage diff --git a/src/video_output/vout_pictures.c b/src/video_output/vout_pictures.c index 29b250054a..791c49abaf 100644 --- a/src/video_output/vout_pictures.c +++ b/src/video_output/vout_pictures.c @@ -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 *