9 #include "video_out_internal.h"
10 #include "osdep/timer.h"
13 #include <X11/Xutil.h>
14 #include <X11/Xatom.h>
19 #include <X11/extensions/XShm.h>
22 #include <X11/extensions/Xv.h>
23 #include <X11/extensions/Xvlib.h>
24 #include <X11/extensions/XvMClib.h>
26 #include "x11_common.h"
27 #include "xvmc_render.h"
32 #include "subopt-helper.h"
35 #include "gui/interface.h"
38 #include "libavutil/common.h"
40 //no chance for xinerama to be supported in the near future
41 #undef CONFIG_XINERAMA
47 #define UNUSED(x) ((void)(x))
49 #include "libavcodec/avcodec.h"
50 #if LIBAVCODEC_BUILD < ((51<<16)+(40<<8)+2)
51 #error You need at least libavcodecs v51.40.2
57 static int first_frame
;//draw colorkey on first frame
59 static int xv_port_request
= 0;
60 static int xv_adaptor
= -1;
61 static int bob_deinterlace
;
62 static int top_field_first
;
64 static int image_width
,image_height
;
65 static int image_format
;
66 static uint32_t drwX
,drwY
;
68 #define NO_SUBPICTURE 0
69 #define OVERLAY_SUBPICTURE 1
70 #define BLEND_SUBPICTURE 2
71 #define BACKEND_SUBPICTURE 3
73 static int subpicture_mode
;
74 static int subpicture_alloc
;
75 static XvMCSubpicture subpicture
;
76 static XvImageFormatValues subpicture_info
;
77 static int subpicture_clear_color
;//transparent color for the subpicture or color key for overlay
79 static XvMCSurfaceInfo surface_info
;
80 static XvMCContext ctx
;
81 static XvMCBlockArray data_blocks
;
82 static XvMCMacroBlockArray mv_blocks
;
84 #define MAX_SURFACES 8
85 static int number_of_surfaces
=0;
86 static XvMCSurface surface_array
[MAX_SURFACES
];
87 static struct xvmc_render_state
* surface_render
;
89 static struct xvmc_render_state
* p_render_surface_to_show
=NULL
;
90 static struct xvmc_render_state
* p_render_surface_visible
=NULL
;
92 //display queue, kinda render ahead
93 static struct xvmc_render_state
* show_queue
[MAX_SURFACES
];
94 static int free_element
;
97 static void (*draw_osd_fnc
)(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
);
98 static void (*clear_osd_fnc
)(int x0
,int y0
, int w
,int h
);
99 static void (*init_osd_fnc
)(void);
101 static void draw_osd_AI44(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
);
102 static void draw_osd_IA44(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
);
103 static void clear_osd_subpic(int x0
,int y0
, int w
,int h
);
104 static void init_osd_yuv_pal(void);
108 int id
;//id as xvimages or as mplayer RGB|{8,15,16,24,32}
109 void (* init_func_ptr
)();
110 void (* draw_func_ptr
)();
111 void (* clear_func_ptr
)();
113 {0x34344149,init_osd_yuv_pal
,draw_osd_AI44
,clear_osd_subpic
},
114 {0x34344941,init_osd_yuv_pal
,draw_osd_IA44
,clear_osd_subpic
},
118 static void xvmc_free(void);
119 static void xvmc_clean_surfaces(void);
120 static int count_free_surfaces(void);
121 static struct xvmc_render_state
* find_free_surface(void);
123 static const vo_info_t info
= {
124 "XVideo Motion Compensation",
126 "Ivan Kalvachev <iive@users.sf.net>",
130 const LIBVO_EXTERN(xvmc
);
132 //shm stuff from vo_xv
134 static XShmSegmentInfo Shminfo
;
135 static int Shmem_Flag
;
140 static void allocate_xvimage(int xvimage_width
,int xvimage_height
,int xv_format
)
143 * allocate XvImages. FIXME: no error checking, without
144 * mit-shm this will bomb... trzing to fix ::atmos
147 if ( mLocalDisplay
&& XShmQueryExtension( mDisplay
) ) Shmem_Flag
= 1;
151 mp_msg(MSGT_VO
,MSGL_INFO
, "Shared memory not supported\nReverting to normal Xv\n" );
155 xvimage
= (XvImage
*) XvShmCreateImage(mDisplay
, xv_port
, xv_format
,
156 NULL
, xvimage_width
, xvimage_height
, &Shminfo
);
158 Shminfo
.shmid
= shmget(IPC_PRIVATE
, xvimage
->data_size
, IPC_CREAT
| 0777);
159 Shminfo
.shmaddr
= (char *) shmat(Shminfo
.shmid
, 0, 0);
160 Shminfo
.readOnly
= False
;
162 xvimage
->data
= Shminfo
.shmaddr
;
163 XShmAttach(mDisplay
, &Shminfo
);
164 XSync(mDisplay
, False
);
165 shmctl(Shminfo
.shmid
, IPC_RMID
, 0);
170 xvimage
= (XvImage
*) XvCreateImage(mDisplay
, xv_port
, xv_format
, NULL
, xvimage_width
, xvimage_height
);
171 xvimage
->data
= malloc(xvimage
->data_size
);
172 XSync(mDisplay
,False
);
174 // memset(xvimage->data,128,xvimage->data_size);
178 static void deallocate_xvimage(void)
183 XShmDetach( mDisplay
,&Shminfo
);
184 shmdt( Shminfo
.shmaddr
);
193 XSync(mDisplay
, False
);
196 //end of vo_xv shm/xvimage code
198 static int xvmc_check_surface_format(uint32_t format
, XvMCSurfaceInfo
* surf_info
){
199 if ( format
== IMGFMT_XVMC_IDCT_MPEG2
){
200 if( surf_info
->mc_type
!= (XVMC_IDCT
|XVMC_MPEG_2
) ) return -1;
201 if( surf_info
->chroma_format
!= XVMC_CHROMA_FORMAT_420
) return -1;
204 if ( format
== IMGFMT_XVMC_MOCO_MPEG2
){
205 if(surf_info
->mc_type
!= XVMC_MPEG_2
) return -1;
206 if(surf_info
->chroma_format
!= XVMC_CHROMA_FORMAT_420
) return -1;
212 //print all info needed to add new format
213 static void print_xvimage_format_values(XvImageFormatValues
*xifv
){
215 printf("Format_ID = 0x%X\n",xifv
->id
);
218 if(xifv
->type
== XvRGB
) printf("RGB\n");
219 else if(xifv
->type
== XvYUV
) printf("YUV\n");
220 else printf("Unknown\n");
222 printf(" byte_order = ");
223 if(xifv
->byte_order
== LSBFirst
) printf("LSB First\n");
224 else if(xifv
->type
== MSBFirst
) printf("MSB First\n");
225 else printf("Unknown\n");//yes Linux support other types too
229 printf("%02X ",(unsigned char)xifv
->guid
[i
]);
232 printf(" bits_per_pixel = %d\n",xifv
->bits_per_pixel
);
234 printf(" format = ");
235 if(xifv
->format
== XvPacked
) printf("XvPacked\n");
236 else if(xifv
->format
== XvPlanar
) printf("XvPlanar\n");
237 else printf("Unknown\n");
239 printf(" num_planes = %d\n",xifv
->num_planes
);
241 if(xifv
->type
== XvRGB
){
242 printf(" red_mask = %0X\n", xifv
->red_mask
);
243 printf(" green_mask = %0X\n",xifv
->green_mask
);
244 printf(" blue_mask = %0X\n", xifv
->blue_mask
);
246 if(xifv
->type
== XvYUV
){
247 printf(" y_sample_bits = %d\n u_sample_bits = %d\n v_sample_bits = %d\n",
248 xifv
->y_sample_bits
,xifv
->u_sample_bits
,xifv
->v_sample_bits
);
249 printf(" horz_y_period = %d\n horz_u_period = %d\n horz_v_period = %d\n",
250 xifv
->horz_y_period
,xifv
->horz_u_period
,xifv
->horz_v_period
);
251 printf(" vert_y_period = %d\n vert_u_period = %d\n vert_v_period = %d\n",
252 xifv
->vert_y_period
,xifv
->vert_u_period
,xifv
->vert_v_period
);
254 printf(" component_order = ");
256 if(xifv
->component_order
[i
]>=32)
257 printf("%c",xifv
->component_order
[i
]);
260 printf(" scanline = ");
261 if(xifv
->scanline_order
== XvTopToBottom
) printf("XvTopToBottom\n");
262 else if(xifv
->scanline_order
== XvBottomToTop
) printf("XvBottomToTop\n");
263 else printf("Unknown\n");
268 // WARNING This function may changes xv_port and surface_info!
269 static int xvmc_find_surface_by_format(int format
,int width
,int height
,
270 XvMCSurfaceInfo
* surf_info
,int query
){
276 XvMCSurfaceInfo
* mc_surf_list
;
278 rez
= XvQueryAdaptors(mDisplay
,DefaultRootWindow(mDisplay
),&num_adaptors
,&ai
);
279 if( rez
!= Success
) return -1;
280 if( mp_msg_test(MSGT_VO
,MSGL_DBG3
) ) {
281 printf("vo_xvmc: Querying %d adaptors\n",num_adaptors
); }
282 for(i
=0; i
<num_adaptors
; i
++)
284 /* check if adaptor number has been specified */
285 if (xv_adaptor
!= -1 && xv_adaptor
!= i
)
287 if( mp_msg_test(MSGT_VO
,MSGL_DBG3
) ) {
288 printf("vo_xvmc: Quering adaptor #%d\n",i
); }
289 if( ai
[i
].type
== 0 ) continue;// we need at least dummy type!
291 for(p
=ai
[i
].base_id
; p
<ai
[i
].base_id
+ai
[i
].num_ports
; p
++)
293 if( mp_msg_test(MSGT_VO
,MSGL_DBG3
) ) {
294 printf("vo_xvmc: probing port #%ld\n",p
); }
295 mc_surf_list
= XvMCListSurfaceTypes(mDisplay
,p
,&mc_surf_num
);
296 if( mc_surf_list
== NULL
|| mc_surf_num
== 0){
297 if( mp_msg_test(MSGT_VO
,MSGL_DBG3
) ) {
298 printf("vo_xvmc: No XvMC supported. \n"); }
301 if( mp_msg_test(MSGT_VO
,MSGL_DBG3
) ) {
302 printf("vo_xvmc: XvMC list have %d surfaces\n",mc_surf_num
); }
304 for(s
=0; s
<mc_surf_num
; s
++)
306 if( width
> mc_surf_list
[s
].max_width
) continue;
307 if( height
> mc_surf_list
[s
].max_height
) continue;
308 if( xvmc_check_surface_format(format
,&mc_surf_list
[s
])<0 ) continue;
310 /* respect the users wish */
311 if ( xv_port_request
!= 0 && xv_port_request
!= p
)
317 rez
= XvGrabPort(mDisplay
,p
,CurrentTime
);
319 if ( mp_msg_test(MSGT_VO
,MSGL_DBG3
) ) {
320 printf("vo_xvmc: Fail to grab port %ld\n",p
); }
323 printf("vo_xvmc: Using Xv Adaptor #%d (%s)\n", i
, ai
[i
].name
);
324 printf("vo_xvmc: Port %ld grabed\n",p
);
329 XFree(mc_surf_list
);//if mc_surf_num==0 is list==NULL ?
332 XvFreeAdaptorInfo(ai
);
334 if(!query
) printf("vo_xvmc: Could not find free matching surface. Sorry.\n");
337 // somebody know cleaner way to escape from 3 internal loops?
339 XvFreeAdaptorInfo(ai
);
341 memcpy(surf_info
,&mc_surf_list
[s
],sizeof(XvMCSurfaceInfo
));
342 if( mp_msg_test(MSGT_VO
,MSGL_DBG3
) || !query
)
343 printf("vo_xvmc: Found matching surface with id=%X on %ld port at %d adapter\n",
344 mc_surf_list
[s
].surface_type_id
,p
,i
);
345 return mc_surf_list
[s
].surface_type_id
;
348 static uint32_t xvmc_draw_image(mp_image_t
*mpi
){
349 struct xvmc_render_state
* rndr
;
352 assert(mpi
->flags
&MP_IMGFLAG_DIRECT
);
353 // assert(mpi->flags &MP_IMGFLAGS_DRAWBACK);
355 rndr
= (struct xvmc_render_state
*)mpi
->priv
;//there is copy in plane[2]
356 assert( rndr
!= NULL
);
357 assert( rndr
->magic
== MP_XVMC_RENDER_MAGIC
);
358 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
359 printf("vo_xvmc: draw_image(show rndr=%p)\n",rndr
);
360 // the surface have passed vf system without been skiped, it will be displayed
361 rndr
->state
|= MP_XVMC_STATE_DISPLAY_PENDING
;
362 p_render_surface_to_show
= rndr
;
363 top_field_first
= mpi
->fields
& MP_IMGFIELD_TOP_FIRST
;
367 static int preinit(const char *arg
){
368 int xv_version
,xv_release
,xv_request_base
,xv_event_base
,xv_error_base
;
369 int mc_eventBase
,mc_errorBase
;
371 strarg_t ck_src_arg
= { 0, NULL
};
372 strarg_t ck_method_arg
= { 0, NULL
};
375 /* name arg type arg var test */
376 { "port", OPT_ARG_INT
, &xv_port_request
, (opt_test_f
)int_pos
},
377 { "adaptor", OPT_ARG_INT
, &xv_adaptor
, (opt_test_f
)int_non_neg
},
378 { "ck", OPT_ARG_STR
, &ck_src_arg
, xv_test_ck
},
379 { "ck-method", OPT_ARG_STR
, &ck_method_arg
, xv_test_ckm
},
380 { "benchmark", OPT_ARG_BOOL
, &benchmark
, NULL
},
381 { "sleep", OPT_ARG_BOOL
, &use_sleep
, NULL
},
382 { "queue", OPT_ARG_BOOL
, &use_queue
, NULL
},
383 { "bobdeint", OPT_ARG_BOOL
, &bob_deinterlace
, NULL
},
387 //Obtain display handler
388 if (!vo_init()) return -1;//vo_xv
390 //XvMC is subdivision of XVideo
391 if (Success
!= XvQueryExtension(mDisplay
,&xv_version
,&xv_release
,&xv_request_base
,
392 &xv_event_base
,&xv_error_base
) ){
393 mp_msg(MSGT_VO
,MSGL_ERR
,"Sorry, Xv(MC) not supported by this X11 version/driver\n");
394 mp_msg(MSGT_VO
,MSGL_ERR
,"********** Try with -vo x11 or -vo sdl ***********\n");
397 printf("vo_xvmc: X-Video extension %d.%d\n",xv_version
,xv_release
);
399 if( True
!= XvMCQueryExtension(mDisplay
,&mc_eventBase
,&mc_errorBase
) ){
400 printf("vo_xvmc: No X-Video MotionCompensation Extension on %s\n",
405 if(Success
== XvMCQueryVersion(mDisplay
, &mc_ver
, &mc_rev
) ){
406 printf("vo_xvmc: X-Video MotionCompensation Extension version %i.%i\n",
410 printf("vo_xvmc: Error querying version info!\n");
413 surface_render
= NULL
;
415 number_of_surfaces
= 0;
416 subpicture_alloc
= 0;
418 benchmark
= 0; //disable PutImageto allow faster display than screen refresh
423 /* parse suboptions */
424 if ( subopt_parse( arg
, subopts
) != 0 )
429 xv_setup_colorkeyhandling( ck_method_arg
.str
, ck_src_arg
.str
);
434 static int config(uint32_t width
, uint32_t height
,
435 uint32_t d_width
, uint32_t d_height
,
436 uint32_t flags
, char *title
, uint32_t format
){
438 int numblocks
,blocks_per_macroblock
;//bpmb we have 6,8,12
442 XSetWindowAttributes xswa
;
443 XWindowAttributes attribs
;
444 unsigned long xswamask
;
447 int vm
= flags
& VOFLAG_MODESWITCHING
;
451 if( !IMGFMT_IS_XVMC(format
) )
453 assert(0);//should never happen, abort on debug or
454 return 1;//return error on relese
457 // Find free port that supports MC, by querying adaptors
458 if( xv_port
!= 0 || number_of_surfaces
!= 0 ){
459 if( height
==image_height
&& width
==image_width
&& image_format
==format
){
460 xvmc_clean_surfaces();
461 goto skip_surface_allocation
;
465 numblocks
=((width
+15)/16)*((height
+15)/16);
466 // Find Supported Surface Type
467 mode_id
= xvmc_find_surface_by_format(format
,width
,height
,&surface_info
,0);//false=1 to grab port, not query
473 rez
= XvMCCreateContext(mDisplay
, xv_port
,mode_id
,width
,height
,XVMC_DIRECT
,&ctx
);
474 if( rez
!= Success
){
475 printf("vo_xvmc: XvMCCreateContext failed with error %d\n",rez
);
478 if( ctx
.flags
& XVMC_DIRECT
){
479 printf("vo_xvmc: Allocated Direct Context\n");
481 printf("vo_xvmc: Allocated Indirect Context!\n");
485 blocks_per_macroblock
= 6;
486 if(surface_info
.chroma_format
== XVMC_CHROMA_FORMAT_422
)
487 blocks_per_macroblock
= 8;
488 if(surface_info
.chroma_format
== XVMC_CHROMA_FORMAT_444
)
489 blocks_per_macroblock
= 12;
491 rez
= XvMCCreateBlocks(mDisplay
,&ctx
,numblocks
*blocks_per_macroblock
,&data_blocks
);
492 if( rez
!= Success
){
493 XvMCDestroyContext(mDisplay
,&ctx
);
496 printf("vo_xvmc: data_blocks allocated\n");
498 rez
= XvMCCreateMacroBlocks(mDisplay
,&ctx
,numblocks
,&mv_blocks
);
499 if( rez
!= Success
){
500 XvMCDestroyBlocks(mDisplay
,&data_blocks
);
501 XvMCDestroyContext(mDisplay
,&ctx
);
504 printf("vo_xvmc: mv_blocks allocated\n");
506 if(surface_render
==NULL
)
507 surface_render
=malloc(MAX_SURFACES
*sizeof(struct xvmc_render_state
));//easy mem debug
508 memset(surface_render
,0,MAX_SURFACES
*sizeof(struct xvmc_render_state
));
510 for(i
=0; i
<MAX_SURFACES
; i
++){
511 rez
=XvMCCreateSurface(mDisplay
,&ctx
,&surface_array
[i
]);
514 surface_render
[i
].magic
= MP_XVMC_RENDER_MAGIC
;
515 surface_render
[i
].data_blocks
= data_blocks
.blocks
;
516 surface_render
[i
].mv_blocks
= mv_blocks
.macro_blocks
;
517 surface_render
[i
].total_number_of_mv_blocks
= numblocks
;
518 surface_render
[i
].total_number_of_data_blocks
= numblocks
*blocks_per_macroblock
;;
519 surface_render
[i
].mc_type
= surface_info
.mc_type
& (~XVMC_IDCT
);
520 surface_render
[i
].idct
= (surface_info
.mc_type
& XVMC_IDCT
) == XVMC_IDCT
;
521 surface_render
[i
].chroma_format
= surface_info
.chroma_format
;
522 surface_render
[i
].unsigned_intra
= (surface_info
.flags
& XVMC_INTRA_UNSIGNED
) == XVMC_INTRA_UNSIGNED
;
523 surface_render
[i
].p_surface
= &surface_array
[i
];
524 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
525 printf("vo_xvmc: surface[%d] = %p .rndr=%p\n",i
,&surface_array
[i
], &surface_render
[i
]);
527 number_of_surfaces
= i
;
528 if( number_of_surfaces
< 4 ){// +2 I or P and +2 for B (to avoid visible motion drawing)
529 printf("vo_xvmc: Unable to allocate at least 4 Surfaces\n");
533 printf("vo_xvmc: Motion Compensation context allocated - %d surfaces\n",
537 printf("vo_xvmc: idct=%d unsigned_intra=%d\n",
538 (surface_info
.mc_type
& XVMC_IDCT
) == XVMC_IDCT
,
539 (surface_info
.flags
& XVMC_INTRA_UNSIGNED
) == XVMC_INTRA_UNSIGNED
);
541 // Find way to display OSD & subtitle
542 printf("vo_xvmc: looking for OSD support\n");
543 subpicture_mode
= NO_SUBPICTURE
;
544 if(surface_info
.flags
& XVMC_OVERLAID_SURFACE
)
545 subpicture_mode
= OVERLAY_SUBPICTURE
;
547 if(surface_info
.subpicture_max_width
!= 0 &&
548 surface_info
.subpicture_max_height
!= 0 ){
551 XvImageFormatValues
* xvfmv
;
552 xvfmv
= XvMCListSubpictureTypes(mDisplay
, xv_port
,
553 surface_info
.surface_type_id
, &num_subpic
);
555 if(num_subpic
!= 0 && xvfmv
!= NULL
){
556 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) ){//Print all subpicture types for debug
557 for(s
=0;s
<num_subpic
;s
++)
558 print_xvimage_format_values(&xvfmv
[s
]);
561 for(s
=0;s
<num_subpic
;s
++){
562 for(k
=0;osd_render
[k
].draw_func_ptr
!=NULL
;k
++){
563 if(xvfmv
[s
].id
== osd_render
[k
].id
)
565 init_osd_fnc
= osd_render
[k
].init_func_ptr
;
566 draw_osd_fnc
= osd_render
[k
].draw_func_ptr
;
567 clear_osd_fnc
= osd_render
[k
].clear_func_ptr
;
569 subpicture_mode
= BLEND_SUBPICTURE
;
570 subpicture_info
= xvfmv
[s
];
571 printf(" Subpicture id 0x%08X\n",subpicture_info
.id
);
579 //Blend2 supicture is always possible, blend1 only at backend
580 if( (subpicture_mode
== BLEND_SUBPICTURE
) &&
581 (surface_info
.flags
& XVMC_BACKEND_SUBPICTURE
) )
583 subpicture_mode
= BACKEND_SUBPICTURE
;
588 switch(subpicture_mode
){
590 printf("vo_xvmc: No OSD support for this mode\n");
592 case OVERLAY_SUBPICTURE
:
593 printf("vo_xvmc: OSD support via color key tricks\n");
594 printf("vo_xvmc: not yet implemented:(\n");
596 case BLEND_SUBPICTURE
:
597 printf("vo_xvmc: OSD support by additional frontend rendering\n");
599 case BACKEND_SUBPICTURE
:
600 printf("vo_xvmc: OSD support by backend rendering (fast)\n");
601 printf("vo_xvmc: Please send feedback to confirm that it works,otherwise send bugreport!\n");
605 //take keycolor value and choose method for handling it
606 if ( !vo_xv_init_colorkey() )
608 return -1; // bail out, colorkey setup failed
611 vo_xv_enable_vsync();//it won't break anything
614 image_height
= height
;
617 skip_surface_allocation
:
621 guiGetEvent( guiSetShVideo
,0 ); // let the GUI to setup/resize our window
632 XGetWindowAttributes(mDisplay
, DefaultRootWindow(mDisplay
), &attribs
);
634 if (depth
!= 15 && depth
!= 16 && depth
!= 24 && depth
!= 32) depth
= 24;
635 XMatchVisualInfo(mDisplay
, mScreen
, depth
, TrueColor
, &vinfo
);
637 xswa
.background_pixel
= 0;
638 if (xv_ck_info
.method
== CK_METHOD_BACKGROUND
)
639 xswa
.background_pixel
= xv_colorkey
;
640 xswa
.border_pixel
= 0;
641 xswamask
= CWBackPixel
| CWBorderPixel
;
643 vo_x11_create_vo_window(&vinfo
, vo_dx
, vo_dy
, d_width
, d_height
, flags
,
644 CopyFromParent
, "xvmc", title
);
645 XChangeWindowAttributes(mDisplay
, vo_window
, xswamask
, &xswa
);
650 /* Grab the mouse pointer in our window */
652 XGrabPointer(mDisplay
, vo_window
, True
, 0,
653 GrabModeAsync
, GrabModeAsync
,
654 vo_window
, None
, CurrentTime
);
655 XSetInputFocus(mDisplay
, vo_window
, RevertToNone
, CurrentTime
);
660 if ((flags
& VOFLAG_FULLSCREEN
) && WinID
<= 0) vo_fs
= 1;
661 vo_calc_drwXY(&drwX
, &drwY
);
665 mp_msg(MSGT_VO
,MSGL_V
, "[xvmc] dx: %d dy: %d dw: %d dh: %d\n",drwX
,drwY
,vo_dwidth
,vo_dheight
);
669 /* store image dimesions for displaying */
670 p_render_surface_visible
= NULL
;
671 p_render_surface_to_show
= NULL
;
676 vo_directrendering
= 1;//ugly hack, coz xvmc works only with direct rendering
681 static int draw_frame(uint8_t *srcp
[]){
686 static void init_osd_yuv_pal(void) {
693 subpicture_clear_color
= 0;
695 if(subpicture
.num_palette_entries
> 0){
697 snum
= subpicture
.num_palette_entries
;
698 seb
= subpicture
.entry_bytes
;
699 palette
= malloc(snum
*seb
);//check fail
700 if(palette
== NULL
) return;
701 for(i
=0; i
<snum
; i
++){
702 // 0-black max-white the other are gradients
703 Y
= i
*(1 << subpicture_info
.y_sample_bits
)/snum
;//snum=2;->(0),(1*(1<<1)/2)
704 U
= 1 << (subpicture_info
.u_sample_bits
- 1);
705 V
= 1 << (subpicture_info
.v_sample_bits
- 1);
707 switch(subpicture
.component_order
[j
]){
708 case 'U': palette
[i
*seb
+j
] = U
; break;
709 case 'V': palette
[i
*seb
+j
] = V
; break;
712 palette
[i
*seb
+j
] = Y
; break;
715 rez
= XvMCSetSubpicturePalette(mDisplay
, &subpicture
, palette
);
717 printf("vo_xvmc: Setting palette failed.\n");
723 static void clear_osd_subpic(int x0
, int y0
, int w
, int h
){
725 rez
=XvMCClearSubpicture(mDisplay
, &subpicture
,
727 subpicture_clear_color
);
729 printf("vo_xvmc: XvMCClearSubpicture failed!\n");
732 static void OSD_init(void) {
733 unsigned short osd_height
, osd_width
;
736 if(subpicture_alloc
){
737 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
738 printf("vo_xvmc: destroying subpicture\n");
739 XvMCDestroySubpicture(mDisplay
,&subpicture
);
740 deallocate_xvimage();
741 subpicture_alloc
= 0;
744 /* if(surface_info.flags & XVMC_SUBPICTURE_INDEPENDENT_SCALING){
745 osd_width = vo_dwidth;
746 osd_height = vo_dheight;
749 osd_width
= image_width
;
750 osd_height
= image_height
;
753 if(osd_width
> surface_info
.subpicture_max_width
)
754 osd_width
= surface_info
.subpicture_max_width
;
755 if(osd_height
> surface_info
.subpicture_max_height
)
756 osd_height
= surface_info
.subpicture_max_height
;
757 if(osd_width
== 0 || osd_height
== 0)
758 return;//if called before window size is known
760 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
761 printf("vo_xvmc: creating subpicture (%d,%d) format %X\n",
762 osd_width
,osd_height
,subpicture_info
.id
);
764 rez
= XvMCCreateSubpicture(mDisplay
,&ctx
,&subpicture
,
765 osd_width
,osd_height
,subpicture_info
.id
);
767 subpicture_mode
= NO_SUBPICTURE
;
768 printf("vo_xvmc: Create Subpicture failed, OSD disabled\n");
771 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) ){
773 printf("vo_xvmc: Created Subpicture:\n");
774 printf(" xvimage_id=0x%X\n",subpicture
.xvimage_id
);
775 printf(" width=%d\n",subpicture
.width
);
776 printf(" height=%d\n",subpicture
.height
);
777 printf(" num_palette_entries=0x%X\n",subpicture
.num_palette_entries
);
778 printf(" entry_bytes=0x%X\n",subpicture
.entry_bytes
);
780 printf(" component_order=\"");
782 if(subpicture
.component_order
[i
] >= 32)
783 printf("%c", subpicture
.component_order
[i
]);
787 //call init for the surface type
788 init_osd_fnc();//init palete,clear color etc ...
789 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
790 printf("vo_xvmc: clearing subpicture\n");
791 clear_osd_fnc(0, 0, subpicture
.width
, subpicture
.height
);
793 allocate_xvimage(subpicture
.width
, subpicture
.height
, subpicture_info
.id
);
794 subpicture_alloc
= 1;
797 static void draw_osd_IA44(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
){
801 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
802 printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0
,y0
,w
,h
);
804 for(ox
=0; ox
<w
; ox
++){
805 for(oy
=0; oy
<h
; oy
++){
806 xvimage
->data
[oy
*xvimage
->width
+ox
] = (src
[oy
*stride
+ox
]>>4) | ((0-srca
[oy
*stride
+ox
])&0xf0);
809 rez
= XvMCCompositeSubpicture(mDisplay
, &subpicture
, xvimage
, 0, 0,
812 printf("vo_xvmc: composite subpicture failed\n");
817 static void draw_osd_AI44(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
){
820 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
821 printf("vo_xvmc:composite AI44 subpicture (%d,%d - %d,%d)\n",x0
,y0
,w
,h
);
823 for(ox
=0; ox
<w
; ox
++){
824 for(oy
=0; oy
<h
; oy
++){
825 xvimage
->data
[oy
*xvimage
->width
+ox
] = (src
[oy
*stride
+ox
]&0xf0) | (((0-srca
[oy
*stride
+ox
])>>4)&0xf);
828 rez
= XvMCCompositeSubpicture(mDisplay
, &subpicture
, xvimage
, 0, 0,
831 printf("vo_xvmc: composite subpicture failed\n");
836 static void draw_osd(void){
837 struct xvmc_render_state
* osd_rndr
;
839 int have_osd_to_draw
;
842 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
843 printf("vo_xvmc: draw_osd ,OSD_mode=%d, surface_to_show=%p\n",
844 subpicture_mode
,p_render_surface_to_show
);
846 if(subpicture_mode
== BLEND_SUBPICTURE
||
847 subpicture_mode
== BACKEND_SUBPICTURE
){
849 if(!subpicture_alloc
) //allocate subpicture when dimensions are known
851 if(!subpicture_alloc
)
852 return;//dimensions still unknown.
854 osd_has_changed
= vo_update_osd(subpicture
.width
, subpicture
.height
);
855 have_osd_to_draw
= vo_osd_check_range_update(0, 0, subpicture
.width
,
858 if(!have_osd_to_draw
)
859 return;//nothing to draw,no subpic, no blend
862 //vo_remove_text(subpicture.width, subpicture.height,clear_osd_fnc)
863 clear_osd_fnc(0,0,subpicture
.width
,subpicture
.height
);
864 vo_draw_text(subpicture
.width
, subpicture
.height
, draw_osd_fnc
);
866 XvMCSyncSubpicture(mDisplay
,&subpicture
);//todo usleeep wait!
868 if(subpicture_mode
== BLEND_SUBPICTURE
){
869 osd_rndr
= find_free_surface();
871 return;// no free surface to draw OSD in
873 rez
= XvMCBlendSubpicture2(mDisplay
,
874 p_render_surface_to_show
->p_surface
, osd_rndr
->p_surface
,
876 0, 0, subpicture
.width
, subpicture
.height
,
877 0, 0, image_width
, image_height
);
879 printf("vo_xvmc: BlendSubpicture failed rez=%d\n",rez
);
883 // XvMCFlushSurface(mDisplay,osd_rndr->p_surface);//fixme- should I?
885 //When replaceing the surface with osd one, save the flags too!
886 osd_rndr
->picture_structure
= p_render_surface_to_show
->picture_structure
;
887 osd_rndr
->display_flags
= p_render_surface_to_show
->display_flags
;
888 //add more if needed osd_rndr-> = p_render_surface_to_show->;
890 p_render_surface_to_show
->state
&= ~MP_XVMC_STATE_DISPLAY_PENDING
;
891 p_render_surface_to_show
->state
|= MP_XVMC_STATE_OSD_SOURCE
;
892 p_render_surface_to_show
->p_osd_target_surface_render
= osd_rndr
;
894 p_render_surface_to_show
= osd_rndr
;
895 p_render_surface_to_show
->state
= MP_XVMC_STATE_DISPLAY_PENDING
;
897 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
898 printf("vo_xvmc:draw_osd: surface_to_show changed to %p\n",osd_rndr
);
900 if(subpicture_mode
== BACKEND_SUBPICTURE
){
901 rez
= XvMCBlendSubpicture(mDisplay
,
902 p_render_surface_to_show
->p_surface
,
904 0, 0, subpicture
.width
, subpicture
.height
,
905 0, 0, image_width
, image_height
);
909 }//if(BLEND||BACKEND)
912 static void xvmc_sync_surface(XvMCSurface
* srf
){
914 rez
= XvMCGetSurfaceStatus(mDisplay
,srf
,&status
);
915 assert(rez
==Success
);
916 if((status
& XVMC_RENDERING
) == 0)
917 return;//surface is already complete
919 rez
= XvMCFlushSurface(mDisplay
, srf
);
920 assert(rez
==Success
);
923 usec_sleep(1000);//1ms (may be 20ms on linux)
924 XvMCGetSurfaceStatus(mDisplay
,srf
,&status
);
925 } while (status
& XVMC_RENDERING
);
929 XvMCSyncSurface(mDisplay
, srf
);
932 static void put_xvmc_image(struct xvmc_render_state
* p_render_surface
,
935 int clipX
,clipY
,clipW
,clipH
;
938 if(p_render_surface
== NULL
)
941 clipX
= drwX
-(vo_panscan_x
>>1);
942 clipY
= drwY
-(vo_panscan_y
>>1);
943 clipW
= vo_dwidth
+vo_panscan_x
;
944 clipH
= vo_dheight
+vo_panscan_y
;
947 vo_xv_draw_colorkey(clipX
,clipY
,clipW
,clipH
);
952 for (i
= 1; i
<= bob_deinterlace
+ 1; i
++) {
953 int field
= top_field_first
? i
: i
^ 3;
954 rez
= XvMCPutSurface(mDisplay
, p_render_surface
->p_surface
,
956 0, 0, image_width
, image_height
,
957 clipX
, clipY
, clipW
, clipH
,
958 bob_deinterlace
? field
: 3);
959 //p_render_surface_to_show->display_flags);
961 printf("vo_xvmc: PutSurface failer, critical error %d!\n",rez
);
968 static void flip_page(void){
972 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
973 printf("vo_xvmc: flip_page show(rndr=%p)\n\n",p_render_surface_to_show
);
975 if(p_render_surface_to_show
== NULL
) return;
976 assert( p_render_surface_to_show
->magic
== MP_XVMC_RENDER_MAGIC
);
977 //fixme assert( p_render_surface_to_show != p_render_surface_visible);
980 // fill the queue until only n free surfaces remain
981 // after that start displaying
982 cfs
= count_free_surfaces();
983 show_queue
[free_element
++] = p_render_surface_to_show
;
984 if(cfs
> 3){//well have 3 free surfaces after add queue
985 if(free_element
> 1)//a little voodoo magic
986 xvmc_sync_surface(show_queue
[0]->p_surface
);
989 p_render_surface_to_show
=show_queue
[0];
990 if( mp_msg_test(MSGT_VO
,MSGL_DBG5
) )
991 printf("vo_xvmc: flip_queue free_element=%d\n",free_element
);
993 for(i
=0; i
<free_element
; i
++){
994 show_queue
[i
] = show_queue
[i
+1];
996 show_queue
[free_element
] = NULL
;
999 // make sure the rendering is done
1000 xvmc_sync_surface(p_render_surface_to_show
->p_surface
);
1002 //the visible surface won't be displayed anymore, mark it as free
1003 if(p_render_surface_visible
!= NULL
)
1004 p_render_surface_visible
->state
&= ~MP_XVMC_STATE_DISPLAY_PENDING
;
1006 //!!fixme assert(p_render_surface_to_show->state & MP_XVMC_STATE_DISPLAY_PENDING);
1008 //show it, displaying is always vsynced, so skip it for benchmark
1009 put_xvmc_image(p_render_surface_to_show
,first_frame
);
1010 first_frame
=0;//make sure we won't draw it anymore
1012 p_render_surface_visible
= p_render_surface_to_show
;
1013 p_render_surface_to_show
= NULL
;
1016 static void check_events(void){
1017 int e
=vo_x11_check_events(mDisplay
);
1018 if(e
&VO_EVENT_RESIZE
)
1020 e
|= VO_EVENT_EXPOSE
;
1022 vo_calc_drwXY(&drwX
, &drwY
);
1024 if ( e
& VO_EVENT_EXPOSE
)
1026 put_xvmc_image(p_render_surface_visible
,1);
1030 static void xvmc_free(void){
1032 if( subpicture_alloc
){
1034 XvMCDestroySubpicture(mDisplay
,&subpicture
);
1035 deallocate_xvimage();
1037 subpicture_alloc
= 0;
1039 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
1040 printf("vo_xvmc: subpicture destroyed\n");
1043 if( number_of_surfaces
){
1045 XvMCDestroyMacroBlocks(mDisplay
,&mv_blocks
);
1046 XvMCDestroyBlocks(mDisplay
,&data_blocks
);
1048 for(i
=0; i
<number_of_surfaces
; i
++)
1050 XvMCHideSurface(mDisplay
,&surface_array
[i
]);//it doesn't hurt, I hope
1051 XvMCDestroySurface(mDisplay
,&surface_array
[i
]);
1053 if( (surface_render
[i
].state
!= 0) &&
1054 (p_render_surface_visible
!= &surface_render
[i
]) )
1055 printf("vo_xvmc::uninit surface_render[%d].status=%d\n",i
,
1056 surface_render
[i
].state
);
1059 memset(surface_render
,0,MAX_SURFACES
*sizeof(struct xvmc_render_state
));//for debuging
1060 free(surface_render
);surface_render
=NULL
;
1062 XvMCDestroyContext(mDisplay
,&ctx
);
1063 number_of_surfaces
= 0;
1065 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) ) {
1066 printf("vo_xvmc: Context sucessfuly freed\n"); }
1071 XvUngrabPort(mDisplay
,xv_port
,CurrentTime
);
1073 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) ) {
1074 printf("vo_xvmc: xv_port sucessfuly ungrabed\n"); }
1078 static void uninit(void){
1079 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) ) {
1080 printf("vo_xvmc: uninit called\n"); }
1083 #ifdef CONFIG_XF86VM
1089 static int query_format(uint32_t format
){
1091 XvMCSurfaceInfo qsurface_info
;
1094 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
1095 printf("vo_xvmc: query_format=%X\n",format
);
1097 if(!IMGFMT_IS_XVMC(format
)) return 0;// no caps supported
1098 mode_id
= xvmc_find_surface_by_format(format
, 16, 16, &qsurface_info
, 1);//true=1 - quering
1100 if( mode_id
== 0 ) return 0;
1102 flags
= VFCAP_CSP_SUPPORTED
|
1103 VFCAP_CSP_SUPPORTED_BY_HW
|
1104 VFCAP_ACCEPT_STRIDE
;
1106 if( (qsurface_info
.subpicture_max_width
!= 0) &&
1107 (qsurface_info
.subpicture_max_height
!= 0) )
1113 static int draw_slice(uint8_t *image
[], int stride
[],
1114 int w
, int h
, int x
, int y
){
1115 struct xvmc_render_state
* rndr
;
1118 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
1119 printf("vo_xvmc: draw_slice y=%d\n",y
);
1121 rndr
= (struct xvmc_render_state
*)image
[2];//this is copy of priv-ate
1122 assert( rndr
!= NULL
);
1123 assert( rndr
->magic
== MP_XVMC_RENDER_MAGIC
);
1125 rez
= XvMCRenderSurface(mDisplay
,&ctx
,rndr
->picture_structure
,
1127 rndr
->p_past_surface
,
1128 rndr
->p_future_surface
,
1130 rndr
->filled_mv_blocks_num
,rndr
->start_mv_blocks_num
,
1131 &mv_blocks
,&data_blocks
);
1136 printf("vo_xvmc::slice: RenderSirface returned %d\n",rez
);
1138 printf("vo_xvmc::slice: pict=%d,flags=%x,start_blocks=%d,num_blocks=%d\n",
1139 rndr
->picture_structure
,rndr
->flags
,rndr
->start_mv_blocks_num
,
1140 rndr
->filled_mv_blocks_num
);
1141 printf("vo_xvmc::slice: this_surf=%p, past_surf=%p, future_surf=%p\n",
1142 rndr
->p_surface
,rndr
->p_past_surface
,rndr
->p_future_surface
);
1144 for(i
=0; i
<rndr
->filled_mv_blocks_num
; i
++){
1145 XvMCMacroBlock
* testblock
;
1146 testblock
= &mv_blocks
.macro_blocks
[i
];
1148 printf("vo_xvmc::slice: mv_block - x=%d,y=%d,mb_type=0x%x,mv_type=0x%x,mv_field_select=%d\n",
1149 testblock
->x
,testblock
->y
,testblock
->macroblock_type
,
1150 testblock
->motion_type
,testblock
->motion_vertical_field_select
);
1151 printf("vo_xvmc::slice: dct_type=%d,data_index=0x%x,cbp=%d,pad0=%d\n",
1152 testblock
->dct_type
,testblock
->index
,testblock
->coded_block_pattern
,
1154 printf("vo_xvmc::slice: PMV[0][0][0/1]=(%d,%d)\n",
1155 testblock
->PMV
[0][0][0],testblock
->PMV
[0][0][1]);
1159 assert(rez
==Success
);
1160 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) ) printf("vo_xvmc: flush surface\n");
1161 rez
= XvMCFlushSurface(mDisplay
, rndr
->p_surface
);
1162 assert(rez
==Success
);
1164 // rndr->start_mv_blocks_num += rndr->filled_mv_blocks_num;
1165 rndr
->start_mv_blocks_num
= 0;
1166 rndr
->filled_mv_blocks_num
= 0;
1168 rndr
->next_free_data_block_num
= 0;
1173 //XvMCHide hides the surface on next retrace, so
1174 //check if the surface is not still displaying
1175 static void check_osd_source(struct xvmc_render_state
* src_rndr
){
1176 struct xvmc_render_state
* osd_rndr
;
1178 //If this is source surface, check does the OSD rendering is compleate
1179 if(src_rndr
->state
& MP_XVMC_STATE_OSD_SOURCE
){
1180 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
1181 printf("vo_xvmc: OSD surface=%p quering\n",src_rndr
);
1182 osd_rndr
= src_rndr
->p_osd_target_surface_render
;
1183 XvMCGetSurfaceStatus(mDisplay
, osd_rndr
->p_surface
, &stat
);
1184 if(!(stat
& XVMC_RENDERING
))
1185 src_rndr
->state
&= ~MP_XVMC_STATE_OSD_SOURCE
;
1188 static int count_free_surfaces(void) {
1191 for(i
=0; i
<number_of_surfaces
; i
++){
1192 check_osd_source(&surface_render
[i
]);
1193 if(surface_render
[i
].state
== 0)
1199 static struct xvmc_render_state
* find_free_surface(void) {
1202 struct xvmc_render_state
* visible_rndr
;
1204 visible_rndr
= NULL
;
1205 for(i
=0; i
<number_of_surfaces
; i
++){
1207 check_osd_source(&surface_render
[i
]);
1208 if( surface_render
[i
].state
== 0){
1209 XvMCGetSurfaceStatus(mDisplay
, surface_render
[i
].p_surface
,&stat
);
1210 if( (stat
& XVMC_DISPLAYING
) == 0 )
1211 return &surface_render
[i
];
1212 visible_rndr
= &surface_render
[i
];// remember it, use as last resort
1216 //all surfaces are busy, but there is one that will be free
1217 //on next monitor retrace, we just have to wait
1218 if(visible_rndr
!= NULL
){
1219 printf("vo_xvmc: waiting retrace\n");
1220 for(t
=0;t
<1000;t
++){
1221 usec_sleep(1000);//1ms
1222 XvMCGetSurfaceStatus(mDisplay
, visible_rndr
->p_surface
,&stat
);
1223 if( (stat
& XVMC_DISPLAYING
) == 0 )
1224 return visible_rndr
;
1227 //todo remove when stable
1228 printf("vo_xvmc: no free surfaces, this should not happen in g1\n");
1229 for(i
=0;i
<number_of_surfaces
;i
++)
1230 printf("vo_xvmc: surface[%d].state=%d\n",i
,surface_render
[i
].state
);
1234 static void xvmc_clean_surfaces(void){
1237 for(i
=0; i
<number_of_surfaces
; i
++){
1239 surface_render
[i
].state
&=!( MP_XVMC_STATE_DISPLAY_PENDING
|
1240 MP_XVMC_STATE_OSD_SOURCE
|
1242 surface_render
[i
].p_osd_target_surface_render
=NULL
;
1243 if(surface_render
[i
].state
!= 0){
1244 mp_msg(MSGT_VO
,MSGL_WARN
,"vo_xvmc: surface[%d].state=%d\n",
1245 i
,surface_render
[i
].state
);
1248 free_element
=0;//clean up the queue
1251 static uint32_t get_image(mp_image_t
*mpi
){
1252 struct xvmc_render_state
* rndr
;
1254 rndr
= find_free_surface();
1257 printf("vo_xvmc: get_image failed\n");
1261 assert(rndr
->start_mv_blocks_num
== 0);
1262 assert(rndr
->filled_mv_blocks_num
== 0);
1263 assert(rndr
->next_free_data_block_num
== 0);
1265 mpi
->flags
|= MP_IMGFLAG_DIRECT
;
1266 //keep strides 0 to avoid field manipulations
1271 // these are shared!! so watch out
1272 // do call RenderSurface before overwriting
1273 mpi
->planes
[0] = (char*)data_blocks
.blocks
;
1274 mpi
->planes
[1] = (char*)mv_blocks
.macro_blocks
;
1276 mpi
->planes
[2] = (char*)rndr
;
1278 rndr
->picture_structure
= 0;
1281 rndr
->start_mv_blocks_num
= 0;
1282 rndr
->filled_mv_blocks_num
= 0;
1283 rndr
->next_free_data_block_num
= 0;
1285 if( mp_msg_test(MSGT_VO
,MSGL_DBG4
) )
1286 printf("vo_xvmc: get_image: rndr=%p (surface=%p) \n",
1287 rndr
,rndr
->p_surface
);
1291 static int control(uint32_t request
, void *data
, ... )
1294 case VOCTRL_GET_DEINTERLACE
:
1295 *(int*)data
= bob_deinterlace
;
1297 case VOCTRL_SET_DEINTERLACE
:
1298 bob_deinterlace
= *(int*)data
;
1300 case VOCTRL_QUERY_FORMAT
:
1301 return query_format(*((uint32_t*)data
));
1302 case VOCTRL_DRAW_IMAGE
:
1303 return xvmc_draw_image((mp_image_t
*)data
);
1304 case VOCTRL_GET_IMAGE
:
1305 return get_image((mp_image_t
*)data
);
1307 case VOCTRL_GUISUPPORT
:
1312 case VOCTRL_FULLSCREEN
:
1313 vo_x11_fullscreen();
1314 // indended, fallthrough to update panscan on fullscreen/windowed switch
1315 case VOCTRL_SET_PANSCAN
:
1316 if ( ( vo_fs
&& ( vo_panscan
!= vo_panscan_amount
) ) || ( !vo_fs
&& vo_panscan_amount
) )
1318 int old_y
= vo_panscan_y
;
1321 if(old_y
!= vo_panscan_y
)
1323 //this also draws the colorkey
1324 put_xvmc_image(p_render_surface_visible
,1);
1328 case VOCTRL_GET_PANSCAN
:
1329 if ( !vo_config_count
|| !vo_fs
) return VO_FALSE
;
1331 case VOCTRL_SET_EQUALIZER
:
1337 value
= va_arg(ap
, int);
1340 return vo_xv_set_eq(xv_port
, data
, value
);
1343 case VOCTRL_GET_EQUALIZER
:
1349 value
= va_arg(ap
, int*);
1352 return vo_xv_get_eq(xv_port
, data
, value
);
1354 case VOCTRL_UPDATE_SCREENINFO
:
1355 update_xinerama_info();