- DDCAPS ddcaps;
- HRESULT dxresult;
-
- /* This is just an indication of whether or not we'll support overlay,
- * but with this test we don't know if we support YUV overlay */
- memset( &ddcaps, 0, sizeof( DDCAPS ));
- ddcaps.dwSize = sizeof(DDCAPS);
- dxresult = IDirectDraw2_GetCaps( p_vout->p_sys->p_ddobject,
- &ddcaps, NULL );
- if(dxresult != DD_OK )
- {
- msg_Warn( p_vout, "cannot get caps" );
- }
- else
- {
- bool bHasOverlay, bHasOverlayFourCC, bCanDeinterlace,
- bHasColorKey, bCanStretch, bCanBltFourcc,
- bAlignBoundarySrc, bAlignBoundaryDest,
- bAlignSizeSrc, bAlignSizeDest;
-
- /* Determine if the hardware supports overlay surfaces */
- bHasOverlay = (ddcaps.dwCaps & DDCAPS_OVERLAY) ? 1 : 0;
- /* Determine if the hardware supports overlay surfaces */
- bHasOverlayFourCC = (ddcaps.dwCaps & DDCAPS_OVERLAYFOURCC) ? 1 : 0;
- /* Determine if the hardware supports overlay deinterlacing */
- bCanDeinterlace = (ddcaps.dwCaps & DDCAPS2_CANFLIPODDEVEN) ? 1 : 0;
- /* Determine if the hardware supports colorkeying */
- bHasColorKey = (ddcaps.dwCaps & DDCAPS_COLORKEY) ? 1 : 0;
- /* Determine if the hardware supports scaling of the overlay surface */
- bCanStretch = (ddcaps.dwCaps & DDCAPS_OVERLAYSTRETCH) ? 1 : 0;
- /* Determine if the hardware supports color conversion during a blit */
- bCanBltFourcc = (ddcaps.dwCaps & DDCAPS_BLTFOURCC) ? 1 : 0;
- /* Determine overlay source boundary alignment */
- bAlignBoundarySrc = (ddcaps.dwCaps & DDCAPS_ALIGNBOUNDARYSRC) ? 1 : 0;
- /* Determine overlay destination boundary alignment */
- bAlignBoundaryDest = (ddcaps.dwCaps & DDCAPS_ALIGNBOUNDARYDEST) ? 1:0;
- /* Determine overlay destination size alignment */
- bAlignSizeSrc = (ddcaps.dwCaps & DDCAPS_ALIGNSIZESRC) ? 1 : 0;
- /* Determine overlay destination size alignment */
- bAlignSizeDest = (ddcaps.dwCaps & DDCAPS_ALIGNSIZEDEST) ? 1 : 0;
-
- msg_Dbg( p_vout, "DirectDraw Capabilities: overlay=%i yuvoverlay=%i "
- "can_deinterlace_overlay=%i colorkey=%i stretch=%i "
- "bltfourcc=%i",
- bHasOverlay, bHasOverlayFourCC, bCanDeinterlace,
- bHasColorKey, bCanStretch, bCanBltFourcc );
-
- if( bAlignBoundarySrc || bAlignBoundaryDest ||
- bAlignSizeSrc || bAlignSizeDest )
- {
- if( bAlignBoundarySrc ) p_vout->p_sys->i_align_src_boundary =
- ddcaps.dwAlignBoundarySrc;
- if( bAlignBoundaryDest ) p_vout->p_sys->i_align_dest_boundary =
- ddcaps.dwAlignBoundaryDest;
- if( bAlignSizeDest ) p_vout->p_sys->i_align_src_size =
- ddcaps.dwAlignSizeSrc;
- if( bAlignSizeDest ) p_vout->p_sys->i_align_dest_size =
- ddcaps.dwAlignSizeDest;
-
- msg_Dbg( p_vout, "align_boundary_src=%i,%i "
- "align_boundary_dest=%i,%i "
- "align_size_src=%i,%i align_size_dest=%i,%i",
- bAlignBoundarySrc, p_vout->p_sys->i_align_src_boundary,
- bAlignBoundaryDest, p_vout->p_sys->i_align_dest_boundary,
- bAlignSizeSrc, p_vout->p_sys->i_align_src_size,
- bAlignSizeDest, p_vout->p_sys->i_align_dest_size );
- }
-
- /* Don't ask for troubles */
- if( !bCanBltFourcc ) p_vout->p_sys->b_hw_yuv = FALSE;
- }