mirror of https://github.com/mpv-player/mpv
Settled to CONF_TYPE_IMGFMT which simplified lot of things. Now there's no need to add new img formats to the source, instead you can try it out by providing it in hexa format, and if it isn't supported by the card, you get a nice error message. That's all.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10599 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9cc5a0f4ab
commit
5975cc9bbf
|
@ -302,7 +302,7 @@ m_option_t tvopts_conf[]={
|
|||
{"width", &tv_param_width, CONF_TYPE_INT, 0, 0, 4096, NULL},
|
||||
{"height", &tv_param_height, CONF_TYPE_INT, 0, 0, 4096, NULL},
|
||||
{"input", &tv_param_input, CONF_TYPE_INT, 0, 0, 20, NULL},
|
||||
{"outfmt", &tv_param_outfmt, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
{"outfmt", &tv_param_outfmt, CONF_TYPE_IMGFMT, 0, 0, 0, NULL},
|
||||
{"fps", &tv_param_fps, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL},
|
||||
{"channels", &tv_param_channels, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
|
||||
{"brightness", &tv_param_brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL},
|
||||
|
|
|
@ -54,7 +54,7 @@ char *tv_param_driver = "dummy";
|
|||
int tv_param_width = -1;
|
||||
int tv_param_height = -1;
|
||||
int tv_param_input = 0; /* used in v4l and bttv */
|
||||
char *tv_param_outfmt = "yv12";
|
||||
int tv_param_outfmt = IMGFMT_YV12;
|
||||
float tv_param_fps = -1.0;
|
||||
char **tv_param_channels = NULL;
|
||||
#if defined(HAVE_TV_V4L) || defined(HAVE_TV_V4L2)
|
||||
|
@ -147,7 +147,6 @@ static int open_tv(tvi_handle_t *tvh)
|
|||
{
|
||||
int i;
|
||||
tvi_functions_t *funcs = tvh->functions;
|
||||
int picture_format = 0;
|
||||
|
||||
if (funcs->control(tvh->priv, TVI_CONTROL_IS_VIDEO, 0) != TVI_CONTROL_TRUE)
|
||||
{
|
||||
|
@ -155,29 +154,26 @@ static int open_tv(tvi_handle_t *tvh)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!strcasecmp(tv_param_outfmt, "yv12"))
|
||||
picture_format = IMGFMT_YV12;
|
||||
else if (!strcasecmp(tv_param_outfmt, "i420"))
|
||||
picture_format = IMGFMT_I420;
|
||||
else if (!strcasecmp(tv_param_outfmt, "uyvy"))
|
||||
picture_format = IMGFMT_UYVY;
|
||||
else if (!strcasecmp(tv_param_outfmt, "yuy2"))
|
||||
picture_format = IMGFMT_YUY2;
|
||||
else if (!strcasecmp(tv_param_outfmt, "rgb32"))
|
||||
picture_format = IMGFMT_RGB32;
|
||||
else if (!strcasecmp(tv_param_outfmt, "rgb24"))
|
||||
picture_format = IMGFMT_RGB24;
|
||||
else if (!strcasecmp(tv_param_outfmt, "rgb16"))
|
||||
picture_format = IMGFMT_RGB16;
|
||||
else if (!strcasecmp(tv_param_outfmt, "rgb15"))
|
||||
picture_format = IMGFMT_RGB15;
|
||||
else
|
||||
switch(tv_param_outfmt)
|
||||
{
|
||||
mp_msg(MSGT_TV, MSGL_ERR, "Unknown format given: %s\n", tv_param_outfmt);
|
||||
mp_msg(MSGT_TV, MSGL_V, "Using default: Planar YV12\n");
|
||||
picture_format = IMGFMT_YV12;
|
||||
case IMGFMT_YV12:
|
||||
case IMGFMT_I420:
|
||||
case IMGFMT_UYVY:
|
||||
case IMGFMT_YUY2:
|
||||
case IMGFMT_RGB32:
|
||||
case IMGFMT_RGB24:
|
||||
case IMGFMT_RGB16:
|
||||
case IMGFMT_RGB15:
|
||||
break;
|
||||
default:
|
||||
mp_msg(MSGT_TV, MSGL_ERR, "=================================================================\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " WARNING: UNTESTED OR UNKNOWN OUTPUT IMAGE FORMAT REQUIRED (0x%x)\n", tv_param_outfmt);
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " This may cause buggy playback or program crash! Bugreports will\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " be ignored! You should try again with YV12 (which is the default\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, " colorspace) and read the documentation!\n");
|
||||
mp_msg(MSGT_TV, MSGL_ERR, "=================================================================\n");
|
||||
}
|
||||
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &picture_format);
|
||||
funcs->control(tvh->priv, TVI_CONTROL_VID_SET_FORMAT, &tv_param_outfmt);
|
||||
|
||||
/* set some params got from cmdline */
|
||||
funcs->control(tvh->priv, TVI_CONTROL_SPC_SET_INPUT, &tv_param_input);
|
||||
|
|
|
@ -21,7 +21,7 @@ extern char *tv_param_driver;
|
|||
extern int tv_param_width;
|
||||
extern int tv_param_height;
|
||||
extern int tv_param_input;
|
||||
extern char *tv_param_outfmt;
|
||||
extern int tv_param_outfmt;
|
||||
extern float tv_param_fps;
|
||||
extern char **tv_param_channels;
|
||||
extern int tv_param_noaudio;
|
||||
|
|
Loading…
Reference in New Issue