当前位置: 首页>>代码示例>>C++>>正文


C++ QVideoSurfaceFormat类代码示例

本文整理汇总了C++中QVideoSurfaceFormat的典型用法代码示例。如果您正苦于以下问题:C++ QVideoSurfaceFormat类的具体用法?C++ QVideoSurfaceFormat怎么用?C++ QVideoSurfaceFormat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QVideoSurfaceFormat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sipReleaseType

static PyObject *meth_QVideoSurfaceFormat_setProperty(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const char* a0;
        const QVariant* a1;
        int a1State = 0;
        QVideoSurfaceFormat *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BsJ1", &sipSelf, sipType_QVideoSurfaceFormat, &sipCpp, &a0, sipType_QVariant, &a1, &a1State))
        {
            sipCpp->setProperty(a0,*a1);
            sipReleaseType(const_cast<QVariant *>(a1),sipType_QVariant,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QVideoSurfaceFormat, sipName_setProperty, doc_QVideoSurfaceFormat_setProperty);

    return NULL;
}
开发者ID:rff255,项目名称:python-qt5,代码行数:25,代码来源:sipQtMultimediaQVideoSurfaceFormat.cpp

示例2: isFormatSupported

bool QVideoSurfaceRasterPainter::isFormatSupported(
        const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
{
    return format.handleType() == QAbstractVideoBuffer::NoHandle
            && m_imagePixelFormats.contains(format.pixelFormat())
            && !format.frameSize().isEmpty();
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: frame

bool myVideoPlayer::presentImage(const QImage &image)
{
	QVideoFrame frame(image);

	if (!frame.isValid())
		return false;

	QVideoSurfaceFormat currentFormat = surface->surfaceFormat();

	if (frame.pixelFormat() != currentFormat.pixelFormat()
		|| frame.size() != currentFormat.frameSize()) 
	{
		QVideoSurfaceFormat format(frame.size(), frame.pixelFormat());

		if (!surface->start(format))
			return false;
	}

	if (!surface->present(frame)) 
	{
		surface->stop();

		return false;
	} 
	else
	{
		return true;
	}
}
开发者ID:umbcdavincilab,项目名称:pathBubbles,代码行数:29,代码来源:VideoPlayer.cpp

示例4: bytesPerLine

int DirectShowMediaType::bytesPerLine(const QVideoSurfaceFormat &format)
{
    switch (format.pixelFormat()) {
    // 32 bpp packed formats.
    case QVideoFrame::Format_RGB32:
    case QVideoFrame::Format_AYUV444:
        return format.frameWidth() * 4;
    // 24 bpp packed formats.
    case QVideoFrame::Format_RGB24:
        return PAD_TO_DWORD(format.frameWidth() * 3);
    // 16 bpp packed formats.
    case QVideoFrame::Format_RGB565:
    case QVideoFrame::Format_RGB555:
    case QVideoFrame::Format_YUYV:
    case QVideoFrame::Format_UYVY:
        return PAD_TO_DWORD(format.frameWidth() * 2);
    // Planar formats.
    case QVideoFrame::Format_IMC1:
    case QVideoFrame::Format_IMC2:
    case QVideoFrame::Format_IMC3:
    case QVideoFrame::Format_IMC4:
    case QVideoFrame::Format_YV12:
    case QVideoFrame::Format_NV12:
    case QVideoFrame::Format_YUV420P:
        return PAD_TO_DWORD(format.frameWidth());
    default:
        return 0;
    }
}
开发者ID:Intendu,项目名称:uWebKit,代码行数:29,代码来源:directshowmediatype.cpp

示例5: start

bool VideoSurface_ForQQuickItem::start(const QVideoSurfaceFormat& format)
{
    if (!supportedPixelFormats(format.handleType()).contains(format.pixelFormat())) {
        qDebug() << format.handleType() << " " << format.pixelFormat() << " - format is not supported.";
        return false;
    }
    return QAbstractVideoSurface::start(format);
}
开发者ID:Barbakas,项目名称:Augmented-Reality-on-Qt,代码行数:8,代码来源:ARCameraQml.cpp

示例6: isFormatSupported

bool VideoWidgetSurface::isFormatSupported(const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const
{
    Q_UNUSED(similar);

    const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
    const QSize size = format.frameSize();

    return imageFormat != QImage::Format_Invalid && !size.isEmpty() && format.handleType() == QAbstractVideoBuffer::NoHandle;
}
开发者ID:yumechua,项目名称:ivp,代码行数:9,代码来源:videowidgetsurface.cpp

示例7: start

QAbstractVideoSurface::Error QVideoSurfaceRasterPainter::start(const QVideoSurfaceFormat &format)
{
    m_frame = QVideoFrame();
    m_imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
    m_imageSize = format.frameSize();
    m_scanLineDirection = format.scanLineDirection();

    return format.handleType() == QAbstractVideoBuffer::NoHandle
            && m_imageFormat != QImage::Format_Invalid
            && !m_imageSize.isEmpty()
            ? QAbstractVideoSurface::NoError
            : QAbstractVideoSurface::UnsupportedFormatError;
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例8: start

    // Overridden from QAbstractVideoSurface
    virtual bool start( const QVideoSurfaceFormat &format )
    {
        m_mutex.lock();

        m_flipped = ( format.scanLineDirection() == QVideoSurfaceFormat::BottomToTop );
        m_frameFormat = QVideoFrame::imageFormatFromPixelFormat( format.pixelFormat() );
        m_viewport = format.viewport();
        m_valid = 1;

        // We want to unlock it before calling the parent function, which may call present() and deadlock
        m_mutex.unlock();

        return QAbstractVideoSurface::start( format );
    }
开发者ID:thetazzbot,项目名称:karaokeplayer,代码行数:15,代码来源:universalplayer.cpp

示例9: start

bool MyVideoSurface::start(const QVideoSurfaceFormat &format)
{
    m_videoFormat = format;
    const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
    const QSize size = format.frameSize();

    if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) {
        m_imageFormat = imageFormat;
        QAbstractVideoSurface::start(format);
        return true;
    } else {
        return false;
    }
}
开发者ID:Afreeca,项目名称:qt,代码行数:14,代码来源:cameraexample.cpp

示例10: start

bool VideoItem::start(const QVideoSurfaceFormat &format)
{
    if (isFormatSupported(format)) {
        imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
        imageSize = format.frameSize();
        framePainted = true;

        QAbstractVideoSurface::start(format);

        prepareGeometryChange();

        return true;
    } else {
        return false;
    }
}
开发者ID:RobertoMalatesta,项目名称:emscripten-qt,代码行数:16,代码来源:videoitem.cpp

示例11: initVideoSurface

void QmlVlcMmVideoOutput::initVideoSurface( const QVideoSurfaceFormat& format )
{
    assert( !m_videoSurface || !m_videoSurface->isActive() );

    if( m_videoSurface && format.isValid() )
        m_videoSurface->start( format );
}
开发者ID:Dmitry666,项目名称:QmlVlc,代码行数:7,代码来源:QmlVlcMmVideoOutput.cpp

示例12: start

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;
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:17,代码来源:androidvideosurface.cpp

示例13: m_format

QSGVideoMaterial_YUV::QSGVideoMaterial_YUV(const QVideoSurfaceFormat &format) :
    m_format(format),
    m_opacity(1.0)
{
    memset(m_textureIds, 0, sizeof(m_textureIds));

    switch (format.pixelFormat()) {
    case QVideoFrame::Format_NV12:
    case QVideoFrame::Format_NV21:
        m_planeCount = 2;
        break;
    case QVideoFrame::Format_YUV420P:
    case QVideoFrame::Format_YV12:
        m_planeCount = 3;
        break;
    default:
        m_planeCount = 1;
        break;
    }

    switch (format.yCbCrColorSpace()) {
    case QVideoSurfaceFormat::YCbCr_JPEG:
        m_colorMatrix = QMatrix4x4(
                    1.0f,  0.000f,  1.402f, -0.701f,
                    1.0f, -0.344f, -0.714f,  0.529f,
                    1.0f,  1.772f,  0.000f, -0.886f,
                    0.0f,  0.000f,  0.000f,  1.0000f);
        break;
    case QVideoSurfaceFormat::YCbCr_BT709:
    case QVideoSurfaceFormat::YCbCr_xvYCC709:
        m_colorMatrix = QMatrix4x4(
                    1.164f,  0.000f,  1.793f, -0.5727f,
                    1.164f, -0.534f, -0.213f,  0.3007f,
                    1.164f,  2.115f,  0.000f, -1.1302f,
                    0.0f,    0.000f,  0.000f,  1.0000f);
        break;
    default: //BT 601:
        m_colorMatrix = QMatrix4x4(
                    1.164f,  0.000f,  1.596f, -0.8708f,
                    1.164f, -0.392f, -0.813f,  0.5296f,
                    1.164f,  2.017f,  0.000f, -1.081f,
                    0.0f,    0.000f,  0.000f,  1.0000f);
    }

    setFlag(Blending, false);
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:46,代码来源:qsgvideonode_yuv.cpp

示例14: isFormatSupported

bool QGstXvImageBufferPool::isFormatSupported(const QVideoSurfaceFormat &surfaceFormat) const
{
    bool ok = true;
    surfaceFormat.property("portId").toULongLong(&ok);
    if (!ok)
        return false;

    int xvFormatId = surfaceFormat.property("xvFormatId").toInt(&ok);
    if (!ok || xvFormatId < 0)
        return false;

    int dataSize = surfaceFormat.property("dataSize").toInt(&ok);
    if (!ok || dataSize<=0)
        return false;

    return true;
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:17,代码来源:qgstxvimagebuffer.cpp

示例15: start

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;
	}
}
开发者ID:Argoday,项目名称:IPL,代码行数:17,代码来源:WidgetSurface.cpp


注:本文中的QVideoSurfaceFormat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。