aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Fabio Bas2009-11-15 21:26:09 +0000
committerGravatar Fabio Bas2009-11-15 21:26:09 +0000
commit30a765acc3dd9698d3fcb65e90c74e34e77b896c (patch)
treefa95dcc0bbd4bbb84c71a91dd9fc80a1449d9b85
parentfix for #611 (diff)
downloadKVIrc-30a765acc3dd9698d3fcb65e90c74e34e77b896c.tar.gz
KVIrc-30a765acc3dd9698d3fcb65e90c74e34e77b896c.tar.bz2
KVIrc-30a765acc3dd9698d3fcb65e90c74e34e77b896c.zip
porting && cleaning of avdevice code
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3615 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--src/kvilib/ext/avdevice/kopete_export.h7
-rw-r--r--src/kvilib/ext/avdevice/videodevice.cpp444
-rw-r--r--src/kvilib/ext/avdevice/videodevice.h17
-rw-r--r--src/kvilib/ext/avdevice/videodevicemodelpool.cpp4
-rw-r--r--src/kvilib/ext/avdevice/videodevicemodelpool.h6
-rw-r--r--src/kvilib/ext/avdevice/videodevicepool.cpp143
-rw-r--r--src/kvilib/ext/avdevice/videodevicepool.h10
-rw-r--r--src/kvilib/ext/avdevice/videoinput.cpp36
-rw-r--r--src/kvilib/ext/avdevice/videoinput.h7
9 files changed, 331 insertions, 343 deletions
diff --git a/src/kvilib/ext/avdevice/kopete_export.h b/src/kvilib/ext/avdevice/kopete_export.h
deleted file mode 100644
index fbeca4449..000000000
--- a/src/kvilib/ext/avdevice/kopete_export.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#define KOPETE_EXPORT
-
-#define __linux__ 1
-#define ENABLE_AV
-
-#include <QDebug>
-#define kDebug qDebug
diff --git a/src/kvilib/ext/avdevice/videodevice.cpp b/src/kvilib/ext/avdevice/videodevice.cpp
index 3926c0f51..941ea2a7b 100644
--- a/src/kvilib/ext/avdevice/videodevice.cpp
+++ b/src/kvilib/ext/avdevice/videodevice.cpp
@@ -41,12 +41,12 @@
*************************************************************************
*/
-#define ENABLE_AV
-
#include <cstdlib>
#include <cerrno>
#include <cstring>
+#include <QDebug>
+
#include "videoinput.h"
#include "videodevice.h"
@@ -61,11 +61,11 @@ namespace AV {
VideoDevice::VideoDevice()
{
-// kDebug() << "libkopete (avdevice): VideoDevice() called";
+// qDebug() << "libkopete (avdevice): VideoDevice() called";
descriptor = -1;
m_streambuffers = 0;
m_current_input = 0;
-// kDebug() << "libkopete (avdevice): VideoDevice() exited successfuly";
+// qDebug() << "libkopete (avdevice): VideoDevice() exited successfuly";
}
@@ -86,7 +86,7 @@ void VideoDevice::enumerateControls (void)
int currentid = V4L2_CID_BASE;
-kDebug() << "Checking CID controls";
+qDebug() << "Checking CID controls";
for (currentid = V4L2_CID_BASE; currentid < V4L2_CID_LASTP1; currentid++)
//for (queryctrl.id = 9963776; queryctrl.id < 9963800; queryctrl.id++)
@@ -97,7 +97,7 @@ kDebug() << "Checking CID controls";
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
continue;
-kDebug() << " Control: " << QString::fromLocal8Bit((const char*)queryctrl.name) << " Values from " << queryctrl.minimum << " to " << queryctrl.maximum << " with steps of " << queryctrl.step << ". Default: " << queryctrl.default_value;
+qDebug() << " Control: " << QString::fromLocal8Bit((const char*)queryctrl.name) << " Values from " << queryctrl.minimum << " to " << queryctrl.maximum << " with steps of " << queryctrl.step << ". Default: " << queryctrl.default_value;
// switch (queryctrl.type)
// {
@@ -116,7 +116,7 @@ kDebug() << " Control: " << QString::fromLocal8Bit((const char*)queryctrl.name)
}
}
-kDebug() << "Checking CID private controls";
+qDebug() << "Checking CID private controls";
for (currentid = V4L2_CID_PRIVATE_BASE;; currentid++)
{
@@ -126,7 +126,7 @@ kDebug() << "Checking CID private controls";
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
continue;
-kDebug() << " Control: " << QString::fromLocal8Bit((const char*)queryctrl.name) << " Values from " << queryctrl.minimum << " to " << queryctrl.maximum << " with steps of " << queryctrl.step << ". Default: " << queryctrl.default_value;
+qDebug() << " Control: " << QString::fromLocal8Bit((const char*)queryctrl.name) << " Values from " << queryctrl.minimum << " to " << queryctrl.maximum << " with steps of " << queryctrl.step << ". Default: " << queryctrl.default_value;
if (queryctrl.type == V4L2_CTRL_TYPE_MENU)
enumerateMenu ();
@@ -144,7 +144,7 @@ kDebug() << " Control: " << QString::fromLocal8Bit((const char*)queryctrl.name)
void VideoDevice::enumerateMenu (void)
{
- kDebug() << " Menu items:";
+ qDebug() << " Menu items:";
memset (&querymenu, 0, sizeof (querymenu));
querymenu.id = queryctrl.id;
@@ -153,7 +153,7 @@ void VideoDevice::enumerateMenu (void)
{
if (0 == xioctl (VIDIOC_QUERYMENU, &querymenu))
{
- kDebug() << " " << QString::fromLocal8Bit((const char*)querymenu.name);
+ qDebug() << " " << QString::fromLocal8Bit((const char*)querymenu.name);
}
else
{
@@ -207,10 +207,10 @@ int VideoDevice::open()
{
/// @todo implement me
- kDebug() << "called";
+ qDebug() << "called";
if(-1 != descriptor)
{
- kDebug() << "Device is already open";
+ qDebug() << "Device is already open";
return EXIT_SUCCESS;
}
#ifdef HAVE_LIBV4L2
@@ -220,23 +220,23 @@ int VideoDevice::open()
#endif
if(isOpen())
{
- kDebug() << "File " << full_filename << " was opened successfuly";
+ qDebug() << "File " << full_filename << " was opened successfuly";
if(EXIT_FAILURE==checkDevice())
{
- kDebug() << "File " << full_filename << " could not be opened";
+ qDebug() << "File " << full_filename << " could not be opened";
close();
return EXIT_FAILURE;
}
}
else
{
- kDebug() << "Unable to open file " << full_filename << "Err: "<< errno;
+ qDebug() << "Unable to open file " << full_filename << "Err: "<< errno;
return EXIT_FAILURE;
}
initDevice();
selectInput(m_current_input);
- kDebug() << "exited successfuly";
+ qDebug() << "exited successfuly";
return EXIT_SUCCESS;
}
@@ -244,16 +244,16 @@ bool VideoDevice::isOpen()
{
if(-1 == descriptor)
{
-// kDebug() << "VideoDevice::isOpen() File is not open";
+// qDebug() << "VideoDevice::isOpen() File is not open";
return false;
}
-// kDebug() << "VideoDevice::isOpen() File is open";
+// qDebug() << "VideoDevice::isOpen() File is open";
return true;
}
int VideoDevice::checkDevice()
{
- kDebug() << "checkDevice() called.";
+ qDebug() << "checkDevice() called.";
if(isOpen())
{
m_videocapture=false;
@@ -265,7 +265,7 @@ int VideoDevice::checkDevice()
m_videostream=false;
m_driver=VIDEODEV_DRIVER_NONE;
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
CLEAR(V4L2_capabilities);
@@ -274,12 +274,12 @@ int VideoDevice::checkDevice()
{
if (!(V4L2_capabilities.capabilities & V4L2_CAP_VIDEO_CAPTURE))
{
- kDebug() << "checkDevice(): " << full_filename << " is not a video capture device.";
+ qDebug() << "checkDevice(): " << full_filename << " is not a video capture device.";
m_driver = VIDEODEV_DRIVER_NONE;
return EXIT_FAILURE;
}
m_videocapture=true;
- kDebug() << "checkDevice(): " << full_filename << " is a V4L2 device.";
+ qDebug() << "checkDevice(): " << full_filename << " is a V4L2 device.";
m_driver = VIDEODEV_DRIVER_V4L2;
m_model=QString::fromLocal8Bit((const char*)V4L2_capabilities.card);
@@ -289,7 +289,7 @@ int VideoDevice::checkDevice()
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == xioctl (VIDIOC_G_FMT, &fmt))
{
- kDebug() << "VIDIOC_G_FMT failed (" << errno << ").";
+ qDebug() << "VIDIOC_G_FMT failed (" << errno << ").";
}
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = 32767;
@@ -297,7 +297,7 @@ int VideoDevice::checkDevice()
fmt.fmt.pix.field = V4L2_FIELD_ANY;
if (-1 == xioctl (VIDIOC_S_FMT, &fmt))
{
- 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;
+ qDebug() << "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;
// Note VIDIOC_S_FMT may change width and height.
}
else
@@ -307,7 +307,7 @@ int VideoDevice::checkDevice()
}
if (-1 == xioctl (VIDIOC_G_FMT, &fmt))
{
- kDebug() << "VIDIOC_G_FMT failed (" << errno << ").";
+ qDebug() << "VIDIOC_G_FMT failed (" << errno << ").";
}
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = 1;
@@ -315,7 +315,7 @@ int VideoDevice::checkDevice()
fmt.fmt.pix.field = V4L2_FIELD_ANY;
if (-1 == xioctl (VIDIOC_S_FMT, &fmt))
{
- kDebug() << "Detecting minimum size with VIDIOC_S_FMT failed (" << errno << ").Returned maxwidth: " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
+ qDebug() << "Detecting minimum size with VIDIOC_S_FMT failed (" << errno << ").Returned maxwidth: " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
// Note VIDIOC_S_FMT may change width and height.
}
else
@@ -349,7 +349,7 @@ int VideoDevice::checkDevice()
detectSignalStandards();
tempinput.m_standards = videoinput.std;
m_input.push_back(tempinput);
- kDebug() << "Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.type & V4L2_INPUT_TYPE_TUNER) != 0) << ")";
+ qDebug() << "Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.type & V4L2_INPUT_TYPE_TUNER) != 0) << ")";
if((videoinput.type & V4L2_INPUT_TYPE_TUNER) != 0)
{
// _tunerForInput[name] = desc.tuner;
@@ -366,7 +366,7 @@ detectSignalStandards();
{
// V4L-only drivers should return an EINVAL in errno to indicate they cannot handle V4L2 calls. Not every driver is compliant, so
// it will try the V4L api even if the error code is different than expected.
- kDebug() << "checkDevice(): " << full_filename << " is not a V4L2 device.";
+ qDebug() << "checkDevice(): " << full_filename << " is not a V4L2 device.";
}
#endif
@@ -375,7 +375,7 @@ detectSignalStandards();
if(m_driver==VIDEODEV_DRIVER_NONE)
{
- kDebug() << "checkDevice(): " << full_filename << " Trying V4L API.";
+ qDebug() << "checkDevice(): " << full_filename << " Trying V4L API.";
if (-1 == xioctl (VIDIOCGCAP, &V4L_capabilities))
{
perror ("ioctl (VIDIOCGCAP)");
@@ -384,7 +384,7 @@ detectSignalStandards();
}
else
{
- kDebug() << full_filename << " is a V4L device.";
+ qDebug() << full_filename << " is a V4L device.";
m_driver = VIDEODEV_DRIVER_V4L;
m_model=QString::fromLocal8Bit((const char*)V4L_capabilities.name);
if(V4L_capabilities.type & VID_TYPE_CAPTURE)
@@ -395,8 +395,8 @@ detectSignalStandards();
m_videoscale=true;
if(V4L_capabilities.type & VID_TYPE_OVERLAY)
m_videooverlay=true;
-// kDebug() << "libkopete (avdevice): Inputs : " << V4L_capabilities.channels;
-// kDebug() << "libkopete (avdevice): Audios : " << V4L_capabilities.audios;
+// qDebug() << "libkopete (avdevice): Inputs : " << V4L_capabilities.channels;
+// qDebug() << "libkopete (avdevice): Audios : " << V4L_capabilities.audios;
minwidth = V4L_capabilities.minwidth;
maxwidth = V4L_capabilities.maxwidth;
minheight = V4L_capabilities.minheight;
@@ -419,7 +419,7 @@ detectSignalStandards();
tempinput.hastuner=videoinput.flags & VIDEO_VC_TUNER;
// TODO: The routine to detect the appropriate video standards for V4L must be placed here
m_input.push_back(tempinput);
-// kDebug() << "libkopete (avdevice): Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.flags & VIDEO_VC_TUNER) != 0) << ")";
+// qDebug() << "libkopete (avdevice): Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.flags & VIDEO_VC_TUNER) != 0) << ")";
/* if((input.type & V4L2_INPUT_TYPE_TUNER) != 0)
{
// _tunerForInput[name] = desc.tuner;
@@ -442,7 +442,7 @@ detectSignalStandards();
enumerateControls();
#endif
// TODO: Now we must execute the proper initialization according to the type of the driver.
- kDebug() << "checkDevice() exited successfuly.";
+ qDebug() << "checkDevice() exited successfuly.";
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -454,70 +454,70 @@ detectSignalStandards();
*/
int VideoDevice::showDeviceCapabilities()
{
- kDebug() << "showDeviceCapabilities() called.";
+ qDebug() << "showDeviceCapabilities() called.";
if(isOpen())
{
-/* kDebug() << "libkopete (avdevice): Driver: " << (const char*)V4L2_capabilities.driver << " "
+/* qDebug() << "libkopete (avdevice): Driver: " << (const char*)V4L2_capabilities.driver << " "
<< ((V4L2_capabilities.version>>16) & 0xFF) << "."
<< ((V4L2_capabilities.version>> 8) & 0xFF) << "."
<< ((V4L2_capabilities.version ) & 0xFF) << endl;
- kDebug() << "libkopete (avdevice): Device: " << name;
- kDebug() << "libkopete (avdevice): Capabilities:";
+ qDebug() << "libkopete (avdevice): Device: " << name;
+ qDebug() << "libkopete (avdevice): Capabilities:";
if(V4L2_capabilities.capabilities & V4L2_CAP_VIDEO_CAPTURE)
- kDebug() << "libkopete (avdevice): Video capture";
+ qDebug() << "libkopete (avdevice): Video capture";
if(V4L2_capabilities.capabilities & V4L2_CAP_VIDEO_OUTPUT)
- kDebug() << "libkopete (avdevice): Video output";
+ qDebug() << "libkopete (avdevice): Video output";
if(V4L2_capabilities.capabilities & V4L2_CAP_VIDEO_OVERLAY)
- kDebug() << "libkopete (avdevice): Video overlay";
+ qDebug() << "libkopete (avdevice): Video overlay";
if(V4L2_capabilities.capabilities & V4L2_CAP_VBI_CAPTURE)
- kDebug() << "libkopete (avdevice): VBI capture";
+ qDebug() << "libkopete (avdevice): VBI capture";
if(V4L2_capabilities.capabilities & V4L2_CAP_VBI_OUTPUT)
- kDebug() << "libkopete (avdevice): VBI output";
+ qDebug() << "libkopete (avdevice): VBI output";
if(V4L2_capabilities.capabilities & V4L2_CAP_RDS_CAPTURE)
- kDebug() << "libkopete (avdevice): RDS capture";
+ qDebug() << "libkopete (avdevice): RDS capture";
if(V4L2_capabilities.capabilities & V4L2_CAP_TUNER)
- kDebug() << "libkopete (avdevice): Tuner IO";
+ qDebug() << "libkopete (avdevice): Tuner IO";
if(V4L2_capabilities.capabilities & V4L2_CAP_AUDIO)
- kDebug() << "libkopete (avdevice): Audio IO";
+ qDebug() << "libkopete (avdevice): Audio IO";
;*/
- kDebug() << "Device model: " << m_model;
- kDebug() << "Device name : " << m_name;
- kDebug() << "Capabilities:";
+ qDebug() << "Device model: " << m_model;
+ qDebug() << "Device name : " << m_name;
+ qDebug() << "Capabilities:";
if(canCapture())
{
- kDebug() << " Video capture";
+ qDebug() << " Video capture";
}
if(canRead())
{
- kDebug() << " Read";
+ qDebug() << " Read";
}
if(canAsyncIO())
{
- kDebug() << " Asynchronous input/output";
+ qDebug() << " Asynchronous input/output";
}
if(canStream())
{
- kDebug() << " Streaming";
+ qDebug() << " Streaming";
}
if(canChromakey())
{
- kDebug() << " Video chromakey";
+ qDebug() << " Video chromakey";
}
if(canScale())
{
- kDebug() << " Video scales";
+ qDebug() << " Video scales";
}
if(canOverlay())
{
- kDebug() << " Video overlay";
+ qDebug() << " Video overlay";
}
-// kDebug() << "libkopete (avdevice): Audios : " << V4L_capabilities.audios;
- kDebug() << " Max res: " << maxWidth() << " x " << maxHeight();
- kDebug() << " Min res: " << minWidth() << " x " << minHeight();
- kDebug() << " Inputs : " << inputs();
+// qDebug() << "libkopete (avdevice): Audios : " << V4L_capabilities.audios;
+ qDebug() << " Max res: " << maxWidth() << " x " << maxHeight();
+ qDebug() << " Min res: " << minWidth() << " x " << minHeight();
+ qDebug() << " Inputs : " << inputs();
for (int loop=0; loop < inputs(); loop++)
- kDebug() << "Input " << loop << ": " << m_input[loop].name << " (tuner: " << m_input[loop].hastuner << ")";
- kDebug() << "showDeviceCapabilities() exited successfuly.";
+ qDebug() << "Input " << loop << ": " << m_input[loop].name << " (tuner: " << m_input[loop].hastuner << ")";
+ qDebug() << "showDeviceCapabilities() exited successfuly.";
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -529,39 +529,39 @@ int VideoDevice::showDeviceCapabilities()
int VideoDevice::initDevice()
{
/// @todo implement me
- kDebug() << "initDevice() started";
+ qDebug() << "initDevice() started";
if(-1 == descriptor)
{
- kDebug() << "initDevice() Device is not open";
+ qDebug() << "initDevice() Device is not open";
return EXIT_FAILURE;
}
m_io_method = IO_METHOD_NONE;
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
if(V4L2_capabilities.capabilities & V4L2_CAP_READWRITE)
{
m_videoread=true;
m_io_method = IO_METHOD_READ;
- kDebug() << " Read/Write interface";
+ qDebug() << " Read/Write interface";
}
if(V4L2_capabilities.capabilities & V4L2_CAP_ASYNCIO)
{
m_videoasyncio=true;
- kDebug() << " Async IO interface";
+ qDebug() << " Async IO interface";
}
if(V4L2_capabilities.capabilities & V4L2_CAP_STREAMING)
{
m_videostream=true;
m_io_method = IO_METHOD_MMAP;
// m_io_method = IO_METHOD_USERPTR;
- kDebug() << " Streaming interface";
+ qDebug() << " Streaming interface";
}
if(m_io_method==IO_METHOD_NONE)
{
- kDebug() << "initDevice() Found no suitable input/output method for " << full_filename;
+ qDebug() << "initDevice() Found no suitable input/output method for " << full_filename;
return EXIT_FAILURE;
}
break;
@@ -573,7 +573,7 @@ int VideoDevice::initDevice()
{
// m_videostream=true;
// m_io_method = IO_METHOD_MMAP;
- kDebug() << " Streaming interface";
+ qDebug() << " Streaming interface";
}
break;
#endif
@@ -584,7 +584,7 @@ int VideoDevice::initDevice()
}
// Select video input, video standard and tune here.
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (-1 == xioctl (VIDIOC_CROPCAP, &cropcap))
@@ -604,7 +604,7 @@ int VideoDevice::initDevice()
#endif
showDeviceCapabilities();
- kDebug() << "initDevice() exited successfuly";
+ qDebug() << "initDevice() exited successfuly";
return EXIT_SUCCESS;
}
@@ -646,42 +646,42 @@ int VideoDevice::maxHeight()
int VideoDevice::setSize( int newwidth, int newheight)
{
-kDebug() << "setSize(" << newwidth << ", " << newheight << ") called.";
+qDebug() << "setSize(" << newwidth << ", " << newheight << ") called.";
if(isOpen())
{
// It should not be there. It must remain in a completely distict place, cause this method should not change the pixelformat.
// It shouldn't try to find a suitable pixel format this way. It should use values discovered by - detectPixelFormats() - to choose a valid one.
- kDebug() << "Trying YUY422P";
+ qDebug() << "Trying YUY422P";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_YUV422P))
{
- kDebug() << "Device doesn't seem to support YUV422P format. Trying YUYV.";
+ qDebug() << "Device doesn't seem to support YUV422P format. Trying YUYV.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_YUYV))
{
- kDebug() << "Device doesn't seem to support YUYV format. Trying UYVY.";
+ qDebug() << "Device doesn't seem to support YUYV format. Trying UYVY.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_UYVY))
{
- kDebug() << "Device doesn't seem to support UYVY format. Trying YUV420P.";
+ qDebug() << "Device doesn't seem to support UYVY format. Trying YUV420P.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_YUV420P))
{
- kDebug() << "Device doesn't seem to support YUV420P format. Trying RGB24.";
+ qDebug() << "Device doesn't seem to support YUV420P format. Trying RGB24.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_RGB24))
{
- kDebug() << "Device doesn't seem to support RGB24 format. Trying BGR24.";
+ qDebug() << "Device doesn't seem to support RGB24 format. Trying BGR24.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_BGR24))
{
- kDebug() << "Device doesn't seem to support RGB24 format. Trying RGB32.";
+ qDebug() << "Device doesn't seem to support RGB24 format. Trying RGB32.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_RGB32))
{
- kDebug() << "Device doesn't seem to support RGB32 format. Trying BGR32.";
+ qDebug() << "Device doesn't seem to support RGB32 format. Trying BGR32.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_BGR32))
{
- kDebug() << "Device doesn't seem to support BGR32 format. Trying SBGGR8.";
+ qDebug() << "Device doesn't seem to support BGR32 format. Trying SBGGR8.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_SBGGR8))
{
- kDebug() << "Device doesn't seem to support SBGGR8 format. Trying SN9C10X.";
+ qDebug() << "Device doesn't seem to support SBGGR8 format. Trying SN9C10X.";
if(PIXELFORMAT_NONE == setPixelFormat(PIXELFORMAT_SN9C10X))
{
- kDebug() << "Device doesn't seem to support BGR32 format. Fallback to it is not yet implemented.";
+ qDebug() << "Device doesn't seem to support BGR32 format. Fallback to it is not yet implemented.";
}
}
}
@@ -701,17 +701,17 @@ kDebug() << "setSize(" << newwidth << ", " << newheight << ") called.";
currentwidth = newwidth;
currentheight = newheight;
-//kDebug() << "width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << width() << "x" << height();
+//qDebug() << "width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << width() << "x" << height();
// Change resolution for the video device
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
// CLEAR (fmt);
if (-1 == xioctl (VIDIOC_G_FMT, &fmt))
{
- kDebug() << "VIDIOC_G_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
+ qDebug() << "VIDIOC_G_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
}
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = width();
@@ -719,13 +719,13 @@ kDebug() << "setSize(" << newwidth << ", " << newheight << ") called.";
fmt.fmt.pix.field = V4L2_FIELD_ANY;
if (-1 == xioctl (VIDIOC_S_FMT, &fmt))
{
- kDebug() << "VIDIOC_S_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
+ qDebug() << "VIDIOC_S_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
// Note VIDIOC_S_FMT may change width and height.
}
else
{
// Buggy driver paranoia.
-kDebug() << "VIDIOC_S_FMT worked (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
+qDebug() << "VIDIOC_S_FMT worked (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
unsigned int min = fmt.fmt.pix.width * 2;
if (fmt.fmt.pix.bytesperline < min)
{
@@ -757,12 +757,12 @@ kDebug() << "VIDIOC_S_FMT worked (" << errno << ").Returned width: " << pixelFor
perror ("ioctl VIDIOCSWIN");
// return (NULL);
}
-kDebug() << "------------- width: " << V4L_videowindow.width << " Height: " << V4L_videowindow.height << " Clipcount: " << V4L_videowindow.clipcount << " -----------------";
+qDebug() << "------------- width: " << V4L_videowindow.width << " Height: " << V4L_videowindow.height << " Clipcount: " << V4L_videowindow.clipcount << " -----------------";
-// kDebug() << "libkopete (avdevice): V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
+// qDebug() << "libkopete (avdevice): V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
/* if(-1 == xioctl(VIDIOCGFBUF,&V4L_videobuffer))
- kDebug() << "libkopete (avdevice): VIDIOCGFBUF failed (" << errno << "): Device cannot stream";*/
+ qDebug() << "libkopete (avdevice): VIDIOCGFBUF failed (" << errno << "): Device cannot stream";*/
}
break;
@@ -772,7 +772,7 @@ kDebug() << "------------- width: " << V4L_videowindow.width << " Height: " << V
break;
}
m_buffer_size = width() * height() * pixelFormatDepth(m_pixelformat) / 8;
-kDebug() << "------------------------- ------- -- m_buffer_size: " << m_buffer_size << " !!! -- ------- -----------------------------------------";
+qDebug() << "------------------------- ------- -- m_buffer_size: " << m_buffer_size << " !!! -- ------- -----------------------------------------";
m_currentbuffer.pixelformat=m_pixelformat;
m_currentbuffer.data.resize(m_buffer_size);
@@ -785,10 +785,10 @@ kDebug() << "------------------------- ------- -- m_buffer_size: " << m_buffer_s
case IO_METHOD_USERPTR: initUserptr (); break;
}
-kDebug() << "setSize(" << newwidth << ", " << newheight << ") exited successfuly.";
+qDebug() << "setSize(" << newwidth << ", " << newheight << ") exited successfuly.";
return EXIT_SUCCESS;
}
-kDebug() << "setSize(" << newwidth << ", " << newheight << ") Device is not open.";
+qDebug() << "setSize(" << newwidth << ", " << newheight << ") Device is not open.";
return EXIT_FAILURE;
}
@@ -807,18 +807,18 @@ kDebug() << "setSize(" << newwidth << ", " << newheight << ") Device is not open
pixel_format VideoDevice::setPixelFormat(pixel_format newformat)
{
pixel_format ret = PIXELFORMAT_NONE;
-//kDebug() << "called.";
+//qDebug() << "called.";
// Change the pixel format for the video device
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
// CLEAR (fmt);
if (-1 == xioctl (VIDIOC_G_FMT, &fmt))
{
// return errnoReturn ("VIDIOC_S_FMT");
-// kDebug() << "VIDIOC_G_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
+// qDebug() << "VIDIOC_G_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
}
else
m_pixelformat = pixelFormatForPalette(fmt.fmt.pix.pixelformat);
@@ -826,7 +826,7 @@ pixel_format VideoDevice::setPixelFormat(pixel_format newformat)
fmt.fmt.pix.pixelformat = pixelFormatCode(newformat);
if (-1 == xioctl (VIDIOC_S_FMT, &fmt))
{
-// kDebug() << "VIDIOC_S_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
+// qDebug() << "VIDIOC_S_FMT failed (" << errno << ").Returned width: " << pixelFormatName(fmt.fmt.pix.pixelformat) << " " << fmt.fmt.pix.width << "x" << fmt.fmt.pix.height;
}
else
{
@@ -843,22 +843,22 @@ pixel_format VideoDevice::setPixelFormat(pixel_format newformat)
struct video_picture V4L_picture;
if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
{
- kDebug() << "VIDIOCGPICT failed (" << errno << ").";
+ qDebug() << "VIDIOCGPICT failed (" << errno << ").";
}
-// kDebug() << "V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
+// qDebug() << "V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
V4L_picture.palette = pixelFormatCode(newformat);
V4L_picture.depth = pixelFormatDepth(newformat);
if(-1 == xioctl(VIDIOCSPICT,&V4L_picture))
{
-// kDebug() << "Device seems to not support " << pixelFormatName(newformat) << " format. Fallback to it is not yet implemented.";
+// qDebug() << "Device seems to not support " << pixelFormatName(newformat) << " format. Fallback to it is not yet implemented.";
}
if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
{
- kDebug() << "VIDIOCGPICT failed (" << errno << ").";
+ qDebug() << "VIDIOCGPICT failed (" << errno << ").";
}
-// kDebug() << "V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
+// qDebug() << "V4L_picture.palette: " << V4L_picture.palette << " Depth: " << V4L_picture.depth;
m_pixelformat=pixelFormatForPalette(V4L_picture.palette);
if (m_pixelformat == newformat)
ret = newformat;
@@ -904,7 +904,7 @@ int VideoDevice::selectInput(int newinput)
{
switch (m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
if (-1 == ioctl (descriptor, VIDIOC_S_INPUT, &newinput))
@@ -929,7 +929,7 @@ int VideoDevice::selectInput(int newinput)
default:
break;
}
- kDebug() << "Selected input " << newinput << " (" << m_input[newinput].name << ")";
+ qDebug() << "Selected input " << newinput << " (" << m_input[newinput].name << ")";
m_current_input = newinput;
setInputParameters();
return EXIT_SUCCESS;
@@ -961,7 +961,7 @@ int VideoDevice::setInputParameters()
int VideoDevice::startCapturing()
{
- kDebug() << "called.";
+ qDebug() << "called.";
if(isOpen())
{
switch (m_io_method)
@@ -972,7 +972,7 @@ int VideoDevice::startCapturing()
case IO_METHOD_READ: // Nothing to do
break;
case IO_METHOD_MMAP:
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
{
unsigned int loop;
@@ -994,7 +994,7 @@ int VideoDevice::startCapturing()
#endif
break;
case IO_METHOD_USERPTR:
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
{
unsigned int loop;
@@ -1018,7 +1018,7 @@ int VideoDevice::startCapturing()
break;
}
- kDebug() << "exited successfuly.";
+ qDebug() << "exited successfuly.";
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -1032,12 +1032,12 @@ int VideoDevice::getFrame()
/// @todo implement me
ssize_t bytesread;
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
struct v4l2_buffer v4l2buffer;
#endif
#endif
-// kDebug() << "getFrame() called.";
+// qDebug() << "getFrame() called.";
if(isOpen())
{
switch (m_io_method)
@@ -1046,7 +1046,7 @@ int VideoDevice::getFrame()
return EXIT_FAILURE;
break;
case IO_METHOD_READ:
-// kDebug() << "Using IO_METHOD_READ.File descriptor: " << descriptor << " Buffer address: " << &m_currentbuffer.data[0] << " Size: " << m_currentbuffer.data.size();
+// qDebug() << "Using IO_METHOD_READ.File descriptor: " << descriptor << " Buffer address: " << &m_currentbuffer.data[0] << " Size: " << m_currentbuffer.data.size();
if (m_currentbuffer.data.isEmpty())
return EXIT_FAILURE;
@@ -1057,7 +1057,7 @@ int VideoDevice::getFrame()
#endif
if (-1 == bytesread) // must verify this point with ov511 driver.
{
- kDebug() << "IO_METHOD_READ failed.";
+ qDebug() << "IO_METHOD_READ failed.";
switch (errno)
{
case EAGAIN:
@@ -1069,23 +1069,23 @@ int VideoDevice::getFrame()
}
if((int)m_currentbuffer.data.size() < bytesread)
{
- kDebug() << "IO_METHOD_READ returned less bytes (" << bytesread << ") than it was asked for (" << m_currentbuffer.data.size() <<").";
+ qDebug() << "IO_METHOD_READ returned less bytes (" << bytesread << ") than it was asked for (" << m_currentbuffer.data.size() <<").";
}
break;
case IO_METHOD_MMAP:
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
CLEAR (v4l2buffer);
v4l2buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
v4l2buffer.memory = V4L2_MEMORY_MMAP;
if (-1 == xioctl (VIDIOC_DQBUF, &v4l2buffer))
{
- kDebug() << full_filename << " MMAPed getFrame failed.";
+ qDebug() << full_filename << " MMAPed getFrame failed.";
switch (errno)
{
case EAGAIN:
{
- kDebug() << full_filename << " MMAPed getFrame failed: EAGAIN. Pointer: ";
+ qDebug() << full_filename << " MMAPed getFrame failed: EAGAIN. Pointer: ";
return EXIT_FAILURE;
}
case EIO: /* Could ignore EIO, see spec. fall through */
@@ -1095,7 +1095,7 @@ int VideoDevice::getFrame()
}
/* if (v4l2buffer.index < m_streambuffers)
return EXIT_FAILURE;*/ //it was an assert()
-// kDebug() << "m_rawbuffers[" << v4l2buffer.index << "].start: " << (void *)m_rawbuffers[v4l2buffer.index].start << " Size: " << m_currentbuffer.data.size();
+// qDebug() << "m_rawbuffers[" << v4l2buffer.index << "].start: " << (void *)m_rawbuffers[v4l2buffer.index].start << " Size: " << m_currentbuffer.data.size();
if (m_currentbuffer.data.isEmpty() ||
// v4l2buffer.index < 0 || // is always false: v4l2buffer.index is unsigned
(uint) m_rawbuffers.size() <= v4l2buffer.index)
@@ -1108,7 +1108,7 @@ int VideoDevice::getFrame()
#endif
break;
case IO_METHOD_USERPTR:
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
{
unsigned int i;
@@ -1141,7 +1141,7 @@ int VideoDevice::getFrame()
#endif
break;
}
-// kDebug() << "exited successfuly.";
+// qDebug() << "exited successfuly.";
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -1184,7 +1184,7 @@ int VideoDevice::getImage(QImage *qimage)
}
uchar *bits=qimage->bits();
-// kDebug() << "Capturing in " << pixelFormatName(m_currentbuffer.pixelformat);
+// qDebug() << "Capturing in " << pixelFormatName(m_currentbuffer.pixelformat);
switch(m_currentbuffer.pixelformat)
{
case PIXELFORMAT_NONE : break;
@@ -1457,7 +1457,7 @@ int VideoDevice::getImage(QImage *qimage)
Brange = Bmax - Bmin; if (Brange == 0) Brange = 255;
// Arange = Amax - Amin; if (Arange == 0) Arange = 255;
- kDebug() << " R: " << R << " G: " << G << " B: " << B << " A: " << A << " global: " << global <<
+ qDebug() << " R: " << R << " G: " << G << " B: " << B << " A: " << A << " global: " << global <<
" Rmin: " << Rmin << " Gmin: " << Gmin << " Bmin: " << Bmin << " Amin: " << Amin << " globalmin: " << globalmin <<
" Rmax: " << Rmax << " Gmax: " << Gmax << " Bmax: " << Bmax << " Amax: " << Amax << " globalmax: " << globalmax ;
@@ -1478,7 +1478,7 @@ int VideoDevice::getImage(QImage *qimage)
int VideoDevice::stopCapturing()
{
/// @todo implement me
- kDebug() << "called.";
+ qDebug() << "called.";
if(isOpen())
{
switch (m_io_method)
@@ -1507,7 +1507,7 @@ int VideoDevice::stopCapturing()
if (munmap(m_rawbuffers[loop].start,m_rawbuffers[loop].length) != 0)
#endif
{
- kDebug() << "unable to munmap.";
+ qDebug() << "unable to munmap.";
}
}
}
@@ -1515,7 +1515,7 @@ int VideoDevice::stopCapturing()
#endif
break;
}
- kDebug() << "exited successfuly.";
+ qDebug() << "exited successfuly.";
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -1528,17 +1528,17 @@ int VideoDevice::stopCapturing()
int VideoDevice::close()
{
/// @todo implement me
- kDebug() << " called.";
+ qDebug() << " called.";
if(isOpen())
{
- kDebug() << " Device is open. Trying to properly shutdown the device.";
+ qDebug() << " Device is open. Trying to properly shutdown the device.";
stopCapturing();
#ifdef HAVE_LIBV4L2
int ret = ::v4l2_close(descriptor);
#else
int ret = ::close(descriptor);
#endif
- kDebug() << "::close() returns " << ret;
+ qDebug() << "::close() returns " << ret;
}
descriptor = -1;
return EXIT_SUCCESS;
@@ -1554,12 +1554,12 @@ float VideoDevice::getBrightness()
float VideoDevice::setBrightness(float brightness)
{
- kDebug() << "(" << brightness << ") called.";
+ qDebug() << "(" << brightness << ") called.";
m_input[m_current_input].setBrightness(brightness); // Just to check bounds
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
{
@@ -1573,15 +1573,15 @@ float VideoDevice::setBrightness(float brightness)
{
if (errno != EINVAL)
{
- kDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
} else
{
- kDebug() << "Device doesn't support the Brightness control.";
+ qDebug() << "Device doesn't support the Brightness control.";
}
} else
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
{
- kDebug() << "Brightness control is disabled.";
+ qDebug() << "Brightness control is disabled.";
} else
{
CLEAR (control);
@@ -1591,7 +1591,7 @@ float VideoDevice::setBrightness(float brightness)
if (-1 == xioctl (VIDIOC_S_CTRL, &control))
{
- kDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
}
}
}
@@ -1602,12 +1602,12 @@ float VideoDevice::setBrightness(float brightness)
struct video_picture V4L_picture;
if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
{
- kDebug() << "VIDIOCGPICT failed (" << errno << ").";
+ qDebug() << "VIDIOCGPICT failed (" << errno << ").";
}
V4L_picture.brightness = uint(65535 * getBrightness());
if(-1 == xioctl(VIDIOCSPICT,&V4L_picture))
{
- kDebug() << "Device seems to not support adjusting image brightness. Fallback to it is not yet implemented.";
+ qDebug() << "Device seems to not support adjusting image brightness. Fallback to it is not yet implemented.";
}
}
break;
@@ -1629,12 +1629,12 @@ float VideoDevice::getContrast()
float VideoDevice::setContrast(float contrast)
{
- kDebug() << "(" << contrast << ") called.";
+ qDebug() << "(" << contrast << ") called.";
m_input[m_current_input].setContrast(contrast); // Just to check bounds
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
{
@@ -1648,15 +1648,15 @@ float VideoDevice::setContrast(float contrast)
{
if (errno != EINVAL)
{
- kDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
} else
{
- kDebug() << "Device doesn't support the Contrast control.";
+ qDebug() << "Device doesn't support the Contrast control.";
}
} else
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
{
- kDebug() << "Contrast control is disabled.";
+ qDebug() << "Contrast control is disabled.";
} else
{
CLEAR (control);
@@ -1666,7 +1666,7 @@ float VideoDevice::setContrast(float contrast)
if (-1 == xioctl (VIDIOC_S_CTRL, &control))
{
- kDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
}
}
}
@@ -1677,12 +1677,12 @@ float VideoDevice::setContrast(float contrast)
struct video_picture V4L_picture;
if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
{
- kDebug() << "VIDIOCGPICT failed (" << errno << ").";
+ qDebug() << "VIDIOCGPICT failed (" << errno << ").";
}
V4L_picture.contrast = uint(65535*getContrast());
if(-1 == xioctl(VIDIOCSPICT,&V4L_picture))
{
- kDebug() << "Device seems to not support adjusting image contrast. Fallback to it is not yet implemented.";
+ qDebug() << "Device seems to not support adjusting image contrast. Fallback to it is not yet implemented.";
}
}
break;
@@ -1704,12 +1704,12 @@ float VideoDevice::getSaturation()
float VideoDevice::setSaturation(float saturation)
{
- kDebug() << "(" << saturation << ") called.";
+ qDebug() << "(" << saturation << ") called.";
m_input[m_current_input].setSaturation(saturation); // Just to check bounds
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
{
@@ -1723,15 +1723,15 @@ float VideoDevice::setSaturation(float saturation)
{
if (errno != EINVAL)
{
- kDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
} else
{
- kDebug() << "Device doesn't support the Saturation control.";
+ qDebug() << "Device doesn't support the Saturation control.";
}
} else
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
{
- kDebug() << "Saturation control is disabled.";
+ qDebug() << "Saturation control is disabled.";
} else
{
CLEAR (control);
@@ -1741,7 +1741,7 @@ float VideoDevice::setSaturation(float saturation)
if (-1 == xioctl (VIDIOC_S_CTRL, &control))
{
- kDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
}
}
}
@@ -1752,12 +1752,12 @@ float VideoDevice::setSaturation(float saturation)
struct video_picture V4L_picture;
if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
{
- kDebug() << "VIDIOCGPICT failed (" << errno << ").";
+ qDebug() << "VIDIOCGPICT failed (" << errno << ").";
}
V4L_picture.colour = uint(65535*getSaturation());
if(-1 == xioctl(VIDIOCSPICT,&V4L_picture))
{
- kDebug() << "Device seems to not support adjusting image saturation. Fallback to it is not yet implemented.";
+ qDebug() << "Device seems to not support adjusting image saturation. Fallback to it is not yet implemented.";
}
}
break;
@@ -1779,12 +1779,12 @@ float VideoDevice::getWhiteness()
float VideoDevice::setWhiteness(float whiteness)
{
- kDebug() << "(" << whiteness << ") called.";
+ qDebug() << "(" << whiteness << ") called.";
m_input[m_current_input].setWhiteness(whiteness); // Just to check bounds
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
{
@@ -1798,15 +1798,15 @@ float VideoDevice::setWhiteness(float whiteness)
{
if (errno != EINVAL)
{
- kDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
} else
{
- kDebug() << "Device doesn't support the Whiteness control.";
+ qDebug() << "Device doesn't support the Whiteness control.";
}
} else
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
{
- kDebug() << "Whiteness control is disabled.";
+ qDebug() << "Whiteness control is disabled.";
} else
{
CLEAR (control);
@@ -1816,7 +1816,7 @@ float VideoDevice::setWhiteness(float whiteness)
if (-1 == xioctl (VIDIOC_S_CTRL, &control))
{
- kDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
}
}
}
@@ -1827,12 +1827,12 @@ float VideoDevice::setWhiteness(float whiteness)
struct video_picture V4L_picture;
if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
{
- kDebug() << "VIDIOCGPICT failed (" << errno << ").";
+ qDebug() << "VIDIOCGPICT failed (" << errno << ").";
}
V4L_picture.whiteness = uint(65535*getWhiteness());
if(-1 == xioctl(VIDIOCSPICT,&V4L_picture))
{
- kDebug() << "Device seems to not support adjusting white level. Fallback to it is not yet implemented.";
+ qDebug() << "Device seems to not support adjusting white level. Fallback to it is not yet implemented.";
}
}
break;
@@ -1854,12 +1854,12 @@ float VideoDevice::getHue()
float VideoDevice::setHue(float hue)
{
- kDebug() << "(" << hue << ") called.";
+ qDebug() << "(" << hue << ") called.";
m_input[m_current_input].setHue(hue); // Just to check bounds
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
{
@@ -1873,15 +1873,15 @@ float VideoDevice::setHue(float hue)
{
if (errno != EINVAL)
{
- kDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_QUERYCTRL failed (" << errno << ").";
} else
{
- kDebug() << "Device doesn't support the Hue control.";
+ qDebug() << "Device doesn't support the Hue control.";
}
} else
if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
{
- kDebug() << "Hue control is disabled.";
+ qDebug() << "Hue control is disabled.";
} else
{
CLEAR (control);
@@ -1891,7 +1891,7 @@ float VideoDevice::setHue(float hue)
if (-1 == xioctl (VIDIOC_S_CTRL, &control))
{
- kDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
+ qDebug() << "VIDIOC_S_CTRL failed (" << errno << ").";
}
}
}
@@ -1902,12 +1902,12 @@ float VideoDevice::setHue(float hue)
struct video_picture V4L_picture;
if(-1 == xioctl(VIDIOCGPICT, &V4L_picture))
{
- kDebug() << "VIDIOCGPICT failed (" << errno << ").";
+ qDebug() << "VIDIOCGPICT failed (" << errno << ").";
}
V4L_picture.hue = uint(65535*getHue());
if(-1 == xioctl(VIDIOCSPICT,&V4L_picture))
{
- kDebug() << "Device seems to not support adjusting image hue. Fallback to it is not yet implemented.";
+ qDebug() << "Device seems to not support adjusting image hue. Fallback to it is not yet implemented.";
}
}
break;
@@ -1930,7 +1930,7 @@ bool VideoDevice::getAutoBrightnessContrast()
bool VideoDevice::setAutoBrightnessContrast(bool brightnesscontrast)
{
- kDebug() << "VideoDevice::setAutoBrightnessContrast(" << brightnesscontrast << ") called.";
+ qDebug() << "VideoDevice::setAutoBrightnessContrast(" << brightnesscontrast << ") called.";
if (m_current_input < m_input.size() )
{
m_input[m_current_input].setAutoBrightnessContrast(brightnesscontrast);
@@ -1951,7 +1951,7 @@ bool VideoDevice::getAutoColorCorrection()
bool VideoDevice::setAutoColorCorrection(bool colorcorrection)
{
- kDebug() << "VideoDevice::setAutoColorCorrection(" << colorcorrection << ") called.";
+ qDebug() << "VideoDevice::setAutoColorCorrection(" << colorcorrection << ") called.";
if (m_current_input < m_input.size() )
{
m_input[m_current_input].setAutoColorCorrection(colorcorrection);
@@ -1971,7 +1971,7 @@ bool VideoDevice::getImageAsMirror()
bool VideoDevice::setImageAsMirror(bool imageasmirror)
{
- kDebug() << "VideoDevice::setImageAsMirror(" << imageasmirror << ") called.";
+ qDebug() << "VideoDevice::setImageAsMirror(" << imageasmirror << ") called.";
if (m_current_input < m_input.size() )
{
m_input[m_current_input].setImageAsMirror(imageasmirror);
@@ -1985,7 +1985,7 @@ pixel_format VideoDevice::pixelFormatForPalette( int palette )
{
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
switch(palette)
@@ -2065,7 +2065,7 @@ int VideoDevice::pixelFormatCode(pixel_format pixelformat)
{
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
switch(pixelformat)
@@ -2271,7 +2271,7 @@ QString VideoDevice::pixelFormatName(int pixelformat)
returnvalue = "None";
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
switch(pixelformat)
@@ -2351,7 +2351,7 @@ int VideoDevice::detectPixelFormats()
int err = 0;
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
fmtdesc.index = 0;
@@ -2367,7 +2367,7 @@ int VideoDevice::detectPixelFormats()
}
else
{
- kDebug () << fmtdesc.pixelformat << " " << pixelFormatName(fmtdesc.pixelformat); // Need a cleanup. PixelFormatForPalette is a really bad name
+ qDebug () << fmtdesc.pixelformat << " " << pixelFormatName(fmtdesc.pixelformat); // Need a cleanup. PixelFormatForPalette is a really bad name
fmtdesc.index++;
}
}
@@ -2378,43 +2378,43 @@ int VideoDevice::detectPixelFormats()
// 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.
// Packed RGB formats
- kDebug() << "Supported pixel formats:";
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB332)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB332); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB444)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB444); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB555)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB555); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB565)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB565); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB555X)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB555X); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB565X)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB565X); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_BGR24)) { kDebug() << pixelFormatName(PIXELFORMAT_BGR24); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB24)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB24); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_BGR32)) { kDebug() << pixelFormatName(PIXELFORMAT_BGR32); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB32)) { kDebug() << pixelFormatName(PIXELFORMAT_RGB32); }
+ qDebug() << "Supported pixel formats:";
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB332)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB332); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB444)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB444); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB555)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB555); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB565)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB565); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB555X)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB555X); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB565X)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB565X); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_BGR24)) { qDebug() << pixelFormatName(PIXELFORMAT_BGR24); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB24)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB24); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_BGR32)) { qDebug() << pixelFormatName(PIXELFORMAT_BGR32); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_RGB32)) { qDebug() << pixelFormatName(PIXELFORMAT_RGB32); }
// Bayer RGB format
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_SBGGR8)) { kDebug() << pixelFormatName(PIXELFORMAT_SBGGR8); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_SBGGR8)) { qDebug() << pixelFormatName(PIXELFORMAT_SBGGR8); }
// YUV formats
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_GREY)) { kDebug() << pixelFormatName(PIXELFORMAT_GREY); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUYV)) { kDebug() << pixelFormatName(PIXELFORMAT_YUYV); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_UYVY)) { kDebug() << pixelFormatName(PIXELFORMAT_UYVY); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUV420P)) { kDebug() << pixelFormatName(PIXELFORMAT_YUV420P); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUV422P)) { kDebug() << pixelFormatName(PIXELFORMAT_YUV422P); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_GREY)) { qDebug() << pixelFormatName(PIXELFORMAT_GREY); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUYV)) { qDebug() << pixelFormatName(PIXELFORMAT_YUYV); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_UYVY)) { qDebug() << pixelFormatName(PIXELFORMAT_UYVY); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUV420P)) { qDebug() << pixelFormatName(PIXELFORMAT_YUV420P); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUV422P)) { qDebug() << pixelFormatName(PIXELFORMAT_YUV422P); }
// Compressed formats
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_JPEG)) { kDebug() << pixelFormatName(PIXELFORMAT_JPEG); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_MPEG)) { kDebug() << pixelFormatName(PIXELFORMAT_MPEG); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_JPEG)) { qDebug() << pixelFormatName(PIXELFORMAT_JPEG); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_MPEG)) { qDebug() << pixelFormatName(PIXELFORMAT_MPEG); }
// Reserved formats
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_DV)) { kDebug() << pixelFormatName(PIXELFORMAT_DV); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_ET61X251)) { kDebug() << pixelFormatName(PIXELFORMAT_ET61X251); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_HI240)) { kDebug() << pixelFormatName(PIXELFORMAT_HI240); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_HM12)) { kDebug() << pixelFormatName(PIXELFORMAT_HM12); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_MJPEG)) { kDebug() << pixelFormatName(PIXELFORMAT_MJPEG); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_PWC1)) { kDebug() << pixelFormatName(PIXELFORMAT_PWC1); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_PWC2)) { kDebug() << pixelFormatName(PIXELFORMAT_PWC2); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_SN9C10X)) { kDebug() << pixelFormatName(PIXELFORMAT_SN9C10X); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_WNVA)) { kDebug() << pixelFormatName(PIXELFORMAT_WNVA); }
- if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YYUV)) { kDebug() << pixelFormatName(PIXELFORMAT_YYUV); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_DV)) { qDebug() << pixelFormatName(PIXELFORMAT_DV); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_ET61X251)) { qDebug() << pixelFormatName(PIXELFORMAT_ET61X251); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_HI240)) { qDebug() << pixelFormatName(PIXELFORMAT_HI240); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_HM12)) { qDebug() << pixelFormatName(PIXELFORMAT_HM12); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_MJPEG)) { qDebug() << pixelFormatName(PIXELFORMAT_MJPEG); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_PWC1)) { qDebug() << pixelFormatName(PIXELFORMAT_PWC1); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_PWC2)) { qDebug() << pixelFormatName(PIXELFORMAT_PWC2); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_SN9C10X)) { qDebug() << pixelFormatName(PIXELFORMAT_SN9C10X); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_WNVA)) { qDebug() << pixelFormatName(PIXELFORMAT_WNVA); }
+ if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YYUV)) { qDebug() << pixelFormatName(PIXELFORMAT_YYUV); }
break;
#endif
case VIDEODEV_DRIVER_NONE:
@@ -2428,7 +2428,7 @@ __u64 VideoDevice::signalStandardCode(signal_standard standard)
{
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
switch(standard)
@@ -2612,7 +2612,7 @@ QString VideoDevice::signalStandardName(int standard)
returnvalue = "None";
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
switch(standard)
@@ -2693,12 +2693,12 @@ QString VideoDevice::signalStandardName(int standard)
*/
int VideoDevice::detectSignalStandards()
{
- kDebug() << "called.";
+ qDebug() << "called.";
if(isOpen())
{
switch(m_driver)
{
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
case VIDEODEV_DRIVER_V4L2:
@@ -2726,8 +2726,8 @@ int VideoDevice::detectSignalStandards()
while (0 == xioctl (VIDIOC_ENUMSTD, &standard)) {
if (standard.id & input.std)
{
-// kDebug() << standard.name;
- kDebug() << signalStandardName(standard.id) << " (" << standard.id << ")" << V4L2_STD_NTSC;
+// qDebug() << standard.name;
+ qDebug() << signalStandardName(standard.id) << " (" << standard.id << ")" << V4L2_STD_NTSC;
}
standard.index++;
@@ -2764,7 +2764,7 @@ int VideoDevice::initRead()
{
/// @todo implement me
- kDebug() << "called.";
+ qDebug() << "called.";
if(isOpen())
{
m_rawbuffers.resize(1);
@@ -2773,7 +2773,7 @@ int VideoDevice::initRead()
fprintf (stderr, "Out of memory\n");
return EXIT_FAILURE;
}
- kDebug() << "m_buffer_size: " << m_buffer_size;
+ qDebug() << "m_buffer_size: " << m_buffer_size;
// m_rawbuffers[0].pixelformat=m_pixelformat;
m_rawbuffers[0].length = m_buffer_size;
@@ -2784,7 +2784,7 @@ int VideoDevice::initRead()
fprintf (stderr, "Out of memory\n");
return EXIT_FAILURE;
}
- kDebug() << "exited successfuly.";
+ qDebug() << "exited successfuly.";
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -2800,7 +2800,7 @@ int VideoDevice::initMmap()
#define BUFFERS 2
if(isOpen())
{
- kDebug() << full_filename << " Trying to MMAP";
+ qDebug() << full_filename << " Trying to MMAP";
#ifdef V4L2_CAP_VIDEO_CAPTURE
struct v4l2_requestbuffers req;
@@ -2814,7 +2814,7 @@ int VideoDevice::initMmap()
{
if (EINVAL == errno)
{
- kDebug() << full_filename << " does not support memory mapping";
+ qDebug() << full_filename << " does not support memory mapping";
return EXIT_FAILURE;
}
else
@@ -2825,7 +2825,7 @@ int VideoDevice::initMmap()
if (req.count < BUFFERS)
{
- kDebug() << "Insufficient buffer memory on " << full_filename;
+ qDebug() << "Insufficient buffer memory on " << full_filename;
return EXIT_FAILURE;
}
@@ -2833,7 +2833,7 @@ int VideoDevice::initMmap()
if (m_rawbuffers.size()==0)
{
- kDebug() << "Out of memory";
+ qDebug() << "Out of memory";
return EXIT_FAILURE;
}
@@ -2862,7 +2862,7 @@ int VideoDevice::initMmap()
}
#endif
m_currentbuffer.data.resize(m_rawbuffers[0].length); // Makes the imagesize.data buffer size equal to the rawbuffer size
- kDebug() << full_filename << " m_currentbuffer.data.size(): " << m_currentbuffer.data.size();
+ qDebug() << full_filename << " m_currentbuffer.data.size(): " << m_currentbuffer.data.size();
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -2890,7 +2890,7 @@ int VideoDevice::initUserptr()
{
if (EINVAL == errno)
{
- kDebug() << full_filename << " does not support memory mapping";
+ qDebug() << full_filename << " does not support memory mapping";
return EXIT_FAILURE;
}
else
@@ -2914,7 +2914,7 @@ int VideoDevice::initUserptr()
if (!m_rawbuffers[m_streambuffers].start)
{
- kDebug() << "Out of memory";
+ qDebug() << "Out of memory";
return EXIT_FAILURE;
}
}
diff --git a/src/kvilib/ext/avdevice/videodevice.h b/src/kvilib/ext/avdevice/videodevice.h
index c2bc6951b..0e12e245e 100644
--- a/src/kvilib/ext/avdevice/videodevice.h
+++ b/src/kvilib/ext/avdevice/videodevice.h
@@ -41,8 +41,6 @@
*************************************************************************
*/
-#define ENABLE_AV
-
#ifndef KOPETE_AVVIDEODEVICELISTITEM_H
#define KOPETE_AVVIDEODEVICELISTITEM_H
@@ -55,7 +53,9 @@
#include <unistd.h>
#include <signal.h>
-#if defined(__linux__) && defined(ENABLE_AV)
+#include "kvi_settings.h"
+
+#ifndef COMPILE_DISABLE_AVDEVICE
#include <asm/types.h>
#undef __STRICT_ANSI__
@@ -86,10 +86,9 @@
#endif // __linux__
-#include <qstring.h>
-#include <qfile.h>
-#include <qimage.h>
-#include <q3valuevector.h>
+#include <QString>
+#include <QFile>
+#include <QImage>
#include "videoinput.h"
@@ -103,7 +102,7 @@ namespace AV {
typedef enum
{
VIDEODEV_DRIVER_NONE
-#if defined( __linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
,
VIDEODEV_DRIVER_V4L
#ifdef V4L2_CAP_VIDEO_CAPTURE
@@ -317,7 +316,7 @@ public:
int descriptor;
//protected:
-#if defined(__linux__) && defined(ENABLE_AV)
+#ifndef COMPILE_DISABLE_AVDEVICE
#ifdef V4L2_CAP_VIDEO_CAPTURE
struct v4l2_capability V4L2_capabilities;
struct v4l2_cropcap cropcap;
diff --git a/src/kvilib/ext/avdevice/videodevicemodelpool.cpp b/src/kvilib/ext/avdevice/videodevicemodelpool.cpp
index 3333beaae..ee2a138c1 100644
--- a/src/kvilib/ext/avdevice/videodevicemodelpool.cpp
+++ b/src/kvilib/ext/avdevice/videodevicemodelpool.cpp
@@ -41,6 +41,8 @@
*************************************************************************
*/
+#include <QDebug>
+
#include "videodevicemodelpool.h"
namespace Kopete {
@@ -77,7 +79,7 @@ size_t VideoDeviceModelPool::addModel( QString newmodel )
for ( int loop = 0 ; loop < m_devicemodel.size(); loop++)
if (newmodel == m_devicemodel[loop].model)
{
- kDebug() << "Model " << newmodel << " already exists.";
+ qDebug() << "Model " << newmodel << " already exists.";
m_devicemodel[loop].count++;
return m_devicemodel[loop].count;
}
diff --git a/src/kvilib/ext/avdevice/videodevicemodelpool.h b/src/kvilib/ext/avdevice/videodevicemodelpool.h
index 40d338dec..0baa8faba 100644
--- a/src/kvilib/ext/avdevice/videodevicemodelpool.h
+++ b/src/kvilib/ext/avdevice/videodevicemodelpool.h
@@ -44,10 +44,8 @@
#ifndef KOPETE_AVVIDEODEVICEMODELPOOL_H
#define KOPETE_AVVIDEODEVICEMODELPOOL_H
-#include <qstring.h>
-#include <qvector.h>
-
-#include "kopete_export.h"
+#include <QString>
+#include <QVector>
namespace Kopete {
diff --git a/src/kvilib/ext/avdevice/videodevicepool.cpp b/src/kvilib/ext/avdevice/videodevicepool.cpp
index 2598eaa7d..0960d79f6 100644
--- a/src/kvilib/ext/avdevice/videodevicepool.cpp
+++ b/src/kvilib/ext/avdevice/videodevicepool.cpp
@@ -41,14 +41,13 @@
*************************************************************************
*/
-#define ENABLE_AV
-
#include <assert.h>
#include <cstdlib>
#include <cerrno>
#include <cstring>
-#include <qdir.h>
+#include <QDir>
+#include <QDebug>
#include "videodevice.h"
#include "videodevicepool.h"
@@ -76,14 +75,14 @@ __u64 VideoDevicePool::m_clients = 0;
VideoDevicePool* VideoDevicePool::self()
{
-// kDebug() << "libkopete (avdevice): self() called";
+// qDebug() << "libkopete (avdevice): self() called";
if (s_self == NULL)
{
s_self = new VideoDevicePool;
if (s_self)
m_clients = 0;
}
-// kDebug() << "libkopete (avdevice): self() exited successfuly";
+// qDebug() << "libkopete (avdevice): self() exited successfuly";
return s_self;
}
@@ -114,18 +113,18 @@ qDebug("VideoDevicePool::open()");
m_ready.lock();
if(!m_videodevice.size())
{
- kDebug() << "open(): No devices found. Must scan for available devices." << m_current_device;
+ qDebug() << "open(): No devices found. Must scan for available devices." << m_current_device;
scanDevices();
}
if(!m_videodevice.size())
{
- kDebug() << "open(): No devices found. bailing out." << m_current_device;
+ qDebug() << "open(): No devices found. bailing out." << m_current_device;
m_ready.unlock();
return EXIT_FAILURE;
}
if(m_current_device >= m_videodevice.size())
{
- kDebug() << "open(): Device out of scope (" << m_current_device << "). Defaulting to the first one.";
+ qDebug() << "open(): Device out of scope (" << m_current_device << "). Defaulting to the first one.";
m_current_device = 0;
}
int isopen = m_videodevice[currentDevice()].open();
@@ -135,7 +134,7 @@ qDebug("VideoDevicePool::open()");
}
m_clients++;
- kDebug() << "Number of clients: " << m_clients;
+ qDebug() << "Number of clients: " << m_clients;
m_ready.unlock();
return isopen;
}
@@ -146,16 +145,16 @@ qDebug("VideoDevicePool::open()");
int VideoDevicePool::open(int device)
{
/// @todo implement me
- kDebug() << "open(" << device << ") called.";
+ qDebug() << "open(" << device << ") called.";
if(device >= m_videodevice.size())
{
- kDebug() << "open(" << device <<"): Device does not exist.";
+ qDebug() << "open(" << device <<"): Device does not exist.";
return EXIT_FAILURE;
}
close();
- kDebug() << "open(" << device << ") Setting m_current_Device to " << device;
+ qDebug() << "open(" << device << ") Setting m_current_Device to " << device;
m_current_device = device;
- kDebug() << "open(" << device << ") Calling open().";
+ qDebug() << "open(" << device << ") Calling open().";
saveConfig();
return open();
@@ -210,12 +209,12 @@ int VideoDevicePool::setSize( int newwidth, int newheight)
return m_videodevice[currentDevice()].setSize(newwidth, newheight);
else
{
- kDebug() << "VideoDevicePool::setSize() fallback for no device.";
+ qDebug() << "VideoDevicePool::setSize() fallback for no device.";
m_buffer.width=newwidth;
m_buffer.height=newheight;
m_buffer.pixelformat= PIXELFORMAT_RGB24;
m_buffer.data.resize(m_buffer.width*m_buffer.height*3);
- kDebug() << "VideoDevicePool::setSize() buffer size: "<< m_buffer.data.size();
+ qDebug() << "VideoDevicePool::setSize() buffer size: "<< m_buffer.data.size();
}
return EXIT_SUCCESS;
}
@@ -231,9 +230,9 @@ int VideoDevicePool::close()
if((currentDevice() < m_videodevice.size())&&(!m_clients))
return m_videodevice[currentDevice()].close();
if(m_clients)
- kDebug() << "VideoDevicePool::close() The video device is still in use.";
+ qDebug() << "VideoDevicePool::close() The video device is still in use.";
if(currentDevice() >= m_videodevice.size())
- kDebug() << "VideoDevicePool::close() Current device out of range.";
+ qDebug() << "VideoDevicePool::close() Current device out of range.";
return EXIT_FAILURE;
}
@@ -242,7 +241,7 @@ int VideoDevicePool::close()
*/
int VideoDevicePool::startCapturing()
{
- kDebug() << "startCapturing() called.";
+ qDebug() << "startCapturing() called.";
if(m_videodevice.size())
return m_videodevice[currentDevice()].startCapturing();
return EXIT_FAILURE;
@@ -385,7 +384,7 @@ bool VideoDevicePool::getAutoBrightnessContrast()
*/
bool VideoDevicePool::setAutoBrightnessContrast(bool brightnesscontrast)
{
- kDebug() << "VideoDevicePool::setAutoBrightnessContrast(" << brightnesscontrast << ") called.";
+ qDebug() << "VideoDevicePool::setAutoBrightnessContrast(" << brightnesscontrast << ") called.";
if(m_videodevice.size())
return m_videodevice[currentDevice()].setAutoBrightnessContrast(brightnesscontrast);
return false;
@@ -406,7 +405,7 @@ bool VideoDevicePool::getAutoColorCorrection()
*/
bool VideoDevicePool::setAutoColorCorrection(bool colorcorrection)
{
- kDebug() << "VideoDevicePool::setAutoColorCorrection(" << colorcorrection << ") called.";
+ qDebug() << "VideoDevicePool::setAutoColorCorrection(" << colorcorrection << ") called.";
if(m_videodevice.size())
return m_videodevice[currentDevice()].setAutoColorCorrection(colorcorrection);
return false;
@@ -427,7 +426,7 @@ bool VideoDevicePool::getImageAsMirror()
*/
bool VideoDevicePool::setImageAsMirror(bool imageasmirror)
{
- kDebug() << "VideoDevicePool::setImageAsMirror(" << imageasmirror << ") called.";
+ qDebug() << "VideoDevicePool::setImageAsMirror(" << imageasmirror << ") called.";
if(m_videodevice.size())
return m_videodevice[currentDevice()].setImageAsMirror(imageasmirror);
return false;
@@ -438,12 +437,12 @@ bool VideoDevicePool::setImageAsMirror(bool imageasmirror)
*/
int VideoDevicePool::getFrame()
{
-// kDebug() << "VideoDevicePool::getFrame() called.";
+// qDebug() << "VideoDevicePool::getFrame() called.";
if(m_videodevice.size())
return m_videodevice[currentDevice()].getFrame();
else
{
- kDebug() << "VideoDevicePool::getFrame() fallback for no device.";
+ qDebug() << "VideoDevicePool::getFrame() fallback for no device.";
for(int loop=0; loop < m_buffer.data.size(); loop+=3)
{
m_buffer.data[loop] = 255;
@@ -451,7 +450,7 @@ int VideoDevicePool::getFrame()
m_buffer.data[loop+2] = 0;
}
}
- kDebug() << "VideoDevicePool::getFrame() exited successfuly.";
+ qDebug() << "VideoDevicePool::getFrame() exited successfuly.";
return EXIT_SUCCESS;
}
@@ -461,12 +460,12 @@ int VideoDevicePool::getFrame()
*/
int VideoDevicePool::getImage(QImage *qimage)
{
-// kDebug() << "VideoDevicePool::getImage() called.";
+// qDebug() << "VideoDevicePool::getImage() called.";
if(m_videodevice.size())
return m_videodevice[currentDevice()].getImage(qimage);
else
{
- kDebug() << "VideoDevicePool::getImage() fallback for no device.";
+ qDebug() << "VideoDevicePool::getImage() fallback for no device.";
// do NOT delete qimage here, as it is received as a parameter
if (qimage->width() != width() || qimage->height() != height())
@@ -484,7 +483,7 @@ int VideoDevicePool::getImage(QImage *qimage)
case PIXELFORMAT_RGB565X: break;
case PIXELFORMAT_RGB24 :
{
- kDebug() << "VideoDevicePool::getImage() fallback for no device - RGB24.";
+ qDebug() << "VideoDevicePool::getImage() fallback for no device - RGB24.";
int step=0;
for(int loop=0;loop < qimage->numBytes();loop+=4)
{
@@ -519,7 +518,7 @@ int VideoDevicePool::getImage(QImage *qimage)
default: break;
}
}
- kDebug() << "VideoDevicePool::getImage() exited successfuly.";
+ qDebug() << "VideoDevicePool::getImage() exited successfuly.";
return EXIT_SUCCESS;
}
@@ -528,7 +527,7 @@ int VideoDevicePool::getImage(QImage *qimage)
*/
int VideoDevicePool::selectInput(int newinput)
{
- kDebug() << "VideoDevicePool::selectInput(" << newinput << ") called.";
+ qDebug() << "VideoDevicePool::selectInput(" << newinput << ") called.";
if(m_videodevice.size())
return m_videodevice[currentDevice()].selectInput(newinput);
else
@@ -552,18 +551,18 @@ int VideoDevicePool::setInputParameters()
int VideoDevicePool::fillDeviceQComboBox(QComboBox *combobox)
{
/// @todo implement me
- kDebug() << "Called.";
+ qDebug() << "Called.";
// check if QComboBox is a valid pointer.
if (combobox != NULL)
{
combobox->clear();
- kDebug() << "Combobox cleaned.";
+ qDebug() << "Combobox cleaned.";
if(m_videodevice.size())
{
for (int loop=0; loop < m_videodevice.size(); loop++)
{
combobox->addItem(m_videodevice[loop].m_name);
- kDebug() << "Added device " << loop << ": " << m_videodevice[loop].m_name;
+ qDebug() << "Added device " << loop << ": " << m_videodevice[loop].m_name;
}
combobox->setCurrentIndex(currentDevice());
return EXIT_SUCCESS;
@@ -578,7 +577,7 @@ int VideoDevicePool::fillDeviceQComboBox(QComboBox *combobox)
int VideoDevicePool::fillInputQComboBox(QComboBox *combobox)
{
/// @todo implement me
- kDebug() << "Called.";
+ qDebug() << "Called.";
if (combobox != NULL)
{
combobox->clear();
@@ -589,7 +588,7 @@ int VideoDevicePool::fillInputQComboBox(QComboBox *combobox)
for (int loop=0; loop < m_videodevice[currentDevice()].inputs(); loop++)
{
combobox->addItem(m_videodevice[currentDevice()].m_input[loop].name);
- kDebug() << "Added input " << loop << ": " << m_videodevice[currentDevice()].m_input[loop].name << " (tuner: " << m_videodevice[currentDevice()].m_input[loop].hastuner << ")";
+ qDebug() << "Added input " << loop << ": " << m_videodevice[currentDevice()].m_input[loop].name << " (tuner: " << m_videodevice[currentDevice()].m_input[loop].hastuner << ")";
}
combobox->setCurrentIndex(currentInput());
return EXIT_SUCCESS;
@@ -605,7 +604,7 @@ int VideoDevicePool::fillInputQComboBox(QComboBox *combobox)
int VideoDevicePool::fillStandardQComboBox(QComboBox *combobox)
{
/// @todo implement me
- kDebug() << "Called.";
+ qDebug() << "Called.";
if (combobox != NULL)
{
combobox->clear();
@@ -653,7 +652,7 @@ int VideoDevicePool::fillStandardQComboBox(QComboBox *combobox)
case STANDARD_ALL : return V4L2_STD_ALL; break;
combobox->insertItem(m_videodevice[currentDevice()].m_input[loop].name);
- kDebug() << "StandardQComboBox: Added input " << loop << ": " << m_videodevice[currentDevice()].m_input[loop].name << " (tuner: " << m_videodevice[currentDevice()].m_input[loop].hastuner << ")";*/
+ qDebug() << "StandardQComboBox: Added input " << loop << ": " << m_videodevice[currentDevice()].m_input[loop].name << " (tuner: " << m_videodevice[currentDevice()].m_input[loop].hastuner << ")";*/
}
combobox->setCurrentIndex(currentInput());
return EXIT_SUCCESS;
@@ -670,7 +669,7 @@ int VideoDevicePool::scanDevices()
{
/// @todo implement me
- kDebug() << "called";
+ qDebug() << "called";
#ifdef COMPILE_KDE_SUPPORT
foreach (Solid::Device device,
Solid::Device::listFromType(Solid::DeviceInterface::Video, QString())) {
@@ -678,7 +677,7 @@ int VideoDevicePool::scanDevices()
}
#endif
- kDebug() << "exited successfuly";
+ qDebug() << "exited successfuly";
return EXIT_SUCCESS;
}
@@ -686,7 +685,7 @@ int VideoDevicePool::scanDevices()
void VideoDevicePool::registerDevice( Solid::Device & device )
{
- kDebug() << "New video device at " << device.udi();
+ qDebug() << "New video device at " << device.udi();
const Solid::Device * vendorDevice = &device;
while ( vendorDevice->isValid() && vendorDevice->vendor().isEmpty() )
{
@@ -694,7 +693,7 @@ void VideoDevicePool::registerDevice( Solid::Device & device )
}
if ( vendorDevice->isValid() )
{
- kDebug() << "vendor: " << vendorDevice->vendor() << ", product: " << vendorDevice->product();
+ qDebug() << "vendor: " << vendorDevice->vendor() << ", product: " << vendorDevice->product();
}
Solid::Video * solidVideoDevice = device.as<Solid::Video>();
if ( solidVideoDevice ) {
@@ -704,15 +703,15 @@ void VideoDevicePool::registerDevice( Solid::Device & device )
QStringList drivers = solidVideoDevice->supportedDrivers( "video4linux" );
if ( drivers.contains( "video4linux" ) )
{
- kDebug() << "V4L device path is" << solidVideoDevice->driverHandle( "video4linux" ).toString();
+ qDebug() << "V4L device path is" << solidVideoDevice->driverHandle( "video4linux" ).toString();
VideoDevice videodevice;
videodevice.setUdi( device.udi() );
videodevice.setFileName(solidVideoDevice->driverHandle( "video4linux" ).toString());
- kDebug() << "Found device " << videodevice.full_filename;
+ qDebug() << "Found device " << videodevice.full_filename;
videodevice.open();
if(videodevice.isOpen())
{
- kDebug() << "File " << videodevice.full_filename << " was opened successfuly";
+ qDebug() << "File " << videodevice.full_filename << " was opened successfuly";
videodevice.close();
videodevice.m_modelindex=m_modelvector.addModel (videodevice.m_model); // Adds device to the device list and sets model number
m_videodevice.push_back(videodevice);
@@ -777,12 +776,12 @@ void VideoDevicePool::loadConfig()
{
#ifdef COMPILE_KDE_SUPPORT
/// @todo implement me
- kDebug() << "called";
+ qDebug() << "called";
if((hasDevices())&&(m_clients==0))
{
KConfigGroup config(KGlobal::config(), "Video Device Settings");
QString currentdevice = config.readEntry("Current Device", QString());
- kDebug() << "Current device: " << currentdevice;
+ qDebug() << "Current device: " << currentdevice;
// m_current_device = 0; // Must check this thing because of the fact that multiple loadConfig in other methodas can do bad things. Watch out!
@@ -793,12 +792,12 @@ void VideoDevicePool::loadConfig()
if(modelindex == currentdevice)
{
m_current_device = std::distance (m_videodevice.begin(), vditerator);
-// kDebug() << "This place will be used to set " << modelindex << " as the current device ( " << std::distance(m_videodevice.begin(), vditerator ) << " ).";
+// qDebug() << "This place will be used to set " << modelindex << " as the current device ( " << std::distance(m_videodevice.begin(), vditerator ) << " ).";
}
const QString name = config.readEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Name") .arg ((*vditerator).m_name ) .arg ((*vditerator).m_modelindex)), (*vditerator).m_model);
const int currentinput = config.readEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Current input") .arg ((*vditerator).m_name ) .arg ((*vditerator).m_modelindex)), 0);
- kDebug() << "Device name: " << name;
- kDebug() << "Device current input: " << currentinput;
+ qDebug() << "Device name: " << name;
+ qDebug() << "Device current input: " << currentinput;
(*vditerator).selectInput(currentinput);
for (int input = 0 ; input < (*vditerator).m_input.size(); input++)
@@ -818,14 +817,14 @@ void VideoDevicePool::loadConfig()
(*vditerator).setAutoBrightnessContrast(autobrightnesscontrast);
(*vditerator).setAutoColorCorrection(autocolorcorrection);
(*vditerator).setImageAsMirror(imageasmirror);
- kDebug() << "Brightness:" << brightness;
- kDebug() << "Contrast :" << contrast;
- kDebug() << "Saturation:" << saturation;
- kDebug() << "Whiteness :" << whiteness;
- kDebug() << "Hue :" << hue;
- kDebug() << "AutoBrightnessContrast:" << autobrightnesscontrast;
- kDebug() << "AutoColorCorrection :" << autocolorcorrection;
- kDebug() << "ImageAsMirror :" << imageasmirror;
+ qDebug() << "Brightness:" << brightness;
+ qDebug() << "Contrast :" << contrast;
+ qDebug() << "Saturation:" << saturation;
+ qDebug() << "Whiteness :" << whiteness;
+ qDebug() << "Hue :" << hue;
+ qDebug() << "AutoBrightnessContrast:" << autobrightnesscontrast;
+ qDebug() << "AutoColorCorrection :" << autocolorcorrection;
+ qDebug() << "ImageAsMirror :" << imageasmirror;
}
}
}
@@ -839,7 +838,7 @@ void VideoDevicePool::saveConfig()
{
#ifdef COMPILE_KDE_SUPPORT
/// @todo implement me
- kDebug() << "called";
+ qDebug() << "called";
if(hasDevices())
{
KConfigGroup config(KGlobal::config(), "Video Device Settings");
@@ -849,8 +848,8 @@ void VideoDevicePool::saveConfig()
VideoDeviceModelPool::m_devicemodel::iterator vmiterator;
for( vmiterator = m_modelvector.begin(); vmiterator != m_modelvector.end(); ++vmiterator )
{
- kDebug() << "Device Model: " << (*vmiterator).name;
- kDebug() << "Device Count: " << (*vmiterator).count;
+ qDebug() << "Device Model: " << (*vmiterator).name;
+ qDebug() << "Device Count: " << (*vmiterator).count;
}
}
*/
@@ -861,8 +860,8 @@ void VideoDevicePool::saveConfig()
VideoDeviceVector::iterator vditerator;
for( vditerator = m_videodevice.begin(); vditerator != m_videodevice.end(); ++vditerator )
{
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Name:" << (*vditerator).m_name;
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Current input:" << (*vditerator).currentInput();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Name:" << (*vditerator).m_name;
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Current input:" << (*vditerator).currentInput();
// Stores current input for the given video device
const QString name = QString::fromLocal8Bit ( "Model %1 Device %2 Name") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex);
@@ -872,13 +871,13 @@ void VideoDevicePool::saveConfig()
for (int input = 0 ; input < (*vditerator).m_input.size(); input++)
{
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Brightness: " << (*vditerator).m_input[input].getBrightness();
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Contrast : " << (*vditerator).m_input[input].getContrast();
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Saturation: " << (*vditerator).m_input[input].getSaturation();
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Whiteness : " << (*vditerator).m_input[input].getWhiteness();
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Hue : " << (*vditerator).m_input[input].getHue();
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Automatic brightness / contrast: " << (*vditerator).m_input[input].getAutoBrightnessContrast();
- kDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Automatic color correction : " << (*vditerator).m_input[input].getAutoColorCorrection();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Brightness: " << (*vditerator).m_input[input].getBrightness();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Contrast : " << (*vditerator).m_input[input].getContrast();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Saturation: " << (*vditerator).m_input[input].getSaturation();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Whiteness : " << (*vditerator).m_input[input].getWhiteness();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Hue : " << (*vditerator).m_input[input].getHue();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Automatic brightness / contrast: " << (*vditerator).m_input[input].getAutoBrightnessContrast();
+ qDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Automatic color correction : " << (*vditerator).m_input[input].getAutoColorCorrection();
// Stores configuration about each channel
const QString brightness = QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Brightness") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input);
@@ -900,7 +899,7 @@ void VideoDevicePool::saveConfig()
}
}
config.sync();
- kDebug();
+ qDebug();
}
#endif
}
@@ -909,7 +908,7 @@ void VideoDevicePool::saveConfig()
void VideoDevicePool::deviceAdded( const QString & udi )
{
- kDebug() << "("<< udi << ") called";
+ qDebug() << "("<< udi << ") called";
Solid::Device dev( udi );
if ( dev.is<Solid::Video>() )
{
@@ -920,13 +919,13 @@ void VideoDevicePool::deviceAdded( const QString & udi )
void VideoDevicePool::deviceRemoved( const QString & udi )
{
- kDebug() << "("<< udi << ") called";
+ qDebug() << "("<< udi << ") called";
int i = 0;
foreach ( VideoDevice vd, m_videodevice )
{
if ( vd.udi() == udi )
{
- kDebug() << "Video device '" << udi << "' has been removed!";
+ qDebug() << "Video device '" << udi << "' has been removed!";
emit deviceUnregistered( udi );
// not sure if this is safe but at this point the device node is gone already anyway
m_videodevice.remove( i );
diff --git a/src/kvilib/ext/avdevice/videodevicepool.h b/src/kvilib/ext/avdevice/videodevicepool.h
index 9a5e22c4b..19e57b3c4 100644
--- a/src/kvilib/ext/avdevice/videodevicepool.h
+++ b/src/kvilib/ext/avdevice/videodevicepool.h
@@ -50,13 +50,11 @@
#include "videoinput.h"
#include "videodevicemodelpool.h"
-#include <qstring.h>
-#include <qimage.h>
-#include <q3valuevector.h>
-#include <qmutex.h>
+#include <QString>
+#include <QImage>
+#include <QMutex>
#include <QComboBox>
#include "videodevice.h"
-#include "kopete_export.h"
#ifdef COMPILE_KDE_SUPPORT
#include <solid/device.h>
@@ -80,7 +78,7 @@ This class allows kopete to check for the existence, open, configure, test, set
@author Cláudio da Silveira Pinheiro
*/
-class KOPETE_EXPORT VideoDevicePool : public QObject
+class VideoDevicePool : public QObject
{
Q_OBJECT
public:
diff --git a/src/kvilib/ext/avdevice/videoinput.cpp b/src/kvilib/ext/avdevice/videoinput.cpp
index 2f95c8d58..3acdba95d 100644
--- a/src/kvilib/ext/avdevice/videoinput.cpp
+++ b/src/kvilib/ext/avdevice/videoinput.cpp
@@ -41,6 +41,8 @@
*************************************************************************
*/
+#include <QDebug>
+
#include "videoinput.h"
namespace Kopete {
@@ -49,7 +51,7 @@ namespace AV {
VideoInput::VideoInput()
{
- kDebug() << "Executing Video Input's constructor!!!";
+ qDebug() << "Executing Video Input's constructor!!!";
m_brightness = 0.5;
m_contrast = 0.5;
m_saturation = 0.5;
@@ -65,13 +67,13 @@ VideoInput::~VideoInput()
float VideoInput::getBrightness()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_brightness;
}
float VideoInput::setBrightness(float brightness)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
if ( brightness > 1 )
brightness = 1;
else
@@ -83,13 +85,13 @@ float VideoInput::setBrightness(float brightness)
float VideoInput::getContrast()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_contrast;
}
float VideoInput::setContrast(float contrast)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
if ( contrast > 1 )
contrast = 1;
else
@@ -101,13 +103,13 @@ float VideoInput::setContrast(float contrast)
float VideoInput::getSaturation()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_saturation;
}
float VideoInput::setSaturation(float saturation)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
if ( saturation > 1 )
saturation = 1;
else
@@ -119,13 +121,13 @@ float VideoInput::setSaturation(float saturation)
float VideoInput::getWhiteness()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_whiteness;
}
float VideoInput::setWhiteness(float whiteness)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
if ( whiteness > 1 )
whiteness = 1;
else
@@ -137,13 +139,13 @@ float VideoInput::setWhiteness(float whiteness)
float VideoInput::getHue()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_hue;
}
float VideoInput::setHue(float hue)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
if ( hue > 1 )
hue = 1;
else
@@ -156,39 +158,39 @@ float VideoInput::setHue(float hue)
bool VideoInput::getAutoBrightnessContrast()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_autobrightnesscontrast;
}
bool VideoInput::setAutoBrightnessContrast(bool brightnesscontrast)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
m_autobrightnesscontrast = brightnesscontrast;
return getAutoBrightnessContrast();
}
bool VideoInput::getAutoColorCorrection()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_autocolorcorrection;
}
bool VideoInput::setAutoColorCorrection(bool colorcorrection)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
m_autocolorcorrection = colorcorrection;
return getAutoColorCorrection();
}
bool VideoInput::getImageAsMirror()
{
-// kDebug() << " called.";
+// qDebug() << " called.";
return m_imageasmirror;
}
bool VideoInput::setImageAsMirror(bool imageasmirror)
{
-// kDebug() << " called.";
+// qDebug() << " called.";
m_imageasmirror = imageasmirror;
return getImageAsMirror();
}
diff --git a/src/kvilib/ext/avdevice/videoinput.h b/src/kvilib/ext/avdevice/videoinput.h
index a595617b1..ce9066b54 100644
--- a/src/kvilib/ext/avdevice/videoinput.h
+++ b/src/kvilib/ext/avdevice/videoinput.h
@@ -41,8 +41,6 @@
*************************************************************************
*/
-#define ENABLE_AV
-
#ifndef KOPETE_AVVIDEOINPUT_H
#define KOPETE_AVVIDEOINPUT_H
@@ -54,8 +52,7 @@
#define __u64 unsigned long long
#endif // __u64*/
-#include <qstring.h>
-#include "kopete_export.h"
+#include <QString>
namespace Kopete {
@@ -64,7 +61,7 @@ namespace AV {
/**
@author Kopete Developers
*/
-class KOPETE_EXPORT VideoInput{
+class VideoInput{
public:
VideoInput();
~VideoInput();