Commit b21d16a1 authored by Ronan's avatar Ronan

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

parent a3dc41ec
......@@ -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.
// ---------------------------------------------------------------------------
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment