[MPlayer-dev-eng] [PATCH]Do not try to decode IMGFMT_VDPAU_WMV3 on incapable hardware

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Feb 24 21:09:14 CET 2009


Reimar Döffinger <Reimar.Doeffinger <at> stud.uni-karlsruhe.de> writes:

> 
> On Tue, Feb 24, 2009 at 08:48:01PM +0100, Carl Eugen Hoyos wrote:
> > Attached patch lets vo_vdpau.config() fail if the user tries to decode VC1 
> > or WMV3 video on hardware that does not support that.
> 
> That patch was optimized very well :-P

There is always a first time;-)
It follows inlined; do you want to test all formats (not only VC1 and WMV3)?
I don't believe there will ever be hardware (or drivers) that support finding
function pointers but not decoding MPEG1/2 or H264.

Carl Eugen

Index: libvo/vo_vdpau.c
===================================================================
--- libvo/vo_vdpau.c    (revision 28716)
+++ libvo/vo_vdpau.c    (working copy)
@@ -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}
     };

@@ -453,6 +456,16 @@
 #endif

     image_format = format;
+    if (format == IMGFMT_VDPAU_WMV3 || format == IMGFMT_VDPAU_VC1) {
+        VdpBool result = VDP_FALSE;
+        uint32_t dummy = 1;
+        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 -1;
+        }
+    }

     int_pause = 0;
     visible_buf = 0;





More information about the MPlayer-dev-eng mailing list