void S60VideoEglRendererControl::createEndpoint() { Q_ASSERT(m_surface); Q_ASSERT(!m_nativeSurface.IsNull()); Q_ASSERT(!m_eglEndpoint); m_eglEndpoint = new S60EglEndpoint(m_nativeSurface, m_eglExtensions, this); if (m_eglEndpoint->isValid()) connect(m_eglEndpoint, SIGNAL(imageAvailable()), this, SLOT(imageAvailable())); else emit error(); }
void PreviewThread::setPath(QString path) // ---------------------------------------------------------------------------- // Record the path where we will save the picture and trigger save // ---------------------------------------------------------------------------- { QMutexLocker locker(&mutex); this->path = path; if (!image.isNull() && !isBusy()) emit imageAvailable(); }
void PreviewThread::record(QImage &image) // ---------------------------------------------------------------------------- // Store the image to record next // ---------------------------------------------------------------------------- { if (mutex.tryLock()) { this->image = image; mutex.unlock(); if (path != "" && !isBusy()) emit imageAvailable(); } }
void ImageLoaderSettingsDialog::browseButtonClicked() { QString filename = QFileDialog::getOpenFileName(this, tr("Open Image"), QDir::homePath(), tr("Image Files (*.png *.jpg *.bmp)")); if(!filename.isEmpty() && m_image.load(filename)){ ui->pathLabel->setText(filename); ui->imageLabel->setPixmap(QPixmap::fromImage(m_image)); ui->imageLabel->show(); emit imageAvailable(m_image); } }
PreviewThread::PreviewThread(uint timeInterval, uint maxWidth, uint maxHeight) // ---------------------------------------------------------------------------- // Start preview-save thread by saving // ---------------------------------------------------------------------------- : mutex(), path(), image(), nextSave(), timeInterval(timeInterval), maxWidth(maxWidth), maxHeight(maxHeight) { IFTRACE(preview) debug() << "Starting preview thread (" << timeInterval << " ms)\n"; // Ready the thread to receive events moveToThread(this); connect(this, SIGNAL(imageAvailable()), this, SLOT(savePreview())); // Configure the timer nextSave.setSingleShot(true); nextSave.setInterval(timeInterval); connect(&nextSave, SIGNAL(timeout()), this, SLOT(savePreview())); start(); // Wait until a preview is posted to save }
void ImageLoaderSettingsDialog::reloadImage() { if(!m_image.isNull()){ emit imageAvailable(m_image); } }