2 * vidix interface to any mplayer vo driver
3 * (partly based on vesa_lvo.c)
5 * copyright (C) 2002 Nick Kurshev <nickols_k@mail.ru>
6 * copyright (C) Alex Beregszaszi
8 * This file is part of MPlayer.
10 * MPlayer is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * MPlayer is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include <sys/ioctl.h>
41 #include "vidix/vidix.h"
42 #include "fastmemcpy.h"
44 #include "video_out.h"
46 #include "vosub_vidix.h"
48 #include "libmpcodecs/vfcap.h"
49 #include "libmpcodecs/mp_image.h"
51 #define NUM_FRAMES VID_PLAY_MAXFRAMES /* Temporary: driver will overwrite it */
53 static VDXContext
*vidix_handler
= NULL
;
54 static uint8_t *vidix_mem
= NULL
;
55 static uint8_t next_frame
;
56 static unsigned image_Bpp
,image_height
,image_width
,src_format
,forced_fourcc
=0;
57 static int video_on
=0;
59 static vidix_capability_t vidix_cap
;
60 static vidix_playback_t vidix_play
;
61 static vidix_fourcc_t vidix_fourcc
;
62 static vo_functions_t
* vo_server
;
63 static vidix_yuv_t dstrides
;
64 /*static uint32_t (*server_control)(uint32_t request, void *data, ...);*/
69 if((err
=vdlPlaybackOn(vidix_handler
))!=0)
71 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CantStartPlayback
,strerror(err
));
81 if((err
=vdlPlaybackOff(vidix_handler
))!=0)
83 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CantStopPlayback
,strerror(err
));
90 void vidix_term( void )
92 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
93 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_term() was called\n"); }
95 vdlClose(vidix_handler
);
96 // vo_server->control=server_control;
99 static uint32_t vidix_draw_slice_420(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
106 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
107 dest
+= dstrides
.y
*y
+ x
;
115 if (vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)
119 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
120 dest
+= dstrides
.y
*y
/2 + x
; // <- is this correct ?
125 for(hi
= 0; hi
< h
; hi
++)
127 for(wi
= 0; wi
< w
; wi
++)
129 dest
[2*wi
+0] = src
[wi
];
130 dest
[2*wi
+1] = src2
[wi
];
140 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
141 dest
+= dstrides
.v
*y
/4 + x
;
144 memcpy(dest
,src
,w
/2);
150 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
151 dest
+= dstrides
.u
*y
/4 + x
;
154 memcpy(dest
,src
,w
/2);
156 dest
+= dstrides
.u
/2;
163 static uint32_t vidix_draw_slice_410(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
170 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
171 dest
+= dstrides
.y
*y
+ x
;
179 if (vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)
181 mp_msg(MSGT_VO
,MSGL_WARN
, MSGTR_LIBVO_SUB_VIDIX_InterleavedUvForYuv410pNotSupported
);
186 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
187 dest
+= dstrides
.v
*y
/8 + x
;
190 memcpy(dest
,src
,w
/4);
196 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
197 dest
+= dstrides
.u
*y
/8 + x
;
200 memcpy(dest
,src
,w
/4);
202 dest
+= dstrides
.u
/4;
209 static uint32_t vidix_draw_slice_packed(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
215 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
216 dest
+= dstrides
.y
*y
+ x
;
219 memcpy(dest
,src
,w
*image_Bpp
);
226 static uint32_t vidix_draw_slice_nv12(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
233 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
234 dest
+= dstrides
.y
*y
+ x
;
243 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
244 dest
+= dstrides
.u
*y
/2 + x
;
254 static uint32_t vidix_draw_slice(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
256 mp_msg(MSGT_VO
,MSGL_WARN
, MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawsliceWasCalled
);
260 static uint32_t vidix_draw_image(mp_image_t
*mpi
){
261 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
262 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_draw_image() was called\n"); }
264 // if -dr or -slices then do nothing:
265 if(mpi
->flags
&(MP_IMGFLAG_DIRECT
|MP_IMGFLAG_DRAW_CALLBACK
)) return VO_TRUE
;
267 vo_server
->draw_slice(mpi
->planes
,mpi
->stride
,
268 vidix_play
.src
.w
,vidix_play
.src
.h
,vidix_play
.src
.x
,vidix_play
.src
.y
);
272 static uint32_t vidix_draw_frame(uint8_t *image
[])
274 mp_msg(MSGT_VO
,MSGL_WARN
, MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawframeWasCalled
);
278 static void vidix_flip_page(void)
280 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
281 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_flip_page() was called\n"); }
282 if(vo_doublebuffering
)
284 vdlPlaybackFrameSelect(vidix_handler
,next_frame
);
285 next_frame
=(next_frame
+1)%vidix_play
.num_frames
;
289 static void draw_alpha(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
)
291 uint32_t apitch
,bespitch
;
293 lvo_mem
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
294 apitch
= vidix_play
.dest
.pitch
.y
-1;
295 switch(vidix_play
.fourcc
){
304 bespitch
= (vidix_play
.src
.w
+ apitch
) & (~apitch
);
305 vo_draw_alpha_yv12(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+x0
,bespitch
);
308 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
309 vo_draw_alpha_yuy2(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+2*x0
,bespitch
);
312 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
313 vo_draw_alpha_yuy2(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+2*x0
+1,bespitch
);
317 bespitch
= (vidix_play
.src
.w
*4 + apitch
) & (~apitch
);
318 vo_draw_alpha_rgb32(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+4*x0
,bespitch
);
322 bespitch
= (vidix_play
.src
.w
*3 + apitch
) & (~apitch
);
323 vo_draw_alpha_rgb24(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+3*x0
,bespitch
);
327 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
328 vo_draw_alpha_rgb16(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+2*x0
,bespitch
);
332 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
333 vo_draw_alpha_rgb15(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+2*x0
,bespitch
);
340 static void vidix_draw_osd(void)
342 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
343 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_draw_osd() was called\n"); }
344 /* TODO: hw support */
345 vo_draw_text(vidix_play
.src
.w
,vidix_play
.src
.h
,draw_alpha
);
348 uint32_t vidix_query_fourcc(uint32_t format
)
350 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
351 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: query_format was called: %x (%s)\n",format
,vo_format_name(format
)); }
352 vidix_fourcc
.fourcc
= format
;
353 vdlQueryFourcc(vidix_handler
,&vidix_fourcc
);
354 if (vidix_fourcc
.depth
== VID_DEPTH_NONE
)
356 return VFCAP_CSP_SUPPORTED
|VFCAP_CSP_SUPPORTED_BY_HW
|VFCAP_HWSCALE_UP
|VFCAP_HWSCALE_DOWN
|VFCAP_OSD
|VFCAP_ACCEPT_STRIDE
;
359 int vidix_grkey_support(void)
361 return vidix_fourcc
.flags
& VID_CAP_COLORKEY
;
364 int vidix_grkey_get(vidix_grkey_t
*gr_key
)
366 return vdlGetGrKeys(vidix_handler
, gr_key
);
369 int vidix_grkey_set(const vidix_grkey_t
*gr_key
)
371 return vdlSetGrKeys(vidix_handler
, gr_key
);
375 static int is_422_planes_eq
=0;
376 int vidix_init(unsigned src_width
,unsigned src_height
,
377 unsigned x_org
,unsigned y_org
,unsigned dst_width
,
378 unsigned dst_height
,unsigned format
,unsigned dest_bpp
,
379 unsigned vid_w
,unsigned vid_h
)
384 uint32_t sstride
,apitch
;
385 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) )
386 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_init() was called\n"
387 "src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n"
388 "format=%s dest_bpp=%u vid_w=%u vid_h=%u\n"
389 ,src_width
,src_height
,x_org
,y_org
,dst_width
,dst_height
390 ,vo_format_name(format
),dest_bpp
,vid_w
,vid_h
);
392 if(vidix_query_fourcc(format
) == 0)
394 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_UnsupportedFourccForThisVidixDriver
,
395 format
,vo_format_name(format
));
399 if(((vidix_cap
.maxwidth
!= -1) && (vid_w
> vidix_cap
.maxwidth
)) ||
400 ((vidix_cap
.minwidth
!= -1) && (vid_w
< vidix_cap
.minwidth
)) ||
401 ((vidix_cap
.maxheight
!= -1) && (vid_h
> vidix_cap
.maxheight
)) ||
402 ((vidix_cap
.minwidth
!= -1 ) && (vid_h
< vidix_cap
.minheight
)))
404 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedResolution
,
405 vid_w
, vid_h
, vidix_cap
.minwidth
, vidix_cap
.minheight
,
406 vidix_cap
.maxwidth
, vidix_cap
.maxheight
);
413 case 1: err
= ((vidix_fourcc
.depth
& VID_DEPTH_1BPP
) != VID_DEPTH_1BPP
); break;
414 case 2: err
= ((vidix_fourcc
.depth
& VID_DEPTH_2BPP
) != VID_DEPTH_2BPP
); break;
415 case 4: err
= ((vidix_fourcc
.depth
& VID_DEPTH_4BPP
) != VID_DEPTH_4BPP
); break;
416 case 8: err
= ((vidix_fourcc
.depth
& VID_DEPTH_8BPP
) != VID_DEPTH_8BPP
); break;
417 case 12:err
= ((vidix_fourcc
.depth
& VID_DEPTH_12BPP
) != VID_DEPTH_12BPP
); break;
418 case 15:err
= ((vidix_fourcc
.depth
& VID_DEPTH_15BPP
) != VID_DEPTH_15BPP
); break;
419 case 16:err
= ((vidix_fourcc
.depth
& VID_DEPTH_16BPP
) != VID_DEPTH_16BPP
); break;
420 case 24:err
= ((vidix_fourcc
.depth
& VID_DEPTH_24BPP
) != VID_DEPTH_24BPP
); break;
421 case 32:err
= ((vidix_fourcc
.depth
& VID_DEPTH_32BPP
) != VID_DEPTH_32BPP
); break;
422 default: err
=1; break;
426 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedColorDepth
427 ,vidix_fourcc
.depth
);
430 if((dst_width
> src_width
|| dst_height
> src_height
) && (vidix_cap
.flags
& FLAG_UPSCALER
) != FLAG_UPSCALER
)
432 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_DriverCantUpscaleImage
,
433 src_width
, src_height
, dst_width
, dst_height
);
436 if((dst_width
> src_width
|| dst_height
> src_height
) && (vidix_cap
.flags
& FLAG_DOWNSCALER
) != FLAG_DOWNSCALER
)
438 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_DriverCantDownscaleImage
,
439 src_width
, src_height
, dst_width
, dst_height
);
442 image_width
= src_width
;
443 image_height
= src_height
;
445 if(forced_fourcc
) format
= forced_fourcc
;
446 memset(&vidix_play
,0,sizeof(vidix_playback_t
));
447 vidix_play
.fourcc
= format
;
448 vidix_play
.capability
= vidix_cap
.flags
; /* every ;) */
449 vidix_play
.blend_factor
= 0; /* for now */
450 /* display the full picture.
451 Nick: we could implement here zooming to a specified area -- alex */
452 vidix_play
.src
.x
= vidix_play
.src
.y
= 0;
453 vidix_play
.src
.w
= src_width
;
454 vidix_play
.src
.h
= src_height
;
455 vidix_play
.dest
.x
= x_org
;
456 vidix_play
.dest
.y
= y_org
;
457 vidix_play
.dest
.w
= dst_width
;
458 vidix_play
.dest
.h
= dst_height
;
459 // vidix_play.num_frames=vo_doublebuffering?NUM_FRAMES-1:1;
460 /* we aren't mad...3 buffers are more than enough */
461 vidix_play
.num_frames
=vo_doublebuffering
?3:1;
462 vidix_play
.src
.pitch
.y
= vidix_play
.src
.pitch
.u
= vidix_play
.src
.pitch
.v
= 0;
464 if((err
=vdlConfigPlayback(vidix_handler
,&vidix_play
))!=0)
466 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CantConfigurePlayback
,strerror(err
));
469 if ( mp_msg_test(MSGT_VO
,MSGL_V
) ) {
470 mp_msg(MSGT_VO
,MSGL_V
, "vosub_vidix: using %d buffer(s)\n", vidix_play
.num_frames
); }
472 vidix_mem
= vidix_play
.dga_addr
;
474 tmp
= calloc(image_width
, image_height
);
475 tmpa
= malloc(image_width
* image_height
);
476 memset(tmpa
, 1, image_width
* image_height
);
477 /* clear every frame with correct address and frame_size */
478 /* HACK: use draw_alpha to clear Y component */
479 for (i
= 0; i
< vidix_play
.num_frames
; i
++) {
481 memset(vidix_mem
+ vidix_play
.offsets
[i
], 0x80,
482 vidix_play
.frame_size
);
483 draw_alpha(0, 0, image_width
, image_height
, tmp
, tmpa
, image_width
);
487 /* show one of the "clear" frames */
500 apitch
= vidix_play
.dest
.pitch
.y
-1;
501 dstrides
.y
= (image_width
+ apitch
) & ~apitch
;
502 apitch
= vidix_play
.dest
.pitch
.v
-1;
503 dstrides
.v
= (image_width
+ apitch
) & ~apitch
;
504 apitch
= vidix_play
.dest
.pitch
.u
-1;
505 dstrides
.u
= (image_width
+ apitch
) & ~apitch
;
510 apitch
= vidix_play
.dest
.pitch
.y
-1;
511 dstrides
.y
= (image_width
*4 + apitch
) & ~apitch
;
512 dstrides
.u
= dstrides
.v
= 0;
517 apitch
= vidix_play
.dest
.pitch
.y
-1;
518 dstrides
.y
= (image_width
*3 + apitch
) & ~apitch
;
519 dstrides
.u
= dstrides
.v
= 0;
523 apitch
= vidix_play
.dest
.pitch
.y
-1;
524 dstrides
.y
= (image_width
*2 + apitch
) & ~apitch
;
525 dstrides
.u
= dstrides
.v
= 0;
529 /* tune some info here */
530 sstride
= src_width
*image_Bpp
;
533 is_422_planes_eq
= sstride
== dstrides
.y
;
535 if(src_format
== IMGFMT_YV12
|| src_format
== IMGFMT_I420
|| src_format
== IMGFMT_IYUV
)
536 vo_server
->draw_slice
= vidix_draw_slice_420
;
537 else if (src_format
== IMGFMT_YVU9
|| src_format
== IMGFMT_IF09
)
538 vo_server
->draw_slice
= vidix_draw_slice_410
;
539 else if (src_format
== IMGFMT_NV12
)
540 vo_server
->draw_slice
= vidix_draw_slice_nv12
;
541 else vo_server
->draw_slice
= vidix_draw_slice_packed
;
546 static uint32_t vidix_get_image(mp_image_t
*mpi
)
548 if(mpi
->type
==MP_IMGTYPE_STATIC
&& vidix_play
.num_frames
>1) return VO_FALSE
;
549 if(mpi
->flags
&MP_IMGFLAG_READABLE
) return VO_FALSE
; /* slow video ram */
550 if(( (mpi
->stride
[0]==dstrides
.y
&& (!(mpi
->flags
&MP_IMGFLAG_PLANAR
) ||
551 (mpi
->stride
[1]==dstrides
.u
&& mpi
->stride
[2]==dstrides
.v
)) )
552 || (mpi
->flags
&(MP_IMGFLAG_ACCEPT_STRIDE
|MP_IMGFLAG_ACCEPT_WIDTH
))) &&
553 (!forced_fourcc
&& !(vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)))
555 if(mpi
->flags
&MP_IMGFLAG_ACCEPT_WIDTH
){
556 // check if only width is enough to represent strides:
557 if(mpi
->flags
&MP_IMGFLAG_PLANAR
){
558 if((dstrides
.y
>>1)!=dstrides
.v
|| dstrides
.v
!=dstrides
.u
) return VO_FALSE
;
560 if(dstrides
.y
% (mpi
->bpp
/8)) return VO_FALSE
;
563 mpi
->planes
[0]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.y
;
564 mpi
->width
=mpi
->stride
[0]=dstrides
.y
;
565 if(mpi
->flags
&MP_IMGFLAG_PLANAR
)
567 mpi
->planes
[1]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.v
;
568 mpi
->stride
[1]=dstrides
.v
>> mpi
->chroma_x_shift
;
569 mpi
->planes
[2]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.u
;
570 mpi
->stride
[2]=dstrides
.u
>> mpi
->chroma_x_shift
;
572 mpi
->width
/=mpi
->bpp
/8;
573 mpi
->flags
|=MP_IMGFLAG_DIRECT
;
579 uint32_t vidix_control(uint32_t request
, void *data
, ...)
582 case VOCTRL_QUERY_FORMAT
:
583 return vidix_query_fourcc(*((uint32_t*)data
));
584 case VOCTRL_GET_IMAGE
:
585 return vidix_get_image(data
);
586 case VOCTRL_DRAW_IMAGE
:
587 return vidix_draw_image(data
);
588 case VOCTRL_GET_FRAME_NUM
:
589 *(uint32_t *)data
= next_frame
;
591 case VOCTRL_SET_FRAME_NUM
:
592 next_frame
= *(uint32_t *)data
;
594 case VOCTRL_GET_NUM_FRAMES
:
595 *(uint32_t *)data
= vidix_play
.num_frames
;
597 case VOCTRL_SET_EQUALIZER
:
601 vidix_video_eq_t info
;
603 if(!video_on
) return VO_FALSE
;
605 value
= va_arg(ap
, int);
608 // printf("vidix seteq %s -> %d \n",data,value);
610 /* vidix eq ranges are -1000..1000 */
611 if (!strcasecmp(data
, "brightness"))
613 info
.brightness
= value
*10;
614 info
.cap
= VEQ_CAP_BRIGHTNESS
;
616 else if (!strcasecmp(data
, "contrast"))
618 info
.contrast
= value
*10;
619 info
.cap
= VEQ_CAP_CONTRAST
;
621 else if (!strcasecmp(data
, "saturation"))
623 info
.saturation
= value
*10;
624 info
.cap
= VEQ_CAP_SATURATION
;
626 else if (!strcasecmp(data
, "hue"))
629 info
.cap
= VEQ_CAP_HUE
;
632 if (vdlPlaybackSetEq(vidix_handler
, &info
) == 0)
636 case VOCTRL_GET_EQUALIZER
:
640 vidix_video_eq_t info
;
642 if(!video_on
) return VO_FALSE
;
643 if (vdlPlaybackGetEq(vidix_handler
, &info
) != 0)
647 value
= va_arg(ap
, int*);
650 /* vidix eq ranges are -1000..1000 */
651 if (!strcasecmp(data
, "brightness"))
653 if (info
.cap
& VEQ_CAP_BRIGHTNESS
)
654 *value
= info
.brightness
/10;
656 else if (!strcasecmp(data
, "contrast"))
658 if (info
.cap
& VEQ_CAP_CONTRAST
)
659 *value
= info
.contrast
/10;
661 else if (!strcasecmp(data
, "saturation"))
663 if (info
.cap
& VEQ_CAP_SATURATION
)
664 *value
= info
.saturation
/10;
666 else if (!strcasecmp(data
, "hue"))
668 if (info
.cap
& VEQ_CAP_HUE
)
669 *value
= info
.hue
/10;
676 // WARNING: we drop extra parameters (...) here!
677 // return server_control(request,data); //VO_NOTIMPL;
680 int vidix_preinit(const char *drvname
,vo_functions_t
*server
)
683 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
684 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_preinit(%s) was called\n",drvname
); }
686 vidix_handler
= vdlOpen(drvname
? drvname
[0] == ':' ? &drvname
[1] : drvname
[0] ? drvname
: NULL
: NULL
,
690 if(vidix_handler
== NULL
)
692 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CouldntFindWorkingVidixDriver
);
695 if((err
=vdlGetCapability(vidix_handler
,&vidix_cap
)) != 0)
697 mp_msg(MSGT_VO
,MSGL_ERR
, MSGTR_LIBVO_SUB_VIDIX_CouldntGetCapability
,strerror(err
));
700 mp_msg(MSGT_VO
,MSGL_V
, "[VO_SUB_VIDIX] Description: %s.\n", vidix_cap
.name
);
701 mp_msg(MSGT_VO
,MSGL_V
, "[VO_SUB_VIDIX] Author: %s.\n", vidix_cap
.author
);
702 /* we are able to tune up this stuff depend on fourcc format */
703 server
->draw_slice
=vidix_draw_slice
;
704 server
->draw_frame
=vidix_draw_frame
;
705 server
->flip_page
=vidix_flip_page
;
706 server
->draw_osd
=vidix_draw_osd
;
707 // server_control = server->control;
708 // server->control=vidix_control;