本文整理汇总了C++中QVideoSurfaceFormat::viewport方法的典型用法代码示例。如果您正苦于以下问题:C++ QVideoSurfaceFormat::viewport方法的具体用法?C++ QVideoSurfaceFormat::viewport怎么用?C++ QVideoSurfaceFormat::viewport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVideoSurfaceFormat
的用法示例。
在下文中一共展示了QVideoSurfaceFormat::viewport方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
}
示例2: foreach
QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f)
{
dbg.nospace() << "QVideoSurfaceFormat(" << f.pixelFormat();
dbg.nospace() << ", " << f.frameSize();
dbg.nospace() << ", viewport=" << f.viewport();
dbg.nospace() << ", pixelAspectRatio=" << f.pixelAspectRatio();
dbg.nospace() << ", handleType=" << f.handleType();
dbg.nospace() << ", yCbCrColorSpace=" << f.yCbCrColorSpace();
dbg.nospace() << ")";
foreach(const QByteArray& propertyName, f.propertyNames())
dbg << "\n " << propertyName.data() << " = " << f.property(propertyName.data());
return dbg.space();
}
示例3: constructNull
void tst_QVideoSurfaceFormat::constructNull()
{
QVideoSurfaceFormat format;
QVERIFY(!format.isValid());
QCOMPARE(format.handleType(), QAbstractVideoBuffer::NoHandle);
QCOMPARE(format.pixelFormat(), QVideoFrame::Format_Invalid);
QCOMPARE(format.frameSize(), QSize());
QCOMPARE(format.frameWidth(), -1);
QCOMPARE(format.frameHeight(), -1);
QCOMPARE(format.viewport(), QRect());
QCOMPARE(format.scanLineDirection(), QVideoSurfaceFormat::TopToBottom);
QCOMPARE(format.frameRate(), 0.0);
QCOMPARE(format.pixelAspectRatio(), QSize(1, 1));
QCOMPARE(format.yCbCrColorSpace(), QVideoSurfaceFormat::YCbCr_Undefined);
}
示例4: start
bool QX11VideoSurface::start(const QVideoSurfaceFormat &format)
{
if (m_image)
XFree(m_image);
int xvFormatId = 0;
for (int i = 0; i < m_supportedPixelFormats.count(); ++i) {
if (m_supportedPixelFormats.at(i) == format.pixelFormat()) {
xvFormatId = m_formatIds.at(i);
break;
}
}
if (xvFormatId == 0) {
setError(UnsupportedFormatError);
} else {
XvImage *image = XvCreateImage(
QX11Info::display(),
m_portId,
xvFormatId,
0,
format.frameWidth(),
format.frameHeight());
if (!image) {
setError(ResourceError);
} else {
m_viewport = format.viewport();
m_image = image;
QVideoSurfaceFormat newFormat = format;
newFormat.setProperty("portId", QVariant(quint64(m_portId)));
newFormat.setProperty("xvFormatId", xvFormatId);
newFormat.setProperty("dataSize", image->data_size);
return QAbstractVideoSurface::start(newFormat);
}
}
if (m_image) {
m_image = 0;
QAbstractVideoSurface::stop();
}
return false;
}
示例5: 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;
}
}
示例6: 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;
}
}
示例7: start
//! [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;
}
}
示例8: switch
QDebug operator<<(QDebug dbg, const QVideoSurfaceFormat &f)
{
QString typeName;
switch (f.pixelFormat()) {
case QVideoFrame::Format_Invalid:
typeName = QLatin1String("Format_Invalid");
break;
case QVideoFrame::Format_ARGB32:
typeName = QLatin1String("Format_ARGB32");
break;
case QVideoFrame::Format_ARGB32_Premultiplied:
typeName = QLatin1String("Format_ARGB32_Premultiplied");
break;
case QVideoFrame::Format_RGB32:
typeName = QLatin1String("Format_RGB32");
break;
case QVideoFrame::Format_RGB24:
typeName = QLatin1String("Format_RGB24");
break;
case QVideoFrame::Format_RGB565:
typeName = QLatin1String("Format_RGB565");
break;
case QVideoFrame::Format_RGB555:
typeName = QLatin1String("Format_RGB555");
break;
case QVideoFrame::Format_ARGB8565_Premultiplied:
typeName = QLatin1String("Format_ARGB8565_Premultiplied");
break;
case QVideoFrame::Format_BGRA32:
typeName = QLatin1String("Format_BGRA32");
break;
case QVideoFrame::Format_BGRA32_Premultiplied:
typeName = QLatin1String("Format_BGRA32_Premultiplied");
break;
case QVideoFrame::Format_BGR32:
typeName = QLatin1String("Format_BGR32");
break;
case QVideoFrame::Format_BGR24:
typeName = QLatin1String("Format_BGR24");
break;
case QVideoFrame::Format_BGR565:
typeName = QLatin1String("Format_BGR565");
break;
case QVideoFrame::Format_BGR555:
typeName = QLatin1String("Format_BGR555");
break;
case QVideoFrame::Format_BGRA5658_Premultiplied:
typeName = QLatin1String("Format_BGRA5658_Premultiplied");
break;
case QVideoFrame::Format_AYUV444:
typeName = QLatin1String("Format_AYUV444");
break;
case QVideoFrame::Format_AYUV444_Premultiplied:
typeName = QLatin1String("Format_AYUV444_Premultiplied");
break;
case QVideoFrame::Format_YUV444:
typeName = QLatin1String("Format_YUV444");
break;
case QVideoFrame::Format_YUV420P:
typeName = QLatin1String("Format_YUV420P");
break;
case QVideoFrame::Format_YV12:
typeName = QLatin1String("Format_YV12");
break;
case QVideoFrame::Format_UYVY:
typeName = QLatin1String("Format_UYVY");
break;
case QVideoFrame::Format_YUYV:
typeName = QLatin1String("Format_YUYV");
break;
case QVideoFrame::Format_NV12:
typeName = QLatin1String("Format_NV12");
break;
case QVideoFrame::Format_NV21:
typeName = QLatin1String("Format_NV21");
break;
case QVideoFrame::Format_IMC1:
typeName = QLatin1String("Format_IMC1");
break;
case QVideoFrame::Format_IMC2:
typeName = QLatin1String("Format_IMC2");
break;
case QVideoFrame::Format_IMC3:
typeName = QLatin1String("Format_IMC3");
break;
case QVideoFrame::Format_IMC4:
typeName = QLatin1String("Format_IMC4");
break;
case QVideoFrame::Format_Y8:
typeName = QLatin1String("Format_Y8");
break;
case QVideoFrame::Format_Y16:
typeName = QLatin1String("Format_Y16");
default:
typeName = QString(QLatin1String("UserType(%1)" )).arg(int(f.pixelFormat()));
}
dbg.nospace() << "QVideoSurfaceFormat(" << typeName;
dbg.nospace() << ", " << f.frameSize();
dbg.nospace() << ", viewport=" << f.viewport();
//.........这里部分代码省略.........