[Mplayer-cvslog] CVS: main/libmpcodecs dec_video.c,1.142,1.143 vf.h,1.11,1.12 vf_vo.c,1.14,1.15
Arpi of Ize
arpi at mplayerhq.hu
Sun Jul 28 23:30:14 CEST 2002
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv2955
Modified Files:
dec_video.c vf.h vf_vo.c
Log Message:
... removed from vf's control(), sing struct for equalizer. based on patch by Jindrich Makovicka <makovick at kmlinux.fjfi.cvut.cz>
Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/dec_video.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -r1.142 -r1.143
--- dec_video.c 25 Jul 2002 21:55:13 -0000 1.142
+++ dec_video.c 28 Jul 2002 21:30:09 -0000 1.143
@@ -77,11 +77,15 @@
int set_video_colors(sh_video_t *sh_video,char *item,int value)
{
vf_instance_t* vf=sh_video->vfilter;
+ vf_equalizer_t data;
+
+ data.item = item;
+ data.value = value;
mp_dbg(MSGT_DECVIDEO,MSGL_V,"set video colors %s=%d \n", item, value);
if (vf)
{
- int ret = vf->control(vf, VFCTRL_SET_EQUALIZER, item, (int *)value);
+ int ret = vf->control(vf, VFCTRL_SET_EQUALIZER, &data);
if (ret == CONTROL_TRUE)
return(1);
}
@@ -96,13 +100,18 @@
int get_video_colors(sh_video_t *sh_video,char *item,int *value)
{
vf_instance_t* vf=sh_video->vfilter;
+ vf_equalizer_t data;
+
+ data.item = item;
mp_dbg(MSGT_DECVIDEO,MSGL_V,"get video colors %s \n", item);
if (vf)
{
- int ret = vf->control(vf, VFCTRL_GET_EQUALIZER, item, value);
- if (ret == CONTROL_TRUE)
+ int ret = vf->control(vf, VFCTRL_GET_EQUALIZER, &data);
+ if (ret == CONTROL_TRUE){
+ *value = data.value;
return(1);
+ }
}
/* try software control */
if(mpvdec) return mpvdec->control(sh_video,VDCTRL_GET_EQUALIZER, item, value);
Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- vf.h 24 Jul 2002 18:14:21 -0000 1.11
+++ vf.h 28 Jul 2002 21:30:09 -0000 1.12
@@ -24,7 +24,7 @@
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt);
int (*control)(struct vf_instance_s* vf,
- int request, void* data, ...);
+ int request, void* data);
int (*query_format)(struct vf_instance_s* vf,
unsigned int fmt);
void (*get_image)(struct vf_instance_s* vf,
@@ -45,6 +45,12 @@
// control codes:
#include "mpc_info.h"
+
+typedef struct vf_seteq_s
+{
+ char *item;
+ int value;
+} vf_equalizer_t;
#define VFCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */
#define VFCTRL_SET_PP_LEVEL 5 /* set postprocessing level */
Index: vf_vo.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_vo.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- vf_vo.c 25 Jul 2002 13:10:28 -0000 1.14
+++ vf_vo.c 28 Jul 2002 21:30:09 -0000 1.15
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdarg.h>
#include "../config.h"
#include "../mp_msg.h"
@@ -47,7 +46,7 @@
return 1;
}
-static int control(struct vf_instance_s* vf, int request, void* data, ...)
+static int control(struct vf_instance_s* vf, int request, void* data)
{
switch(request){
#ifdef USE_OSD
@@ -58,25 +57,15 @@
#endif
case VFCTRL_SET_EQUALIZER:
{
- va_list ap;
- int value;
-
+ vf_equalizer_t *eq=data;
if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
- return((video_out->control(VOCTRL_SET_EQUALIZER, data, (int *)value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE);
+ return((video_out->control(VOCTRL_SET_EQUALIZER, eq->item, eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE);
}
case VFCTRL_GET_EQUALIZER:
{
- va_list ap;
- int *value;
-
+ vf_equalizer_t *eq=data;
if(!vo_config_count) return CONTROL_FALSE; // vo not configured?
- va_start(ap, data);
- value = va_arg(ap, int);
- va_end(ap);
- return((video_out->control(VOCTRL_GET_EQUALIZER, data, value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE);
+ return((video_out->control(VOCTRL_GET_EQUALIZER, eq->item, &eq->value) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE);
}
}
// return video_out->control(request,data);
More information about the MPlayer-cvslog
mailing list