mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1052169: Proxy thread destruction to avoid recursing event loops within OMX H264 shutdown r=bsmedberg
This commit is contained in:
parent
74d6fa680a
commit
87e617255b
@ -23,6 +23,7 @@ using namespace android;
|
||||
// WebRTC
|
||||
#include "common_video/interface/texture_video_frame.h"
|
||||
#include "video_engine/include/vie_external_codec.h"
|
||||
#include "runnable_utils.h"
|
||||
|
||||
// Gecko
|
||||
#include "GonkNativeWindow.h"
|
||||
@ -104,6 +105,12 @@ struct EncodedFrame
|
||||
int64_t mRenderTimeMs;
|
||||
};
|
||||
|
||||
static void
|
||||
ShutdownThread(nsCOMPtr<nsIThread>& aThread)
|
||||
{
|
||||
aThread->Shutdown();
|
||||
}
|
||||
|
||||
// Base runnable class to repeatly pull OMX output buffers in seperate thread.
|
||||
// How to use:
|
||||
// - implementing DrainOutput() to get output. Remember to return false to tell
|
||||
@ -137,7 +144,9 @@ public:
|
||||
if (mThread != nullptr) {
|
||||
MonitorAutoUnlock unlock(mMonitor);
|
||||
CODEC_LOGD("OMXOutputDrain thread shutdown");
|
||||
mThread->Shutdown();
|
||||
NS_DispatchToMainThread(
|
||||
WrapRunnableNM<decltype(&ShutdownThread),
|
||||
nsCOMPtr<nsIThread> >(&ShutdownThread, mThread));
|
||||
mThread = nullptr;
|
||||
}
|
||||
CODEC_LOGD("OMXOutputDrain stopped");
|
||||
|
Loading…
Reference in New Issue
Block a user