本文整理汇总了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;
}
示例2: isFormatSupported
bool QVideoSurfaceRasterPainter::isFormatSupported(
const QVideoSurfaceFormat &format, QVideoSurfaceFormat *) const
{
return format.handleType() == QAbstractVideoBuffer::NoHandle
&& m_imagePixelFormats.contains(format.pixelFormat())
&& !format.frameSize().isEmpty();
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
示例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 );
}
示例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;
}
}
示例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;
}
}
示例11: initVideoSurface
void QmlVlcMmVideoOutput::initVideoSurface( const QVideoSurfaceFormat& format )
{
assert( !m_videoSurface || !m_videoSurface->isActive() );
if( m_videoSurface && format.isValid() )
m_videoSurface->start( format );
}
示例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;
}
}
示例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);
}
示例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;
}
示例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;
}
}