comparison libvo/vo_vdpau.c @ 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 389d43c448b3
children c922d2550d20
comparison
equal deleted inserted replaced
36196:6feedb93c073 36197:a3aaf74a68a1
264 CHECK_ST_WARNING("Error when calling vdp_video_mixer_render") 264 CHECK_ST_WARNING("Error when calling vdp_video_mixer_render")
265 push_deint_surface(surface_render[vid_surface_num].surface); 265 push_deint_surface(surface_render[vid_surface_num].surface);
266 } 266 }
267 } 267 }
268 268
269 static const uint32_t rotate_flags[4] = {
270 VDP_OUTPUT_SURFACE_RENDER_ROTATE_0,
271 VDP_OUTPUT_SURFACE_RENDER_ROTATE_90,
272 VDP_OUTPUT_SURFACE_RENDER_ROTATE_180,
273 VDP_OUTPUT_SURFACE_RENDER_ROTATE_270
274 };
275
269 static void resize(void) 276 static void resize(void)
270 { 277 {
271 VdpStatus vdp_st; 278 VdpStatus vdp_st;
272 int i; 279 int i;
273 struct vo_rect src_rect; 280 struct vo_rect src_rect;
312 } 319 }
313 if (image_format == IMGFMT_BGRA) { 320 if (image_format == IMGFMT_BGRA) {
314 vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num], 321 vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num],
315 NULL, VDP_INVALID_HANDLE, 322 NULL, VDP_INVALID_HANDLE,
316 NULL, NULL, NULL, 323 NULL, NULL, NULL,
317 VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); 324 rotate_flags[vo_rotate & 3]);
318 CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface") 325 CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface")
319 vdp_st = vdp_output_surface_render_output_surface(output_surfaces[1 - surface_num], 326 vdp_st = vdp_output_surface_render_output_surface(output_surfaces[1 - surface_num],
320 NULL, VDP_INVALID_HANDLE, 327 NULL, VDP_INVALID_HANDLE,
321 NULL, NULL, NULL, 328 NULL, NULL, NULL,
322 VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); 329 rotate_flags[vo_rotate & 3]);
323 CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface") 330 CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface")
324 } else 331 } else
325 video_to_output_surface(); 332 video_to_output_surface();
326 if (visible_buf) 333 if (visible_buf)
327 flip_page(); 334 flip_page();
825 &output_indexed_rect_vid, 832 &output_indexed_rect_vid,
826 osd_surface, 833 osd_surface,
827 &output_indexed_rect_vid, 834 &output_indexed_rect_vid,
828 NULL, 835 NULL,
829 &blend_state, 836 &blend_state,
830 VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); 837 rotate_flags[vo_rotate & 3]);
831 CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface") 838 CHECK_ST_WARNING("Error when calling vdp_output_surface_render_output_surface")
832 } 839 }
833 840
834 static void draw_eosd(void) 841 static void draw_eosd(void)
835 { 842 {
849 for (i = 0; i < eosd_render_count; i++) { 856 for (i = 0; i < eosd_render_count; i++) {
850 vdp_st = vdp_output_surface_render_bitmap_surface( 857 vdp_st = vdp_output_surface_render_bitmap_surface(
851 output_surface, &eosd_targets[i].dest, 858 output_surface, &eosd_targets[i].dest,
852 eosd_targets[i].surface, &eosd_targets[i].source, 859 eosd_targets[i].surface, &eosd_targets[i].source,
853 &eosd_targets[i].color, &blend_state, 860 &eosd_targets[i].color, &blend_state,
854 VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); 861 rotate_flags[vo_rotate & 3]);
855 CHECK_ST_WARNING("EOSD: Error when rendering") 862 CHECK_ST_WARNING("EOSD: Error when rendering")
856 } 863 }
857 } 864 }
858 865
859 static void generate_eosd(struct mp_eosd_image_list *imgs) 866 static void generate_eosd(struct mp_eosd_image_list *imgs)
1039 CHECK_ST_ERROR("Error when calling vdp_output_surface_put_bits_native") 1046 CHECK_ST_ERROR("Error when calling vdp_output_surface_put_bits_native")
1040 vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num], 1047 vdp_st = vdp_output_surface_render_output_surface(output_surfaces[surface_num],
1041 &out_rect_vid, 1048 &out_rect_vid,
1042 output_surfaces[2], 1049 output_surfaces[2],
1043 &src_rect_vid, NULL, NULL, 1050 &src_rect_vid, NULL, NULL,
1044 VDP_OUTPUT_SURFACE_RENDER_ROTATE_0); 1051 rotate_flags[vo_rotate & 3]);
1045 CHECK_ST_ERROR("Error when calling vdp_output_surface_render_output_surface") 1052 CHECK_ST_ERROR("Error when calling vdp_output_surface_render_output_surface")
1046 } else if (!(mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)) { 1053 } else if (!(mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)) {
1047 VdpStatus vdp_st; 1054 VdpStatus vdp_st;
1048 void *destdata[3] = {mpi->planes[0], mpi->planes[2], mpi->planes[1]}; 1055 void *destdata[3] = {mpi->planes[0], mpi->planes[2], mpi->planes[1]};
1049 struct vdpau_render_state *rndr = get_surface(deint_counter); 1056 struct vdpau_render_state *rndr = get_surface(deint_counter);