- case VLC_FOURCC('I','4','2','0'):
-
- p_pic->p_sys->p_info = (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, i_width * i_height * 3 / 2 );
-
- /* Y buffer */
- p_pic->Y_PIXELS = p_pic->p_data;
- p_pic->p[Y_PLANE].i_lines = i_height;
- p_pic->p[Y_PLANE].i_pitch = i_width;
- p_pic->p[Y_PLANE].i_pixel_pitch = 1;
- p_pic->p[Y_PLANE].i_visible_pitch = i_width;
-
- /* U buffer */
- p_pic->U_PIXELS = p_pic->Y_PIXELS + i_height * i_width;
- p_pic->p[U_PLANE].i_lines = i_height / 2;
- p_pic->p[U_PLANE].i_pitch = i_width / 2;
- p_pic->p[U_PLANE].i_pixel_pitch = 1;
- p_pic->p[U_PLANE].i_visible_pitch = i_width / 2;
-
- /* V buffer */
- p_pic->V_PIXELS = p_pic->U_PIXELS + i_height * i_width / 4;
- p_pic->p[V_PLANE].i_lines = i_height / 2;
- p_pic->p[V_PLANE].i_pitch = i_width / 2;
- p_pic->p[V_PLANE].i_pixel_pitch = 1;
- p_pic->p[V_PLANE].i_visible_pitch = 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_info;
- P.componentInfoCb.offset = (void *)p_pic->U_PIXELS
- - p_pic->p_sys->p_info;
- P.componentInfoCr.offset = (void *)p_pic->V_PIXELS
- - p_pic->p_sys->p_info;
-
- P.componentInfoY.rowBytes = i_width;
- P.componentInfoCb.rowBytes = i_width / 2;
- P.componentInfoCr.rowBytes = 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 );