本文整理汇总了C++中QVideoSurfaceFormat::setProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ QVideoSurfaceFormat::setProperty方法的具体用法?C++ QVideoSurfaceFormat::setProperty怎么用?C++ QVideoSurfaceFormat::setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVideoSurfaceFormat
的用法示例。
在下文中一共展示了QVideoSurfaceFormat::setProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}