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"
47 #include "old_vo_wrapper.h"
49 #include "libmpcodecs/vfcap.h"
50 #include "libmpcodecs/mp_image.h"
52 #define NUM_FRAMES VID_PLAY_MAXFRAMES /* Temporary: driver will overwrite it */
54 static VDXContext
*vidix_handler
= NULL
;
55 static uint8_t *vidix_mem
= NULL
;
56 static uint8_t next_frame
;
57 static unsigned image_Bpp
,image_height
,image_width
,src_format
,forced_fourcc
=0;
58 static int video_on
=0;
60 static vidix_capability_t vidix_cap
;
61 static vidix_playback_t vidix_play
;
62 static vidix_fourcc_t vidix_fourcc
;
63 static struct vo_old_functions
*vo_server
;
64 static vidix_yuv_t dstrides
;
65 /*static uint32_t (*server_control)(uint32_t request, void *data, ...);*/
70 if((err
=vdlPlaybackOn(vidix_handler
))!=0)
72 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Can't start playback: %s\n",strerror(err
));
82 if((err
=vdlPlaybackOff(vidix_handler
))!=0)
84 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Can't stop playback: %s\n",strerror(err
));
91 void vidix_term( void )
93 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
94 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_term() was called\n"); }
96 vdlClose(vidix_handler
);
97 // vo_server->control=server_control;
100 static int vidix_draw_slice_420(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
107 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
108 dest
+= dstrides
.y
*y
+ x
;
116 if (vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)
120 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
121 dest
+= dstrides
.y
*y
/2 + x
; // <- is this correct ?
126 for(hi
= 0; hi
< h
; hi
++)
128 for(wi
= 0; wi
< w
; wi
++)
130 dest
[2*wi
+0] = src
[wi
];
131 dest
[2*wi
+1] = src2
[wi
];
141 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
142 dest
+= dstrides
.v
*y
/4 + x
;
145 memcpy(dest
,src
,w
/2);
151 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
152 dest
+= dstrides
.u
*y
/4 + x
;
155 memcpy(dest
,src
,w
/2);
157 dest
+= dstrides
.u
/2;
164 static int vidix_draw_slice_410(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
171 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
172 dest
+= dstrides
.y
*y
+ x
;
180 if (vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)
182 mp_tmsg(MSGT_VO
,MSGL_WARN
, "[VO_SUB_VIDIX] Interleaved UV for YUV410P not supported.\n");
187 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.v
;
188 dest
+= dstrides
.v
*y
/8 + x
;
191 memcpy(dest
,src
,w
/4);
197 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
198 dest
+= dstrides
.u
*y
/8 + x
;
201 memcpy(dest
,src
,w
/4);
203 dest
+= dstrides
.u
/4;
210 static int vidix_draw_slice_packed(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
216 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
217 dest
+= dstrides
.y
*y
+ x
;
220 memcpy(dest
,src
,w
*image_Bpp
);
227 static int vidix_draw_slice_nv12(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
234 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
235 dest
+= dstrides
.y
*y
+ x
;
244 dest
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.u
;
245 dest
+= dstrides
.u
*y
/2 + x
;
255 static int vidix_draw_slice(uint8_t *image
[], int stride
[], int w
,int h
,int x
,int y
)
257 mp_tmsg(MSGT_VO
,MSGL_WARN
, "[VO_SUB_VIDIX] Dummy vidix_draw_slice() was called.\n");
261 static uint32_t vidix_draw_image(mp_image_t
*mpi
){
262 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
263 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_draw_image() was called\n"); }
265 // if -dr or -slices then do nothing:
266 if(mpi
->flags
&(MP_IMGFLAG_DIRECT
|MP_IMGFLAG_DRAW_CALLBACK
)) return VO_TRUE
;
268 vo_server
->draw_slice(mpi
->planes
,mpi
->stride
,
269 vidix_play
.src
.w
,vidix_play
.src
.h
,vidix_play
.src
.x
,vidix_play
.src
.y
);
273 static int vidix_draw_frame(uint8_t *image
[])
275 mp_tmsg(MSGT_VO
,MSGL_WARN
, "[VO_SUB_VIDIX] Dummy vidix_draw_frame() was called.\n");
279 static void vidix_flip_page(void)
281 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
282 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_flip_page() was called\n"); }
283 if(vo_doublebuffering
)
285 vdlPlaybackFrameSelect(vidix_handler
,next_frame
);
286 next_frame
=(next_frame
+1)%vidix_play
.num_frames
;
290 static void draw_alpha(int x0
,int y0
, int w
,int h
, unsigned char* src
, unsigned char *srca
, int stride
)
292 uint32_t apitch
,bespitch
;
294 lvo_mem
= vidix_mem
+ vidix_play
.offsets
[next_frame
] + vidix_play
.offset
.y
;
295 apitch
= vidix_play
.dest
.pitch
.y
-1;
296 switch(vidix_play
.fourcc
){
305 bespitch
= (vidix_play
.src
.w
+ apitch
) & (~apitch
);
306 vo_draw_alpha_yv12(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+x0
,bespitch
);
309 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
310 vo_draw_alpha_yuy2(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+2*x0
,bespitch
);
313 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
314 vo_draw_alpha_yuy2(w
,h
,src
,srca
,stride
,lvo_mem
+bespitch
*y0
+2*x0
+1,bespitch
);
318 bespitch
= (vidix_play
.src
.w
*4 + apitch
) & (~apitch
);
319 vo_draw_alpha_rgb32(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+4*x0
,bespitch
);
323 bespitch
= (vidix_play
.src
.w
*3 + apitch
) & (~apitch
);
324 vo_draw_alpha_rgb24(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+3*x0
,bespitch
);
328 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
329 vo_draw_alpha_rgb16(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+2*x0
,bespitch
);
333 bespitch
= (vidix_play
.src
.w
*2 + apitch
) & (~apitch
);
334 vo_draw_alpha_rgb15(w
,h
,src
,srca
,stride
,lvo_mem
+y0
*bespitch
+2*x0
,bespitch
);
341 static void vidix_draw_osd(void)
343 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
344 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_draw_osd() was called\n"); }
345 /* TODO: hw support */
346 vo_draw_text(vidix_play
.src
.w
,vidix_play
.src
.h
,draw_alpha
);
349 uint32_t vidix_query_fourcc(uint32_t format
)
351 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
352 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: query_format was called: %x (%s)\n",format
,vo_format_name(format
)); }
353 vidix_fourcc
.fourcc
= format
;
354 vdlQueryFourcc(vidix_handler
,&vidix_fourcc
);
355 if (vidix_fourcc
.depth
== VID_DEPTH_NONE
)
357 return VFCAP_CSP_SUPPORTED
|VFCAP_CSP_SUPPORTED_BY_HW
|VFCAP_HWSCALE_UP
|VFCAP_HWSCALE_DOWN
|VFCAP_OSD
|VFCAP_ACCEPT_STRIDE
;
360 int vidix_grkey_support(void)
362 return vidix_fourcc
.flags
& VID_CAP_COLORKEY
;
365 int vidix_grkey_get(vidix_grkey_t
*gr_key
)
367 return vdlGetGrKeys(vidix_handler
, gr_key
);
370 int vidix_grkey_set(const vidix_grkey_t
*gr_key
)
372 return vdlSetGrKeys(vidix_handler
, gr_key
);
376 static int is_422_planes_eq
=0;
377 int vidix_init(unsigned src_width
,unsigned src_height
,
378 unsigned x_org
,unsigned y_org
,unsigned dst_width
,
379 unsigned dst_height
,unsigned format
,unsigned dest_bpp
,
380 unsigned vid_w
,unsigned vid_h
)
385 uint32_t sstride
,apitch
;
386 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) )
387 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_init() was called\n"
388 "src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n"
389 "format=%s dest_bpp=%u vid_w=%u vid_h=%u\n"
390 ,src_width
,src_height
,x_org
,y_org
,dst_width
,dst_height
391 ,vo_format_name(format
),dest_bpp
,vid_w
,vid_h
);
393 if(vidix_query_fourcc(format
) == 0)
395 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Unsupported FourCC for this VIDIX driver: %x (%s).\n",
396 format
,vo_format_name(format
));
400 if(((vidix_cap
.maxwidth
!= -1) && (vid_w
> vidix_cap
.maxwidth
)) ||
401 ((vidix_cap
.minwidth
!= -1) && (vid_w
< vidix_cap
.minwidth
)) ||
402 ((vidix_cap
.maxheight
!= -1) && (vid_h
> vidix_cap
.maxheight
)) ||
403 ((vidix_cap
.minwidth
!= -1 ) && (vid_h
< vidix_cap
.minheight
)))
405 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Video server has unsupported resolution (%dx%d), supported: %dx%d-%dx%d.\n",
406 vid_w
, vid_h
, vidix_cap
.minwidth
, vidix_cap
.minheight
,
407 vidix_cap
.maxwidth
, vidix_cap
.maxheight
);
414 case 1: err
= ((vidix_fourcc
.depth
& VID_DEPTH_1BPP
) != VID_DEPTH_1BPP
); break;
415 case 2: err
= ((vidix_fourcc
.depth
& VID_DEPTH_2BPP
) != VID_DEPTH_2BPP
); break;
416 case 4: err
= ((vidix_fourcc
.depth
& VID_DEPTH_4BPP
) != VID_DEPTH_4BPP
); break;
417 case 8: err
= ((vidix_fourcc
.depth
& VID_DEPTH_8BPP
) != VID_DEPTH_8BPP
); break;
418 case 12:err
= ((vidix_fourcc
.depth
& VID_DEPTH_12BPP
) != VID_DEPTH_12BPP
); break;
419 case 15:err
= ((vidix_fourcc
.depth
& VID_DEPTH_15BPP
) != VID_DEPTH_15BPP
); break;
420 case 16:err
= ((vidix_fourcc
.depth
& VID_DEPTH_16BPP
) != VID_DEPTH_16BPP
); break;
421 case 24:err
= ((vidix_fourcc
.depth
& VID_DEPTH_24BPP
) != VID_DEPTH_24BPP
); break;
422 case 32:err
= ((vidix_fourcc
.depth
& VID_DEPTH_32BPP
) != VID_DEPTH_32BPP
); break;
423 default: err
=1; break;
427 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Video server has unsupported color depth by vidix (%d).\n"
428 ,vidix_fourcc
.depth
);
431 if((dst_width
> src_width
|| dst_height
> src_height
) && (vidix_cap
.flags
& FLAG_UPSCALER
) != FLAG_UPSCALER
)
433 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] VIDIX driver can't upscale image (%d%d -> %d%d).\n",
434 src_width
, src_height
, dst_width
, dst_height
);
437 if((dst_width
> src_width
|| dst_height
> src_height
) && (vidix_cap
.flags
& FLAG_DOWNSCALER
) != FLAG_DOWNSCALER
)
439 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] VIDIX driver can't downscale image (%d%d -> %d%d).\n",
440 src_width
, src_height
, dst_width
, dst_height
);
443 image_width
= src_width
;
444 image_height
= src_height
;
446 if(forced_fourcc
) format
= forced_fourcc
;
447 memset(&vidix_play
,0,sizeof(vidix_playback_t
));
448 vidix_play
.fourcc
= format
;
449 vidix_play
.capability
= vidix_cap
.flags
; /* every ;) */
450 vidix_play
.blend_factor
= 0; /* for now */
451 /* display the full picture.
452 Nick: we could implement here zooming to a specified area -- alex */
453 vidix_play
.src
.x
= vidix_play
.src
.y
= 0;
454 vidix_play
.src
.w
= src_width
;
455 vidix_play
.src
.h
= src_height
;
456 vidix_play
.dest
.x
= x_org
;
457 vidix_play
.dest
.y
= y_org
;
458 vidix_play
.dest
.w
= dst_width
;
459 vidix_play
.dest
.h
= dst_height
;
460 // vidix_play.num_frames=vo_doublebuffering?NUM_FRAMES-1:1;
461 /* we aren't mad...3 buffers are more than enough */
462 vidix_play
.num_frames
=vo_doublebuffering
?3:1;
463 vidix_play
.src
.pitch
.y
= vidix_play
.src
.pitch
.u
= vidix_play
.src
.pitch
.v
= 0;
465 if((err
=vdlConfigPlayback(vidix_handler
,&vidix_play
))!=0)
467 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Can't configure playback: %s.\n",strerror(err
));
470 if ( mp_msg_test(MSGT_VO
,MSGL_V
) ) {
471 mp_msg(MSGT_VO
,MSGL_V
, "vosub_vidix: using %d buffer(s)\n", vidix_play
.num_frames
); }
473 vidix_mem
= vidix_play
.dga_addr
;
475 tmp
= calloc(image_width
, image_height
);
476 tmpa
= malloc(image_width
* image_height
);
477 memset(tmpa
, 1, image_width
* image_height
);
478 /* clear every frame with correct address and frame_size */
479 /* HACK: use draw_alpha to clear Y component */
480 for (i
= 0; i
< vidix_play
.num_frames
; i
++) {
482 memset(vidix_mem
+ vidix_play
.offsets
[i
], 0x80,
483 vidix_play
.frame_size
);
484 draw_alpha(0, 0, image_width
, image_height
, tmp
, tmpa
, image_width
);
488 /* show one of the "clear" frames */
501 apitch
= vidix_play
.dest
.pitch
.y
-1;
502 dstrides
.y
= (image_width
+ apitch
) & ~apitch
;
503 apitch
= vidix_play
.dest
.pitch
.v
-1;
504 dstrides
.v
= (image_width
+ apitch
) & ~apitch
;
505 apitch
= vidix_play
.dest
.pitch
.u
-1;
506 dstrides
.u
= (image_width
+ apitch
) & ~apitch
;
511 apitch
= vidix_play
.dest
.pitch
.y
-1;
512 dstrides
.y
= (image_width
*4 + apitch
) & ~apitch
;
513 dstrides
.u
= dstrides
.v
= 0;
518 apitch
= vidix_play
.dest
.pitch
.y
-1;
519 dstrides
.y
= (image_width
*3 + apitch
) & ~apitch
;
520 dstrides
.u
= dstrides
.v
= 0;
524 apitch
= vidix_play
.dest
.pitch
.y
-1;
525 dstrides
.y
= (image_width
*2 + apitch
) & ~apitch
;
526 dstrides
.u
= dstrides
.v
= 0;
530 /* tune some info here */
531 sstride
= src_width
*image_Bpp
;
534 is_422_planes_eq
= sstride
== dstrides
.y
;
536 if(src_format
== IMGFMT_YV12
|| src_format
== IMGFMT_I420
|| src_format
== IMGFMT_IYUV
)
537 vo_server
->draw_slice
= vidix_draw_slice_420
;
538 else if (src_format
== IMGFMT_YVU9
|| src_format
== IMGFMT_IF09
)
539 vo_server
->draw_slice
= vidix_draw_slice_410
;
540 else if (src_format
== IMGFMT_NV12
)
541 vo_server
->draw_slice
= vidix_draw_slice_nv12
;
542 else vo_server
->draw_slice
= vidix_draw_slice_packed
;
547 static uint32_t vidix_get_image(mp_image_t
*mpi
)
549 if(mpi
->type
==MP_IMGTYPE_STATIC
&& vidix_play
.num_frames
>1) return VO_FALSE
;
550 if(mpi
->flags
&MP_IMGFLAG_READABLE
) return VO_FALSE
; /* slow video ram */
551 if(( (mpi
->stride
[0]==dstrides
.y
&& (!(mpi
->flags
&MP_IMGFLAG_PLANAR
) ||
552 (mpi
->stride
[1]==dstrides
.u
&& mpi
->stride
[2]==dstrides
.v
)) )
553 || (mpi
->flags
&(MP_IMGFLAG_ACCEPT_STRIDE
|MP_IMGFLAG_ACCEPT_WIDTH
))) &&
554 (!forced_fourcc
&& !(vidix_play
.flags
& VID_PLAY_INTERLEAVED_UV
)))
556 if(mpi
->flags
&MP_IMGFLAG_ACCEPT_WIDTH
){
557 // check if only width is enough to represent strides:
558 if(mpi
->flags
&MP_IMGFLAG_PLANAR
){
559 if((dstrides
.y
>>1)!=dstrides
.v
|| dstrides
.v
!=dstrides
.u
) return VO_FALSE
;
561 if(dstrides
.y
% (mpi
->bpp
/8)) return VO_FALSE
;
564 mpi
->planes
[0]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.y
;
565 mpi
->width
=mpi
->stride
[0]=dstrides
.y
;
566 if(mpi
->flags
&MP_IMGFLAG_PLANAR
)
568 mpi
->planes
[1]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.v
;
569 mpi
->stride
[1]=dstrides
.v
>> mpi
->chroma_x_shift
;
570 mpi
->planes
[2]=vidix_mem
+vidix_play
.offsets
[next_frame
]+vidix_play
.offset
.u
;
571 mpi
->stride
[2]=dstrides
.u
>> mpi
->chroma_x_shift
;
573 mpi
->width
/=mpi
->bpp
/8;
574 mpi
->flags
|=MP_IMGFLAG_DIRECT
;
580 uint32_t vidix_control(uint32_t request
, void *data
)
583 case VOCTRL_QUERY_FORMAT
:
584 return vidix_query_fourcc(*((uint32_t*)data
));
585 case VOCTRL_GET_IMAGE
:
586 return vidix_get_image(data
);
587 case VOCTRL_DRAW_IMAGE
:
588 return vidix_draw_image(data
);
589 case VOCTRL_GET_FRAME_NUM
:
590 *(uint32_t *)data
= next_frame
;
592 case VOCTRL_SET_FRAME_NUM
:
593 next_frame
= *(uint32_t *)data
;
595 case VOCTRL_GET_NUM_FRAMES
:
596 *(uint32_t *)data
= vidix_play
.num_frames
;
598 case VOCTRL_SET_EQUALIZER
:
600 vidix_video_eq_t info
;
602 if(!video_on
) return VO_FALSE
;
604 struct voctrl_set_equalizer_args
*args
= data
;
606 /* vidix eq ranges are -1000..1000 */
607 if (!strcasecmp(args
->name
, "brightness"))
609 info
.brightness
= args
->value
*10;
610 info
.cap
= VEQ_CAP_BRIGHTNESS
;
612 else if (!strcasecmp(args
->name
, "contrast"))
614 info
.contrast
= args
->value
*10;
615 info
.cap
= VEQ_CAP_CONTRAST
;
617 else if (!strcasecmp(args
->name
, "saturation"))
619 info
.saturation
= args
->value
*10;
620 info
.cap
= VEQ_CAP_SATURATION
;
622 else if (!strcasecmp(args
->name
, "hue"))
624 info
.hue
= args
->value
*10;
625 info
.cap
= VEQ_CAP_HUE
;
628 if (vdlPlaybackSetEq(vidix_handler
, &info
) == 0)
632 case VOCTRL_GET_EQUALIZER
:
634 vidix_video_eq_t info
;
636 if(!video_on
) return VO_FALSE
;
637 if (vdlPlaybackGetEq(vidix_handler
, &info
) != 0)
640 struct voctrl_get_equalizer_args
*args
= data
;
642 /* vidix eq ranges are -1000..1000 */
643 if (!strcasecmp(args
->name
, "brightness"))
645 if (info
.cap
& VEQ_CAP_BRIGHTNESS
)
646 *args
->valueptr
= info
.brightness
/10;
648 else if (!strcasecmp(args
->name
, "contrast"))
650 if (info
.cap
& VEQ_CAP_CONTRAST
)
651 *args
->valueptr
= info
.contrast
/10;
653 else if (!strcasecmp(args
->name
, "saturation"))
655 if (info
.cap
& VEQ_CAP_SATURATION
)
656 *args
->valueptr
= info
.saturation
/10;
658 else if (!strcasecmp(args
->name
, "hue"))
660 if (info
.cap
& VEQ_CAP_HUE
)
661 *args
->valueptr
= info
.hue
/10;
668 // WARNING: we drop extra parameters (...) here!
669 // return server_control(request,data); //VO_NOTIMPL;
672 int vidix_preinit(const char *drvname
, struct vo_old_functions
*server
)
675 if( mp_msg_test(MSGT_VO
,MSGL_DBG2
) ) {
676 mp_msg(MSGT_VO
,MSGL_DBG2
, "vosub_vidix: vidix_preinit(%s) was called\n",drvname
); }
678 vidix_handler
= vdlOpen(drvname
? drvname
[0] == ':' ? &drvname
[1] : drvname
[0] ? drvname
: NULL
: NULL
,
682 if(vidix_handler
== NULL
)
684 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Couldn't find working VIDIX driver.\n");
687 if((err
=vdlGetCapability(vidix_handler
,&vidix_cap
)) != 0)
689 mp_tmsg(MSGT_VO
,MSGL_ERR
, "[VO_SUB_VIDIX] Couldn't get capability: %s.\n",strerror(err
));
692 mp_msg(MSGT_VO
,MSGL_V
, "[VO_SUB_VIDIX] Description: %s.\n", vidix_cap
.name
);
693 mp_msg(MSGT_VO
,MSGL_V
, "[VO_SUB_VIDIX] Author: %s.\n", vidix_cap
.author
);
694 /* we are able to tune up this stuff depend on fourcc format */
695 server
->draw_slice
=vidix_draw_slice
;
696 server
->draw_frame
=vidix_draw_frame
;
697 server
->flip_page
=vidix_flip_page
;
698 server
->draw_osd
=vidix_draw_osd
;
699 // server_control = server->control;
700 // server->control=vidix_control;