4 * Copyright (C) Nick Kurshev <nickols_k@mail.ru> - 2002
5 * Copyright (C) Alex Beregszaszi
7 * You can redistribute this file under terms and conditions
8 * of GNU General Public licence v2 or later.
10 * This file contains vidix interface to any mplayer's VO plugin.
11 * (Partly based on vesa_lvo.c from mplayer's package)
18 #include <sys/ioctl.h>
30 #include "vidix/vidixlib.h"
31 #include "fastmemcpy.h"
33 #include "video_out.h"
35 #include "vosub_vidix.h"
36 #include "old_vo_wrapper.h"
38 #include "libmpcodecs/vfcap.h"
39 #include "libmpcodecs/mp_image.h"
41 #define NUM_FRAMES VID_PLAY_MAXFRAMES /* Temporary: driver will overwrite it */
43 static VDL_HANDLE vidix_handler
= NULL
;
44 static uint8_t *vidix_mem
= NULL
;
45 static uint8_t next_frame
;
46 static unsigned image_Bpp
,image_height
,image_width
,src_format
,forced_fourcc
=0;
47 static int video_on
=0;
49 static vidix_capability_t vidix_cap
;
50 static vidix_playback_t vidix_play
;
51 static vidix_fourcc_t vidix_fourcc
;
52 static struct vo_old_functions
*vo_server
;
53 static vidix_yuv_t dstrides
;
54 /*static uint32_t (*server_control)(uint32_t request, void *data, ...);*/
59 if((err
=vdlPlaybackOn(vidix_handler
))!=0)
61 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CantStartPlayback
,strerror(err
));
71 if((err
=vdlPlaybackOff(vidix_handler
))!=0)
73 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CantStopPlayback
,strerror(err
));
80 void vidix_term( void )
82 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
83 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_term() was called\n"); }
85 vdlClose(vidix_handler
);
86 // vo_server->control=server_control;
89 static int vidix_draw_slice_420(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
96 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
97 dest
+= dstrides
.y
*y
+ x
;
105 if (vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)
109 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
110 dest
+= dstrides
.y
*y
/2 + x
; // <- is this correct ?
115 for(hi
= 0; hi
< h
; hi
++)
117 for(wi
= 0; wi
< w
; wi
++)
119 dest
[2*wi
+0] = src
[wi
];
120 dest
[2*wi
+1] = src2
[wi
];
130 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
131 dest
+= dstrides
.v
*y
/4 + x
;
134 memcpy(dest
,src
,w
/2);
140 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
141 dest
+= dstrides
.u
*y
/4 + x
;
144 memcpy(dest
,src
,w
/2);
146 dest
+= dstrides
.u
/2;
153 static int vidix_draw_slice_410(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
160 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
161 dest
+= dstrides
.y
*y
+ x
;
169 if (vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)
171 mp_msg(MSGT_VO
,MSGL_WARN
, MSGTR_LIBVO_SUB_VIDIX_InterleavedUvForYuv410pNotSupported
);
176 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
177 dest
+= dstrides
.v
*y
/8 + x
;
180 memcpy(dest
,src
,w
/4);
186 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
187 dest
+= dstrides
.u
*y
/8 + x
;
190 memcpy(dest
,src
,w
/4);
192 dest
+= dstrides
.u
/4;
199 static int vidix_draw_slice_packed(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
205 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
206 dest
+= dstrides
.y
*y
+ x
;
209 memcpy(dest
,src
,w
*image_Bpp
);
216 int vidix_draw_slice(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
218 mp_msg(MSGT_VO
,MSGL_WARN
, MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawsliceWasCalled
);
222 static uint32_t vidix_draw_image(mp_image_t
*mpi
){
223 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
224 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_draw_image() was called\n"); }
226 // if -dr or -slices then do nothing:
227 if(mpi
->flags
&(MP_IMGFLAG_DIRECT
|MP_IMGFLAG_DRAW_CALLBACK
)) return VO_TRUE
;
229 vo_server
->draw_slice(mpi
->planes
,mpi
->stride
,
230 vidix_play
.src
.w
,vidix_play
.src
.h
,vidix_play
.src
.x
,vidix_play
.src
.y
);
234 int vidix_draw_frame(uint8_t *image
[])
236 mp_msg(MSGT_VO
,MSGL_WARN
, MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawframeWasCalled
);
240 void vidix_flip_page(void)
242 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
243 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_flip_page() was called\n"); }
244 if(vo_doublebuffering
)
246 vdlPlaybackFrameSelect(vidix_handler
,next_frame
);
247 next_frame
=(next_frame
+1)%vidix_play
.num_frames
;
251 static void draw_alpha(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
)
253 uint32_t apitch
,bespitch
;
255 lvo_mem
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
256 apitch
= vidix_play
.dest
.pitch
.y
-1;
257 switch(vidix_play
.fourcc
){
265 bespitch
= (vidix_play
.src
.w
+ apitch
) & (~apitch
);
266 vo_draw_alpha_yv12(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+x0
,bespitch
);
269 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
270 vo_draw_alpha_yuy2(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+2*x0
,bespitch
);
273 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
274 vo_draw_alpha_yuy2(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+2*x0
+1,bespitch
);
278 bespitch
= (vidix_play
.src
.w
*4 + apitch
) & (~apitch
);
279 vo_draw_alpha_rgb32(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+4*x0
,bespitch
);
283 bespitch
= (vidix_play
.src
.w
*3 + apitch
) & (~apitch
);
284 vo_draw_alpha_rgb24(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+3*x0
,bespitch
);
288 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
289 vo_draw_alpha_rgb16(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+2*x0
,bespitch
);
293 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
294 vo_draw_alpha_rgb15(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+2*x0
,bespitch
);
301 void vidix_draw_osd(void)
303 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
304 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_draw_osd() was called\n"); }
305 /* TODO: hw support */
306 vo_draw_text(vidix_play
.src
.w
,vidix_play
.src
.h
,draw_alpha
);
309 uint32_t vidix_query_fourcc(uint32_t format
)
311 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
312 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: query_format was called: %x (%s)\n",format
,vo_format_name(format
)); }
313 vidix_fourcc
.fourcc
= format
;
314 vdlQueryFourcc(vidix_handler
,&vidix_fourcc
);
315 if (vidix_fourcc
.depth
== VID_DEPTH_NONE
)
317 return VFCAP_CSP_SUPPORTED
|VFCAP_CSP_SUPPORTED_BY_HW
|VFCAP_HWSCALE_UP
|VFCAP_HWSCALE_DOWN
|VFCAP_OSD
|VFCAP_ACCEPT_STRIDE
;
320 int vidix_grkey_support(void)
322 return(vidix_fourcc
.flags
& VID_CAP_COLORKEY
);
325 int vidix_grkey_get(vidix_grkey_t
*gr_key
)
327 return(vdlGetGrKeys(vidix_handler
, gr_key
));
330 int vidix_grkey_set(const vidix_grkey_t
*gr_key
)
332 return(vdlSetGrKeys(vidix_handler
, gr_key
));
336 static int is_422_planes_eq
=0;
337 int vidix_init(unsigned src_width
,unsigned src_height
,
338 unsigned x_org
,unsigned y_org
,unsigned dst_width
,
339 unsigned dst_height
,unsigned format
,unsigned dest_bpp
,
340 unsigned vid_w
,unsigned vid_h
)
345 uint32_t sstride
,apitch
;
346 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) )
347 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_init() was called\n"
348 "src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n"
349 "format=%s dest_bpp=%u vid_w=%u vid_h=%u\n"
350 ,src_width
,src_height
,x_org
,y_org
,dst_width
,dst_height
351 ,vo_format_name(format
),dest_bpp
,vid_w
,vid_h
);
353 if(vidix_query_fourcc(format
) == 0)
355 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_UnsupportedFourccForThisVidixDriver
,
356 format
,vo_format_name(format
));
360 if(((vidix_cap
.maxwidth
!= -1) && (vid_w
> vidix_cap
.maxwidth
)) ||
361 ((vidix_cap
.minwidth
!= -1) && (vid_w
< vidix_cap
.minwidth
)) ||
362 ((vidix_cap
.maxheight
!= -1) && (vid_h
> vidix_cap
.maxheight
)) ||
363 ((vidix_cap
.minwidth
!= -1 ) && (vid_h
< vidix_cap
.minheight
)))
365 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedResolution
,
366 vid_w
, vid_h
, vidix_cap
.minwidth
, vidix_cap
.minheight
,
367 vidix_cap
.maxwidth
, vidix_cap
.maxheight
);
374 case 1: err
= ((vidix_fourcc
.depth
& VID_DEPTH_1BPP
) != VID_DEPTH_1BPP
); break;
375 case 2: err
= ((vidix_fourcc
.depth
& VID_DEPTH_2BPP
) != VID_DEPTH_2BPP
); break;
376 case 4: err
= ((vidix_fourcc
.depth
& VID_DEPTH_4BPP
) != VID_DEPTH_4BPP
); break;
377 case 8: err
= ((vidix_fourcc
.depth
& VID_DEPTH_8BPP
) != VID_DEPTH_8BPP
); break;
378 case 12:err
= ((vidix_fourcc
.depth
& VID_DEPTH_12BPP
) != VID_DEPTH_12BPP
); break;
379 case 15:err
= ((vidix_fourcc
.depth
& VID_DEPTH_15BPP
) != VID_DEPTH_15BPP
); break;
380 case 16:err
= ((vidix_fourcc
.depth
& VID_DEPTH_16BPP
) != VID_DEPTH_16BPP
); break;
381 case 24:err
= ((vidix_fourcc
.depth
& VID_DEPTH_24BPP
) != VID_DEPTH_24BPP
); break;
382 case 32:err
= ((vidix_fourcc
.depth
& VID_DEPTH_32BPP
) != VID_DEPTH_32BPP
); break;
383 default: err
=1; break;
387 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedColorDepth
388 ,vidix_fourcc
.depth
);
391 if((dst_width
> src_width
|| dst_height
> src_height
) && (vidix_cap
.flags
& FLAG_UPSCALER
) != FLAG_UPSCALER
)
393 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_DriverCantUpscaleImage
,
394 src_width
, src_height
, dst_width
, dst_height
);
397 if((dst_width
> src_width
|| dst_height
> src_height
) && (vidix_cap
.flags
& FLAG_DOWNSCALER
) != FLAG_DOWNSCALER
)
399 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_DriverCantDownscaleImage
,
400 src_width
, src_height
, dst_width
, dst_height
);
403 image_width
= src_width
;
404 image_height
= src_height
;
406 if(forced_fourcc
) format
= forced_fourcc
;
407 memset(&vidix_play
,0,sizeof(vidix_playback_t
));
408 vidix_play
.fourcc
= format
;
409 vidix_play
.capability
= vidix_cap
.flags
; /* every ;) */
410 vidix_play
.blend_factor
= 0; /* for now */
411 /* display the full picture.
412 Nick: we could implement here zooming to a specified area -- alex */
413 vidix_play
.src
.x
= vidix_play
.src
.y
= 0;
414 vidix_play
.src
.w
= src_width
;
415 vidix_play
.src
.h
= src_height
;
416 vidix_play
.dest
.x
= x_org
;
417 vidix_play
.dest
.y
= y_org
;
418 vidix_play
.dest
.w
= dst_width
;
419 vidix_play
.dest
.h
= dst_height
;
420 // vidix_play.num_frames=vo_doublebuffering?NUM_FRAMES-1:1;
421 /* we aren't mad...3 buffers are more than enough */
422 vidix_play
.num_frames
=vo_doublebuffering
?3:1;
423 vidix_play
.src
.pitch
.y
= vidix_play
.src
.pitch
.u
= vidix_play
.src
.pitch
.v
= 0;
425 if((err
=vdlConfigPlayback(vidix_handler
,&vidix_play
))!=0)
427 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CantConfigurePlayback
,strerror(err
));
430 if ( mp_msg_test(MSGT_VO
,MSGL_V
) ) {
431 mp_msg(MSGT_VO
,MSGL_V
, "vosub_vidix: using %d buffer(s)\n", vidix_play
.num_frames
); }
433 vidix_mem
= vidix_play
.dga_addr
;
435 tmp
= calloc(image_width
, image_height
);
436 tmpa
= malloc(image_width
* image_height
);
437 memset(tmpa
, 1, image_width
* image_height
);
438 /* clear every frame with correct address and frame_size */
439 /* HACK: use draw_alpha to clear Y component */
440 for (i
= 0; i
< vidix_play
.num_frames
; i
++) {
442 memset(vidix_mem
+ vidix_play
.offsets
[i
], 0x80,
443 vidix_play
.frame_size
);
444 draw_alpha(0, 0, image_width
, image_height
, tmp
, tmpa
, image_width
);
448 /* show one of the "clear" frames */
460 apitch
= vidix_play
.dest
.pitch
.y
-1;
461 dstrides
.y
= (image_width
+ apitch
) & ~apitch
;
462 apitch
= vidix_play
.dest
.pitch
.v
-1;
463 dstrides
.v
= (image_width
+ apitch
) & ~apitch
;
464 apitch
= vidix_play
.dest
.pitch
.u
-1;
465 dstrides
.u
= (image_width
+ apitch
) & ~apitch
;
470 apitch
= vidix_play
.dest
.pitch
.y
-1;
471 dstrides
.y
= (image_width
*4 + apitch
) & ~apitch
;
472 dstrides
.u
= dstrides
.v
= 0;
477 apitch
= vidix_play
.dest
.pitch
.y
-1;
478 dstrides
.y
= (image_width
*3 + apitch
) & ~apitch
;
479 dstrides
.u
= dstrides
.v
= 0;
483 apitch
= vidix_play
.dest
.pitch
.y
-1;
484 dstrides
.y
= (image_width
*2 + apitch
) & ~apitch
;
485 dstrides
.u
= dstrides
.v
= 0;
489 /* tune some info here */
490 sstride
= src_width
*image_Bpp
;
493 is_422_planes_eq
= sstride
== dstrides
.y
;
495 if(src_format
== IMGFMT_YV12
|| src_format
== IMGFMT_I420
|| src_format
== IMGFMT_IYUV
)
496 vo_server
->draw_slice
= vidix_draw_slice_420
;
497 else if (src_format
== IMGFMT_YVU9
|| src_format
== IMGFMT_IF09
)
498 vo_server
->draw_slice
= vidix_draw_slice_410
;
499 else vo_server
->draw_slice
= vidix_draw_slice_packed
;
504 static uint32_t vidix_get_image(mp_image_t
*mpi
)
506 if(mpi
->type
==MP_IMGTYPE_STATIC
&& vidix_play
.num_frames
>1) return VO_FALSE
;
507 if(mpi
->flags
&MP_IMGFLAG_READABLE
) return VO_FALSE
; /* slow video ram */
508 if(( (mpi
->stride
[0]==dstrides
.y
&& (!(mpi
->flags
&MP_IMGFLAG_PLANAR
) ||
509 (mpi
->stride
[1]==dstrides
.u
&& mpi
->stride
[2]==dstrides
.v
)) )
510 || (mpi
->flags
&(MP_IMGFLAG_ACCEPT_STRIDE
|MP_IMGFLAG_ACCEPT_WIDTH
))) &&
511 (!forced_fourcc
&& !(vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)))
513 if(mpi
->flags
&MP_IMGFLAG_ACCEPT_WIDTH
){
514 // check if only width is enough to represent strides:
515 if(mpi
->flags
&MP_IMGFLAG_PLANAR
){
516 if((dstrides
.y
>>1)!=dstrides
.v
|| dstrides
.v
!=dstrides
.u
) return VO_FALSE
;
518 if(dstrides
.y
% (mpi
->bpp
/8)) return VO_FALSE
;
521 mpi
->planes
[0]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.y
;
522 mpi
->width
=mpi
->stride
[0]=dstrides
.y
;
523 if(mpi
->flags
&MP_IMGFLAG_PLANAR
)
525 mpi
->planes
[1]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.v
;
526 mpi
->stride
[1]=dstrides
.v
>> mpi
->chroma_x_shift
;
527 mpi
->planes
[2]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.u
;
528 mpi
->stride
[2]=dstrides
.u
>> mpi
->chroma_x_shift
;
530 mpi
->width
/=mpi
->bpp
/8;
531 mpi
->flags
|=MP_IMGFLAG_DIRECT
;
537 uint32_t vidix_control(uint32_t request
, void *data
)
540 case VOCTRL_QUERY_FORMAT
:
541 return vidix_query_fourcc(*((uint32_t*)data
));
542 case VOCTRL_GET_IMAGE
:
543 return vidix_get_image(data
);
544 case VOCTRL_DRAW_IMAGE
:
545 return vidix_draw_image(data
);
546 case VOCTRL_GET_FRAME_NUM
:
547 *(uint32_t *)data
= next_frame
;
549 case VOCTRL_SET_FRAME_NUM
:
550 next_frame
= *(uint32_t *)data
;
552 case VOCTRL_GET_NUM_FRAMES
:
553 *(uint32_t *)data
= vidix_play
.num_frames
;
555 case VOCTRL_SET_EQUALIZER
:
557 vidix_video_eq_t info
;
559 if(!video_on
) return VO_FALSE
;
561 struct voctrl_set_equalizer_args
*args
= data
;
563 /* vidix eq ranges are -1000..1000 */
564 if (!strcasecmp(args
->name
, "brightness"))
566 info
.brightness
= args
->value
*10;
567 info
.cap
= VEQ_CAP_BRIGHTNESS
;
569 else if (!strcasecmp(args
->name
, "contrast"))
571 info
.contrast
= args
->value
*10;
572 info
.cap
= VEQ_CAP_CONTRAST
;
574 else if (!strcasecmp(args
->name
, "saturation"))
576 info
.saturation
= args
->value
*10;
577 info
.cap
= VEQ_CAP_SATURATION
;
579 else if (!strcasecmp(args
->name
, "hue"))
581 info
.hue
= args
->value
*10;
582 info
.cap
= VEQ_CAP_HUE
;
585 if (vdlPlaybackSetEq(vidix_handler
, &info
) == 0)
589 case VOCTRL_GET_EQUALIZER
:
591 vidix_video_eq_t info
;
593 if(!video_on
) return VO_FALSE
;
594 if (vdlPlaybackGetEq(vidix_handler
, &info
) != 0)
597 struct voctrl_get_equalizer_args
*args
= data
;
599 /* vidix eq ranges are -1000..1000 */
600 if (!strcasecmp(args
->name
, "brightness"))
602 if (info
.cap
& VEQ_CAP_BRIGHTNESS
)
603 *args
->valueptr
= info
.brightness
/10;
605 else if (!strcasecmp(args
->name
, "contrast"))
607 if (info
.cap
& VEQ_CAP_CONTRAST
)
608 *args
->valueptr
= info
.contrast
/10;
610 else if (!strcasecmp(args
->name
, "saturation"))
612 if (info
.cap
& VEQ_CAP_SATURATION
)
613 *args
->valueptr
= info
.saturation
/10;
615 else if (!strcasecmp(args
->name
, "hue"))
617 if (info
.cap
& VEQ_CAP_HUE
)
618 *args
->valueptr
= info
.hue
/10;
625 // WARNING: we drop extra parameters (...) here!
626 // return server_control(request,data); //VO_NOTIMPL;
629 int vidix_preinit(const char *drvname
, struct vo_old_functions
*server
)
632 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
633 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_preinit(%s) was called\n",drvname
); }
634 if(vdlGetVersion() != VIDIX_VERSION
)
636 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_YouHaveWrongVersionOfVidixLibrary
);
640 vidix_handler
= vdlOpen(MP_VIDIX_PFX
,
641 drvname
? drvname
[0] == ':' ? &drvname
[1] : drvname
[0] ? drvname
: NULL
: NULL
,
645 vidix_handler
= vdlOpen(get_path("vidix/"),
646 drvname
? drvname
[0] == ':' ? &drvname
[1] : drvname
[0] ? drvname
: NULL
: NULL
,
651 if(vidix_handler
== NULL
)
653 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CouldntFindWorkingVidixDriver
);
656 if((err
=vdlGetCapability(vidix_handler
,&vidix_cap
)) != 0)
658 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CouldntGetCapability
,strerror(err
));
661 mp_msg(MSGT_VO
,MSGL_INFO
, MSGTR_LIBVO_SUB_VIDIX_Description
, vidix_cap
.name
);
662 mp_msg(MSGT_VO
,MSGL_INFO
, MSGTR_LIBVO_SUB_VIDIX_Author
, vidix_cap
.author
);
663 /* we are able to tune up this stuff depend on fourcc format */
664 server
->draw_slice
=vidix_draw_slice
;
665 server
->draw_frame
=vidix_draw_frame
;
666 server
->flip_page
=vidix_flip_page
;
667 server
->draw_osd
=vidix_draw_osd
;
668 // server_control = server->control;
669 // server->control=vidix_control;