Backport for the 120117 fix and some other bugs.

http://bugs.kde.org/show_bug.cgi?id=120117

From KDE SVN.
This commit is contained in:
brad 2006-04-29 01:02:24 +00:00
parent 7b0be3a97d
commit f793ea9c92
7 changed files with 1069 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.37 2006/04/01 10:49:21 espie Exp $
# $OpenBSD: Makefile,v 1.38 2006/04/29 01:02:24 brad Exp $
COMMENT= "K Desktop Environment, network applications"
CATEGORIES= x11 x11/kde
VERSION= 3.5.2
DISTNAME= kdenetwork-${VERSION}
PKGNAME= ${DISTNAME}
PKGNAME= ${DISTNAME}p1
MODKDE_VERSION= 3.5.2
FLAVORS=debug
SHARED_LIBS= kopete 2.0 \

View File

@ -0,0 +1,531 @@
$OpenBSD: patch-kopete_libkopete_avdevice_videodevice_cpp,v 1.1 2006/04/29 01:02:24 brad Exp $
--- kopete/libkopete/avdevice/videodevice.cpp.orig Fri Mar 17 05:12:32 2006
+++ kopete/libkopete/avdevice/videodevice.cpp Fri Apr 28 15:52:51 2006
@@ -141,6 +141,9 @@ int VideoDevice::checkDevice()
m_driver=VIDEODEV_DRIVER_NONE;
#if defined(__linux__) && defined(ENABLE_AV)
#ifdef HAVE_V4L2
+
+if(!getWorkaroundBrokenDriver())
+{
CLEAR(V4L2_capabilities);
if (-1 != xioctl (VIDIOC_QUERYCAP, &V4L2_capabilities))
@@ -214,7 +217,8 @@ int VideoDevice::checkDevice()
{
VideoInput tempinput;
tempinput.name = QString::fromLocal8Bit((const char*)videoinput.name);
- tempinput.hastuner=videoinput.type & V4L2_INPUT_TYPE_TUNER;
+ tempinput.hastuner = videoinput.type & V4L2_INPUT_TYPE_TUNER;
+ tempinput.m_standards = videoinput.std;
m_input.push_back(tempinput);
kdDebug() << k_funcinfo << "Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.type & V4L2_INPUT_TYPE_TUNER) != 0) << ")" << endl;
if((videoinput.type & V4L2_INPUT_TYPE_TUNER) != 0)
@@ -237,6 +241,8 @@ int VideoDevice::checkDevice()
// it will try the V4L api even if the error code is different than expected.
kdDebug() << k_funcinfo << "checkDevice(): " << full_filename << " is not a V4L2 device." << endl;
}
+
+}
#endif
CLEAR(V4L_capabilities);
@@ -285,6 +291,7 @@ int VideoDevice::checkDevice()
VideoInput tempinput;
tempinput.name = QString::fromLocal8Bit((const char*)videoinput.name);
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);
// kdDebug() << "libkopete (avdevice): Input " << loop << ": " << tempinput.name << " (tuner: " << ((videoinput.flags & VIDEO_VC_TUNER) != 0) << ")" << endl;
/* if((input.type & V4L2_INPUT_TYPE_TUNER) != 0)
@@ -303,6 +310,8 @@ int VideoDevice::checkDevice()
}
#endif
m_name=m_model; // Take care about changing the name to be different from the model itself...
+// TODO: THis thing can be used to detec what pixel formats are supported in a API-independent way, but V4L2 has VIDIOC_ENUM_PIXFMT.
+// 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.
kdDebug() << k_funcinfo << "checkDevice(): " << "Supported pixel formats:" << endl;
if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_GREY))
kdDebug() << k_funcinfo << "checkDevice(): " << pixelFormatName(PIXELFORMAT_GREY) << endl;
@@ -333,7 +342,7 @@ int VideoDevice::checkDevice()
if(PIXELFORMAT_NONE != setPixelFormat(PIXELFORMAT_YUV420P))
kdDebug() << k_funcinfo << "checkDevice(): " << pixelFormatName(PIXELFORMAT_YUV420P) << endl;
- // Now we must execute the proper initialization according to the type of the driver.
+// TODO: Now we must execute the proper initialization according to the type of the driver.
kdDebug() << k_funcinfo << "checkDevice() exited successfuly." << endl;
return EXIT_SUCCESS;
}
@@ -743,7 +752,6 @@ int VideoDevice::selectInput(int newinpu
if(m_current_input >= inputs())
return EXIT_FAILURE;
- m_current_input = newinput;
if(isOpen())
{
switch (m_driver)
@@ -761,7 +769,7 @@ int VideoDevice::selectInput(int newinpu
case VIDEODEV_DRIVER_V4L:
struct video_channel V4L_input;
V4L_input.channel=newinput;
- V4L_input.norm=1;
+ V4L_input.norm=4; // Hey, it's plain wrong! It should be input's signal standard!
if (-1 == ioctl (descriptor, VIDIOCSCHAN, &V4L_input))
{
perror ("ioctl (VIDIOCSCHAN)");
@@ -774,6 +782,7 @@ int VideoDevice::selectInput(int newinpu
break;
}
kdDebug() << k_funcinfo << "Selected input " << newinput << " (" << m_input[newinput].name << ")" << endl;
+ m_current_input = newinput;
setInputParameters();
return EXIT_SUCCESS;
}
@@ -1282,7 +1291,10 @@ int VideoDevice::close()
float VideoDevice::getBrightness()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getBrightness();
+ else
+ return 0;
}
float VideoDevice::setBrightness(float brightness)
@@ -1317,7 +1329,10 @@ float VideoDevice::setBrightness(float b
float VideoDevice::getContrast()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getContrast();
+ else
+ return 0;
}
float VideoDevice::setContrast(float contrast)
@@ -1352,7 +1367,10 @@ float VideoDevice::setContrast(float con
float VideoDevice::getSaturation()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getSaturation();
+ else
+ return 0;
}
float VideoDevice::setSaturation(float saturation)
@@ -1387,7 +1405,10 @@ float VideoDevice::setSaturation(float s
float VideoDevice::getWhiteness()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getWhiteness();
+ else
+ return 0;
}
float VideoDevice::setWhiteness(float whiteness)
@@ -1422,7 +1443,10 @@ float VideoDevice::setWhiteness(float wh
float VideoDevice::getHue()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getHue();
+ else
+ return 0;
}
float VideoDevice::setHue(float hue)
@@ -1458,41 +1482,77 @@ float VideoDevice::setHue(float hue)
bool VideoDevice::getAutoBrightnessContrast()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getAutoBrightnessContrast();
+ else
+ return false;
}
bool VideoDevice::setAutoBrightnessContrast(bool brightnesscontrast)
{
kdDebug() << k_funcinfo << "VideoDevice::setAutoBrightnessContrast(" << brightnesscontrast << ") called." << endl;
- m_input[m_current_input].setAutoBrightnessContrast(brightnesscontrast);
- return m_input[m_current_input].getAutoBrightnessContrast();
-
+ if (m_current_input < m_input.size() )
+ {
+ m_input[m_current_input].setAutoBrightnessContrast(brightnesscontrast);
+ return m_input[m_current_input].getAutoBrightnessContrast();
+ }
+ else
+ return false;
+
}
bool VideoDevice::getAutoColorCorrection()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getAutoColorCorrection();
+ else
+ return false;
}
bool VideoDevice::setAutoColorCorrection(bool colorcorrection)
{
kdDebug() << k_funcinfo << "VideoDevice::setAutoColorCorrection(" << colorcorrection << ") called." << endl;
- m_input[m_current_input].setAutoColorCorrection(colorcorrection);
- return m_input[m_current_input].getAutoColorCorrection();
+ if (m_current_input < m_input.size() )
+ {
+ m_input[m_current_input].setAutoColorCorrection(colorcorrection);
+ return m_input[m_current_input].getAutoColorCorrection();
+ }
+ else
+ return false;
}
bool VideoDevice::getImageAsMirror()
{
+ if (m_current_input < m_input.size() )
return m_input[m_current_input].getImageAsMirror();
+ else
+ return false;
}
bool VideoDevice::setImageAsMirror(bool imageasmirror)
{
kdDebug() << k_funcinfo << "VideoDevice::setImageAsMirror(" << imageasmirror << ") called." << endl;
- m_input[m_current_input].setImageAsMirror(imageasmirror);
- return m_input[m_current_input].getImageAsMirror();
+ if (m_current_input < m_input.size() )
+ {
+ m_input[m_current_input].setImageAsMirror(imageasmirror);
+ return m_input[m_current_input].getImageAsMirror();
+ }
+ else
+ return false;
}
+bool VideoDevice::getDisableMMap()
+{
+ return m_disablemmap;
+}
+
+bool VideoDevice::setDisableMMap(bool disablemmap)
+{
+ kdDebug() << k_funcinfo << "VideoDevice::setDisableMMap(" << disablemmap << ") called." << endl;
+ m_disablemmap = disablemmap;
+ return m_disablemmap;
+}
+
bool VideoDevice::getWorkaroundBrokenDriver()
{
return m_workaroundbrokendriver;
@@ -1637,6 +1697,7 @@ int VideoDevice::pixelFormatDepth(pixel_
QString VideoDevice::pixelFormatName(pixel_format pixelformat)
{
QString returnvalue;
+ returnvalue = "None";
switch(pixelformat)
{
case PIXELFORMAT_NONE : returnvalue = "None"; break;
@@ -1669,36 +1730,36 @@ QString VideoDevice::pixelFormatName(int
case VIDEODEV_DRIVER_V4L2:
switch(pixelformat)
{
- case V4L2_PIX_FMT_GREY : returnvalue = "8-bit Grayscale"; break;
- case V4L2_PIX_FMT_RGB332 : returnvalue = "8-bit RGB332"; break;
- case V4L2_PIX_FMT_RGB555 : returnvalue = "16-bit RGB555"; break;
- case V4L2_PIX_FMT_RGB555X : returnvalue = "16-bit RGB555X"; break;
- case V4L2_PIX_FMT_RGB565 : returnvalue = "16-bit RGB565"; break;
- case V4L2_PIX_FMT_RGB565X : returnvalue = "16-bit RGB565X"; break;
- case V4L2_PIX_FMT_RGB24 : returnvalue = "24-bit RGB24"; break;
- case V4L2_PIX_FMT_BGR24 : returnvalue = "24-bit BGR24"; break;
- case V4L2_PIX_FMT_RGB32 : returnvalue = "32-bit RGB32"; break;
- case V4L2_PIX_FMT_BGR32 : returnvalue = "32-bit BGR32"; break;
- case V4L2_PIX_FMT_YUYV : returnvalue = "Packed YUV 4:2:2"; break;
- case V4L2_PIX_FMT_UYVY : returnvalue = "Packed YVU 4:2:2"; break;
- case V4L2_PIX_FMT_YUV420 : returnvalue = "Planar YUV 4:2:0"; break;
- case V4L2_PIX_FMT_YUV422P : returnvalue = "Planar YUV 4:2:2"; break;
+ case V4L2_PIX_FMT_GREY : returnvalue = pixelFormatName(PIXELFORMAT_GREY); break;
+ case V4L2_PIX_FMT_RGB332 : returnvalue = pixelFormatName(PIXELFORMAT_RGB332); break;
+ case V4L2_PIX_FMT_RGB555 : returnvalue = pixelFormatName(PIXELFORMAT_RGB555); break;
+ case V4L2_PIX_FMT_RGB555X : returnvalue = pixelFormatName(PIXELFORMAT_RGB555X); break;
+ case V4L2_PIX_FMT_RGB565 : returnvalue = pixelFormatName(PIXELFORMAT_RGB565); break;
+ case V4L2_PIX_FMT_RGB565X : returnvalue = pixelFormatName(PIXELFORMAT_RGB565X); break;
+ case V4L2_PIX_FMT_RGB24 : returnvalue = pixelFormatName(PIXELFORMAT_RGB24); break;
+ case V4L2_PIX_FMT_BGR24 : returnvalue = pixelFormatName(PIXELFORMAT_BGR24); break;
+ case V4L2_PIX_FMT_RGB32 : returnvalue = pixelFormatName(PIXELFORMAT_RGB32); break;
+ case V4L2_PIX_FMT_BGR32 : returnvalue = pixelFormatName(PIXELFORMAT_BGR32); break;
+ case V4L2_PIX_FMT_YUYV : returnvalue = pixelFormatName(PIXELFORMAT_YUYV); break;
+ case V4L2_PIX_FMT_UYVY : returnvalue = pixelFormatName(PIXELFORMAT_UYVY); break;
+ case V4L2_PIX_FMT_YUV420 : returnvalue = pixelFormatName(PIXELFORMAT_YUV420P); break;
+ case V4L2_PIX_FMT_YUV422P : returnvalue = pixelFormatName(PIXELFORMAT_YUV422P); break;
}
break;
#endif
case VIDEODEV_DRIVER_V4L:
switch(pixelformat)
{
- case VIDEO_PALETTE_GREY : returnvalue = "8-bit Grayscale"; break;
- case VIDEO_PALETTE_HI240 : returnvalue = "8-bit RGB332"; break;
- case VIDEO_PALETTE_RGB555 : returnvalue = "16-bit RGB555"; break;
- case VIDEO_PALETTE_RGB565 : returnvalue = "16-bit RGB565"; break;
- case VIDEO_PALETTE_RGB24 : returnvalue = "24-bit RGB24"; break;
- case VIDEO_PALETTE_RGB32 : returnvalue = "32-bit RGB32"; break;
- case VIDEO_PALETTE_YUYV : returnvalue = "Packed YUV 4:2:2"; break;
- case VIDEO_PALETTE_UYVY : returnvalue = "Packed YVU 4:2:2"; break;
- case VIDEO_PALETTE_YUV420 : returnvalue = "Planar YUV 4:2:0"; break;
- case VIDEO_PALETTE_YUV422P : returnvalue = "Planar YUV 4:2:2"; break;
+ case VIDEO_PALETTE_GREY : returnvalue = pixelFormatName(PIXELFORMAT_GREY); break;
+ case VIDEO_PALETTE_HI240 : returnvalue = pixelFormatName(PIXELFORMAT_RGB332); break;
+ case VIDEO_PALETTE_RGB555 : returnvalue = pixelFormatName(PIXELFORMAT_RGB555); break;
+ case VIDEO_PALETTE_RGB565 : returnvalue = pixelFormatName(PIXELFORMAT_RGB565); break;
+ case VIDEO_PALETTE_RGB24 : returnvalue = pixelFormatName(PIXELFORMAT_RGB24); break;
+ case VIDEO_PALETTE_RGB32 : returnvalue = pixelFormatName(PIXELFORMAT_RGB32); break;
+ case VIDEO_PALETTE_YUYV : returnvalue = pixelFormatName(PIXELFORMAT_YUYV); break;
+ case VIDEO_PALETTE_UYVY : returnvalue = pixelFormatName(PIXELFORMAT_UYVY); break;
+ case VIDEO_PALETTE_YUV420 : returnvalue = pixelFormatName(PIXELFORMAT_YUV420P); break;
+ case VIDEO_PALETTE_YUV422P : returnvalue = pixelFormatName(PIXELFORMAT_YUV422P); break;
}
break;
#endif
@@ -1707,6 +1768,238 @@ QString VideoDevice::pixelFormatName(int
break;
}
return returnvalue;
+}
+
+__u64 VideoDevice::signalStandardCode(signal_standard standard)
+{
+ switch(m_driver)
+ {
+#if defined(__linux__) && defined(ENABLE_AV)
+#ifdef HAVE_V4L2
+ case VIDEODEV_DRIVER_V4L2:
+ switch(standard)
+ {
+ case STANDARD_NONE : return V4L2_STD_UNKNOWN; break;
+ case STANDARD_PAL_B : return V4L2_STD_PAL_B; break;
+ case STANDARD_PAL_B1 : return V4L2_STD_PAL_B1; break;
+ case STANDARD_PAL_G : return V4L2_STD_PAL_G; break;
+ case STANDARD_PAL_H : return V4L2_STD_PAL_H; break;
+ case STANDARD_PAL_I : return V4L2_STD_PAL_I; break;
+ case STANDARD_PAL_D : return V4L2_STD_PAL_D; break;
+ case STANDARD_PAL_D1 : return V4L2_STD_PAL_D1; break;
+ case STANDARD_PAL_K : return V4L2_STD_PAL_K; break;
+ case STANDARD_PAL_M : return V4L2_STD_PAL_M; break;
+ case STANDARD_PAL_N : return V4L2_STD_PAL_N; break;
+ case STANDARD_PAL_Nc : return V4L2_STD_PAL_Nc; break;
+ case STANDARD_PAL_60 : return V4L2_STD_PAL_60; break;
+ case STANDARD_NTSC_M : return V4L2_STD_NTSC_M; break;
+ case STANDARD_NTSC_M_JP : return V4L2_STD_NTSC_M_JP; break;
+ case STANDARD_NTSC_443 : return V4L2_STD_NTSC; break; // Using workaround value because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
+ case STANDARD_SECAM_B : return V4L2_STD_SECAM_B; break;
+ case STANDARD_SECAM_D : return V4L2_STD_SECAM_D; break;
+ case STANDARD_SECAM_G : return V4L2_STD_SECAM_G; break;
+ case STANDARD_SECAM_H : return V4L2_STD_SECAM_H; break;
+ case STANDARD_SECAM_K : return V4L2_STD_SECAM_K; break;
+ case STANDARD_SECAM_K1 : return V4L2_STD_SECAM_K1; break;
+ case STANDARD_SECAM_L : return V4L2_STD_SECAM_L; break;
+ case STANDARD_SECAM_LC : return V4L2_STD_SECAM; break; // Using workaround value because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
+ case STANDARD_ATSC_8_VSB : return V4L2_STD_ATSC_8_VSB; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_ATSC_16_VSB : return V4L2_STD_ATSC_16_VSB; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_PAL_BG : return V4L2_STD_PAL_BG; break;
+ case STANDARD_PAL_DK : return V4L2_STD_PAL_DK; break;
+ case STANDARD_PAL : return V4L2_STD_PAL; break;
+ case STANDARD_NTSC : return V4L2_STD_NTSC; break;
+ case STANDARD_SECAM_DK : return V4L2_STD_SECAM_DK; break;
+ case STANDARD_SECAM : return V4L2_STD_SECAM; break;
+ case STANDARD_525_60 : return V4L2_STD_525_60; break;
+ case STANDARD_625_50 : return V4L2_STD_625_50; break;
+ case STANDARD_ALL : return V4L2_STD_ALL; break;
+ }
+ break;
+#endif
+ case VIDEODEV_DRIVER_V4L:
+ switch(standard)
+ {
+ case STANDARD_NONE : return VIDEO_MODE_AUTO; break;
+ case STANDARD_PAL_B : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_B1 : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_G : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_H : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_I : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_D : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_D1 : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_K : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_M : return 5; break; // Undocumented value found to be compatible with V4L bttv driver
+ case STANDARD_PAL_N : return 6; break; // Undocumented value found to be compatible with V4L bttv driver
+ case STANDARD_PAL_Nc : return 4; break; // Undocumented value found to be compatible with V4L bttv driver
+ case STANDARD_PAL_60 : return VIDEO_MODE_PAL; break;
+ case STANDARD_NTSC_M : return VIDEO_MODE_NTSC; break;
+ case STANDARD_NTSC_M_JP : return 7; break; // Undocumented value found to be compatible with V4L bttv driver
+ case STANDARD_NTSC_443 : return VIDEO_MODE_NTSC; break; // Using workaround value because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
+ case STANDARD_SECAM_B : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM_D : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM_G : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM_H : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM_K : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM_K1 : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM_L : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM_LC : return VIDEO_MODE_SECAM; break; // Using workaround value because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
+ case STANDARD_ATSC_8_VSB : return VIDEO_MODE_AUTO; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_ATSC_16_VSB : return VIDEO_MODE_AUTO; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_PAL_BG : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL_DK : return VIDEO_MODE_PAL; break;
+ case STANDARD_PAL : return VIDEO_MODE_PAL; break;
+ case STANDARD_NTSC : return VIDEO_MODE_NTSC; break;
+ case STANDARD_SECAM_DK : return VIDEO_MODE_SECAM; break;
+ case STANDARD_SECAM : return VIDEO_MODE_SECAM; break;
+ case STANDARD_525_60 : return VIDEO_MODE_PAL; break;
+ case STANDARD_625_50 : return VIDEO_MODE_SECAM; break;
+ case STANDARD_ALL : return VIDEO_MODE_AUTO; break;
+ }
+ break;
+#endif
+ case VIDEODEV_DRIVER_NONE:
+ default:
+ return STANDARD_NONE; break;
+ }
+ return STANDARD_NONE;
+}
+
+QString VideoDevice::signalStandardName(signal_standard standard)
+{
+ QString returnvalue;
+ returnvalue = "None";
+ switch(standard)
+ {
+ case STANDARD_NONE : returnvalue = "None"; break;
+ case STANDARD_PAL_B : returnvalue = "PAL-B"; break;
+ case STANDARD_PAL_B1 : returnvalue = "PAL-B1"; break;
+ case STANDARD_PAL_G : returnvalue = "PAL-G"; break;
+ case STANDARD_PAL_H : returnvalue = "PAL-H"; break;
+ case STANDARD_PAL_I : returnvalue = "PAL-I"; break;
+ case STANDARD_PAL_D : returnvalue = "PAL-D"; break;
+ case STANDARD_PAL_D1 : returnvalue = "PAL-D1"; break;
+ case STANDARD_PAL_K : returnvalue = "PAL-K"; break;
+ case STANDARD_PAL_M : returnvalue = "PAL-M"; break;
+ case STANDARD_PAL_N : returnvalue = "PAL-N"; break;
+ case STANDARD_PAL_Nc : returnvalue = "PAL-Nc"; break;
+ case STANDARD_PAL_60 : returnvalue = "PAL-60"; break;
+ case STANDARD_NTSC_M : returnvalue = "NTSC-M"; break;
+ case STANDARD_NTSC_M_JP : returnvalue = "NTSC-M(JP)"; break;
+ case STANDARD_NTSC_443 : returnvalue = "NTSC-443"; break;
+ case STANDARD_SECAM_B : returnvalue = "SECAM-B"; break;
+ case STANDARD_SECAM_D : returnvalue = "SECAM-D"; break;
+ case STANDARD_SECAM_G : returnvalue = "SECAM-G"; break;
+ case STANDARD_SECAM_H : returnvalue = "SECAM-H"; break;
+ case STANDARD_SECAM_K : returnvalue = "SECAM-K"; break;
+ case STANDARD_SECAM_K1 : returnvalue = "SECAM-K1"; break;
+ case STANDARD_SECAM_L : returnvalue = "SECAM-L"; break;
+ case STANDARD_SECAM_LC : returnvalue = "SECAM-LC"; break;
+ case STANDARD_ATSC_8_VSB : returnvalue = "ATSC-8-VSB"; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_ATSC_16_VSB : returnvalue = "ATSC-16-VSB"; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_PAL_BG : returnvalue = "PAL-BG"; break;
+ case STANDARD_PAL_DK : returnvalue = "PAL-DK"; break;
+ case STANDARD_PAL : returnvalue = "PAL"; break;
+ case STANDARD_NTSC : returnvalue = "NTSC"; break;
+ case STANDARD_SECAM_DK : returnvalue = "SECAM-DK"; break;
+ case STANDARD_SECAM : returnvalue = "SECAM"; break;
+ case STANDARD_525_60 : returnvalue = "525 lines 60Hz"; break;
+ case STANDARD_625_50 : returnvalue = "625 lines 50Hz"; break;
+ case STANDARD_ALL : returnvalue = "All"; break;
+ }
+ return returnvalue;
+}
+
+QString VideoDevice::signalStandardName(int standard)
+{
+ QString returnvalue;
+ returnvalue = "None";
+ switch(m_driver)
+ {
+#if defined(__linux__) && defined(ENABLE_AV)
+#ifdef HAVE_V4L2
+ case VIDEODEV_DRIVER_V4L2:
+ switch(standard)
+ {
+ case V4L2_STD_PAL_B : returnvalue = signalStandardName(STANDARD_PAL_B); break;
+ case V4L2_STD_PAL_B1 : returnvalue = signalStandardName(STANDARD_PAL_B1); break;
+ case V4L2_STD_PAL_G : returnvalue = signalStandardName(STANDARD_PAL_G); break;
+ case V4L2_STD_PAL_H : returnvalue = signalStandardName(STANDARD_PAL_H); break;
+ case V4L2_STD_PAL_I : returnvalue = signalStandardName(STANDARD_PAL_I); break;
+ case V4L2_STD_PAL_D : returnvalue = signalStandardName(STANDARD_PAL_D); break;
+ case V4L2_STD_PAL_D1 : returnvalue = signalStandardName(STANDARD_PAL_D1); break;
+ case V4L2_STD_PAL_K : returnvalue = signalStandardName(STANDARD_PAL_K); break;
+ case V4L2_STD_PAL_M : returnvalue = signalStandardName(STANDARD_PAL_M); break;
+ case V4L2_STD_PAL_N : returnvalue = signalStandardName(STANDARD_PAL_N); break;
+ case V4L2_STD_PAL_Nc : returnvalue = signalStandardName(STANDARD_PAL_Nc); break;
+ case V4L2_STD_PAL_60 : returnvalue = signalStandardName(STANDARD_PAL_60); break;
+ case V4L2_STD_NTSC_M : returnvalue = signalStandardName(STANDARD_NTSC_M); break;
+ case V4L2_STD_NTSC_M_JP : returnvalue = signalStandardName(STANDARD_NTSC_M_JP); break;
+// 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
+ case V4L2_STD_SECAM_B : returnvalue = signalStandardName(STANDARD_SECAM_B); break;
+ case V4L2_STD_SECAM_D : returnvalue = signalStandardName(STANDARD_SECAM_D); break;
+ case V4L2_STD_SECAM_G : returnvalue = signalStandardName(STANDARD_SECAM_G); break;
+ case V4L2_STD_SECAM_H : returnvalue = signalStandardName(STANDARD_SECAM_H); break;
+ case V4L2_STD_SECAM_K : returnvalue = signalStandardName(STANDARD_SECAM_K); break;
+ case V4L2_STD_SECAM_K1 : returnvalue = signalStandardName(STANDARD_SECAM_K1); break;
+ case V4L2_STD_SECAM_L : returnvalue = signalStandardName(STANDARD_SECAM_L); break;
+// case V4L2_STD_SECAM_LC : returnvalue = signalStandardName(STANDARD_SECAM_LC); break; // Commented out because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
+ case V4L2_STD_ATSC_8_VSB : returnvalue = signalStandardName(STANDARD_ATSC_8_VSB); break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case V4L2_STD_ATSC_16_VSB : returnvalue = signalStandardName(STANDARD_ATSC_16_VSB); break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case V4L2_STD_PAL_BG : returnvalue = signalStandardName(STANDARD_PAL_BG); break;
+ case V4L2_STD_PAL_DK : returnvalue = signalStandardName(STANDARD_PAL_DK); break;
+ case V4L2_STD_PAL : returnvalue = signalStandardName(STANDARD_PAL); break;
+ case V4L2_STD_NTSC : returnvalue = signalStandardName(STANDARD_NTSC); break;
+ case V4L2_STD_SECAM_DK : returnvalue = signalStandardName(STANDARD_SECAM_DK); break;
+ case V4L2_STD_SECAM : returnvalue = signalStandardName(STANDARD_SECAM); break;
+ case V4L2_STD_525_60 : returnvalue = signalStandardName(STANDARD_525_60); break;
+ case V4L2_STD_625_50 : returnvalue = signalStandardName(STANDARD_625_50); break;
+ case V4L2_STD_ALL : returnvalue = signalStandardName(STANDARD_ALL); break;
+ }
+ break;
+#endif
+ case VIDEODEV_DRIVER_V4L:
+ switch(standard)
+ {
+ case VIDEO_MODE_PAL : returnvalue = signalStandardName(STANDARD_PAL); break;
+ case VIDEO_MODE_NTSC : returnvalue = signalStandardName(STANDARD_NTSC); break;
+ case VIDEO_MODE_SECAM : returnvalue = signalStandardName(STANDARD_SECAM); break;
+ 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
+// case VIDEO_MODE_PAL_Nc : returnvalue = signalStandardName(STANDARD_PAL_Nc); break; // Undocumented value found to be compatible with V4L bttv driver
+ case VIDEO_MODE_PAL_M : returnvalue = signalStandardName(STANDARD_PAL_M); break; // Undocumented value found to be compatible with V4L bttv driver
+ case VIDEO_MODE_PAL_N : returnvalue = signalStandardName(STANDARD_PAL_N); break; // Undocumented value found to be compatible with V4L bttv driver
+ case VIDEO_MODE_NTSC_JP : returnvalue = signalStandardName(STANDARD_NTSC_M_JP); break; // Undocumented value found to be compatible with V4L bttv driver
+ }
+ break;
+#endif
+ case VIDEODEV_DRIVER_NONE:
+ default:
+ break;
+ }
+ return returnvalue;
+}
+
+/*!
+ \fn VideoDevice::detectSignalStandards()
+ */
+int VideoDevice::detectSignalStandards()
+{
+ switch(m_driver)
+ {
+#if defined(__linux__) && defined(ENABLE_AV)
+#ifdef HAVE_V4L2
+ case VIDEODEV_DRIVER_V4L2:
+ break;
+#endif
+ case VIDEODEV_DRIVER_V4L:
+ break;
+#endif
+ case VIDEODEV_DRIVER_NONE:
+ default:
+ break;
+ }
+ //FIXME: return a real value
+ return 0;
}
/*!

View File

@ -0,0 +1,118 @@
$OpenBSD: patch-kopete_libkopete_avdevice_videodevice_h,v 1.1 2006/04/29 01:02:24 brad Exp $
--- kopete/libkopete/avdevice/videodevice.h.orig Fri Mar 17 05:12:32 2006
+++ kopete/libkopete/avdevice/videodevice.h Fri Apr 28 15:51:55 2006
@@ -48,6 +48,10 @@
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/videodev.h>
+#define VIDEO_MODE_PAL_Nc 3
+#define VIDEO_MODE_PAL_M 4
+#define VIDEO_MODE_PAL_N 5
+#define VIDEO_MODE_NTSC_JP 6
#define __STRICT_ANSI__
#endif // __linux__
@@ -102,6 +106,50 @@ typedef enum
typedef enum
{
+ STANDARD_NONE = 0,
+ STANDARD_PAL_B = (1 << 0),
+ STANDARD_PAL_B1 = (1 << 1),
+ STANDARD_PAL_G = (1 << 2),
+ STANDARD_PAL_H = (1 << 3),
+ STANDARD_PAL_I = (1 << 4),
+ STANDARD_PAL_D = (1 << 5),
+ STANDARD_PAL_D1 = (1 << 6),
+ STANDARD_PAL_K = (1 << 7),
+ STANDARD_PAL_M = (1 << 8),
+ STANDARD_PAL_N = (1 << 9),
+ STANDARD_PAL_Nc = (1 << 10),
+ STANDARD_PAL_60 = (1 << 11),
+// STANDARD_PAL_60 is a hybrid standard with 525 lines, 60 Hz refresh rate, and PAL color modulation with a 4.43 MHz color subcarrier. Some PAL video recorders can play back NTSC tapes in this mode for display on a 50/60 Hz agnostic PAL TV.
+ STANDARD_NTSC_M = (1 << 12),
+ STANDARD_NTSC_M_JP = (1 << 13),
+ STANDARD_NTSC_443 = (1 << 14),
+// STANDARD_NTSC_443 is a hybrid standard with 525 lines, 60 Hz refresh rate, and NTSC color modulation with a 4.43 MHz color subcarrier.
+ STANDARD_SECAM_B = (1 << 16),
+ STANDARD_SECAM_D = (1 << 17),
+ STANDARD_SECAM_G = (1 << 18),
+ STANDARD_SECAM_H = (1 << 19),
+ STANDARD_SECAM_K = (1 << 20),
+ STANDARD_SECAM_K1 = (1 << 21),
+ STANDARD_SECAM_L = (1 << 22),
+ STANDARD_SECAM_LC = (1 << 23),
+// ATSC/HDTV
+ STANDARD_ATSC_8_VSB = (1 << 24),
+ STANDARD_ATSC_16_VSB = (1 << 25),
+
+ STANDARD_PAL_BG = ( STANDARD_PAL_B | STANDARD_PAL_B1 | STANDARD_PAL_G ),
+ STANDARD_PAL_DK = ( STANDARD_PAL_D | STANDARD_PAL_D1 | STANDARD_PAL_K ),
+ STANDARD_PAL = ( STANDARD_PAL_BG | STANDARD_PAL_DK | STANDARD_PAL_H | STANDARD_PAL_I ),
+ STANDARD_NTSC = ( STANDARD_NTSC_M | STANDARD_NTSC_M_JP ),
+ STANDARD_SECAM_DK = ( STANDARD_SECAM_D | STANDARD_SECAM_K | STANDARD_SECAM_K1 ),
+ STANDARD_SECAM = ( STANDARD_SECAM_B | STANDARD_SECAM_G | STANDARD_SECAM_H | STANDARD_SECAM_DK | STANDARD_SECAM_L),
+ STANDARD_525_60 = ( STANDARD_PAL_M | STANDARD_PAL_60 | STANDARD_NTSC | STANDARD_NTSC_443),
+ STANDARD_625_50 = ( STANDARD_PAL | STANDARD_PAL_N | STANDARD_PAL_Nc | STANDARD_SECAM),
+ STANDARD_ALL = ( STANDARD_525_60 | STANDARD_625_50)
+} signal_standard;
+
+
+typedef enum
+{
IO_METHOD_NONE,
IO_METHOD_READ,
IO_METHOD_MMAP,
@@ -140,12 +188,19 @@ public:
int minHeight();
int maxHeight();
int setSize( int newwidth, int newheight);
+
pixel_format setPixelFormat(pixel_format newformat);
int pixelFormatCode(pixel_format pixelformat);
pixel_format pixelFormatForPalette( int palette );
int pixelFormatDepth(pixel_format pixelformat);
QString pixelFormatName(pixel_format pixelformat);
QString pixelFormatName(int pixelformat);
+
+ __u64 signalStandardCode(signal_standard standard);
+ QString signalStandardName(signal_standard standard);
+ QString signalStandardName(int standard);
+ int detectSignalStandards();
+
int currentInput();
int selectInput(int input);
int setInputParameters();
@@ -166,12 +221,16 @@ public:
float setWhiteness(float whiteness);
float getHue();
float setHue(float Hue);
+
bool getAutoBrightnessContrast();
bool setAutoBrightnessContrast(bool brightnesscontrast);
bool getAutoColorCorrection();
bool setAutoColorCorrection(bool colorcorrection);
bool getImageAsMirror();
bool setImageAsMirror(bool imageasmirror);
+
+ bool getDisableMMap();
+ bool setDisableMMap(bool disablemmap);
bool getWorkaroundBrokenDriver();
bool setWorkaroundBrokenDriver(bool workaroundbrokendriver);
@@ -197,6 +256,7 @@ public:
struct v4l2_cropcap cropcap;
struct v4l2_crop crop;
struct v4l2_format fmt;
+// struct v4l2_input m_input;
#endif
struct video_capability V4L_capabilities;
struct video_buffer V4L_videobuffer;
@@ -206,6 +266,7 @@ public:
protected:
int currentwidth, minwidth, maxwidth, currentheight, minheight, maxheight;
+ bool m_disablemmap;
bool m_workaroundbrokendriver;
QValueVector<rawbuffer> m_rawbuffers;

View File

@ -0,0 +1,331 @@
$OpenBSD: patch-kopete_libkopete_avdevice_videodevicepool_cpp,v 1.1 2006/04/29 01:02:24 brad Exp $
--- kopete/libkopete/avdevice/videodevicepool.cpp.orig Fri Mar 17 05:12:32 2006
+++ kopete/libkopete/avdevice/videodevicepool.cpp Fri Apr 28 15:51:20 2006
@@ -36,6 +36,7 @@ namespace Kopete {
namespace AV {
VideoDevicePool *VideoDevicePool::s_self = NULL;
+__u64 VideoDevicePool::m_clients = 0;
VideoDevicePool* VideoDevicePool::self()
{
@@ -43,6 +44,8 @@ VideoDevicePool* VideoDevicePool::self()
if (s_self == NULL)
{
s_self = new VideoDevicePool;
+ if (s_self)
+ m_clients = 0;
}
// kdDebug() << "libkopete (avdevice): self() exited successfuly" << endl;
return s_self;
@@ -67,6 +70,7 @@ int VideoDevicePool::open()
{
/// @todo implement me
+ m_ready.lock();
if(!m_videodevice.size())
{
kdDebug() << k_funcinfo << "open(): No devices found. Must scan for available devices." << m_current_device << endl;
@@ -75,6 +79,7 @@ int VideoDevicePool::open()
if(!m_videodevice.size())
{
kdDebug() << k_funcinfo << "open(): No devices found. bailing out." << m_current_device << endl;
+ m_ready.unlock();
return EXIT_FAILURE;
}
if(m_current_device >= m_videodevice.size())
@@ -82,13 +87,15 @@ int VideoDevicePool::open()
kdDebug() << k_funcinfo << "open(): Device out of scope (" << m_current_device << "). Defaulting to the first one." << endl;
m_current_device = 0;
}
-loadConfig();
int isopen = m_videodevice[currentDevice()].open();
if ( isopen == EXIT_SUCCESS)
{
loadConfig(); // Temporary hack. The open() seems to clean the input parameters. Need to find a way to fix it.
}
+ m_clients++;
+ kdDebug() << k_funcinfo << "Number of clients: " << m_clients << endl;
+ m_ready.unlock();
return isopen;
}
@@ -188,6 +195,7 @@ int VideoDevicePool::close()
*/
int VideoDevicePool::startCapturing()
{
+ kdDebug() << k_funcinfo << "startCapturing() called." << endl;
if(m_videodevice.size())
return m_videodevice[currentDevice()].startCapturing();
return EXIT_FAILURE;
@@ -210,7 +218,10 @@ int VideoDevicePool::stopCapturing()
*/
float VideoDevicePool::getBrightness()
{
+ if (currentDevice() < m_videodevice.size() )
return m_videodevice[currentDevice()].getBrightness();
+ else
+ return 0;
}
/*!
@@ -218,7 +229,10 @@ float VideoDevicePool::getBrightness()
*/
float VideoDevicePool::setBrightness(float brightness)
{
- return m_videodevice[currentDevice()].setBrightness(brightness);
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].setBrightness(brightness);
+ else
+ return 0;
}
/*!
@@ -226,7 +240,10 @@ float VideoDevicePool::setBrightness(flo
*/
float VideoDevicePool::getContrast()
{
- return m_videodevice[currentDevice()].getContrast();
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].getContrast();
+ else
+ return 0;
}
/*!
@@ -234,7 +251,10 @@ float VideoDevicePool::getContrast()
*/
float VideoDevicePool::setContrast(float contrast)
{
- return m_videodevice[currentDevice()].setContrast(contrast);
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].setContrast(contrast);
+ else
+ return 0;
}
/*!
@@ -242,7 +262,10 @@ float VideoDevicePool::setContrast(float
*/
float VideoDevicePool::getSaturation()
{
- return m_videodevice[currentDevice()].getSaturation();
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].getSaturation();
+ else
+ return 0;
}
/*!
@@ -250,7 +273,10 @@ float VideoDevicePool::getSaturation()
*/
float VideoDevicePool::setSaturation(float saturation)
{
- return m_videodevice[currentDevice()].setSaturation(saturation);
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].setSaturation(saturation);
+ else
+ return 0;
}
/*!
@@ -258,7 +284,10 @@ float VideoDevicePool::setSaturation(flo
*/
float VideoDevicePool::getWhiteness()
{
- return m_videodevice[currentDevice()].getWhiteness();
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].getWhiteness();
+ else
+ return 0;
}
/*!
@@ -266,7 +295,10 @@ float VideoDevicePool::getWhiteness()
*/
float VideoDevicePool::setWhiteness(float whiteness)
{
- return m_videodevice[currentDevice()].setWhiteness(whiteness);
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].setWhiteness(whiteness);
+ else
+ return 0;
}
/*!
@@ -274,7 +306,10 @@ float VideoDevicePool::setWhiteness(floa
*/
float VideoDevicePool::getHue()
{
- return m_videodevice[currentDevice()].getHue();
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].getHue();
+ else
+ return 0;
}
/*!
@@ -282,7 +317,10 @@ float VideoDevicePool::getHue()
*/
float VideoDevicePool::setHue(float hue)
{
- return m_videodevice[currentDevice()].setHue(hue);
+ if (currentDevice() < m_videodevice.size() )
+ return m_videodevice[currentDevice()].setHue(hue);
+ else
+ return 0;
}
/*!
@@ -349,6 +387,27 @@ bool VideoDevicePool::setImageAsMirror(b
}
/*!
+ \fn VideoDevicePool::getDisableMMap()
+ */
+bool VideoDevicePool::getDisableMMap()
+{
+ if(m_videodevice.size())
+ return m_videodevice[currentDevice()].getDisableMMap();
+ return false;
+}
+
+/*!
+ \fn VideoDevicePool::setDisableMMap(bool disablemmap)
+ */
+bool VideoDevicePool::setDisableMMap(bool disablemmap)
+{
+ kdDebug() << k_funcinfo << "VideoDevicePool::setDisableMMap(" << disablemmap << ") called." << endl;
+ if(m_videodevice.size())
+ return m_videodevice[currentDevice()].setDisableMMap(disablemmap);
+ return false;
+}
+
+/*!
\fn VideoDevicePool::getWorkaroundBrokenDriver()
*/
bool VideoDevicePool::getWorkaroundBrokenDriver()
@@ -473,7 +532,7 @@ int VideoDevicePool::setInputParameters(
}
/*!
- \fn Kopete::AV::VideoDevicePool::fillInputKComboBox(KComboBox *combobox)
+ \fn Kopete::AV::VideoDevicePool::fillDeviceKComboBox(KComboBox *combobox)
*/
int VideoDevicePool::fillDeviceKComboBox(KComboBox *combobox)
{
@@ -518,6 +577,67 @@ int VideoDevicePool::fillInputKComboBox(
}
/*!
+ \fn Kopete::AV::VideoDevicePool::fillStandardKComboBox(KComboBox *combobox)
+ */
+int VideoDevicePool::fillStandardKComboBox(KComboBox *combobox)
+{
+ /// @todo implement me
+ kdDebug() << k_funcinfo << "fillInputKComboBox: Called." << endl;
+ combobox->clear();
+ if(m_videodevice.size())
+ {
+ if(m_videodevice[currentDevice()].inputs()>0)
+ {
+ for (unsigned int loop=0; loop < 25; loop++)
+ {
+ if ( (m_videodevice[currentDevice()].m_input[currentInput()].m_standards) & (1 << loop) )
+ combobox->insertItem(m_videodevice[currentDevice()].signalStandardName( 1 << loop));
+/*
+ case STANDARD_PAL_B1 : return V4L2_STD_PAL_B1; break;
+ case STANDARD_PAL_G : return V4L2_STD_PAL_G; break;
+ case STANDARD_PAL_H : return V4L2_STD_PAL_H; break;
+ case STANDARD_PAL_I : return V4L2_STD_PAL_I; break;
+ case STANDARD_PAL_D : return V4L2_STD_PAL_D; break;
+ case STANDARD_PAL_D1 : return V4L2_STD_PAL_D1; break;
+ case STANDARD_PAL_K : return V4L2_STD_PAL_K; break;
+ case STANDARD_PAL_M : return V4L2_STD_PAL_M; break;
+ case STANDARD_PAL_N : return V4L2_STD_PAL_N; break;
+ case STANDARD_PAL_Nc : return V4L2_STD_PAL_Nc; break;
+ case STANDARD_PAL_60 : return V4L2_STD_PAL_60; break;
+ case STANDARD_NTSC_M : return V4L2_STD_NTSC_M; break;
+ case STANDARD_NTSC_M_JP : return V4L2_STD_NTSC_M_JP; break;
+ case STANDARD_NTSC_443 : return V4L2_STD_NTSC; break; // Using workaround value because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
+ case STANDARD_SECAM_B : return V4L2_STD_SECAM_B; break;
+ case STANDARD_SECAM_D : return V4L2_STD_SECAM_D; break;
+ case STANDARD_SECAM_G : return V4L2_STD_SECAM_G; break;
+ case STANDARD_SECAM_H : return V4L2_STD_SECAM_H; break;
+ case STANDARD_SECAM_K : return V4L2_STD_SECAM_K; break;
+ case STANDARD_SECAM_K1 : return V4L2_STD_SECAM_K1; break;
+ case STANDARD_SECAM_L : return V4L2_STD_SECAM_L; break;
+ case STANDARD_SECAM_LC : return V4L2_STD_SECAM; break; // Using workaround value because my videodev2.h header seems to not include this standard in struct __u64 v4l2_std_id
+ case STANDARD_ATSC_8_VSB : return V4L2_STD_ATSC_8_VSB; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_ATSC_16_VSB : return V4L2_STD_ATSC_16_VSB; break; // ATSC/HDTV Standard officially not supported by V4L2 but exists in videodev2.h
+ case STANDARD_PAL_BG : return V4L2_STD_PAL_BG; break;
+ case STANDARD_PAL_DK : return V4L2_STD_PAL_DK; break;
+ case STANDARD_PAL : return V4L2_STD_PAL; break;
+ case STANDARD_NTSC : return V4L2_STD_NTSC; break;
+ case STANDARD_SECAM_DK : return V4L2_STD_SECAM_DK; break;
+ case STANDARD_SECAM : return V4L2_STD_SECAM; break;
+ case STANDARD_525_60 : return V4L2_STD_525_60; break;
+ case STANDARD_625_50 : return V4L2_STD_625_50; break;
+ case STANDARD_ALL : return V4L2_STD_ALL; break;
+
+ combobox->insertItem(m_videodevice[currentDevice()].m_input[loop].name);
+ kdDebug() << k_funcinfo << "StandardKCombobox: Added input " << loop << ": " << m_videodevice[currentDevice()].m_input[loop].name << " (tuner: " << m_videodevice[currentDevice()].m_input[loop].hastuner << ")" << endl;*/
+ }
+ combobox->setCurrentItem(currentInput());
+ return EXIT_SUCCESS;
+ }
+ }
+ return EXIT_FAILURE;
+}
+
+/*!
\fn Kopete::AV::VideoDevicePool::scanDevices()
*/
int VideoDevicePool::scanDevices()
@@ -683,11 +803,12 @@ void VideoDevicePool::loadConfig()
const QString modelindex = QString::fromLocal8Bit ( "Model %1 Device %2") .arg ((*vditerator).m_name ) .arg ((*vditerator).m_modelindex);
if(modelindex == currentdevice)
{
- m_current_device = vditerator - m_videodevice.begin();
+ m_current_device = std::distance (m_videodevice.begin(), vditerator);
// kdDebug() << k_funcinfo << "This place will be used to set " << modelindex << " as the current device ( " << std::distance(m_videodevice.begin(), vditerator ) << " )." << endl;
}
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->readNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Current input") .arg ((*vditerator).m_name ) .arg ((*vditerator).m_modelindex)), 0);
+ const bool disablemmap = config->readBoolEntry((QString::fromLocal8Bit ( "Model %1 Device %2 DisableMMap") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex)), false );
const bool workaroundbrokendriver = config->readBoolEntry((QString::fromLocal8Bit ( "Model %1 Device %2 WorkaroundBrokenDriver") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex)), false );
kdDebug() << k_funcinfo << "Device name: " << name << endl;
kdDebug() << k_funcinfo << "Device current input: " << currentinput << endl;
@@ -699,8 +820,8 @@ void VideoDevicePool::loadConfig()
const float brightness = config->readDoubleNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Brightness").arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , 0.5 );
const float contrast = config->readDoubleNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Contrast") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , 0.5 );
const float saturation = config->readDoubleNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Saturation").arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , 0.5 );
- const float whiteness = config->readDoubleNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Whiteness") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , 0.5 );
- const float hue = config->readDoubleNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Hue") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , 0.0 );
+ const float whiteness = config->readDoubleNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Whiteness") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , 0.5 );
+ const float hue = config->readDoubleNumEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 Hue") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , 0.5 );
const bool autobrightnesscontrast = config->readBoolEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 AutoBrightnessContrast") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , false );
const bool autocolorcorrection = config->readBoolEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 AutoColorCorrection") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , false );
const bool imageasmirror = config->readBoolEntry((QString::fromLocal8Bit ( "Model %1 Device %2 Input %3 mageAsMirror") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex) .arg (input)) , false );
@@ -759,9 +880,11 @@ void VideoDevicePool::saveConfig()
// 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);
const QString currentinput = QString::fromLocal8Bit ( "Model %1 Device %2 Current input") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex);
+ const QString disablemmap = QString::fromLocal8Bit ( "Model %1 Device %2 DisableMMap") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex);
const QString workaroundbrokendriver = QString::fromLocal8Bit ( "Model %1 Device %2 WorkaroundBrokenDriver") .arg ((*vditerator).m_model ) .arg ((*vditerator).m_modelindex);
config->writeEntry( name, (*vditerator).m_name);
config->writeEntry( currentinput, (*vditerator).currentInput());
+ config->writeEntry( disablemmap, (*vditerator).getDisableMMap());
config->writeEntry( workaroundbrokendriver, (*vditerator).getWorkaroundBrokenDriver());
for (size_t input = 0 ; input < (*vditerator).m_input.size(); input++)
@@ -769,7 +892,7 @@ void VideoDevicePool::saveConfig()
kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Brightness: " << (*vditerator).m_input[input].getBrightness() << endl;
kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Contrast : " << (*vditerator).m_input[input].getContrast() << endl;
kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Saturation: " << (*vditerator).m_input[input].getSaturation() << endl;
- kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Whiteness : " << (*vditerator).m_input[input].getWhiteness() << endl;
+ kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Whiteness : " << (*vditerator).m_input[input].getWhiteness() << endl;
kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Hue : " << (*vditerator).m_input[input].getHue() << endl;
kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Automatic brightness / contrast: " << (*vditerator).m_input[input].getAutoBrightnessContrast() << endl;
kdDebug() << "Model:" << (*vditerator).m_model << ":Index:" << (*vditerator).m_modelindex << ":Input:" << input << ":Automatic color correction : " << (*vditerator).m_input[input].getAutoColorCorrection() << endl;

View File

@ -0,0 +1,49 @@
$OpenBSD: patch-kopete_libkopete_avdevice_videodevicepool_h,v 1.1 2006/04/29 01:02:24 brad Exp $
--- kopete/libkopete/avdevice/videodevicepool.h.orig Fri Mar 17 05:12:32 2006
+++ kopete/libkopete/avdevice/videodevicepool.h Fri Apr 28 15:50:23 2006
@@ -27,6 +27,7 @@
#include <qstring.h>
#include <qimage.h>
#include <qvaluevector.h>
+#include <qmutex.h>
#include <kcombobox.h>
#include "videodevice.h"
#include "kopete_export.h"
@@ -78,6 +79,7 @@ public:
VideoDeviceModelPool m_modelvector; // Vector to be filled with unique device models
int fillDeviceKComboBox(KComboBox *combobox);
int fillInputKComboBox(KComboBox *combobox);
+ int fillStandardKComboBox(KComboBox *combobox);
unsigned int currentDevice();
int currentInput();
unsigned int inputs();
@@ -92,12 +94,16 @@ public:
float setWhiteness(float whiteness);
float getHue();
float setHue(float hue);
+
bool getAutoBrightnessContrast();
bool setAutoBrightnessContrast(bool brightnesscontrast);
bool getAutoColorCorrection();
bool setAutoColorCorrection(bool colorcorrection);
bool getImageAsMirror();
bool setImageAsMirror(bool imageasmirror);
+
+ bool getDisableMMap();
+ bool setDisableMMap(bool disablemmap);
bool getWorkaroundBrokenDriver();
bool setWorkaroundBrokenDriver(bool workaroundbrokendriver);
@@ -111,9 +117,12 @@ protected:
void guessDriver();
unsigned int m_current_device;
struct imagebuffer m_buffer; // only used when no devices were found
+
+ QMutex m_ready;
private:
VideoDevicePool();
static VideoDevicePool* s_self;
+ static __u64 m_clients; // Number of instances
};
}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-kopete_libkopete_avdevice_videoinput_cpp,v 1.1 2006/04/29 01:02:24 brad Exp $
--- kopete/libkopete/avdevice/videoinput.cpp.orig Fri Mar 17 05:12:32 2006
+++ kopete/libkopete/avdevice/videoinput.cpp Fri Apr 28 15:53:17 2006
@@ -27,7 +27,7 @@ VideoInput::VideoInput()
m_brightness = 0.5;
m_contrast = 0.5;
m_saturation = 0.5;
- m_hue = 0.0;
+ m_hue = 0.5;
m_autobrightnesscontrast = false;
m_autocolorcorrection = false;
}

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-kopete_libkopete_avdevice_videoinput_h,v 1.1 2006/04/29 01:02:24 brad Exp $
--- kopete/libkopete/avdevice/videoinput.h.orig Fri Mar 17 05:12:32 2006
+++ kopete/libkopete/avdevice/videoinput.h Fri Apr 28 15:50:53 2006
@@ -20,6 +20,14 @@
#ifndef KOPETE_AVVIDEOINPUT_H
#define KOPETE_AVVIDEOINPUT_H
+#ifdef __linux__
+#include <asm/types.h>
+#undef __STRICT_ANSI__
+#endif // __linux__
+#ifndef __u64 //required by videodev.h
+#define __u64 unsigned long long
+#endif // __u64*/
+
#include <qstring.h>
#include <kdebug.h>
#include "kopete_export.h"
@@ -37,6 +45,7 @@ public:
~VideoInput();
QString name;
int hastuner;
+ __u64 m_standards;
float getBrightness();
float setBrightness(float brightness);
float getContrast();