- switch( i_chroma )
- {
- case FOURCC_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 FOURCC_I410:
- case FOURCC_YVU9:
- 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 FOURCC_YV12:
- case FOURCC_I420:
- case FOURCC_IYUV:
- case FOURCC_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 FOURCC_I422:
- case FOURCC_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 FOURCC_I444:
- case FOURCC_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 FOURCC_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 FOURCC_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 FOURCC_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 FOURCC_UYVY:
- case FOURCC_YUY2:
- 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 FOURCC_RGB2:
- 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 FOURCC_RV15:
- 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 FOURCC_RV16:
- 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 FOURCC_RV24:
- 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 FOURCC_RV32:
- case FOURCC_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 FOURCC_GREY:
- 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:
- msg_Err( p_this, "unknown chroma type 0x%.8x (%4.4s)",
- i_chroma, (char*)&i_chroma );
- p_pic->i_planes = 0;
- return VLC_EGENERIC;
+ switch( vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ) )
+ {
+ case VLC_CODEC_I411:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I410:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned / 4;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height / 4;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned / 4;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height / 4;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 4;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 4;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_YV12:
+ case VLC_CODEC_I420:
+ case VLC_CODEC_J420:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I422:
+ case VLC_CODEC_J422:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width / 2;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I440:
+ case VLC_CODEC_J440:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned / 2;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height / 2;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_I444:
+ case VLC_CODEC_J444:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width;
+ p_picture->i_planes = 3;
+ break;
+
+ case VLC_CODEC_YUVA:
+ p_picture->p[ Y_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ Y_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ Y_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ U_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ U_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ U_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ U_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ V_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ V_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ V_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ V_PLANE ].i_visible_pitch = i_width;
+ p_picture->p[ A_PLANE ].i_lines = i_height_aligned;
+ p_picture->p[ A_PLANE ].i_visible_lines = i_height;
+ p_picture->p[ A_PLANE ].i_pitch = i_width_aligned;
+ p_picture->p[ A_PLANE ].i_visible_pitch = i_width;
+ p_picture->i_planes = 4;
+ break;
+
+ case VLC_CODEC_YUVP:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 1;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_Y211:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 4;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_UYVY:
+ case VLC_CODEC_VYUY:
+ case VLC_CODEC_YUYV:
+ case VLC_CODEC_YVYU:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 2;
+ p_picture->p->i_visible_pitch = i_width * 2;
+ p_picture->p->i_pixel_pitch = 2;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB8:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 1;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB15:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 2;
+ p_picture->p->i_visible_pitch = i_width * 2;
+ p_picture->p->i_pixel_pitch = 2;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB16:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 2;
+ p_picture->p->i_visible_pitch = i_width * 2;
+ p_picture->p->i_pixel_pitch = 2;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB24:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 3;
+ p_picture->p->i_visible_pitch = i_width * 3;
+ p_picture->p->i_pixel_pitch = 3;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_RGB32:
+ case VLC_CODEC_RGBA:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned * 4;
+ p_picture->p->i_visible_pitch = i_width * 4;
+ p_picture->p->i_pixel_pitch = 4;
+ p_picture->i_planes = 1;
+ break;
+
+ case VLC_CODEC_GREY:
+ case VLC_CODEC_RGBP:
+ p_picture->p->i_lines = i_height_aligned;
+ p_picture->p->i_visible_lines = i_height;
+ p_picture->p->i_pitch = i_width_aligned;
+ p_picture->p->i_visible_pitch = i_width;
+ p_picture->p->i_pixel_pitch = 1;
+ p_picture->i_planes = 1;
+ break;
+
+ default:
+ p_picture->i_planes = 0;
+ return VLC_EGENERIC;