-
- 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') )
- {
- if( i_height > 0 ) dshow_stream.b_invert = VLC_TRUE;
- else i_height = - i_height;
- }
-
- /* Check if we are dealing with a DV stream */
- if( dshow_stream.i_fourcc == VLC_FOURCC('d','v','s','l') ||
- dshow_stream.i_fourcc == VLC_FOURCC('d','v','s','d') ||
- dshow_stream.i_fourcc == VLC_FOURCC('d','v','h','d') )
- {
- p_access->pf_read = ReadCompressed;
- if( !p_access->psz_demux || !*p_access->psz_demux )
- {
- p_access->psz_demux = strdup( "rawdv" );
- }
- p_sys->b_audio = VLC_FALSE;
- }
-
- /* Check if we are dealing with an MPEG video stream */
- if( dshow_stream.i_fourcc == VLC_FOURCC('m','p','2','v') )
- {
- p_access->pf_read = ReadCompressed;
- if( !p_access->psz_demux || !*p_access->psz_demux )
- {
- p_access->psz_demux = "mpgv";
- }
- p_sys->b_audio = VLC_FALSE;
- }
-
- /* Add video stream to header */
- p_sys->i_header_size += 20;
- p_sys->p_header = (uint8_t *)realloc( p_sys->p_header,
- p_sys->i_header_size );
- memcpy( &p_sys->p_header[p_sys->i_header_pos], "vids", 4 );
- memcpy( &p_sys->p_header[p_sys->i_header_pos + 4],
- &dshow_stream.i_fourcc, 4 );
- SetDWBE( &p_sys->p_header[p_sys->i_header_pos + 8],
- dshow_stream.header.video.bmiHeader.biWidth );
- SetDWBE( &p_sys->p_header[p_sys->i_header_pos + 12], i_height );
- SetDWBE( &p_sys->p_header[p_sys->i_header_pos + 16], 0 );
- p_sys->i_header_pos = p_sys->i_header_size;
-
- /* Greatly simplifies the reading routine */
- int i_mtu = dshow_stream.header.video.bmiHeader.biWidth *
- i_height * 4;
- p_sys->i_mtu = __MAX( p_sys->i_mtu, (unsigned int)i_mtu );