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

Lines Matching refs:peasycap

38  *          peasycap->standard_offset
39 * peasycap->fps
40 * peasycap->usec
41 * peasycap->tolerate
44 int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id)
51 if ((struct usb_device *)NULL == peasycap->pusb_device) {
52 SAY("ERROR: peasycap->pusb_device is NULL\n");
68 if (peasycap->standard_offset == \
73 peasycap->standard_offset = (int)(peasycap_standard - &easycap_standard[0]);
74 peasycap->fps = peasycap_standard->v4l2_standard.frameperiod.denominator / \
76 if (!peasycap->fps) {
80 JOT(8, "%i frames-per-second\n", peasycap->fps);
81 peasycap->usec = 1000000 / (2 * peasycap->fps);
82 peasycap->tolerate = 1000 * (25 / peasycap->fps);
84 kill_video_urbs(peasycap);
95 ir = read_saa(peasycap->pusb_device, reg);
102 set2to78(peasycap->pusb_device);
105 rc = write_saa(peasycap->pusb_device, reg, set);
110 isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
118 set2to78(peasycap->pusb_device);
123 ir = read_saa(peasycap->pusb_device, reg);
129 set2to78(peasycap->pusb_device);
131 rc = write_saa(peasycap->pusb_device, reg, set);
136 isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
144 set2to78(peasycap->pusb_device);
177 ir = read_saa(peasycap->pusb_device, reg);
183 set2to78(peasycap->pusb_device);
185 rc = write_saa(peasycap->pusb_device, reg, set);
186 if (0 != write_saa(peasycap->pusb_device, reg, set)) {
190 isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
205 ir = read_saa(peasycap->pusb_device, reg);
216 set2to78(peasycap->pusb_device);
218 rc = write_saa(peasycap->pusb_device, reg, set);
222 isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
236 ir = read_saa(peasycap->pusb_device, reg);
247 set2to78(peasycap->pusb_device);
249 rc = write_saa(peasycap->pusb_device, reg, set);
253 isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
267 ir = read_saa(peasycap->pusb_device, reg);
276 set2to78(peasycap->pusb_device);
278 if (0 != write_saa(peasycap->pusb_device, reg, set))
282 isnow = (unsigned int)read_saa(peasycap->pusb_device, reg);
290 if (0 != check_saa(peasycap->pusb_device))
298 * CURRENT VALUE OF peasycap->standard_offset.
301 * peasycap->format_offset
302 * peasycap->pixelformat
303 * peasycap->field
304 * peasycap->height
305 * peasycap->width
306 * peasycap->bytesperpixel
307 * peasycap->byteswaporder
308 * peasycap->decimatepixel
309 * peasycap->frame_buffer_used
310 * peasycap->videofieldamount
311 * peasycap->offerfields
318 int adjust_format(struct easycap *peasycap, \
328 if ((struct easycap *)NULL == peasycap) {
329 SAY("ERROR: peasycap is NULL\n");
332 p = peasycap->pusb_device;
339 mask = easycap_standard[peasycap->standard_offset].mask;
394 return peasycap->format_offset;
416 peasycap->height = peasycap_format->v4l2_format.fmt.pix.height;
417 peasycap->width = peasycap_format->v4l2_format.fmt.pix.width;
418 peasycap->pixelformat = peasycap_format->v4l2_format.fmt.pix.pixelformat;
419 peasycap->field = peasycap_format->v4l2_format.fmt.pix.field;
420 peasycap->format_offset = (int)(peasycap_format - &easycap_format[0]);
421 peasycap->bytesperpixel = (0x00F0 & peasycap_format->mask) >> 4 ;
423 peasycap->byteswaporder = true;
425 peasycap->byteswaporder = false;
427 peasycap->decimatepixel = true;
429 peasycap->decimatepixel = false;
431 peasycap->offerfields = true;
433 peasycap->offerfields = false;
434 if (true == peasycap->decimatepixel)
438 peasycap->videofieldamount = multiplier * peasycap->width * \
439 multiplier * peasycap->height;
440 peasycap->frame_buffer_used = peasycap->bytesperpixel * \
441 peasycap->width * peasycap->height;
443 if (true == peasycap->offerfields) {
444 SAY("WARNING: %i=peasycap->field is untested: " \
445 "please report problems\n", peasycap->field);
453 kill_video_urbs(peasycap);
528 check_stk(peasycap->pusb_device);
533 int adjust_brightness(struct easycap *peasycap, int value)
538 if ((struct usb_device *)NULL == peasycap->pusb_device) {
539 SAY("ERROR: peasycap->pusb_device is NULL\n");
548 peasycap->brightness = value;
549 mood = 0x00FF & (unsigned int)peasycap->brightness;
551 set2to78(peasycap->pusb_device);
553 if (!write_saa(peasycap->pusb_device, 0x0A, mood)) {
562 set2to78(peasycap->pusb_device);
572 int adjust_contrast(struct easycap *peasycap, int value)
577 if ((struct usb_device *)NULL == peasycap->pusb_device) {
578 SAY("ERROR: peasycap->pusb_device is NULL\n");
587 peasycap->contrast = value;
588 mood = 0x00FF & (unsigned int) (peasycap->contrast - 128);
590 set2to78(peasycap->pusb_device);
592 if (!write_saa(peasycap->pusb_device, 0x0B, mood)) {
601 set2to78(peasycap->pusb_device);
611 int adjust_saturation(struct easycap *peasycap, int value)
616 if ((struct usb_device *)NULL == peasycap->pusb_device) {
617 SAY("ERROR: peasycap->pusb_device is NULL\n");
626 peasycap->saturation = value;
627 mood = 0x00FF & (unsigned int) (peasycap->saturation - 128);
629 set2to78(peasycap->pusb_device);
631 if (!write_saa(peasycap->pusb_device, 0x0C, mood)) {
641 set2to78(peasycap->pusb_device);
650 int adjust_hue(struct easycap *peasycap, int value)
655 if ((struct usb_device *)NULL == peasycap->pusb_device) {
656 SAY("ERROR: peasycap->pusb_device is NULL\n");
665 peasycap->hue = value;
666 i2 = peasycap->hue - 128;
669 set2to78(peasycap->pusb_device);
671 if (!write_saa(peasycap->pusb_device, 0x0D, mood)) {
679 set2to78(peasycap->pusb_device);
689 int adjust_volume(struct easycap *peasycap, int value)
694 if ((struct usb_device *)NULL == peasycap->pusb_device) {
695 SAY("ERROR: peasycap->pusb_device is NULL\n");
704 peasycap->volume = value;
705 mood = (16 > peasycap->volume) ? 16 : \
706 ((31 < peasycap->volume) ? 31 : \
707 (__s8) peasycap->volume);
708 if (!audio_gainset(peasycap->pusb_device, mood)) {
727 * usb_set_interface(peasycap->pusb_device, \
728 * peasycap->audio_interface, \
729 * peasycap->audio_altsetting_off);
735 int adjust_mute(struct easycap *peasycap, int value)
739 if ((struct usb_device *)NULL == peasycap->pusb_device) {
740 SAY("ERROR: peasycap->pusb_device is NULL\n");
746 peasycap->mute = value;
747 switch (peasycap->mute) {
749 peasycap->audio_idle = 1;
750 peasycap->timeval0.tv_sec = 0;
751 SAY("adjusting mute: %i=peasycap->audio_idle\n", \
752 peasycap->audio_idle);
756 peasycap->audio_idle = 0;
757 SAY("adjusting mute: %i=peasycap->audio_idle\n", \
758 peasycap->audio_idle);
774 static struct easycap *peasycap;
778 peasycap = file->private_data;
779 if (NULL == peasycap) {
780 SAY("ERROR: peasycap is NULL\n");
783 p = peasycap->pusb_device;
785 SAY("ERROR: peasycap->pusb_device is NULL\n");
844 if (usb_make_path(peasycap->pusb_device, &v4l2_capability.bus_info[0],\
965 index = (__u32)peasycap->input;
987 if ((int)index == peasycap->input) {
996 peasycap->input = (int)index;
998 select_input(peasycap->pusb_device, peasycap->input, 9);
1087 v4l2_control.value = peasycap->brightness;
1092 v4l2_control.value = peasycap->contrast;
1097 v4l2_control.value = peasycap->saturation;
1102 v4l2_control.value = peasycap->hue;
1107 v4l2_control.value = peasycap->volume;
1112 if (1 == peasycap->mute)
1154 if (0 != adjust_brightness(peasycap, v4l2_control.value))
1160 if (0 != adjust_contrast(peasycap, v4l2_control.value))
1166 if (0 != adjust_saturation(peasycap, v4l2_control.value))
1172 if (0 != adjust_hue(peasycap, v4l2_control.value))
1178 if (0 != adjust_volume(peasycap, v4l2_control.value))
1191 if (0 != adjust_mute(peasycap, mute))
1313 &(easycap_format[peasycap->format_offset]\
1316 &easycap_format[peasycap->format_offset].name[0]);
1347 best_format = adjust_format(peasycap, \
1391 v4l2_cropcap.bounds.width = peasycap->width;
1392 v4l2_cropcap.bounds.height = peasycap->height;
1395 v4l2_cropcap.defrect.width = peasycap->width;
1396 v4l2_cropcap.defrect.height = peasycap->height;
1400 JOT(8, "user is told: %ix%i\n", peasycap->width, peasycap->height);
1486 peasycap_standard = &easycap_standard[peasycap->standard_offset];
1512 rc = adjust_standard(peasycap, std_id);
1552 peasycap->frame_buffer_many = nbuffers;
1568 if (peasycap->video_eof) {
1570 peasycap->video_eof);
1583 if (index < 0 || index >= peasycap->frame_buffer_many)
1588 v4l2_buffer.bytesused = peasycap->frame_buffer_used;
1590 peasycap->done[index] | \
1591 peasycap->queued[index];
1592 v4l2_buffer.field = peasycap->field;
1633 (v4l2_buffer.index >= peasycap->frame_buffer_many))
1637 peasycap->done[v4l2_buffer.index] = 0;
1638 peasycap->queued[v4l2_buffer.index] = V4L2_BUF_FLAG_QUEUED;
1649 peasycap->frame_lock = 0;
1669 if ((peasycap->video_idle) || (peasycap->video_eof)) {
1672 peasycap->video_idle, peasycap->video_eof);
1685 if (!peasycap->video_isoc_streaming) {
1692 * THE FLAG peasycap->polled SET, THERE MUST BE NO FURTHER WAIT HERE. IN THIS
1693 * CASE, JUST CHOOSE THE FRAME INDICATED BY peasycap->frame_read
1697 if (!peasycap->polled) {
1698 if (-EIO == easycap_dqbuf(peasycap, 0))
1701 if (peasycap->video_eof)
1704 if (V4L2_BUF_FLAG_DONE != peasycap->done[peasycap->frame_read]) {
1706 peasycap->done[peasycap->frame_read]);
1708 peasycap->polled = 0;
1712 peasycap->merit[i] = peasycap->merit[i+1];
1713 peasycap->merit[179] = merit_saa(peasycap->pusb_device);
1716 j += peasycap->merit[i];
1720 peasycap->video_eof = 1; peasycap->audio_eof = 1;
1724 v4l2_buffer.index = peasycap->frame_read;
1726 v4l2_buffer.bytesused = peasycap->frame_buffer_used;
1728 v4l2_buffer.field = peasycap->field;
1731 0x000F & (peasycap->\
1732 frame_buffer[peasycap->frame_read][0].kount);
1737 if (!peasycap->timeval0.tv_sec) {
1743 if (mutex_lock_interruptible(&(peasycap->mutex_timeval0)))
1745 peasycap->timeval0 = timeval0;
1746 mutex_unlock(&(peasycap->mutex_timeval0));
1748 if (mutex_lock_interruptible(&(peasycap->mutex_timeval1)))
1750 dnbydt = peasycap->dnbydt;
1751 timeval1 = peasycap->timeval1;
1752 mutex_unlock(&(peasycap->mutex_timeval1));
1803 peasycap->frame_read);
1804 peasycap->frame_lock = 1;
1805 if (peasycap->frame_read == peasycap->frame_fill) {
1806 if (peasycap->frame_lock) {
1827 peasycap->merit[i] = 0;
1828 if ((struct usb_device *)NULL == peasycap->pusb_device) {
1829 SAY("ERROR: peasycap->pusb_device is NULL\n");
1832 submit_video_urbs(peasycap);
1833 peasycap->video_idle = 0;
1834 peasycap->audio_idle = 0;
1835 peasycap->video_eof = 0;
1836 peasycap->audio_eof = 0;
1843 if ((struct usb_device *)NULL == peasycap->pusb_device) {
1844 SAY("ERROR: peasycap->pusb_device is NULL\n");
1848 peasycap->video_idle = 1;
1849 peasycap->audio_idle = 1; peasycap->timeval0.tv_sec = 0;
1857 wake_up_interruptible(&(peasycap->wq_video));
1858 wake_up_interruptible(&(peasycap->wq_audio));
1882 v4l2_streamparm.parm.capture.readbuffers = peasycap->frame_buffer_many;
1955 struct easycap *peasycap;
1958 peasycap = file->private_data;
1959 if (NULL == peasycap) {
1960 SAY("ERROR: peasycap is NULL.\n");
1963 p = peasycap->pusb_device;
1971 if (true == peasycap->microphone)
1976 if (true == peasycap->microphone)
1991 if (true == peasycap->microphone)
1996 if (true == peasycap->microphone)
2014 if (true == peasycap->microphone)
2019 if (true == peasycap->microphone)
2044 if (true == peasycap->microphone)
2049 if (true == peasycap->microphone)
2067 if (true == peasycap->microphone)
2072 if (true == peasycap->microphone)
2115 incoming = peasycap->audio_bytes_per_fragment;
2125 audio_buf_info.bytes = peasycap->audio_bytes_per_fragment;