[MPlayer-cvslog] r33388 - in trunk: libmpcodecs/vf_vo.c libvo/mga_template.c libvo/vo_aa.c libvo/vo_cvidix.c libvo/vo_dfbmga.c libvo/vo_directfb2.c libvo/vo_directx.c libvo/vo_dxr3.c libvo/vo_fbdev.c libvo/vo_gl.c ...
iive
subversion at mplayerhq.hu
Fri May 6 12:32:46 CEST 2011
Author: iive
Date: Fri May 6 12:32:46 2011
New Revision: 33388
Log:
Implement control() VOCTRL_SET/GET_EQUALIZER using a vf_equalize struct,
instead of employing vaarg. Do the same for vidix_control() too.
Simplifies a lot of code. Allows direct passing of the struct
from video filter system. Makes possible the complete removal
of vaarg from libvo.
Patch inspired by old work of uau.
Modified:
trunk/libmpcodecs/vf_vo.c
trunk/libvo/mga_template.c
trunk/libvo/vo_aa.c
trunk/libvo/vo_cvidix.c
trunk/libvo/vo_dfbmga.c
trunk/libvo/vo_directfb2.c
trunk/libvo/vo_directx.c
trunk/libvo/vo_dxr3.c
trunk/libvo/vo_fbdev.c
trunk/libvo/vo_gl.c
trunk/libvo/vo_gl2.c
trunk/libvo/vo_kva.c
trunk/libvo/vo_matrixview.c
trunk/libvo/vo_svga.c
trunk/libvo/vo_vdpau.c
trunk/libvo/vo_vesa.c
trunk/libvo/vo_winvidix.c
trunk/libvo/vo_x11.c
trunk/libvo/vo_xv.c
trunk/libvo/vo_xvidix.c
trunk/libvo/vo_xvmc.c
trunk/libvo/vosub_vidix.c
Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libmpcodecs/vf_vo.c Fri May 6 12:32:46 2011 (r33388)
@@ -105,15 +105,13 @@ static int control(struct vf_instance *v
}
case VFCTRL_SET_EQUALIZER:
{
- vf_equalizer_t *eq=data;
if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
- return (video_out->control(VOCTRL_SET_EQUALIZER, eq->item, eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
+ return (video_out->control(VOCTRL_SET_EQUALIZER, data) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
}
case VFCTRL_GET_EQUALIZER:
{
- vf_equalizer_t *eq=data;
if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
- return (video_out->control(VOCTRL_GET_EQUALIZER, eq->item, &eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
+ return (video_out->control(VOCTRL_GET_EQUALIZER, data) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
}
#ifdef CONFIG_ASS
case VFCTRL_INIT_EOSD:
Modified: trunk/libvo/mga_template.c
==============================================================================
--- trunk/libvo/mga_template.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/mga_template.c Fri May 6 12:32:46 2011 (r33388)
@@ -18,6 +18,7 @@
#include "fastmemcpy.h"
#include "cpudetect.h"
+#include "libmpcodecs/vf.h"
#include "libswscale/swscale.h"
#include "libavutil/imgutils.h"
#include "libmpcodecs/vf_scale.h"
@@ -246,11 +247,11 @@ static int control(uint32_t request, voi
return draw_image(data);
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
+ vf_equalizer_t *eq=data;
short value;
uint32_t luma,prev;
- if ( strcmp( data,"brightness" ) && strcmp( data,"contrast" ) ) return VO_FALSE;
+ if ( strcmp( eq->item,"brightness" ) && strcmp( eq->item,"contrast" ) ) return VO_FALSE;
if (ioctl(f,MGA_VID_GET_LUMA,&prev)) {
perror("Error in mga_vid_config ioctl()");
@@ -260,12 +261,8 @@ static int control(uint32_t request, voi
// printf("GET: 0x%4X 0x%4X \n",(prev>>16),(prev&0xffff));
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
-// printf("value: %d -> ",value);
- value=((value+100)*255)/200-128; // maps -100=>-128 and +100=>127
+// printf("value: %d -> ",eq->value);
+ value=((eq->value+100)*255)/200-128; // maps -100=>-128 and +100=>127
// printf("%d \n",value);
if(!strcmp(data,"contrast"))
@@ -284,12 +281,11 @@ static int control(uint32_t request, voi
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int * value;
+ vf_equalizer_t *eq=data;
short val;
uint32_t luma;
- if ( strcmp( data,"brightness" ) && strcmp( data,"contrast" ) ) return VO_FALSE;
+ if ( strcmp( eq->item,"brightness" ) && strcmp( eq->item,"contrast" ) ) return VO_FALSE;
if (ioctl(f,MGA_VID_GET_LUMA,&luma)) {
perror("Error in mga_vid_config ioctl()");
@@ -297,16 +293,12 @@ static int control(uint32_t request, voi
return VO_FALSE;
}
- if ( !strcmp( data,"contrast" ) )
+ if ( !strcmp( eq->item,"contrast" ) )
val=(luma & 0xFFFF);
else
val=(luma >> 16);
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- *value = (val*200)/255;
+ eq->value = (val*200)/255;
return VO_TRUE;
}
Modified: trunk/libvo/vo_aa.c
==============================================================================
--- trunk/libvo/vo_aa.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_aa.c Fri May 6 12:32:46 2011 (r33388)
@@ -36,6 +36,7 @@
#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "aspect.h"
#include "libswscale/swscale.h"
#include "libmpcodecs/vf_scale.h"
@@ -731,31 +732,21 @@ static int control(uint32_t request, voi
case VOCTRL_QUERY_FORMAT:
return query_format(*((uint32_t*)data));
case VOCTRL_SET_EQUALIZER: {
- va_list ap;
- int val;
-
- va_start(ap, data);
- val = va_arg(ap, int);
- va_end(ap);
+ vf_equalizer_t *eq=data;
- if(strcmp((char*)data,"contrast") == 0)
- p->contrast = ( val + 100 ) * 64 / 100;
- else if(strcmp((char*)data,"brightness") == 0)
- p->bright = ( val + 100) * 128 / 100;
+ if(strcmp(eq->item,"contrast") == 0)
+ p->contrast = ( eq->value + 100 ) * 64 / 100;
+ else if(strcmp(eq->item,"brightness") == 0)
+ p->bright = ( eq->value + 100) * 128 / 100;
return VO_TRUE;
}
case VOCTRL_GET_EQUALIZER: {
- va_list ap;
- int* val;
-
- va_start(ap, data);
- val = va_arg(ap, int*);
- va_end(ap);
+ vf_equalizer_t *eq=data;
- if(strcmp((char*)data,"contrast") == 0)
- *val = (p->contrast - 64) * 100 / 64;
- else if(strcmp((char*)data,"brightness") == 0)
- *val = (p->bright - 128) * 100 / 128;
+ if(strcmp(eq->item,"contrast") == 0)
+ eq->value = (p->contrast - 64) * 100 / 64;
+ else if(strcmp(eq->item,"brightness") == 0)
+ eq->value = (p->bright - 128) * 100 / 128;
return VO_TRUE;
}
Modified: trunk/libvo/vo_cvidix.c
==============================================================================
--- trunk/libvo/vo_cvidix.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_cvidix.c Fri May 6 12:32:46 2011 (r33388)
@@ -173,24 +173,6 @@ static int control(uint32_t request, voi
else vo_fs=1;
setup_vidix();
return VO_TRUE;
- case VOCTRL_SET_EQUALIZER:
- {
- va_list ap;
- int value;
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
- return vidix_control(request, data, value);
- }
- case VOCTRL_GET_EQUALIZER:
- {
- va_list ap;
- int *value;
- va_start(ap, data);
- value = va_arg(ap, int *);
- va_end(ap);
- return vidix_control(request, data, value);
- }
}
return vidix_control(request, data);
}
Modified: trunk/libvo/vo_dfbmga.c
==============================================================================
--- trunk/libvo/vo_dfbmga.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_dfbmga.c Fri May 6 12:32:46 2011 (r33388)
@@ -30,6 +30,7 @@
#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "fastmemcpy.h"
#include "sub/sub.h"
#include "mp_msg.h"
@@ -1426,25 +1427,13 @@ control( uint32_t request, void *data, .
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
- va_start( ap, data );
- value = va_arg( ap, int );
- va_end( ap );
-
- return set_equalizer( data, value );
+ vf_equalizer_t *eq=data;
+ return set_equalizer( eq->item, eq->value );
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
- va_start( ap, data );
- value = va_arg( ap, int* );
- va_end( ap );
-
- return get_equalizer( data, value );
+ vf_equalizer_t *eq=data;
+ return get_equalizer( eq->item, &eq->value );
}
}
Modified: trunk/libvo/vo_directfb2.c
==============================================================================
--- trunk/libvo/vo_directfb2.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_directfb2.c Fri May 6 12:32:46 2011 (r33388)
@@ -32,6 +32,7 @@
#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "fastmemcpy.h"
#include "sub/sub.h"
#include "mp_msg.h"
@@ -1382,25 +1383,13 @@ static int control(uint32_t request, voi
return put_image(data);
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
- return directfb_set_video_eq(data, value);
+ vf_equalizer_t *eq=data;
+ return directfb_set_video_eq(eq->item, eq->value);
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- return directfb_get_video_eq(data, value);
+ vf_equalizer_t *eq=data;
+ return directfb_get_video_eq(eq->item, &eq->value);
}
};
return VO_NOTIMPL;
Modified: trunk/libvo/vo_directx.c
==============================================================================
--- trunk/libvo/vo_directx.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_directx.c Fri May 6 12:32:46 2011 (r33388)
@@ -29,6 +29,7 @@
#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "fastmemcpy.h"
#include "input/input.h"
#include "libmpcodecs/vd.h"
@@ -1566,22 +1567,12 @@ static int control(uint32_t request, voi
return VO_TRUE;
}
case VOCTRL_SET_EQUALIZER: {
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
- return color_ctrl_set(data, value);
+ vf_equalizer_t *eq=data;
+ return color_ctrl_set(eq->item, eq->value);
}
case VOCTRL_GET_EQUALIZER: {
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
- return color_ctrl_get(data, value);
+ vf_equalizer_t *eq=data;
+ return color_ctrl_get(eq->item, &eq->value);
}
case VOCTRL_UPDATE_SCREENINFO:
if (vidmode) {
Modified: trunk/libvo/vo_dxr3.c
==============================================================================
--- trunk/libvo/vo_dxr3.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_dxr3.c Fri May 6 12:32:46 2011 (r33388)
@@ -41,6 +41,7 @@
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "aspect.h"
#include "sub/spuenc.h"
#include "sub/sub.h"
@@ -252,22 +253,17 @@ static int control(uint32_t request, voi
}
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
+ vf_equalizer_t *eq=data;
em8300_bcs_t bcs;
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0)
return VO_FALSE;
- if (!strcasecmp(data, "brightness"))
- bcs.brightness = (value+100)*5;
- else if (!strcasecmp(data, "contrast"))
- bcs.contrast = (value+100)*5;
- else if (!strcasecmp(data, "saturation"))
- bcs.saturation = (value+100)*5;
+ if (!strcasecmp(eq->item, "brightness"))
+ bcs.brightness = (eq->value+100)*5;
+ else if (!strcasecmp(eq->item, "contrast"))
+ bcs.contrast = (eq->value+100)*5;
+ else if (!strcasecmp(eq->item, "saturation"))
+ bcs.saturation = (eq->value+100)*5;
else return VO_FALSE;
if (ioctl(fd_control, EM8300_IOCTL_SETBCS, &bcs) < 0)
@@ -276,23 +272,18 @@ static int control(uint32_t request, voi
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
+ vf_equalizer_t *eq=data;
em8300_bcs_t bcs;
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0)
return VO_FALSE;
- if (!strcasecmp(data, "brightness"))
- *value = (bcs.brightness/5)-100;
- else if (!strcasecmp(data, "contrast"))
- *value = (bcs.contrast/5)-100;
- else if (!strcasecmp(data, "saturation"))
- *value = (bcs.saturation/5)-100;
+ if (!strcasecmp(eq->item, "brightness"))
+ eq->value = (bcs.brightness/5)-100;
+ else if (!strcasecmp(eq->item, "contrast"))
+ eq->value = (bcs.contrast/5)-100;
+ else if (!strcasecmp(eq->item, "saturation"))
+ eq->value = (bcs.saturation/5)-100;
else return VO_FALSE;
return VO_TRUE;
Modified: trunk/libvo/vo_fbdev.c
==============================================================================
--- trunk/libvo/vo_fbdev.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_fbdev.c Fri May 6 12:32:46 2011 (r33388)
@@ -1163,27 +1163,8 @@ static int control(uint32_t request, voi
if (vidix_name) {
switch (request) {
case VOCTRL_SET_EQUALIZER:
- {
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
case VOCTRL_GET_EQUALIZER:
- {
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
+ return vidix_control(request, data);
}
}
#endif
Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_gl.c Fri May 6 12:32:46 2011 (r33388)
@@ -32,6 +32,7 @@
#include "subopt-helper.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "sub/font_load.h"
#include "sub/sub.h"
@@ -1361,34 +1362,26 @@ static int control(uint32_t request, voi
case VOCTRL_GET_EQUALIZER:
if (is_yuv) {
int i;
- va_list va;
- int *value;
- va_start(va, data);
- value = va_arg(va, int *);
- va_end(va);
+ vf_equalizer_t *eq=data;
for (i = 0; eq_map[i].name; i++)
- if (strcmp(data, eq_map[i].name) == 0) break;
+ if (strcmp(eq->item, eq_map[i].name) == 0) break;
if (!(eq_map[i].supportmask & (1 << use_yuv)))
break;
- *value = *eq_map[i].value;
+ eq->value = *eq_map[i].value;
return VO_TRUE;
}
break;
case VOCTRL_SET_EQUALIZER:
if (is_yuv) {
int i;
- va_list va;
- int value;
- va_start(va, data);
- value = va_arg(va, int);
- va_end(va);
+ vf_equalizer_t *eq=data;
for (i = 0; eq_map[i].name; i++)
- if (strcmp(data, eq_map[i].name) == 0) break;
+ if (strcmp(eq->item, eq_map[i].name) == 0) break;
if (!(eq_map[i].supportmask & (1 << use_yuv)))
break;
- *eq_map[i].value = value;
+ *eq_map[i].value = eq->value;
if (strcmp(data, "gamma") == 0)
- eq_rgamma = eq_ggamma = eq_bgamma = value;
+ eq_rgamma = eq_ggamma = eq_bgamma = eq->value;
update_yuvconv();
return VO_TRUE;
}
Modified: trunk/libvo/vo_gl2.c
==============================================================================
--- trunk/libvo/vo_gl2.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_gl2.c Fri May 6 12:32:46 2011 (r33388)
@@ -29,6 +29,7 @@
#include "subopt-helper.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "sub/sub.h"
#include "gl_common.h"
@@ -915,23 +916,13 @@ static int control(uint32_t request, voi
#ifdef CONFIG_GL_X11
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
- return vo_x11_set_equalizer(data, value);
+ vf_equalizer_t *eq=data;
+ return vo_x11_set_equalizer(eq->item, eq->value);
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int *);
- va_end(ap);
- return vo_x11_get_equalizer(data, value);
+ vf_equalizer_t *eq=data;
+ return vo_x11_get_equalizer(eq->item, &eq->value);
}
#endif
case VOCTRL_UPDATE_SCREENINFO:
Modified: trunk/libvo/vo_kva.c
==============================================================================
--- trunk/libvo/vo_kva.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_kva.c Fri May 6 12:32:46 2011 (r33388)
@@ -40,6 +40,7 @@
#include "help_mp.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "aspect.h"
#include "fastmemcpy.h"
@@ -965,26 +966,14 @@ static int control(uint32_t request, voi
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
- return color_ctrl_set(data, value);
+ vf_equalizer_t *eq=data;
+ return color_ctrl_set(eq->item, eq->value);
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int *);
- va_end(ap);
-
- return color_ctrl_get(data, value);
+ vf_equalizer_t *eq=data;
+ return color_ctrl_get(eq->item, &eq->value);
}
case VOCTRL_UPDATE_SCREENINFO:
Modified: trunk/libvo/vo_matrixview.c
==============================================================================
--- trunk/libvo/vo_matrixview.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_matrixview.c Fri May 6 12:32:46 2011 (r33388)
@@ -30,6 +30,7 @@
#include "subopt-helper.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "gl_common.h"
#include "libswscale/swscale.h"
#include "libmpcodecs/vf_scale.h"
@@ -296,29 +297,22 @@ static int control(uint32_t request, voi
return VO_TRUE;
case VOCTRL_GET_EQUALIZER:
{
- va_list va;
- int *value;
- va_start(va, data);
- value = va_arg(va, int *);
- va_end(va);
- if (strcasecmp(data, "contrast") == 0) {
- *value = eq_contrast;
- } else if (strcasecmp(data, "brightness") == 0) {
- *value = eq_brightness;
+ vf_equalizer_t *eq=data;
+
+ if (strcasecmp(eq->item, "contrast") == 0) {
+ eq->value = eq_contrast;
+ } else if (strcasecmp(eq->item, "brightness") == 0) {
+ eq->value = eq_brightness;
}
}
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
{
- va_list va;
- int value;
- va_start(va, data);
- value = va_arg(va, int);
- va_end(va);
- if (strcasecmp(data, "contrast") == 0) {
- contrast_set(value);
- } else if (strcasecmp(data, "brightness") == 0) {
- brightness_set(value);
+ vf_equalizer_t *eq=data;
+ if (strcasecmp(eq->item, "contrast") == 0) {
+ contrast_set(eq->value);
+ } else if (strcasecmp(eq->item, "brightness") == 0) {
+ brightness_set(eq->value);
}
}
return VO_TRUE;
Modified: trunk/libvo/vo_svga.c
==============================================================================
--- trunk/libvo/vo_svga.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_svga.c Fri May 6 12:32:46 2011 (r33388)
@@ -366,30 +366,6 @@ static int control(uint32_t request, voi
#ifdef CONFIG_VIDIX
if (vidix_name[0]) {
- switch (request) {
- case VOCTRL_SET_EQUALIZER:
- {
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
- case VOCTRL_GET_EQUALIZER:
- {
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
- }
return vidix_control(request, data);
}
#endif
Modified: trunk/libvo/vo_vdpau.c
==============================================================================
--- trunk/libvo/vo_vdpau.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_vdpau.c Fri May 6 12:32:46 2011 (r33388)
@@ -39,6 +39,7 @@
#include "mp_msg.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "x11_common.h"
#include "aspect.h"
#include "sub/font_load.h"
@@ -1367,26 +1368,15 @@ static int control(uint32_t request, voi
resize();
return VO_TRUE;
case VOCTRL_SET_EQUALIZER: {
- va_list ap;
- int value;
+ vf_equalizer_t *eq=data;
if (image_format == IMGFMT_BGRA)
return VO_NOTIMPL;
- va_start(ap, data);
- value = va_arg(ap, int);
-
- va_end(ap);
- return set_equalizer(data, value);
+ return set_equalizer(eq->item, eq->value);
}
case VOCTRL_GET_EQUALIZER: {
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int *);
-
- va_end(ap);
- return get_equalizer(data, value);
+ vf_equalizer_t *eq=data;
+ return get_equalizer(eq->item, &eq->value);
}
case VOCTRL_ONTOP:
vo_x11_ontop();
Modified: trunk/libvo/vo_vesa.c
==============================================================================
--- trunk/libvo/vo_vesa.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_vesa.c Fri May 6 12:32:46 2011 (r33388)
@@ -1092,30 +1092,6 @@ static int control(uint32_t request, voi
#ifdef CONFIG_VIDIX
if (vidix_name) {
- switch (request) {
- case VOCTRL_SET_EQUALIZER:
- {
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
- return vidix_control(request, data, (int *)value);
- }
- case VOCTRL_GET_EQUALIZER:
- {
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
- }
return vidix_control(request, data);
}
#endif
Modified: trunk/libvo/vo_winvidix.c
==============================================================================
--- trunk/libvo/vo_winvidix.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_winvidix.c Fri May 6 12:32:46 2011 (r33388)
@@ -338,28 +338,6 @@ static int control(uint32_t request, voi
break;
case VOCTRL_QUERY_FORMAT:
return query_format(*((uint32_t*)data));
- case VOCTRL_SET_EQUALIZER:
- {
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
- return vidix_control(request, data, (int *)value);
- }
- case VOCTRL_GET_EQUALIZER:
- {
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
}
return vidix_control(request, data);
// return VO_NOTIMPL;
Modified: trunk/libvo/vo_x11.c
==============================================================================
--- trunk/libvo/vo_x11.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_x11.c Fri May 6 12:32:46 2011 (r33388)
@@ -23,6 +23,7 @@
#include "config.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include "aspect.h"
@@ -674,25 +675,13 @@ static int control(uint32_t request, voi
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
-
- va_end(ap);
- return vo_x11_set_equalizer(data, value);
+ vf_equalizer_t *eq=data;
+ return vo_x11_set_equalizer(eq->item, &(eq->value));
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int *);
-
- va_end(ap);
- return vo_x11_get_equalizer(data, value);
+ vf_equalizer_t *eq=data;
+ return vo_x11_get_equalizer(eq->item, &eq->value);
}
case VOCTRL_ONTOP:
vo_x11_ontop();
Modified: trunk/libvo/vo_xv.c
==============================================================================
--- trunk/libvo/vo_xv.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_xv.c Fri May 6 12:32:46 2011 (r33388)
@@ -43,6 +43,7 @@ Buffer allocation:
#include "help_mp.h"
#include "video_out.h"
#include "video_out_internal.h"
+#include "libmpcodecs/vf.h"
#include <X11/Xlib.h>
@@ -757,27 +758,13 @@ static int control(uint32_t request, voi
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
-
- va_end(ap);
-
- return vo_xv_set_eq(xv_port, data, value);
+ vf_equalizer_t *eq=data;
+ return vo_xv_set_eq(xv_port, eq->item, eq->value);
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int *);
-
- va_end(ap);
-
- return vo_xv_get_eq(xv_port, data, value);
+ vf_equalizer_t *eq=data;
+ return vo_xv_get_eq(xv_port, eq->item, &eq->value);
}
case VOCTRL_ONTOP:
vo_x11_ontop();
Modified: trunk/libvo/vo_xvidix.c
==============================================================================
--- trunk/libvo/vo_xvidix.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_xvidix.c Fri May 6 12:32:46 2011 (r33388)
@@ -413,30 +413,6 @@ static int control(uint32_t request, voi
set_window(0);
}
return VO_TRUE;
- case VOCTRL_SET_EQUALIZER:
- {
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
-
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
- case VOCTRL_GET_EQUALIZER:
- {
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int *);
-
- va_end(ap);
-
- return vidix_control(request, data, value);
- }
case VOCTRL_UPDATE_SCREENINFO:
aspect_save_screenres(vo_screenwidth, vo_screenheight);
return VO_TRUE;
Modified: trunk/libvo/vo_xvmc.c
==============================================================================
--- trunk/libvo/vo_xvmc.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vo_xvmc.c Fri May 6 12:32:46 2011 (r33388)
@@ -26,6 +26,7 @@
#include "video_out.h"
#include "video_out_internal.h"
#include "osdep/timer.h"
+#include "libmpcodecs/vf.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -1332,26 +1333,14 @@ static int control(uint32_t request, voi
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-
- return vo_xv_set_eq(xv_port, data, value);
+ vf_equalizer_t *eq=data;
+ return vo_xv_set_eq(xv_port, eq->item, eq->value);
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
- return vo_xv_get_eq(xv_port, data, value);
+ vf_equalizer_t *eq=data;
+ return vo_xv_get_eq(xv_port, eq->item, &eq->value);
}
case VOCTRL_UPDATE_SCREENINFO:
update_xinerama_info();
Modified: trunk/libvo/vosub_vidix.c
==============================================================================
--- trunk/libvo/vosub_vidix.c Fri May 6 12:12:54 2011 (r33387)
+++ trunk/libvo/vosub_vidix.c Fri May 6 12:32:46 2011 (r33388)
@@ -45,6 +45,7 @@
#include "sub/sub.h"
#include "vosub_vidix.h"
+#include "libmpcodecs/vf.h"
#include "libmpcodecs/vfcap.h"
#include "libmpcodecs/mp_image.h"
@@ -596,36 +597,32 @@ uint32_t vidix_control(uint32_t request,
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
+ vf_equalizer_t *eq=data;
vidix_video_eq_t info;
if(!video_on) return VO_FALSE;
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
-// printf("vidix seteq %s -> %d \n",data,value);
+// printf("vidix seteq %s -> %d \n",eq->item,eq->value);
/* vidix eq ranges are -1000..1000 */
- if (!strcasecmp(data, "brightness"))
+ if (!strcasecmp(eq->item, "brightness"))
{
- info.brightness = value*10;
+ info.brightness = eq->value*10;
info.cap = VEQ_CAP_BRIGHTNESS;
}
- else if (!strcasecmp(data, "contrast"))
+ else if (!strcasecmp(eq->item, "contrast"))
{
- info.contrast = value*10;
+ info.contrast = eq->value*10;
info.cap = VEQ_CAP_CONTRAST;
}
- else if (!strcasecmp(data, "saturation"))
+ else if (!strcasecmp(eq->item, "saturation"))
{
- info.saturation = value*10;
+ info.saturation = eq->value*10;
info.cap = VEQ_CAP_SATURATION;
}
- else if (!strcasecmp(data, "hue"))
+ else if (!strcasecmp(eq->item, "hue"))
{
- info.hue = value*10;
+ info.hue = eq->value*10;
info.cap = VEQ_CAP_HUE;
}
@@ -635,38 +632,33 @@ uint32_t vidix_control(uint32_t request,
}
case VOCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
+ vf_equalizer_t *eq=data;
vidix_video_eq_t info;
if(!video_on) return VO_FALSE;
if (vdlPlaybackGetEq(vidix_handler, &info) != 0)
return VO_FALSE;
- va_start(ap, data);
- value = va_arg(ap, int*);
- va_end(ap);
-
/* vidix eq ranges are -1000..1000 */
- if (!strcasecmp(data, "brightness"))
+ if (!strcasecmp(eq->item, "brightness"))
{
if (info.cap & VEQ_CAP_BRIGHTNESS)
- *value = info.brightness/10;
+ eq->value = info.brightness/10;
}
- else if (!strcasecmp(data, "contrast"))
+ else if (!strcasecmp(eq->item, "contrast"))
{
if (info.cap & VEQ_CAP_CONTRAST)
- *value = info.contrast/10;
+ eq->value = info.contrast/10;
}
- else if (!strcasecmp(data, "saturation"))
+ else if (!strcasecmp(eq->item, "saturation"))
{
if (info.cap & VEQ_CAP_SATURATION)
- *value = info.saturation/10;
+ eq->value = info.saturation/10;
}
- else if (!strcasecmp(data, "hue"))
+ else if (!strcasecmp(eq->item, "hue"))
{
if (info.cap & VEQ_CAP_HUE)
- *value = info.hue/10;
+ eq->value = info.hue/10;
}
return VO_TRUE;
More information about the MPlayer-cvslog
mailing list