本文整理汇总了C++中DisplayPtr::isCompatible方法的典型用法代码示例。如果您正苦于以下问题:C++ DisplayPtr::isCompatible方法的具体用法?C++ DisplayPtr::isCompatible怎么用?C++ DisplayPtr::isCompatible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DisplayPtr
的用法示例。
在下文中一共展示了DisplayPtr::isCompatible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createDisplay
DisplayPtr DisplayCache::createDisplay(const NativeDisplay& nativeDisplay)
{
NativeDisplayPtr nativeDisplayObj;
VADisplay vaDisplay = NULL;
DisplayPtr vaapiDisplay;
YamiMediaCodec::AutoLock locker(m_lock);
m_cache.remove_if(expired);
//lockup first
list<weak_ptr<VaapiDisplay> >::iterator it;
for (it = m_cache.begin(); it != m_cache.end(); ++it) {
vaapiDisplay = (*it).lock();
if (vaapiDisplay->isCompatible(nativeDisplay)) {
return vaapiDisplay;
}
}
vaapiDisplay.reset();
//crate new one
DEBUG("nativeDisplay: (type : %d), (handle : 0x%x)", nativeDisplay.type, nativeDisplay.handle);
switch (nativeDisplay.type) {
case NATIVE_DISPLAY_AUTO:
#if __ENABLE_X11__
case NATIVE_DISPLAY_X11:
nativeDisplayObj.reset (new NativeDisplayX11());
if (nativeDisplayObj && nativeDisplayObj->initialize(nativeDisplay))
vaDisplay = vaGetDisplay((Display*)(nativeDisplayObj->nativeHandle()));
if (vaDisplay)
INFO("use vaapi x11 backend");
if(vaDisplay || nativeDisplay.type == NATIVE_DISPLAY_X11)
break;
INFO("try to init va with x11 display (%p) but failed", (Display*)(nativeDisplayObj->nativeHandle()));
// NATIVE_DISPLAY_AUTO continue, no break
#endif
case NATIVE_DISPLAY_DRM:
nativeDisplayObj.reset (new NativeDisplayDrm());
if (nativeDisplayObj && nativeDisplayObj->initialize(nativeDisplay))
vaDisplay = vaGetDisplayDRM(nativeDisplayObj->nativeHandle());
INFO("use vaapi drm backend");
break;
default:
break;
}
if (vaDisplay == NULL) {
ERROR("vaGetDisplay failed.");
return vaapiDisplay;
}
if (vaInit(vaDisplay))
vaapiDisplay.reset(new VaapiDisplay(nativeDisplayObj, vaDisplay));
if (vaapiDisplay) {
weak_ptr<VaapiDisplay> weak(vaapiDisplay);
m_cache.push_back(weak);
}
return vaapiDisplay;
}
示例2: isCompatible
bool isCompatible(const DisplayPtr display, const NativeDisplay& native) {
return display->isCompatible(native);
}