[MPlayer-dev-eng] [PATCH]Do not try to decode IMGFMT_VDPAU_WMV3, try 2

Carl Eugen Hoyos cehoyos at rainbow.studorg.tuwien.ac.at
Tue Feb 24 22:37:10 CET 2009


Hi!

Attached patch is a new try not to start decoding on hardware that doesn't 
support it.

Please comment, Carl Eugen
-------------- next part --------------
Index: libvo/vo_vdpau.c
===================================================================
--- libvo/vo_vdpau.c	(Revision 28717)
+++ libvo/vo_vdpau.c	(Arbeitskopie)
@@ -132,6 +132,7 @@
 static VdpOutputSurfaceRenderOutputSurface       *vdp_output_surface_render_output_surface;
 static VdpOutputSurfacePutBitsIndexed            *vdp_output_surface_put_bits_indexed;
 static VdpOutputSurfaceRenderBitmapSurface       *vdp_output_surface_render_bitmap_surface;
+static VdpDecoderQueryCapabilities               *vdp_decoder_query_capabilies;
 
 static VdpBitmapSurfaceCreate                    *vdp_bitmap_surface_create;
 static VdpBitmapSurfaceDestroy                   *vdp_bitmap_surface_destroy;
@@ -323,6 +324,8 @@
                         &vdp_bitmap_surface_putbits_native},
         {VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE,
                         &vdp_output_surface_render_bitmap_surface},
+        {VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES,
+                                                &vdp_decoder_query_capabilies},
         {0, NULL}
     };
 
@@ -848,15 +851,25 @@
 
 static int query_format(uint32_t format)
 {
+    VdpBool result = VDP_FALSE;
+    uint32_t dummy = 1;
     int default_flags = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_OSD | VFCAP_EOSD | VFCAP_EOSD_UNSCALED;
     switch (format) {
         case IMGFMT_YV12:
             return default_flags | VOCAP_NOSLICES;
+        case IMGFMT_VDPAU_WMV3:
+        case IMGFMT_VDPAU_VC1:
+            vdp_decoder_query_capabilies(vdp_device,
+                                         VDP_DECODER_PROFILE_VC1_MAIN, &result,
+                                         &dummy, &dummy, &dummy, &dummy);
+            if (!result) {
+                mp_msg(MSGT_VO, MSGL_FATAL, "[vdpau] Your hardware does not support decoding of WMV3 and VC1.\n");
+                return 0;
+            }
         case IMGFMT_VDPAU_MPEG1:
         case IMGFMT_VDPAU_MPEG2:
         case IMGFMT_VDPAU_H264:
-        case IMGFMT_VDPAU_WMV3:
-        case IMGFMT_VDPAU_VC1:
+
             return default_flags;
     }
     return 0;


More information about the MPlayer-dev-eng mailing list