[MPlayer-dev-eng] [PATCH]Add IMGFMT_NV12 support for vo vdpau

Carl Eugen Hoyos cehoyos at rainbow.studorg.tuwien.ac.at
Sun Mar 29 21:51:42 CEST 2009


Hi!

Attached patch adds support for nv12 to vo vdpau.

Please comment, Carl Eugen
-------------- next part --------------
Index: libvo/vo_vdpau.c
===================================================================
--- libvo/vo_vdpau.c	(revision 29105)
+++ libvo/vo_vdpau.c	(working copy)
@@ -606,6 +606,9 @@
         case IMGFMT_IYUV:
             vdp_pixel_format = VDP_YCBCR_FORMAT_YV12;
             break;
+        case IMGFMT_NV12:
+            vdp_pixel_format = VDP_YCBCR_FORMAT_NV12;
+            break;
         case IMGFMT_YUY2:
             vdp_pixel_format = VDP_YCBCR_FORMAT_YUYV;
             vdp_chroma_type  = VDP_CHROMA_TYPE_422;
@@ -902,6 +905,8 @@
         struct vdpau_render_state *rndr = get_surface(deint_counter);
         deint_counter = (deint_counter + 1) % 3;
         vid_surface_num = rndr - surface_render;
+        if (image_format == IMGFMT_NV12)
+            destdata[1] = destdata[2];
         vdp_st = vdp_video_surface_put_bits_y_cb_cr(rndr->surface,
                                                     vdp_pixel_format,
                                                     (const void *const*)destdata,
@@ -948,6 +953,7 @@
         case IMGFMT_YV12:
         case IMGFMT_I420:
         case IMGFMT_IYUV:
+        case IMGFMT_NV12:
         case IMGFMT_YUY2:
         case IMGFMT_UYVY:
             return default_flags | VOCAP_NOSLICES;


More information about the MPlayer-dev-eng mailing list