Skip to content
Snippets Groups Projects
Commit 699be957 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

videomanager: don't keep mutex locked when configuring sink

Change-Id: I729e15f31fd1f7e9c0a2319966e50ed3ad86ec56
parent 6de733c5
No related branches found
No related tags found
No related merge requests found
......@@ -369,8 +369,10 @@ JNIEXPORT void JNICALL Java_net_jami_daemon_JamiServiceJNI_registerVideoCallback
auto f_display_cb = std::bind(&AndroidDisplayCb, nativeWindow, std::placeholders::_1);
auto p_display_cb = std::bind(&sinkTargetPullCallback, nativeWindow, std::placeholders::_1);
{
std::lock_guard<std::mutex> guard(windows_mutex);
windows.emplace(nativeWindow, nullptr);
}
DRing::registerSinkTarget(sink, DRing::SinkTarget {.pull=p_display_cb, .push=f_display_cb});
}
......@@ -385,10 +387,11 @@ JNIEXPORT void JNICALL Java_net_jami_daemon_JamiServiceJNI_unregisterVideoCallba
return;
const std::string sink(arg1_pstr);
jenv->ReleaseStringUTFChars(sinkId, arg1_pstr);
ANativeWindow* nativeWindow = (ANativeWindow*)((intptr_t) window);
std::lock_guard<std::mutex> guard(windows_mutex);
DRing::registerSinkTarget(sink, DRing::SinkTarget {});
ANativeWindow* nativeWindow = (ANativeWindow*)((intptr_t) window);
std::lock_guard<std::mutex> guard(windows_mutex);
windows.erase(nativeWindow);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment