changeset 36197:a3aaf74a68a1

Try to support -monitor-orientation with VDPAU. It doesn't work on my system with a radeon card, though maybe that feature just isn't implemented.
author reimar
date Tue, 28 May 2013 20:56:05 +0000
parents 6feedb93c073
children 3e4454636ad9
files libvo/vo_vdpau.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_vdpau.c	Tue May 28 20:43:50 2013 +0000
+++ b/libvo/vo_vdpau.c	Tue May 28 20:56:05 2013 +0000
@@ -266,6 +266,13 @@
     }
 }
 
+static const uint32_t rotate_flags[4] = {
+    VDP_OUTPUT_SURFACE_RENDER_ROTATE_0,
+    VDP_OUTPUT_SURFACE_RENDER_ROTATE_90,
+    VDP_OUTPUT_SURFACE_RENDER_ROTATE_180,
+    VDP_OUTPUT_SURFACE_RENDER_ROTATE_270
+};
+
 static void resize(void)
 {
     VdpStatus vdp_st;
@@ -314,12 +321,12 @@
         vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num],
                                                           NULL, VDP_INVALID_HANDLE,
                                                           NULL, NULL, NULL,
-                                                          VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+                                                          rotate_flags[vo_rotate & 3]);
         CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface")
         vdp_st = vdp_output_surface_render_output_surface(output_surfaces[1 - surface_num],
                                                           NULL, VDP_INVALID_HANDLE,
                                                           NULL, NULL, NULL,
-                                                          VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+                                                          rotate_flags[vo_rotate & 3]);
         CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface")
     } else
         video_to_output_surface();
@@ -827,7 +834,7 @@
                                                       &output_indexed_rect_vid,
                                                       NULL,
                                                       &blend_state,
-                                                      VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+                                                      rotate_flags[vo_rotate & 3]);
     CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface")
 }
 
@@ -851,7 +858,7 @@
             output_surface, &eosd_targets[i].dest,
             eosd_targets[i].surface, &eosd_targets[i].source,
             &eosd_targets[i].color, &blend_state,
-            VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+            rotate_flags[vo_rotate & 3]);
         CHECK_ST_WARNING("EOSD: Error when rendering")
     }
 }
@@ -1041,7 +1048,7 @@
                                                           &out_rect_vid,
                                                           output_surfaces[2],
                                                           &src_rect_vid, NULL, NULL,
-                                                          VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+                                                          rotate_flags[vo_rotate & 3]);
         CHECK_ST_ERROR("Error when calling vdp_output_surface_render_output_surface")
     } else if (!(mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)) {
         VdpStatus vdp_st;