[media] saa7164: replace current_norm by g_std
current_norm is deprecated. Replace it by g_std. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
804be2d493
commit
8d2d41e92d
3 changed files with 25 additions and 2 deletions
|
@ -228,6 +228,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
port->encodernorm = saa7164_tvnorms[i];
|
port->encodernorm = saa7164_tvnorms[i];
|
||||||
|
port->std = id;
|
||||||
|
|
||||||
/* Update the audio decoder while is not running in
|
/* Update the audio decoder while is not running in
|
||||||
* auto detect mode.
|
* auto detect mode.
|
||||||
|
@ -239,6 +240,15 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
|
||||||
|
{
|
||||||
|
struct saa7164_encoder_fh *fh = file->private_data;
|
||||||
|
struct saa7164_port *port = fh->port;
|
||||||
|
|
||||||
|
*id = port->std;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int vidioc_enum_input(struct file *file, void *priv,
|
static int vidioc_enum_input(struct file *file, void *priv,
|
||||||
struct v4l2_input *i)
|
struct v4l2_input *i)
|
||||||
{
|
{
|
||||||
|
@ -1290,6 +1300,7 @@ static const struct v4l2_file_operations mpeg_fops = {
|
||||||
|
|
||||||
static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
|
static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
|
||||||
.vidioc_s_std = vidioc_s_std,
|
.vidioc_s_std = vidioc_s_std,
|
||||||
|
.vidioc_g_std = vidioc_g_std,
|
||||||
.vidioc_enum_input = vidioc_enum_input,
|
.vidioc_enum_input = vidioc_enum_input,
|
||||||
.vidioc_g_input = vidioc_g_input,
|
.vidioc_g_input = vidioc_g_input,
|
||||||
.vidioc_s_input = vidioc_s_input,
|
.vidioc_s_input = vidioc_s_input,
|
||||||
|
@ -1316,7 +1327,6 @@ static struct video_device saa7164_mpeg_template = {
|
||||||
.ioctl_ops = &mpeg_ioctl_ops,
|
.ioctl_ops = &mpeg_ioctl_ops,
|
||||||
.minor = -1,
|
.minor = -1,
|
||||||
.tvnorms = SAA7164_NORMS,
|
.tvnorms = SAA7164_NORMS,
|
||||||
.current_norm = V4L2_STD_NTSC_M,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct video_device *saa7164_encoder_alloc(
|
static struct video_device *saa7164_encoder_alloc(
|
||||||
|
@ -1383,6 +1393,7 @@ int saa7164_encoder_register(struct saa7164_port *port)
|
||||||
port->encoder_params.ctl_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3;
|
port->encoder_params.ctl_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3;
|
||||||
port->encoder_params.refdist = 1;
|
port->encoder_params.refdist = 1;
|
||||||
port->encoder_params.gop_size = SAA7164_ENCODER_DEFAULT_GOP_SIZE;
|
port->encoder_params.gop_size = SAA7164_ENCODER_DEFAULT_GOP_SIZE;
|
||||||
|
port->std = V4L2_STD_NTSC_M;
|
||||||
|
|
||||||
if (port->encodernorm.id & V4L2_STD_525_60)
|
if (port->encodernorm.id & V4L2_STD_525_60)
|
||||||
port->height = 480;
|
port->height = 480;
|
||||||
|
|
|
@ -200,6 +200,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
port->encodernorm = saa7164_tvnorms[i];
|
port->encodernorm = saa7164_tvnorms[i];
|
||||||
|
port->std = id;
|
||||||
|
|
||||||
/* Update the audio decoder while is not running in
|
/* Update the audio decoder while is not running in
|
||||||
* auto detect mode.
|
* auto detect mode.
|
||||||
|
@ -211,6 +212,15 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
|
||||||
|
{
|
||||||
|
struct saa7164_encoder_fh *fh = file->private_data;
|
||||||
|
struct saa7164_port *port = fh->port;
|
||||||
|
|
||||||
|
*id = port->std;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int vidioc_enum_input(struct file *file, void *priv,
|
static int vidioc_enum_input(struct file *file, void *priv,
|
||||||
struct v4l2_input *i)
|
struct v4l2_input *i)
|
||||||
{
|
{
|
||||||
|
@ -1236,6 +1246,7 @@ static const struct v4l2_file_operations vbi_fops = {
|
||||||
|
|
||||||
static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
|
static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
|
||||||
.vidioc_s_std = vidioc_s_std,
|
.vidioc_s_std = vidioc_s_std,
|
||||||
|
.vidioc_g_std = vidioc_g_std,
|
||||||
.vidioc_enum_input = vidioc_enum_input,
|
.vidioc_enum_input = vidioc_enum_input,
|
||||||
.vidioc_g_input = vidioc_g_input,
|
.vidioc_g_input = vidioc_g_input,
|
||||||
.vidioc_s_input = vidioc_s_input,
|
.vidioc_s_input = vidioc_s_input,
|
||||||
|
@ -1265,7 +1276,6 @@ static struct video_device saa7164_vbi_template = {
|
||||||
.ioctl_ops = &vbi_ioctl_ops,
|
.ioctl_ops = &vbi_ioctl_ops,
|
||||||
.minor = -1,
|
.minor = -1,
|
||||||
.tvnorms = SAA7164_NORMS,
|
.tvnorms = SAA7164_NORMS,
|
||||||
.current_norm = V4L2_STD_NTSC_M,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct video_device *saa7164_vbi_alloc(
|
static struct video_device *saa7164_vbi_alloc(
|
||||||
|
@ -1324,6 +1334,7 @@ int saa7164_vbi_register(struct saa7164_port *port)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
port->std = V4L2_STD_NTSC_M;
|
||||||
video_set_drvdata(port->v4l_device, port);
|
video_set_drvdata(port->v4l_device, port);
|
||||||
result = video_register_device(port->v4l_device,
|
result = video_register_device(port->v4l_device,
|
||||||
VFL_TYPE_VBI, -1);
|
VFL_TYPE_VBI, -1);
|
||||||
|
|
|
@ -375,6 +375,7 @@ struct saa7164_port {
|
||||||
/* Encoder */
|
/* Encoder */
|
||||||
/* Defaults established in saa7164-encoder.c */
|
/* Defaults established in saa7164-encoder.c */
|
||||||
struct saa7164_tvnorm encodernorm;
|
struct saa7164_tvnorm encodernorm;
|
||||||
|
v4l2_std_id std;
|
||||||
u32 height;
|
u32 height;
|
||||||
u32 width;
|
u32 width;
|
||||||
u32 freq;
|
u32 freq;
|
||||||
|
|
Loading…
Add table
Reference in a new issue