support for exotic norms

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8478 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
henry 2002-12-16 17:05:49 +00:00
parent ccf116f7ab
commit 0c71a7f53c
3 changed files with 43 additions and 5 deletions

View File

@ -159,6 +159,18 @@ static int open_tv(tvi_handle_t *tvh)
tvh->norm = TV_NORM_NTSC;
else if (!strcasecmp(tv_param_norm, "secam"))
tvh->norm = TV_NORM_SECAM;
else if (!strcasecmp(tv_param_norm, "palnc"))
tvh->norm = TV_NORM_PALNC;
else if (!strcasecmp(tv_param_norm, "palm"))
tvh->norm = TV_NORM_PALM;
else if (!strcasecmp(tv_param_norm, "paln"))
tvh->norm = TV_NORM_PALN;
else if (!strcasecmp(tv_param_norm, "ntscjp"))
tvh->norm = TV_NORM_NTSCJP;
else {
mp_msg(MSGT_TV, MSGL_V, "Bogus norm parameter, setting PAL.\n");
tvh->norm = TV_NORM_PAL;
}
mp_msg(MSGT_TV, MSGL_V, "Selected norm: %s\n", tv_param_norm);
funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm);

View File

@ -154,6 +154,10 @@ int tv_step_chanlist(tvi_handle_t *tvh);
#define TV_NORM_PAL 1
#define TV_NORM_NTSC 2
#define TV_NORM_SECAM 3
#define TV_NORM_PALNC 4
#define TV_NORM_PALM 5
#define TV_NORM_PALN 6
#define TV_NORM_NTSCJP 7
#endif /* USE_TV */

View File

@ -980,15 +980,21 @@ static int control(priv_t *priv, int cmd, void *arg)
{
int req_mode = (int)*(void **)arg;
if ((req_mode != TV_NORM_PAL) && (req_mode != TV_NORM_NTSC) && (req_mode != TV_NORM_SECAM)) {
if ((req_mode != TV_NORM_PAL) && (req_mode != TV_NORM_NTSC) && (req_mode != TV_NORM_SECAM)
&& (req_mode != TV_NORM_PALNC) && (req_mode != TV_NORM_PALM) && (req_mode != TV_NORM_PALN)
&& (req_mode != TV_NORM_NTSCJP)) {
mp_msg(MSGT_TV, MSGL_ERR, "Unknown norm!\n");
return(TVI_CONTROL_FALSE);
}
if (priv->channels[priv->act_channel].flags & VIDEO_VC_TUNER) {
control(priv, TVI_CONTROL_TUN_GET_TUNER, 0);
if (((req_mode == TV_NORM_PAL) && !(priv->tuner.flags & VIDEO_TUNER_PAL)) ||
((req_mode == TV_NORM_NTSC) && !(priv->tuner.flags & VIDEO_TUNER_NTSC)) ||
if (((req_mode == TV_NORM_PAL
|| req_mode == TV_NORM_PALNC
|| req_mode == TV_NORM_PALN) && !(priv->tuner.flags & VIDEO_TUNER_PAL)) ||
((req_mode == TV_NORM_NTSC
|| req_mode == TV_NORM_NTSCJP
|| req_mode == TV_NORM_PALM) && !(priv->tuner.flags & VIDEO_TUNER_NTSC)) ||
((req_mode == TV_NORM_SECAM) && !(priv->tuner.flags & VIDEO_TUNER_SECAM)))
{
mp_msg(MSGT_TV, MSGL_ERR, "Tuner isn't capable to set norm!\n");
@ -997,9 +1003,13 @@ static int control(priv_t *priv, int cmd, void *arg)
switch(req_mode) {
case TV_NORM_PAL:
case TV_NORM_PALNC:
case TV_NORM_PALN:
priv->tuner.mode = VIDEO_MODE_PAL;
break;
case TV_NORM_NTSC:
case TV_NORM_NTSCJP:
case TV_NORM_PALM:
priv->tuner.mode = VIDEO_MODE_NTSC;
break;
case TV_NORM_SECAM:
@ -1023,6 +1033,18 @@ static int control(priv_t *priv, int cmd, void *arg)
case TV_NORM_SECAM:
priv->channels[priv->act_channel].norm = VIDEO_MODE_SECAM;
break;
case TV_NORM_PALNC:
priv->channels[priv->act_channel].norm = 3;
break;
case TV_NORM_PALM:
priv->channels[priv->act_channel].norm = 4;
break;
case TV_NORM_PALN:
priv->channels[priv->act_channel].norm = 5;
break;
case TV_NORM_NTSCJP:
priv->channels[priv->act_channel].norm = 6;
break;
}
if (ioctl(priv->video_fd, VIDIOCSCHAN, &priv->channels[priv->act_channel]) == -1)
{
@ -1035,11 +1057,11 @@ static int control(priv_t *priv, int cmd, void *arg)
return(TVI_CONTROL_FALSE);
}
if(req_mode == TV_NORM_PAL || req_mode == TV_NORM_SECAM) {
if(req_mode == TV_NORM_PAL || req_mode == TV_NORM_SECAM || req_mode == TV_NORM_PALN || req_mode == TV_NORM_PALNC) {
priv->fps = PAL_FPS;
}
if(req_mode == TV_NORM_NTSC) {
if(req_mode == TV_NORM_NTSC || req_mode == TV_NORM_NTSCJP || req_mode == TV_NORM_PALM) {
priv->fps = NTSC_FPS;
}