mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 993787: Make MediaEngine threadsafe r=ehsan
This commit is contained in:
parent
f44247f985
commit
535042d8d1
@ -36,11 +36,10 @@ enum {
|
||||
kAudioTrack = 2
|
||||
};
|
||||
|
||||
class MediaEngine : public RefCounted<MediaEngine>
|
||||
class MediaEngine
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(MediaEngine)
|
||||
virtual ~MediaEngine() {}
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaEngine)
|
||||
|
||||
static const int DEFAULT_VIDEO_FPS = 30;
|
||||
static const int DEFAULT_VIDEO_MIN_FPS = 10;
|
||||
@ -55,6 +54,9 @@ public:
|
||||
/* Populate an array of audio sources in the nsTArray. Also include devices
|
||||
* that are currently unavailable. */
|
||||
virtual void EnumerateAudioDevices(nsTArray<nsRefPtr<MediaEngineAudioSource> >*) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~MediaEngine() {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -131,12 +131,13 @@ public:
|
||||
MediaEngineDefault()
|
||||
: mMutex("mozilla::MediaEngineDefault")
|
||||
{}
|
||||
~MediaEngineDefault() {}
|
||||
|
||||
virtual void EnumerateVideoDevices(nsTArray<nsRefPtr<MediaEngineVideoSource> >*);
|
||||
virtual void EnumerateAudioDevices(nsTArray<nsRefPtr<MediaEngineAudioSource> >*);
|
||||
|
||||
private:
|
||||
~MediaEngineDefault() {}
|
||||
|
||||
Mutex mMutex;
|
||||
// protected with mMutex:
|
||||
|
||||
|
@ -350,14 +350,6 @@ class MediaEngineWebRTC : public MediaEngine
|
||||
{
|
||||
public:
|
||||
MediaEngineWebRTC(MediaEnginePrefs &aPrefs);
|
||||
~MediaEngineWebRTC() {
|
||||
Shutdown();
|
||||
#ifdef MOZ_B2G_CAMERA
|
||||
AsyncLatencyLogger::Get()->Release();
|
||||
#endif
|
||||
// XXX
|
||||
gFarendObserver = nullptr;
|
||||
}
|
||||
|
||||
// Clients should ensure to clean-up sources video/audio sources
|
||||
// before invoking Shutdown on this class.
|
||||
@ -367,6 +359,15 @@ public:
|
||||
virtual void EnumerateAudioDevices(nsTArray<nsRefPtr<MediaEngineAudioSource> >*);
|
||||
|
||||
private:
|
||||
~MediaEngineWebRTC() {
|
||||
Shutdown();
|
||||
#ifdef MOZ_B2G_CAMERA
|
||||
AsyncLatencyLogger::Get()->Release();
|
||||
#endif
|
||||
// XXX
|
||||
gFarendObserver = nullptr;
|
||||
}
|
||||
|
||||
Mutex mMutex;
|
||||
// protected with mMutex:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user