• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/media/common/

Lines Matching defs:fh

8 #define IS_CAPTURE_ACTIVE(fh) \
9 (((vv->video_status & STATUS_CAPTURE) != 0) && (vv->video_fh == fh))
11 #define IS_OVERLAY_ACTIVE(fh) \
12 (((vv->video_status & STATUS_OVERLAY) != 0) && (vv->video_fh == fh))
100 static int g_fmt(struct saa7146_fh *fh, struct v4l2_format *f)
102 struct saa7146_dev *dev = fh->dev;
103 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
107 f->fmt.pix = fh->video_fmt;
110 f->fmt.win = fh->ov.win;
114 f->fmt.vbi = fh->vbi_fmt;
180 static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f)
182 struct saa7146_dev *dev = fh->dev;
194 DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n",dev,fh));
250 DEB_EE(("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n",dev,fh));
262 int saa7146_start_preview(struct saa7146_fh *fh)
264 struct saa7146_dev *dev = fh->dev;
268 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
271 if( NULL == fh->ov.fh ) {
277 if (IS_CAPTURE_ACTIVE(fh) != 0) {
283 if (IS_OVERLAY_ACTIVE(fh) != 0) {
284 if (vv->video_fh == fh) {
292 if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) {
297 err = try_win(dev,&fh->ov.win);
303 vv->ov_data = &fh->ov;
306 fh->ov.win.w.width,fh->ov.win.w.height,
307 fh->ov.win.w.left,fh->ov.win.w.top,
308 vv->ov_fmt->name,v4l2_field_names[fh->ov.win.field]));
310 if (0 != (ret = saa7146_enable_overlay(fh))) {
317 vv->video_fh = fh;
323 int saa7146_stop_preview(struct saa7146_fh *fh)
325 struct saa7146_dev *dev = fh->dev;
328 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
331 if (IS_CAPTURE_ACTIVE(fh) != 0) {
342 if (vv->video_fh != fh) {
350 saa7146_disable_overlay(fh);
352 saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
358 static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f)
360 struct saa7146_dev *dev = fh->dev;
367 DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n",dev,fh));
368 if (IS_CAPTURE_ACTIVE(fh) != 0) {
372 err = try_fmt(fh,f);
375 fh->video_fmt = f->fmt.pix;
376 DEB_EE(("set to pixelformat '%4.4s'\n",(char *)&fh->video_fmt.pixelformat));
379 DEB_EE(("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n",dev,fh));
384 fh->ov.win = f->fmt.win;
385 fh->ov.nclips = f->fmt.win.clipcount;
386 if (fh->ov.nclips > 16)
387 fh->ov.nclips = 16;
388 if (copy_from_user(fh->ov.clips,f->fmt.win.clips,sizeof(struct v4l2_clip)*fh->ov.nclips)) {
393 /* fh->ov.fh is used to indicate that we have valid overlay informations, too */
394 fh->ov.fh = fh;
399 if (IS_OVERLAY_ACTIVE(fh) != 0) {
400 saa7146_stop_preview(fh);
401 saa7146_start_preview(fh);
466 static int get_control(struct saa7146_fh *fh, struct v4l2_control *c)
468 struct saa7146_dev *dev = fh->dev;
508 static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
510 struct saa7146_dev *dev = fh->dev;
562 if (IS_CAPTURE_ACTIVE(fh) != 0) {
570 if (IS_CAPTURE_ACTIVE(fh) != 0) {
583 if (IS_OVERLAY_ACTIVE(fh) != 0) {
584 saa7146_stop_preview(fh);
585 saa7146_start_preview(fh);
711 static int video_begin(struct saa7146_fh *fh)
713 struct saa7146_dev *dev = fh->dev;
719 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
722 if (vv->video_fh == fh) {
740 fmt = format_by_fourcc(dev,fh->video_fmt.pixelformat);
750 ret = saa7146_res_get(fh, resource);
766 vv->video_fh = fh;
772 static int video_end(struct saa7146_fh *fh, struct file *file)
774 struct saa7146_dev *dev = fh->dev;
780 DEB_EE(("dev:%p, fh:%p\n",dev,fh));
787 if (vv->video_fh != fh) {
792 fmt = format_by_fourcc(dev,fh->video_fmt.pixelformat);
819 saa7146_res_free(fh, resource);
837 struct saa7146_fh *fh = file->private_data;
838 struct saa7146_dev *dev = fh->dev;
854 result = dev->ext_vv_data->ioctl(fh, cmd, arg);
859 result = dev->ext_vv_data->ioctl(fh, cmd, arg);
866 switch (fh->type) {
869 q = &fh->video_q;
874 q = &fh->vbi_q;
935 if (IS_OVERLAY_ACTIVE(fh) != 0) {
936 if (vv->video_fh != fh) {
1006 return get_control(fh,arg);
1011 err = set_control(fh,arg);
1030 return g_fmt(fh,f);
1036 return s_fmt(fh,f);
1042 return try_fmt(fh,f);
1122 err = saa7146_start_preview(fh);
1124 err = saa7146_stop_preview(fh);
1156 err = video_begin(fh);
1176 if (vv->video_fh != fh) {
1184 video_end(fh, file);
1186 err = video_end(fh, file);
1202 q = &fh->video_q;
1246 struct saa7146_fh *fh = file->private_data;
1247 struct saa7146_dev *dev = fh->dev;
1255 if (fh->video_fmt.width < 48 ||
1256 fh->video_fmt.height < 32 ||
1257 fh->video_fmt.width > vv->standard->h_max_out ||
1258 fh->video_fmt.height > vv->standard->v_max_out) {
1259 DEB_D(("w (%d) / h (%d) out of bounds.\n",fh->video_fmt.width,fh->video_fmt.height));
1263 size = fh->video_fmt.sizeimage;
1270 fh->video_fmt.width,fh->video_fmt.height,size,v4l2_field_names[fh->video_fmt.field]));
1271 if (buf->vb.width != fh->video_fmt.width ||
1272 buf->vb.bytesperline != fh->video_fmt.bytesperline ||
1273 buf->vb.height != fh->video_fmt.height ||
1276 buf->vb.field != fh->video_fmt.field ||
1277 buf->fmt != &fh->video_fmt) {
1284 buf->vb.bytesperline = fh->video_fmt.bytesperline;
1285 buf->vb.width = fh->video_fmt.width;
1286 buf->vb.height = fh->video_fmt.height;
1289 buf->fmt = &fh->video_fmt;
1290 buf->vb.field = fh->video_fmt.field;
1329 struct saa7146_fh *fh = file->private_data;
1334 *size = fh->video_fmt.sizeimage;
1349 struct saa7146_fh *fh = file->private_data;
1350 struct saa7146_dev *dev = fh->dev;
1355 saa7146_buffer_queue(fh->dev,&vv->video_q,buf);
1361 struct saa7146_fh *fh = file->private_data;
1362 struct saa7146_dev *dev = fh->dev;
1398 struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
1401 fh->video_fmt.width = 384;
1402 fh->video_fmt.height = 288;
1403 fh->video_fmt.pixelformat = V4L2_PIX_FMT_BGR24;
1404 fh->video_fmt.bytesperline = 0;
1405 fh->video_fmt.field = V4L2_FIELD_ANY;
1406 sfmt = format_by_fourcc(dev,fh->video_fmt.pixelformat);
1407 fh->video_fmt.sizeimage = (fh->video_fmt.width * fh->video_fmt.height * sfmt->depth)/8;
1409 videobuf_queue_init(&fh->video_q, &video_qops,
1416 mutex_init(&fh->video_q.lock);
1424 struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
1426 struct videobuf_queue *q = &fh->video_q;
1429 if (IS_CAPTURE_ACTIVE(fh) != 0) {
1430 err = video_end(fh, file);
1431 } else if (IS_OVERLAY_ACTIVE(fh) != 0) {
1432 err = saa7146_stop_preview(fh);
1464 struct saa7146_fh *fh = file->private_data;
1465 struct saa7146_dev *dev = fh->dev;
1472 if (vv->video_fh == fh) {
1480 ret = video_begin(fh);
1485 ret = videobuf_read_one(&fh->video_q , data, count, ppos,
1488 video_end(fh, file);
1490 ret = video_end(fh, file);