fix(Camera): share opengl context, avoid reset of window id

This commit is contained in:
Ronan Abhamon 2018-08-06 13:26:26 +02:00
parent a3dc41ec55
commit b21d16a15f
2 changed files with 8 additions and 4 deletions

View file

@ -50,6 +50,9 @@ AppController::AppController (int &argc, char *argv[]) {
QGuiApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
// Useful to share camera on Fullscreen (other context).
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
// ---------------------------------------------------------------------------
// App creation.
// ---------------------------------------------------------------------------

View file

@ -56,12 +56,13 @@ CameraRenderer::~CameraRenderer () {
qInfo() << QStringLiteral("Delete context info:") << mContextInfo;
CoreManager *coreManager = CoreManager::getInstance();
coreManager->lockVideoRender();
if (mIsPreview)
coreManager->getCore()->setNativePreviewWindowId(nullptr);
else if (mCall)
shared_ptr<linphone::Core> core = coreManager->getCore();
if (mIsPreview) {
if (core->getNativePreviewWindowId() == mContextInfo)
core->setNativePreviewWindowId(nullptr);
} else if (mCall && mCall->getNativeVideoWindowId() == mContextInfo)
mCall->setNativeVideoWindowId(nullptr);
coreManager->unlockVideoRender();