diff options
| author | 2010-11-05 16:23:06 +0000 | |
|---|---|---|
| committer | 2010-11-05 16:23:06 +0000 | |
| commit | 1276275eca7168144e456b9ac2856f8a9f40291d (patch) | |
| tree | 7b0e5c8af9f4bfd7d71e423fdefcd208d077811c /src/modules/dcc/video.cpp | |
| parent | refix for 884 (diff) | |
| download | KVIrc-1276275eca7168144e456b9ac2856f8a9f40291d.tar.gz KVIrc-1276275eca7168144e456b9ac2856f8a9f40291d.tar.bz2 KVIrc-1276275eca7168144e456b9ac2856f8a9f40291d.zip | |
fixed a crash bug in dcc video and added the ability to switch input
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5132 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/dcc/video.cpp')
| -rw-r--r-- | src/modules/dcc/video.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/modules/dcc/video.cpp b/src/modules/dcc/video.cpp index eae11d33f..461a092a3 100644 --- a/src/modules/dcc/video.cpp +++ b/src/modules/dcc/video.cpp @@ -301,6 +301,24 @@ bool KviDccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool return true; } +void KviDccVideoThread::restartRecording(int iDevice, int iInput, int) +{ +#ifndef COMPILE_DISABLE_DCC_VIDEO + m_bRecording=false; + if(!g_pVideoDevicePool) + g_pVideoDevicePool = Kopete::AV::VideoDevicePool::self(); + + g_pVideoDevicePool->stopCapturing(); + g_pVideoDevicePool->open(iDevice); + g_pVideoDevicePool->setSize(320, 240); + if(iInput >= 0) + g_pVideoDevicePool->selectInput(iInput); + g_pVideoDevicePool->startCapturing(); + + m_bRecording=true; +#endif +} + void KviDccVideoThread::startRecording() { #ifndef COMPILE_DISABLE_DCC_VIDEO @@ -483,6 +501,10 @@ KviDccVideo::KviDccVideo(KviFrame *pFrm,KviDccDescriptor * dcc,const char * name connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected())); connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress())); + connect(m_pCDevices, SIGNAL(currentIndexChanged(int)), this, SLOT(videoInputChanged(int))); + connect(m_pCInputs, SIGNAL(currentIndexChanged(int)), this, SLOT(videoInputChanged(int))); + connect(m_pCStandards, SIGNAL(currentIndexChanged(int)), this, SLOT(videoInputChanged(int))); + startConnection(); } @@ -997,6 +1019,12 @@ void KviDccVideo::deviceUnregistered(const QString & ) #endif } +void KviDccVideo::videoInputChanged(int ) +{ + if(m_pSlaveThread) + m_pSlaveThread->restartRecording(m_pCDevices->currentIndex(), m_pCInputs->currentIndex(), m_pCStandards->currentIndex()); +} + #ifndef COMPILE_USE_STANDALONE_MOC_SOURCES #include "m_video.moc" #endif //!COMPILE_USE_STANDALONE_MOC_SOURCES |
