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

Lines Matching defs:fh

318 static int res_get(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bit)
321 if (fh->resources & bit)
333 fh->resources |= bit;
341 int res_check(struct cx8800_fh *fh, unsigned int bit)
343 return (fh->resources & bit);
353 void res_free(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bits)
356 BUG_ON((fh->resources & bits) != bits);
359 fh->resources &= ~bits;
521 struct cx8800_fh *fh = q->priv_data;
523 *size = fh->fmt->depth*fh->width*fh->height >> 3;
535 struct cx8800_fh *fh = q->priv_data;
536 struct cx8800_dev *dev = fh->dev;
541 BUG_ON(NULL == fh->fmt);
542 if (fh->width < 48 || fh->width > norm_maxw(core->tvnorm) ||
543 fh->height < 32 || fh->height > norm_maxh(core->tvnorm))
545 buf->vb.size = (fh->width * fh->height * fh->fmt->depth) >> 3;
549 if (buf->fmt != fh->fmt ||
550 buf->vb.width != fh->width ||
551 buf->vb.height != fh->height ||
553 buf->fmt = fh->fmt;
554 buf->vb.width = fh->width;
555 buf->vb.height = fh->height;
605 fh->width, fh->height, fh->fmt->depth, fh->fmt->name,
621 struct cx8800_fh *fh = vq->priv_data;
622 struct cx8800_dev *dev = fh->dev;
685 static struct videobuf_queue* get_queue(struct cx8800_fh *fh)
687 switch (fh->type) {
689 return &fh->vidq;
691 return &fh->vbiq;
698 static int get_ressource(struct cx8800_fh *fh)
700 switch (fh->type) {
716 struct cx8800_fh *fh;
746 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
747 if (NULL == fh)
749 file->private_data = fh;
750 fh->dev = dev;
751 fh->radio = radio;
752 fh->type = type;
753 fh->width = 320;
754 fh->height = 240;
755 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
757 videobuf_queue_init(&fh->vidq, &cx8800_video_qops,
762 fh);
763 videobuf_queue_init(&fh->vbiq, &cx8800_vbi_qops,
768 fh);
770 if (fh->radio) {
789 struct cx8800_fh *fh = file->private_data;
791 switch (fh->type) {
793 if (res_locked(fh->dev,RESOURCE_VIDEO))
795 return videobuf_read_one(&fh->vidq, data, count, ppos,
798 if (!res_get(fh->dev,fh,RESOURCE_VBI))
800 return videobuf_read_stream(&fh->vbiq, data, count, ppos, 1,
811 struct cx8800_fh *fh = file->private_data;
814 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
815 if (!res_get(fh->dev,fh,RESOURCE_VBI))
817 return videobuf_poll_stream(file, &fh->vbiq, wait);
820 if (res_check(fh,RESOURCE_VIDEO)) {
822 if (list_empty(&fh->vidq.stream))
824 buf = list_entry(fh->vidq.stream.next,struct cx88_buffer,vb.stream);
827 buf = (struct cx88_buffer*)fh->vidq.read_buf;
840 struct cx8800_fh *fh = file->private_data;
841 struct cx8800_dev *dev = fh->dev;
844 if (res_check(fh, RESOURCE_OVERLAY)) {
845 res_free(dev,fh,RESOURCE_OVERLAY);
849 if (res_check(fh, RESOURCE_VIDEO)) {
850 videobuf_queue_cancel(&fh->vidq);
851 res_free(dev,fh,RESOURCE_VIDEO);
853 if (fh->vidq.read_buf) {
854 buffer_release(&fh->vidq,fh->vidq.read_buf);
855 kfree(fh->vidq.read_buf);
859 if (res_check(fh, RESOURCE_VBI)) {
860 if (fh->vbiq.streaming)
861 videobuf_streamoff(&fh->vbiq);
862 if (fh->vbiq.reading)
863 videobuf_read_stop(&fh->vbiq);
864 res_free(dev,fh,RESOURCE_VBI);
867 videobuf_mmap_free(&fh->vidq);
868 videobuf_mmap_free(&fh->vbiq);
870 kfree(fh);
880 struct cx8800_fh *fh = file->private_data;
882 return videobuf_mmap_mapper(get_queue(fh), vma);
995 struct cx8800_fh *fh = priv;
997 f->fmt.pix.width = fh->width;
998 f->fmt.pix.height = fh->height;
999 f->fmt.pix.field = fh->vidq.field;
1000 f->fmt.pix.pixelformat = fh->fmt->fourcc;
1002 (f->fmt.pix.width * fh->fmt->depth) >> 3;
1062 struct cx8800_fh *fh = priv;
1067 fh->fmt = format_by_fourcc(f->fmt.pix.pixelformat);
1068 fh->width = f->fmt.pix.width;
1069 fh->height = f->fmt.pix.height;
1070 fh->vidq.field = f->fmt.pix.field;
1110 struct cx8800_fh *fh = priv;
1116 q = get_queue(fh);
1137 struct cx8800_fh *fh = priv;
1138 return (videobuf_reqbufs(get_queue(fh), p));
1143 struct cx8800_fh *fh = priv;
1144 return (videobuf_querybuf(get_queue(fh), p));
1149 struct cx8800_fh *fh = priv;
1150 return (videobuf_qbuf(get_queue(fh), p));
1155 struct cx8800_fh *fh = priv;
1156 return (videobuf_dqbuf(get_queue(fh), p,
1162 struct cx8800_fh *fh = priv;
1163 struct cx8800_dev *dev = fh->dev;
1165 if (unlikely(fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE))
1167 if (unlikely(i != fh->type))
1170 if (unlikely(!res_get(dev,fh,get_ressource(fh))))
1172 return videobuf_streamon(get_queue(fh));
1177 struct cx8800_fh *fh = priv;
1178 struct cx8800_dev *dev = fh->dev;
1181 if (fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1183 if (i != fh->type)
1186 res = get_ressource(fh);
1187 err = videobuf_streamoff(get_queue(fh));
1190 res_free(dev,fh,res);
1333 struct cx8800_fh *fh = priv;
1334 struct cx88_core *core = fh->dev->core;
1339 /* f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; */
1340 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
1374 struct cx8800_fh *fh = priv;
1375 struct cx88_core *core = fh->dev->core;
1377 if (unlikely(0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV))
1379 if (unlikely(1 == fh->radio && f->type != V4L2_TUNER_RADIO))
1387 static int vidioc_g_register (struct file *file, void *fh,
1390 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
1399 static int vidioc_s_register (struct file *file, void *fh,
1402 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
1480 static int radio_s_audio (struct file *file, void *fh,
1486 static int radio_s_input (struct file *file, void *fh, unsigned int i)