kopete/libkopete
videodevice.cpp
  
Go to the documentation of this file.
   78             for (quint32 k = V4L2_CID_BASE; k < V4L2_CID_LASTP1; k++) // NOTE: DO NOT USE qctrl.id DIRECTLY !
  402 // Detect maximum and minimum resolution supported by the V4L2 device. VIDIOC_ENUM_FRAMESIZES is still experimental.
  415                 kDebug() << "Detecting maximum size with VIDIOC_S_FMT failed (" << errno << ").Returned maxwidth: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
  433                 kDebug() << "Detecting minimum size with VIDIOC_S_FMT failed (" << errno << ").Returned maxwidth: " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
  467                     kDebug() << "Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.type & V4L2_INPUT_TYPE_TUNER) != 0) << ")";
  482 // V4L-only drivers should return an EINVAL in errno to indicate they cannot handle V4L2 calls. Not every driver is compliant, so
  537 //                      kDebug() << "libkopete (avdevice): Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.flags & VIDEO_VC_TUNER) != 0) << ")";
  632             kDebug() << "Input " << loop << ": " << m_input[loop].name << " (tuner: " << m_input[loop].hastuner << ")";
  772 // It should not be there. It must remain in a completely distict place, cause this method should not change the pixelformat.
  773 // It shouldn't try to find a suitable pixel format this way. It should use values discovered by - detectPixelFormats() - to choose a valid one.
  805                                                 kDebug() <<  "Device doesn't seem to support BGR32 format. Fallback to it is not yet implemented.";
  826 //kDebug() << "width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << width() << "x" << height();
  836                     kDebug() << "VIDIOC_G_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
  844                     kDebug() << "VIDIOC_S_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
  851 kDebug() << "VIDIOC_S_FMT worked (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
  887 kDebug() << "------------- width: " << V4L_videowindow.width << " Height: " << V4L_videowindow.height << " Clipcount: " << V4L_videowindow.clipcount << " -----------------";
  892 //              kDebug() << "libkopete (avdevice): V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
  895                     kDebug() << "libkopete (avdevice): VIDIOCGFBUF failed (" << errno << "): Device cannot stream";*/
  906 kDebug() << "------------------------- ------- -- m_buffer_size: " << m_buffer_size << " !!! -- ------- -----------------------------------------";
  954 //              kDebug() << "VIDIOC_G_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
  962 //              kDebug() << "VIDIOC_S_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
  966                 if (fmt.fmt.pix.pixelformat == (unsigned int) pixelFormatCode(newformat)) // Thih "if" (not what is contained within) is a fix for a bug in sn9c102 driver.
  982 //          kDebug() << "V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
  987 //              kDebug() << "Device seems to not support " << pixelFormatName(newformat) << " format. Fallback to it is not yet implemented.";
  995 //          kDebug() << "V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
 1169 //              kDebug() << "Using IO_METHOD_READ.File descriptor: " << descriptor << " Buffer address: " << &m_currentbuffer.data[0] << " Size: " << m_currentbuffer.data.size();
 1190                     kDebug() << "IO_METHOD_READ returned less bytes (" << bytesread << ") than it was asked for (" << m_currentbuffer.data.size() <<").";
 1211 // kDebug() << "m_rawbuffers[" << v4l2buffer.index << "].start: " << (void *)m_rawbuffers[v4l2buffer.index].start << "   Size: " << m_currentbuffer.data.size();
 1219                     kDebug() <<  "Buffer size mismatch: expecting raw buffer length to be" << m_currentbuffer.data.size() << "but it was" << m_rawbuffers[v4l2buffer.index].length;
 1223                 memcpy(&m_currentbuffer.data[0], m_rawbuffers[v4l2buffer.index].start, m_currentbuffer.data.size());
 1251                         if (v4l2buffer.m.userptr == (unsigned long) m_rawbuffers[i].start && v4l2buffer.length == m_rawbuffers[i].length)
 1298         //there is no data so if we continue something will try access it (as in bug 161536) and crash kopete
 1299         //perhaps we should look at having the interface reflect when the camera isn't available? as it thinks
 1316                     bits[loop]   = (m_currentbuffer.data[step]>>5<<5)+(m_currentbuffer.data[step]>>5<<2)+(m_currentbuffer.data[step]>>6);
 1317                     bits[loop+1] = (m_currentbuffer.data[step]>>2<<5)+(m_currentbuffer.data[step]<<3>>5<<2)+(m_currentbuffer.data[step]<<3>>6);
 1318                     bits[loop+2] = (m_currentbuffer.data[step]<<6)+(m_currentbuffer.data[step]<<6>>2)+(m_currentbuffer.data[step]<<6>>4)+(m_currentbuffer.data[step]<<6>>6);
 1538     if (m_input[m_current_input].img_softcorr_autobrightnesscontrast || m_input[m_current_input].img_softcorr_autocolor)
 1563         if (Rmin > Gmin) globalmin = Gmin; else globalmin = Rmin; if (Bmin < globalmin) globalmin = Bmin;
 1564         if (Rmax > Gmax) globalmax = Rmax; else globalmax = Gmax; if (Bmax > globalmax) globalmax = Bmax;
 1565 // If no color correction should be performed, simply level all the intensities so they're just the same.
 1566 // In fact color correction should use the R, G and B variables to detect color deviation and "bump up" the saturation,
 1567 // but it's computationally more expensive and the current way returns better results to the user.
 1581         kDebug() << " R: " << R << " G: " << G << " B: " << B << " A: " << A << " global: " << global <<
 1582             " Rmin: " << Rmin << " Gmin: " << Gmin << " Bmin: " << Bmin << " Amin: " << Amin << " globalmin: " << globalmin <<
 1583             " Rmax: " << Rmax << " Gmax: " << Gmax << " Bmax: " << Bmax << " Amax: " << Amax << " globalmax: " << globalmax ;
 1594     if (m_input[m_current_input].img_softcorr_vflip || m_input[m_current_input].img_softcorr_hflip)
 1595         *qimage = qimage->mirrored(m_input[m_current_input].img_softcorr_vflip, m_input[m_current_input].img_softcorr_hflip);
 2018                 kDebug() << "Device seems to not support adjusting image brightness. Fallback to it is not yet implemented.";
 2424                     kDebug () << fmtdesc.pixelformat << "  " << pixelFormatName(fmtdesc.pixelformat); // Need a cleanup. PixelFormatForPalette is a really bad name
 2431 // TODO: THis thing can be used to detec what pixel formats are supported in a API-independent way, but V4L2 has VIDIOC_ENUM_PIXFMT.
 2432 // The correct thing to do is to isolate these calls and do a proper implementation for V4L and another for V4L2 when this thing will be migrated to a plugin architecture.
 2436             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB332))  { kDebug() << pixelFormatName(PIXELFORMAT_RGB332); }
 2437             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB444))  { kDebug() << pixelFormatName(PIXELFORMAT_RGB444); }
 2438             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB555))  { kDebug() << pixelFormatName(PIXELFORMAT_RGB555); }
 2439             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB565))  { kDebug() << pixelFormatName(PIXELFORMAT_RGB565); }
 2440             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB555X)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB555X); }
 2441             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB565X)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB565X); }
 2442             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_BGR24))   { kDebug() << pixelFormatName(PIXELFORMAT_BGR24); }
 2443             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB24))   { kDebug() << pixelFormatName(PIXELFORMAT_RGB24); }
 2444             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_BGR32))   { kDebug() << pixelFormatName(PIXELFORMAT_BGR32); }
 2445             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB32))   { kDebug() << pixelFormatName(PIXELFORMAT_RGB32); }
 2448             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_SBGGR8))  { kDebug() << pixelFormatName(PIXELFORMAT_SBGGR8); }
 2451             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_GREY))    { kDebug() << pixelFormatName(PIXELFORMAT_GREY); }
 2452             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUYV))    { kDebug() << pixelFormatName(PIXELFORMAT_YUYV); }
 2453             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_UYVY))    { kDebug() << pixelFormatName(PIXELFORMAT_UYVY); }
 2454             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUV420P)) { kDebug() << pixelFormatName(PIXELFORMAT_YUV420P); }
 2455             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUV422P)) { kDebug() << pixelFormatName(PIXELFORMAT_YUV422P); }
 2458             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_JPEG))    { kDebug() << pixelFormatName(PIXELFORMAT_JPEG); }
 2459             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_MPEG))    { kDebug() << pixelFormatName(PIXELFORMAT_MPEG); }
 2462             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_DV))      { kDebug() << pixelFormatName(PIXELFORMAT_DV); }
 2463             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_ET61X251))    { kDebug() << pixelFormatName(PIXELFORMAT_ET61X251); }
 2464             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_HI240))   { kDebug() << pixelFormatName(PIXELFORMAT_HI240); }
 2465             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_HM12))    { kDebug() << pixelFormatName(PIXELFORMAT_HM12); }
 2466             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_MJPEG))   { kDebug() << pixelFormatName(PIXELFORMAT_MJPEG); }
 2467             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_PWC1))    { kDebug() << pixelFormatName(PIXELFORMAT_PWC1); }
 2468             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_PWC2))    { kDebug() << pixelFormatName(PIXELFORMAT_PWC2); }
 2469             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_SN9C10X)) { kDebug() << pixelFormatName(PIXELFORMAT_SN9C10X); }
 2470             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_WNVA))    { kDebug() << pixelFormatName(PIXELFORMAT_WNVA); }
 2471             if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YYUV))    { kDebug() << pixelFormatName(PIXELFORMAT_YYUV); }
 2555                 case STANDARD_PAL_M : return 5; break;  // Undocumented value found to be compatible with V4L bttv driver
 2556                 case STANDARD_PAL_N : return 6; break;  // Undocumented value found to be compatible with V4L bttv driver
 2557                 case STANDARD_PAL_Nc    : return 4; break;  // Undocumented value found to be compatible with V4L bttv driver
 2561                 case STANDARD_NTSC_M_JP : return 7; break;  // Undocumented value found to be compatible with V4L bttv driver
 2690                 case V4L2_STD_NTSC_443  : returnvalue = signalStandardName(STANDARD_NTSC_443);  break; // Commented out because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
 2691                 case V4L2_STD_NTSC_M_KR : returnvalue = signalStandardName(STANDARD_NTSC_M_KR); break; // Commented out because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
 2732                 case VIDEO_MODE_AUTO    : returnvalue = signalStandardName(STANDARD_ALL);   break;  // It must be disabled until I find a correct way to handle those non-standard bttv modes
 2733 //              case VIDEO_MODE_PAL_Nc  : returnvalue = signalStandardName(STANDARD_PAL_Nc);    break;  // Undocumented value found to be compatible with V4L bttv driver
 2734                 case VIDEO_MODE_PAL_M   : returnvalue = signalStandardName(STANDARD_PAL_M); break;  // Undocumented value found to be compatible with V4L bttv driver
 2735                 case VIDEO_MODE_PAL_N   : returnvalue = signalStandardName(STANDARD_PAL_N); break;  // Undocumented value found to be compatible with V4L bttv driver
 2736                 case VIDEO_MODE_NTSC_JP : returnvalue = signalStandardName(STANDARD_NTSC_M_JP); break;  // Undocumented value found to be compatible with V4L bttv driver
 2913             m_rawbuffers[m_streambuffers].start = (uchar *) v4l2_mmap (NULL /* start anywhere */, v4l2buffer.length, PROT_READ | PROT_WRITE /* required */, MAP_SHARED /* recommended */, descriptor, v4l2buffer.m.offset);
 2915             m_rawbuffers[m_streambuffers].start = (uchar *) mmap (NULL /* start anywhere */, v4l2buffer.length, PROT_READ | PROT_WRITE /* required */, MAP_SHARED /* recommended */, descriptor, v4l2buffer.m.offset);
 2922         m_currentbuffer.data.resize(m_rawbuffers[0].length); // Makes the imagesize.data buffer size equal to the rawbuffer size
 3031 #if (defined(__linux__) || defined(__FreeBSD__)) && defined(ENABLE_AV)  && defined(V4L2_CAP_VIDEO_CAPTURE)
QVector< Kopete::AV::VideoInput > m_input
Definition: videodevice.h:338
Definition: videodevice.h:215
Definition: videodevice.h:175
Definition: videodevice.h:117
Definition: videodevice.h:152
virtual pixel_format setPixelFormat(pixel_format newformat)
Definition: videodevice.cpp:940
QList< ActionVideoControl > getSupportedActionControls()
Returns the supported action-controls for the current input. 
Definition: videodevice.cpp:1722
Definition: videodevice.h:151
#define BUFFERS
Definition: videodevice.h:126
Definition: videodevice.h:113
Definition: videodevice.h:138
Definition: videodevice.h:200
Definition: videodevice.h:153
Definition: videodevice.h:211
Definition: videodevice.h:255
Definition: videodevice.h:110
Definition: videodevice.h:188
Definition: videodevice.h:107
void setupControls()
Sets up the supported video-controls for the current input. 
Definition: videodevice.cpp:59
int setFileName(QString filename)
Definition: videodevice.cpp:303
QList< NumericVideoControl > m_numericCtrls
Definition: videodevice.h:360
int getControlValue(quint32 ctrl_id, qint32 *value)
Reads the value of a video-control. 
Definition: videodevice.cpp:1736
Definition: videodevice.h:196
Definition: videodevice.h:186
Definition: videodevice.h:162
QString pixelFormatName(pixel_format pixelformat)
Definition: videodevice.cpp:2269
Definition: videodevice.h:201
QList< ActionVideoControl > m_actionCtrls
Definition: videodevice.h:363
Definition: videodevice.h:194
Definition: videodevice.h:141
Definition: videodevice.h:176
int setControlValue(quint32 ctrl_id, qint32 value)
Sets the value of a video-control. 
Definition: videodevice.cpp:1878
Definition: videodevice.h:156
virtual int getImage(QImage *qimage)
Definition: videodevice.cpp:1288
int showDeviceCapabilities()
Definition: videodevice.cpp:568
QList< MenuVideoControl > getSupportedMenuControls()
Returns the supported menu-controls for the current input. 
Definition: videodevice.cpp:1712
Definition: videodevice.h:109
virtual int setSize(int newwidth, int newheight)
Definition: videodevice.cpp:767
Definition: videodevice.h:199
Definition: videodevice.h:134
Definition: videodevice.h:115
I18N_NOOP("Target KB")
Definition: videodevice.h:191
int sonix_decompress(int width, int height, unsigned char *inp, unsigned char *outp)
Definition: sonix_compress.cpp:111
Definition: videodevice.h:160
Definition: videodevice.h:112
Definition: videodevice.h:209
Definition: videodevice.h:170
__u64 signalStandardCode(signal_standard standard)
Definition: videodevice.cpp:2481
QList< BooleanVideoControl > getSupportedBooleanControls()
Returns the supported boolean controls for the current input. 
Definition: videodevice.cpp:1702
Definition: videodevice.h:154
Definition: videodevice.h:161
Definition: videodevice.h:114
Definition: videodevice.h:93
Definition: videodevice.h:143
Definition: videodevice.h:130
Definition: videodevice.h:136
Definition: videodevice.h:124
Definition: videodevice.h:155
Definition: videodevice.h:195
Definition: videodevice.h:177
Definition: videodevice.h:245
QList< MenuVideoControl > m_menuCtrls
Definition: videodevice.h:362
int detectSignalStandards()
Definition: videodevice.cpp:2752
Definition: videodevice.h:127
Definition: videodevice.h:179
Definition: videodevice.h:140
Definition: videodevice.h:142
Definition: videodevice.h:204
Definition: videodevice.h:118
pixel_format pixelFormatForPalette(int palette)
Definition: videodevice.cpp:2031
Definition: videodevice.h:158
Definition: videodevice.h:139
int pixelFormatDepth(pixel_format pixelformat)
Definition: videodevice.cpp:2222
Definition: videodevice.h:108
int pixelFormatCode(pixel_format pixelformat)
Definition: videodevice.cpp:2113
Definition: videodevice.h:168
Definition: videodevice.h:137
Definition: videodevice.h:210
Definition: videodevice.h:203
Definition: videodevice.h:121
void bayer2rgb24(unsigned char *dst, unsigned char *src, long int WIDTH, long int HEIGHT)
Definition: bayer.cpp:29
Definition: videodevice.h:178
Definition: videodevice.h:182
Definition: videodevice.h:187
Definition: videodevice.h:163
QString signalStandardName(signal_standard standard)
Definition: videodevice.cpp:2606
Definition: videodevice.h:111
Definition: videodevice.h:172
Definition: videodevice.h:189
Definition: videodevice.h:166
Definition: videodevice.h:190
Definition: videodevice.h:131
Definition: videodevice.h:116
Definition: videodevice.h:167
Definition: videoinput.h:42
Definition: videodevice.h:212
Definition: videodevice.h:125
Definition: videodevice.h:157
Definition: videodevice.h:174
Definition: videodevice.h:197
QList< BooleanVideoControl > m_booleanCtrls
Definition: videodevice.h:361
Definition: videodevice.h:173
QList< NumericVideoControl > getSupportedNumericControls()
Returns the supported numeric controls for the current input. 
Definition: videodevice.cpp:1692
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
            Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
    KDE API Reference