void V4LOutput::setVideoSource(VideoSource *source) { if(m_source == source) return; if(m_source) disconnectVideoSource(); m_source = source; if(m_source) { connect(m_source, SIGNAL(frameReady()), this, SLOT(frameReady())); connect(m_source, SIGNAL(destroyed()), this, SLOT(disconnectVideoSource())); //qDebug() << "GLVideoDrawable::setVideoSource(): "<<objectName()<<" m_source:"<<m_source; //setVideoFormat(m_source->videoFormat()); frameReady(); } else { qDebug() << "V4LOutput::setVideoSource(): "<<this<<" Source is NULL"; } }
void VideoFilter::setVideoSource(VideoSource* source) { if(source == m_source) return; if(m_source) { disconnectVideoSource(); } m_source = source; if(m_source) { connect(m_source, SIGNAL(frameReady()), this, SLOT(frameAvailable())); connect(m_source, SIGNAL(destroyed()), this, SLOT(disconnectVideoSource())); m_source->registerConsumer(this); // pull in the first frame frameAvailable(); } else { //qDebug() << "VideoFilter::setVideoSource(): "<<(QObject*)this<<" Source is NULL"; } }
void VideoWidget::setVideoSource(VideoSource *source) { if(source == m_thread) return; if(m_fadeToBlack) { disconnectVideoSource(); connectVideoSource(source); } if(m_fadeTimer.isActive()) { m_queuedSource = source; return; } if(m_fadeLength > 33) fadeStart(); if(m_thread && m_fadeLength < 33) disconnectVideoSource(); //qDebug() << "VideoWidget::setVideoSource: In Thread ID "<<QThread::currentThreadId(); //qDebug() << "VideoWidget::setVideoSource: source: "<<source; connectVideoSource(source); }
void VideoSender::setVideoSource(VideoSource *source) { if(m_source == source) return; if(m_source) disconnectVideoSource(); m_source = source; if(m_source) { connect(m_source, SIGNAL(frameReady()), this, SLOT(frameReady())); connect(m_source, SIGNAL(destroyed()), this, SLOT(disconnectVideoSource())); if(CameraThread *camera = dynamic_cast<CameraThread*>(m_source)) { connect(camera, SIGNAL(signalStatusChanged(bool)), this, SIGNAL(signalStatusChanged(bool))); } //qDebug() << "GLVideoDrawable::setVideoSource(): "<<objectName()<<" m_source:"<<m_source; //setVideoFormat(m_source->videoFormat()); m_consumerRegistered = false; frameReady(); }
void VideoWidget::closeEvent(QCloseEvent*) { disconnectVideoSource(); m_paintTimer.stop(); }