• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/media/common/

Lines Matching refs:fh

9 #define IS_CAPTURE_ACTIVE(fh) \
10 (((vv->video_status & STATUS_CAPTURE) != 0) && (vv->video_fh == fh))
12 #define IS_OVERLAY_ACTIVE(fh) \
13 (((vv->video_status & STATUS_OVERLAY) != 0) && (vv->video_fh == fh))
101 static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f);
103 int saa7146_start_preview(struct saa7146_fh *fh)
105 struct saa7146_dev *dev = fh->dev;
110 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
113 if( NULL == fh->ov.fh ) {
119 if (IS_CAPTURE_ACTIVE(fh) != 0) {
125 if (IS_OVERLAY_ACTIVE(fh) != 0) {
126 if (vv->video_fh == fh) {
134 if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) {
139 fmt.fmt.win = fh->ov.win;
140 err = vidioc_try_fmt_vid_overlay(NULL, fh, &fmt);
145 fh->ov.win = fmt.fmt.win;
146 vv->ov_data = &fh->ov;
149 fh->ov.win.w.width,fh->ov.win.w.height,
150 fh->ov.win.w.left,fh->ov.win.w.top,
151 vv->ov_fmt->name,v4l2_field_names[fh->ov.win.field]));
153 if (0 != (ret = saa7146_enable_overlay(fh))) {
160 vv->video_fh = fh;
166 int saa7146_stop_preview(struct saa7146_fh *fh)
168 struct saa7146_dev *dev = fh->dev;
171 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
174 if (IS_CAPTURE_ACTIVE(fh) != 0) {
185 if (vv->video_fh != fh) {
193 saa7146_disable_overlay(fh);
195 saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
382 static int video_begin(struct saa7146_fh *fh)
384 struct saa7146_dev *dev = fh->dev;
390 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
393 if (vv->video_fh == fh) {
411 fmt = saa7146_format_by_fourcc(dev,fh->video_fmt.pixelformat);
421 ret = saa7146_res_get(fh, resource);
437 vv->video_fh = fh;
443 static int video_end(struct saa7146_fh *fh, struct file *file)
445 struct saa7146_dev *dev = fh->dev;
451 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
458 if (vv->video_fh != fh) {
463 fmt = saa7146_format_by_fourcc(dev,fh->video_fmt.pixelformat);
490 saa7146_res_free(fh, resource);
500 static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
502 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
517 static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
519 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
527 static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb)
529 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
549 if (IS_OVERLAY_ACTIVE(fh) != 0) {
550 if (vv->video_fh != fh) {
571 static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f)
581 static int vidioc_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *c)
600 static int vidioc_g_ctrl(struct file *file, void *fh, struct v4l2_control *c)
602 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
640 static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
642 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
693 if (IS_CAPTURE_ACTIVE(fh) != 0) {
701 if (IS_CAPTURE_ACTIVE(fh) != 0) {
714 if (IS_OVERLAY_ACTIVE(fh) != 0) {
715 saa7146_stop_preview(fh);
716 saa7146_start_preview(fh);
721 static int vidioc_g_parm(struct file *file, void *fh,
724 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
733 static int vidioc_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f)
735 f->fmt.pix = ((struct saa7146_fh *)fh)->video_fmt;
739 static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f)
741 f->fmt.win = ((struct saa7146_fh *)fh)->ov.win;
745 static int vidioc_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f)
747 f->fmt.vbi = ((struct saa7146_fh *)fh)->vbi_fmt;
751 static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f)
753 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
760 DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh));
815 static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f)
817 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
875 struct saa7146_fh *fh = __fh;
876 struct saa7146_dev *dev = fh->dev;
880 DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh));
881 if (IS_CAPTURE_ACTIVE(fh) != 0) {
885 err = vidioc_try_fmt_vid_cap(file, fh, f);
888 fh->video_fmt = f->fmt.pix;
889 DEB_EE(("set to pixelformat '%4.4s'\n", (char *)&fh->video_fmt.pixelformat));
895 struct saa7146_fh *fh = __fh;
896 struct saa7146_dev *dev = fh->dev;
900 DEB_EE(("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh));
901 err = vidioc_try_fmt_vid_overlay(file, fh, f);
905 fh->ov.win = f->fmt.win;
906 fh->ov.nclips = f->fmt.win.clipcount;
907 if (fh->ov.nclips > 16)
908 fh->ov.nclips = 16;
909 if (copy_from_user(fh->ov.clips, f->fmt.win.clips,
910 sizeof(struct v4l2_clip) * fh->ov.nclips)) {
915 /* fh->ov.fh is used to indicate that we have valid overlay informations, too */
916 fh->ov.fh = fh;
921 if (IS_OVERLAY_ACTIVE(fh) != 0) {
922 saa7146_stop_preview(fh);
923 saa7146_start_preview(fh);
928 static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm)
930 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
955 static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
957 struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
1006 static int vidioc_overlay(struct file *file, void *fh, unsigned int on)
1012 err = saa7146_start_preview(fh);
1014 err = saa7146_stop_preview(fh);
1020 struct saa7146_fh *fh = __fh;
1023 return videobuf_reqbufs(&fh->video_q, b);
1025 return videobuf_reqbufs(&fh->vbi_q, b);
1031 struct saa7146_fh *fh = __fh;
1034 return videobuf_querybuf(&fh->video_q, buf);
1036 return videobuf_querybuf(&fh->vbi_q, buf);
1042 struct saa7146_fh *fh = __fh;
1045 return videobuf_qbuf(&fh->video_q, buf);
1047 return videobuf_qbuf(&fh->vbi_q, buf);
1053 struct saa7146_fh *fh = __fh;
1056 return videobuf_dqbuf(&fh->video_q, buf, file->f_flags & O_NONBLOCK);
1058 return videobuf_dqbuf(&fh->vbi_q, buf, file->f_flags & O_NONBLOCK);
1064 struct saa7146_fh *fh = __fh;
1069 err = video_begin(fh);
1073 return videobuf_streamon(&fh->video_q);
1075 return videobuf_streamon(&fh->vbi_q);
1081 struct saa7146_fh *fh = __fh;
1082 struct saa7146_dev *dev = fh->dev;
1096 if (vv->video_fh != fh) {
1103 err = videobuf_streamoff(&fh->video_q);
1105 err = videobuf_streamoff(&fh->vbi_q);
1108 video_end(fh, file);
1110 err = video_end(fh, file);
1118 struct saa7146_fh *fh = __fh;
1119 struct saa7146_dev *dev = fh->dev;
1134 struct saa7146_fh *fh = __fh;
1135 struct videobuf_queue *q = &fh->video_q;
1143 q = &fh->video_q;
1219 struct saa7146_fh *fh = file->private_data;
1220 struct saa7146_dev *dev = fh->dev;
1228 if (fh->video_fmt.width < 48 ||
1229 fh->video_fmt.height < 32 ||
1230 fh->video_fmt.width > vv->standard->h_max_out ||
1231 fh->video_fmt.height > vv->standard->v_max_out) {
1232 DEB_D(("w (%d) / h (%d) out of bounds.\n",fh->video_fmt.width,fh->video_fmt.height));
1236 size = fh->video_fmt.sizeimage;
1243 fh->video_fmt.width,fh->video_fmt.height,size,v4l2_field_names[fh->video_fmt.field]));
1244 if (buf->vb.width != fh->video_fmt.width ||
1245 buf->vb.bytesperline != fh->video_fmt.bytesperline ||
1246 buf->vb.height != fh->video_fmt.height ||
1249 buf->vb.field != fh->video_fmt.field ||
1250 buf->fmt != &fh->video_fmt) {
1257 buf->vb.bytesperline = fh->video_fmt.bytesperline;
1258 buf->vb.width = fh->video_fmt.width;
1259 buf->vb.height = fh->video_fmt.height;
1262 buf->fmt = &fh->video_fmt;
1263 buf->vb.field = fh->video_fmt.field;
1298 struct saa7146_fh *fh = file->private_data;
1303 *size = fh->video_fmt.sizeimage;
1318 struct saa7146_fh *fh = file->private_data;
1319 struct saa7146_dev *dev = fh->dev;
1324 saa7146_buffer_queue(fh->dev,&vv->video_q,buf);
1330 struct saa7146_fh *fh = file->private_data;
1331 struct saa7146_dev *dev = fh->dev;
1370 struct saa7146_fh *fh = file->private_data;
1373 fh->video_fmt.width = 384;
1374 fh->video_fmt.height = 288;
1375 fh->video_fmt.pixelformat = V4L2_PIX_FMT_BGR24;
1376 fh->video_fmt.bytesperline = 0;
1377 fh->video_fmt.field = V4L2_FIELD_ANY;
1378 sfmt = saa7146_format_by_fourcc(dev,fh->video_fmt.pixelformat);
1379 fh->video_fmt.sizeimage = (fh->video_fmt.width * fh->video_fmt.height * sfmt->depth)/8;
1381 videobuf_queue_sg_init(&fh->video_q, &video_qops,
1394 struct saa7146_fh *fh = file->private_data;
1396 struct videobuf_queue *q = &fh->video_q;
1399 if (IS_CAPTURE_ACTIVE(fh) != 0) {
1400 err = video_end(fh, file);
1401 } else if (IS_OVERLAY_ACTIVE(fh) != 0) {
1402 err = saa7146_stop_preview(fh);
1431 struct saa7146_fh *fh = file->private_data;
1432 struct saa7146_dev *dev = fh->dev;
1439 if (vv->video_fh == fh) {
1447 ret = video_begin(fh);
1452 ret = videobuf_read_one(&fh->video_q , data, count, ppos,
1455 video_end(fh, file);
1457 ret = video_end(fh, file);