- msg_Dbg( p_input, "MEDIATYPE_Video");
-
- /* Packed RGB formats */
- if( dshow_stream.mt.subtype == MEDIASUBTYPE_RGB1 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'G', 'B', '1' );
- if( dshow_stream.mt.subtype == MEDIASUBTYPE_RGB4 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'G', 'B', '4' );
- if( dshow_stream.mt.subtype == MEDIASUBTYPE_RGB8 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'G', 'B', '8' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_RGB555 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'V', '1', '5' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_RGB565 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'V', '1', '6' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_RGB24 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'V', '2', '4' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_RGB32 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'V', '3', '2' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_ARGB32 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'R', 'G', 'B', 'A' );
-
- /* Packed YUV formats */
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_YVYU )
- dshow_stream.i_fourcc = VLC_FOURCC( 'Y', 'V', 'Y', 'U' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_YUYV )
- dshow_stream.i_fourcc = VLC_FOURCC( 'Y', 'U', 'Y', 'V' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_Y411 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'I', '4', '1', 'N' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_Y211 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'Y', '2', '1', '1' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_YUY2 ||
- dshow_stream.mt.subtype == MEDIASUBTYPE_UYVY )
- dshow_stream.i_fourcc = VLC_FOURCC( 'Y', 'U', 'Y', '2' );
-
- /* Planar YUV formats */
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_I420 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'I', '4', '2', '0' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_Y41P )
- dshow_stream.i_fourcc = VLC_FOURCC( 'I', '4', '1', '1' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_YV12 ||
- dshow_stream.mt.subtype == MEDIASUBTYPE_IYUV )
- dshow_stream.i_fourcc = VLC_FOURCC( 'Y', 'V', '1', '2' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_YVU9 )
- dshow_stream.i_fourcc = VLC_FOURCC( 'Y', 'V', 'U', '9' );
-
- /* DV formats */
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_dvsl )
- dshow_stream.i_fourcc = VLC_FOURCC( 'd', 'v', 's', 'l' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_dvsd )
- dshow_stream.i_fourcc = VLC_FOURCC( 'd', 'v', 's', 'd' );
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_dvhd )
- dshow_stream.i_fourcc = VLC_FOURCC( 'd', 'v', 'h', 'd' );
-
- /* MPEG video formats */
- else if( dshow_stream.mt.subtype == MEDIASUBTYPE_MPEG2_VIDEO )
- dshow_stream.i_fourcc = VLC_FOURCC( 'm', 'p', '2', 'v' );
-
- else goto fail;
-
- dshow_stream.header.video =
- *(VIDEOINFOHEADER *)dshow_stream.mt.pbFormat;
-
- int i_height = dshow_stream.header.video.bmiHeader.biHeight;
-
- /* Check if the image is inverted (bottom to top) */
- if( dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'G', 'B', '1' ) ||
- dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'G', 'B', '4' ) ||
- dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'G', 'B', '8' ) ||
- dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'V', '1', '5' ) ||
- dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'V', '1', '6' ) ||
- dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'V', '2', '4' ) ||
- dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'V', '3', '2' ) ||
- dshow_stream.i_fourcc == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )