コード例 #1
0
bool AndroidVideoSurface::start(const QVideoSurfaceFormat &format)
{
    const QImage::Format m_imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
    const QSize size = format.frameSize();

    if (m_imageFormat != QImage::Format_Invalid && !size.isEmpty()) {
        this->m_imageFormat = m_imageFormat;
        m_imageSize = size;
        m_sourceRect = format.viewport();
        emit(surfaceStarted(format));
        m_widget->updateGeometry();
        updateVideoRect();
        return true;
    } else {
        return false;
    }
}
コード例 #2
0
ファイル: WidgetSurface.cpp プロジェクト: Argoday/IPL
bool AVL_QT_DLL_EXPORT WidgetSurface::start(const QVideoSurfaceFormat & format){
	const QSize size = format.frameSize();

	if (size.isEmpty()==false) {
		imageSize.set(size.width(),size.height());
		sourceRect = format.viewport();

		QAbstractVideoSurface::start(format);

		widget->updateGeometry();
		updateVideoRect();

		return true;
	}else{
		return false;
	}
}
コード例 #3
0
//! [2]
bool VideoWidgetSurface::start(const QVideoSurfaceFormat &format)
{
    const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
    const QSize size = format.frameSize();

    if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) {
        this->imageFormat = imageFormat;
        imageSize = size;
        sourceRect = format.viewport();

        QAbstractVideoSurface::start(format);

        widget->updateGeometry();
        updateVideoRect();

        return true;
    } else {
        return false;
    }
}