1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

Implement tv_get_color_options() and make tv_set_color_options() return

mainfull values.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18173 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2006-04-21 12:45:18 +00:00
parent c07b14a9b0
commit f865d5a17e
2 changed files with 27 additions and 9 deletions

View File

@ -679,22 +679,39 @@ int tv_set_color_options(tvi_handle_t *tvh, int opt, int value)
switch(opt)
{
case TV_COLOR_BRIGHTNESS:
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_BRIGHTNESS, &value);
break;
return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_BRIGHTNESS, &value);
case TV_COLOR_HUE:
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HUE, &value);
break;
return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_HUE, &value);
case TV_COLOR_SATURATION:
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_SATURATION, &value);
break;
return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_SATURATION, &value);
case TV_COLOR_CONTRAST:
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_CONTRAST, &value);
break;
return funcs->control(tvh->priv, TVI_CONTROL_VID_SET_CONTRAST, &value);
default:
mp_msg(MSGT_TV, MSGL_WARN, "Unknown color option (%d) specified!\n", opt);
}
return(1);
return(TVI_CONTROL_UNKNOWN);
}
int tv_get_color_options(tvi_handle_t *tvh, int opt, int* value)
{
tvi_functions_t *funcs = tvh->functions;
switch(opt)
{
case TV_COLOR_BRIGHTNESS:
return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_BRIGHTNESS, value);
case TV_COLOR_HUE:
return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HUE, value);
case TV_COLOR_SATURATION:
return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_SATURATION, value);
case TV_COLOR_CONTRAST:
return funcs->control(tvh->priv, TVI_CONTROL_VID_GET_CONTRAST, value);
default:
mp_msg(MSGT_TV, MSGL_WARN, "Unknown color option (%d) specified!\n", opt);
}
return(TVI_CONTROL_UNKNOWN);
}
int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq)

View File

@ -163,6 +163,7 @@ extern int tv_init(tvi_handle_t *tvh);
extern int tv_uninit(tvi_handle_t *tvh);
int tv_set_color_options(tvi_handle_t *tvh, int opt, int val);
int tv_get_color_options(tvi_handle_t *tvh, int opt, int* val);
#define TV_COLOR_BRIGHTNESS 1
#define TV_COLOR_HUE 2
#define TV_COLOR_SATURATION 3