diff options
author | Archit Taneja <archit@ti.com> | 2010-08-06 16:03:40 +0530 |
---|---|---|
committer | Ricardo Perez Olivares <x0081762@ti.com> | 2010-09-14 19:27:05 -0500 |
commit | 71ca1f3b3e54725d06d47a00e2e6888e0998e167 (patch) | |
tree | b4325ce41494f0fdcb7b24b0ad8d727f1bfcedf7 /drivers/media | |
parent | 6e4dffa91f7a235c9bad1398d4bcd62d984b5548 (diff) |
OMAP:V4l2:Patch to add v4l2 Api set/get format of vid overlay in Writeback
Signed-off-by: Mythri P K <mythripk@ti.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/omap/omap_wb.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/media/video/omap/omap_wb.c b/drivers/media/video/omap/omap_wb.c index 1011c0010a7a..2847255a224c 100644 --- a/drivers/media/video/omap/omap_wb.c +++ b/drivers/media/video/omap/omap_wb.c @@ -247,6 +247,24 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *fh, return 0; } +static int vidioc_s_fmt_vid_overlay(struct file *file, void *fh, + struct v4l2_format *f) +{ + int ret = 0; + struct omap_wb_device *wb = fh; + struct v4l2_window *win = &f->fmt.win; + + mutex_lock(&wb->lock); + /* No boundry checks for wb window for now */ + wb->win.w.left = win->w.left; + wb->win.w.top = win->w.top; + wb->win.w.width = win->w.width; + wb->win.w.height = win->w.height; + mutex_unlock(&wb->lock); + + return ret; +} + static int vidioc_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *req) { @@ -494,6 +512,20 @@ err: return -EINVAL; } +static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, + struct v4l2_format *f) +{ + + struct omap_wb_device *wb = fh; + struct v4l2_window *win = &f->fmt.win; + + win->w = wb->win.w; + win->field = wb->win.field; + win->global_alpha = wb->win.global_alpha; + + return 0; +} + static const struct v4l2_ioctl_ops wb_ioctl_fops = { .vidioc_querycap = vidioc_querycap, .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, @@ -504,6 +536,8 @@ static const struct v4l2_ioctl_ops wb_ioctl_fops = { .vidioc_dqbuf = vidioc_dqbuf, .vidioc_streamon = vidioc_streamon, .vidioc_streamoff = vidioc_streamoff, + .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay, + .vidioc_g_fmt_vid_overlay = vidioc_g_fmt_vid_overlay, .vidioc_default = vidioc_default_wb, }; |