void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma,
int i_width, int i_height, int i_aspect )
{
- p_format->i_chroma = i_chroma;
- p_format->i_width = p_format->i_visible_width = i_width;
- p_format->i_height = p_format->i_visible_height = i_height;
- p_format->i_x_offset = p_format->i_y_offset = 0;
- p_format->i_aspect = i_aspect;
-
-#if 0
- /* Assume we have square pixels */
- if( i_width && i_height )
- p_format->i_aspect = i_width * VOUT_ASPECT_FACTOR / i_height;
- else
- p_format->i_aspect = 0;
-#endif
-
- switch( vlc_fourcc_GetCodec( VIDEO_ES, i_chroma ) )
- {
- case VLC_CODEC_YUVA:
- p_format->i_bits_per_pixel = 32;
- break;
- case VLC_CODEC_I444:
- case VLC_CODEC_J444:
- p_format->i_bits_per_pixel = 24;
- break;
- case VLC_CODEC_I422:
- case VLC_CODEC_YUYV:
- case VLC_CODEC_YVYU:
- case VLC_CODEC_UYVY:
- case VLC_CODEC_VYUY:
- case VLC_CODEC_J422:
- p_format->i_bits_per_pixel = 16;
- break;
- case VLC_CODEC_I440:
- case VLC_CODEC_J440:
- p_format->i_bits_per_pixel = 16;
- break;
- case VLC_CODEC_I411:
- case VLC_CODEC_YV12:
- case VLC_CODEC_I420:
- case VLC_CODEC_J420:
- p_format->i_bits_per_pixel = 12;
- break;
- case VLC_CODEC_I410:
- p_format->i_bits_per_pixel = 9;
- break;
- case VLC_CODEC_Y211:
- p_format->i_bits_per_pixel = 8;
- break;
- case VLC_CODEC_YUVP:
- p_format->i_bits_per_pixel = 8;
- break;
-
- case VLC_CODEC_RGB32:
- case VLC_CODEC_RGBA:
- p_format->i_bits_per_pixel = 32;
- break;
- case VLC_CODEC_RGB24:
- p_format->i_bits_per_pixel = 24;
- break;
- case VLC_CODEC_RGB15:
- case VLC_CODEC_RGB16:
- p_format->i_bits_per_pixel = 16;
- break;
- case VLC_CODEC_RGB8:
- p_format->i_bits_per_pixel = 8;
- break;
-
- case VLC_CODEC_GREY:
- case VLC_CODEC_RGBP:
- p_format->i_bits_per_pixel = 8;
- break;
-
- default:
- p_format->i_bits_per_pixel = 0;
- break;
- }
+ video_format_Setup( p_format, i_chroma, i_width, i_height, i_aspect );
}
/**