1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "DOMMediaStream.h"
9 #include "MediaEventSource.h"
10 #include "MediaTrackGraph.h"
11 #include "MediaTrackConstraints.h"
12 #include "mozilla/dom/MediaStreamTrackBinding.h"
13 #include "mozilla/dom/VideoStreamTrack.h"
14 #include "mozilla/RefPtr.h"
15 #include "mozilla/ThreadSafeWeakPtr.h"
23 class AllocationHandle
;
25 class MediaEngineSource
;
32 enum { kVideoTrack
= 1, kAudioTrack
= 2, kTrackCount
};
36 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaEngine
)
37 NS_DECL_OWNINGEVENTTARGET
39 void AssertIsOnOwningThread() const { NS_ASSERT_OWNINGTHREAD(MediaEngine
); }
42 * Populate an array of sources of the requested type in the nsTArray.
43 * Also include devices that are currently unavailable.
45 virtual void EnumerateDevices(dom::MediaSourceEnum
, MediaSinkEnum
,
46 nsTArray
<RefPtr
<MediaDevice
>>*) = 0;
48 virtual void Shutdown() = 0;
50 virtual RefPtr
<MediaEngineSource
> CreateSource(
51 const MediaDevice
* aDevice
) = 0;
53 virtual MediaEventSource
<void>& DeviceListChangeEvent() = 0;
55 * Return true if devices returned from EnumerateDevices are emulated media
58 virtual bool IsFake() const = 0;
61 virtual ~MediaEngine() = default;
64 } // namespace mozilla
66 #endif /* MEDIAENGINE_H_ */