[MPlayer-dev-eng] [PATCH]Support IMGFMT_BGRA in vo vdpau

Carl Eugen Hoyos cehoyos at rainbow.studorg.tuwien.ac.at
Sat Mar 28 12:48:07 CET 2009


Hi!

Attached patch allows vo vdpau to use IMGFMT_BGRA.
Works except for fullscreen support, which I would add later.

Please comment, Carl Eugen
-------------- next part --------------
Index: libvo/vo_vdpau.c
===================================================================
--- libvo/vo_vdpau.c	(revision 29061)
+++ libvo/vo_vdpau.c	(working copy)
@@ -880,6 +880,19 @@
             deint_mpi[1] = deint_mpi[0];
             deint_mpi[0] = mpi;
         }
+    } else if (image_format==IMGFMT_BGRA) {
+        VdpStatus vdp_st;
+        VdpRect r = {0, 0, vid_width, vid_height};
+        vdp_st = vdp_output_surface_put_bits_native(output_surfaces[2],
+                                                    (void const*const*)mpi->planes,
+                                                    mpi->stride, &r);
+        CHECK_ST_ERROR("Error when calling vdp_output_surface_put_bits_native")
+        vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num],
+                                                          &out_rect_vid,
+                                                          output_surfaces[2],
+                                                          &r, NULL, NULL,
+                                                          VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+        CHECK_ST_ERROR("Error when calling vdp_output_surface_render_output_surface")
     } else if (!(mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)) {
         VdpStatus vdp_st;
         void *destdata[3] = {mpi->planes[0], mpi->planes[2], mpi->planes[1]};
@@ -927,6 +940,7 @@
     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:
+        case IMGFMT_BGRA:
             return default_flags | VOCAP_NOSLICES;
         case IMGFMT_VDPAU_MPEG1:
         case IMGFMT_VDPAU_MPEG2:


More information about the MPlayer-dev-eng mailing list