mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 05:04:00 +08:00
V4L/DVB (8921): ivtv: fix incorrect capability and assorted sliced vbi and video out fmt fixes
- V4L2_CAP_VBI_OUTPUT is not supported by ivtv, remove it. - ivtv_try_fmt_vid_out also needed to constrain the width/height of MPEG decoder window sizes. - allow empty sliced services. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
effc3466d3
commit
854ad9abcc
@ -154,7 +154,7 @@
|
|||||||
#define IVTV_CAP_ENCODER (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | \
|
#define IVTV_CAP_ENCODER (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | \
|
||||||
V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | V4L2_CAP_VBI_CAPTURE | \
|
V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | V4L2_CAP_VBI_CAPTURE | \
|
||||||
V4L2_CAP_SLICED_VBI_CAPTURE)
|
V4L2_CAP_SLICED_VBI_CAPTURE)
|
||||||
#define IVTV_CAP_DECODER (V4L2_CAP_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT | \
|
#define IVTV_CAP_DECODER (V4L2_CAP_VIDEO_OUTPUT | \
|
||||||
V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_OVERLAY)
|
V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_OVERLAY)
|
||||||
|
|
||||||
struct ivtv_card_video_input {
|
struct ivtv_card_video_input {
|
||||||
|
@ -101,18 +101,15 @@ void ivtv_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int check_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal)
|
static void check_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal)
|
||||||
{
|
{
|
||||||
int f, l;
|
int f, l;
|
||||||
u16 set = 0;
|
|
||||||
|
|
||||||
for (f = 0; f < 2; f++) {
|
for (f = 0; f < 2; f++) {
|
||||||
for (l = 0; l < 24; l++) {
|
for (l = 0; l < 24; l++) {
|
||||||
fmt->service_lines[f][l] = select_service_from_set(f, l, fmt->service_lines[f][l], is_pal);
|
fmt->service_lines[f][l] = select_service_from_set(f, l, fmt->service_lines[f][l], is_pal);
|
||||||
set |= fmt->service_lines[f][l];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return set != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt)
|
u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt)
|
||||||
@ -474,7 +471,7 @@ static int ivtv_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format
|
|||||||
int h = fmt->fmt.pix.height;
|
int h = fmt->fmt.pix.height;
|
||||||
|
|
||||||
w = min(w, 720);
|
w = min(w, 720);
|
||||||
w = max(w, 1);
|
w = max(w, 2);
|
||||||
h = min(h, itv->is_50hz ? 576 : 480);
|
h = min(h, itv->is_50hz ? 576 : 480);
|
||||||
h = max(h, 2);
|
h = max(h, 2);
|
||||||
ivtv_g_fmt_vid_cap(file, fh, fmt);
|
ivtv_g_fmt_vid_cap(file, fh, fmt);
|
||||||
@ -512,18 +509,18 @@ static int ivtv_try_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_
|
|||||||
static int ivtv_try_fmt_vid_out(struct file *file, void *fh, struct v4l2_format *fmt)
|
static int ivtv_try_fmt_vid_out(struct file *file, void *fh, struct v4l2_format *fmt)
|
||||||
{
|
{
|
||||||
struct ivtv_open_id *id = fh;
|
struct ivtv_open_id *id = fh;
|
||||||
|
struct ivtv *itv = id->itv;
|
||||||
s32 w = fmt->fmt.pix.width;
|
s32 w = fmt->fmt.pix.width;
|
||||||
s32 h = fmt->fmt.pix.height;
|
s32 h = fmt->fmt.pix.height;
|
||||||
int field = fmt->fmt.pix.field;
|
int field = fmt->fmt.pix.field;
|
||||||
int ret = ivtv_g_fmt_vid_out(file, fh, fmt);
|
int ret = ivtv_g_fmt_vid_out(file, fh, fmt);
|
||||||
|
|
||||||
if (!ret && id->type == IVTV_DEC_STREAM_TYPE_YUV) {
|
|
||||||
fmt->fmt.pix.field = field;
|
|
||||||
w = min(w, 720);
|
w = min(w, 720);
|
||||||
w = max(w, 2);
|
w = max(w, 2);
|
||||||
h = min(h, 576);
|
h = min(h, itv->is_out_50hz ? 576 : 480);
|
||||||
h = max(h, 2);
|
h = max(h, 2);
|
||||||
}
|
if (id->type == IVTV_DEC_STREAM_TYPE_YUV)
|
||||||
|
fmt->fmt.pix.field = field;
|
||||||
fmt->fmt.pix.width = w;
|
fmt->fmt.pix.width = w;
|
||||||
fmt->fmt.pix.height = h;
|
fmt->fmt.pix.height = h;
|
||||||
return ret;
|
return ret;
|
||||||
@ -593,8 +590,7 @@ static int ivtv_s_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_fo
|
|||||||
if (ret || id->type == IVTV_DEC_STREAM_TYPE_VBI)
|
if (ret || id->type == IVTV_DEC_STREAM_TYPE_VBI)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (check_service_set(vbifmt, itv->is_50hz) == 0)
|
check_service_set(vbifmt, itv->is_50hz);
|
||||||
return -EINVAL;
|
|
||||||
if (atomic_read(&itv->capturing) > 0)
|
if (atomic_read(&itv->capturing) > 0)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
itv->video_dec_func(itv, VIDIOC_S_FMT, fmt);
|
itv->video_dec_func(itv, VIDIOC_S_FMT, fmt);
|
||||||
|
Loading…
Reference in New Issue
Block a user