Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226346
b: refs/heads/master
c: ddda424
h: refs/heads/master
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Dec 29, 2010
1 parent f2dfcfb commit a6c5ed4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b0c45686c8e8aecc7b0cd04d9b6af48d74418d53
refs/heads/master: ddda424999817fbc17adf9013feb066903382ede
3 changes: 1 addition & 2 deletions trunk/drivers/media/video/ivtv/ivtv-fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,8 @@ ssize_t ivtv_v4l2_write(struct file *filp, const char __user *user_buf, size_t c
int elems = count / sizeof(struct v4l2_sliced_vbi_data);

set_bit(IVTV_F_S_APPL_IO, &s->s_flags);
ivtv_write_vbi_from_user(itv,
return ivtv_write_vbi_from_user(itv,
(const struct v4l2_sliced_vbi_data __user *)user_buf, elems);
return elems * sizeof(struct v4l2_sliced_vbi_data);
}

mode = s->type == IVTV_DEC_STREAM_TYPE_MPG ? OUT_MPG : OUT_YUV;
Expand Down
14 changes: 10 additions & 4 deletions trunk/drivers/media/video/ivtv/ivtv-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,30 @@ static void ivtv_write_vbi(struct ivtv *itv,
ivtv_write_vbi_cc_lines(itv, &cc);
}

void ivtv_write_vbi_from_user(struct ivtv *itv,
const struct v4l2_sliced_vbi_data __user *sliced,
size_t cnt)
ssize_t
ivtv_write_vbi_from_user(struct ivtv *itv,
const struct v4l2_sliced_vbi_data __user *sliced,
size_t cnt)
{
struct vbi_cc cc = { .odd = { 0x80, 0x80 }, .even = { 0x80, 0x80 } };
int found_cc = 0;
size_t i;
struct v4l2_sliced_vbi_data d;
ssize_t ret = cnt * sizeof(struct v4l2_sliced_vbi_data);

for (i = 0; i < cnt; i++) {
if (copy_from_user(&d, sliced + i,
sizeof(struct v4l2_sliced_vbi_data)))
sizeof(struct v4l2_sliced_vbi_data))) {
ret = -EFAULT;
break;
}
ivtv_write_vbi_line(itv, sliced + i, &cc, &found_cc);
}

if (found_cc)
ivtv_write_vbi_cc_lines(itv, &cc);

return ret;
}

static void copy_vbi_data(struct ivtv *itv, int lines, u32 pts_stamp)
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/media/video/ivtv/ivtv-vbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
#ifndef IVTV_VBI_H
#define IVTV_VBI_H

void ivtv_write_vbi_from_user(struct ivtv *itv,
const struct v4l2_sliced_vbi_data __user *sliced,
size_t count);
ssize_t
ivtv_write_vbi_from_user(struct ivtv *itv,
const struct v4l2_sliced_vbi_data __user *sliced,
size_t count);
void ivtv_process_vbi_data(struct ivtv *itv, struct ivtv_buffer *buf,
u64 pts_stamp, int streamtype);
int ivtv_used_line(struct ivtv *itv, int line, int field);
Expand Down

0 comments on commit a6c5ed4

Please sign in to comment.