+
+ case VLC_FOURCC('I','4','2','0'):
+ p_pic->p_sys->p_data = (void *)&p_pic->p_sys->pixmap_i420;
+ p_pic->p_sys->i_size = sizeof(PlanarPixmapInfoYUV420);
+
+ /* Allocate the memory buffer */
+ p_pic->p_data = vlc_memalign( &p_pic->p_data_orig,
+ 16, p_vout->output.i_width * p_vout->output.i_height * 3 / 2 );
+
+ /* Y buffer */
+ p_pic->Y_PIXELS = p_pic->p_data;
+ p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
+ p_pic->p[Y_PLANE].i_visible_lines = p_vout->output.i_height;
+ p_pic->p[Y_PLANE].i_pitch = p_vout->output.i_width;
+ p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+ p_pic->p[Y_PLANE].i_visible_pitch = p_vout->output.i_width;
+
+ /* U buffer */
+ p_pic->U_PIXELS = p_pic->Y_PIXELS + p_vout->output.i_height * p_vout->output.i_width;
+ p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
+ p_pic->p[U_PLANE].i_visible_lines = p_vout->output.i_height / 2;
+ p_pic->p[U_PLANE].i_pitch = p_vout->output.i_width / 2;
+ p_pic->p[U_PLANE].i_pixel_pitch = 1;
+ p_pic->p[U_PLANE].i_visible_pitch = p_vout->output.i_width / 2;
+
+ /* V buffer */
+ p_pic->V_PIXELS = p_pic->U_PIXELS + p_vout->output.i_height * p_vout->output.i_width / 4;
+ p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
+ p_pic->p[V_PLANE].i_visible_lines = p_vout->output.i_height / 2;
+ p_pic->p[V_PLANE].i_pitch = p_vout->output.i_width / 2;
+ p_pic->p[V_PLANE].i_pixel_pitch = 1;
+ p_pic->p[V_PLANE].i_visible_pitch = p_vout->output.i_width / 2;
+
+ /* We allocated 3 planes */
+ p_pic->i_planes = 3;
+
+#define P p_pic->p_sys->pixmap_i420
+ P.componentInfoY.offset = (void *)p_pic->Y_PIXELS
+ - p_pic->p_sys->p_data;
+ P.componentInfoCb.offset = (void *)p_pic->U_PIXELS
+ - p_pic->p_sys->p_data;
+ P.componentInfoCr.offset = (void *)p_pic->V_PIXELS
+ - p_pic->p_sys->p_data;
+
+ P.componentInfoY.rowBytes = p_vout->output.i_width;
+ P.componentInfoCb.rowBytes = p_vout->output.i_width / 2;
+ P.componentInfoCr.rowBytes = p_vout->output.i_width / 2;
+#undef P
+ break;
+
+ default:
+ /* Unknown chroma, tell the guy to get lost */
+ free( p_pic->p_sys );
+ msg_Err( p_vout, "never heard of chroma 0x%.8x (%4.4s)",
+ p_vout->output.i_chroma, (char*)&p_vout->output.i_chroma );
+ p_pic->i_planes = 0;
+ return( -1 );