Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/media/webrtc/MediaEngine.h
Line
Count
Source (jump to first uncovered line)
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/. */
4
5
#ifndef MEDIAENGINE_H_
6
#define MEDIAENGINE_H_
7
8
#include "DOMMediaStream.h"
9
#include "MediaStreamGraph.h"
10
#include "MediaTrackConstraints.h"
11
#include "mozilla/dom/MediaStreamTrackBinding.h"
12
#include "mozilla/dom/VideoStreamTrack.h"
13
#include "mozilla/media/DeviceChangeCallback.h"
14
#include "mozilla/RefPtr.h"
15
#include "mozilla/ThreadSafeWeakPtr.h"
16
17
namespace mozilla {
18
19
namespace dom {
20
class Blob;
21
} // namespace dom
22
23
class AllocationHandle;
24
class MediaEngineSource;
25
26
enum MediaSinkEnum {
27
  Speaker,
28
  Other,
29
};
30
31
enum {
32
  kVideoTrack = 1,
33
  kAudioTrack = 2,
34
  kTrackCount
35
};
36
37
class MediaEngine : public DeviceChangeCallback
38
{
39
public:
40
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaEngine)
41
  NS_DECL_OWNINGTHREAD
42
43
  void AssertIsOnOwningThread() const
44
0
  {
45
0
    NS_ASSERT_OWNINGTHREAD(MediaEngine);
46
0
  }
47
48
  /**
49
   * Populate an array of sources of the requested type in the nsTArray.
50
   * Also include devices that are currently unavailable.
51
   */
52
  virtual void EnumerateDevices(uint64_t aWindowId,
53
                                dom::MediaSourceEnum,
54
                                MediaSinkEnum,
55
                                nsTArray<RefPtr<MediaDevice>>*) = 0;
56
57
  virtual void ReleaseResourcesForWindow(uint64_t aWindowId) = 0;
58
  virtual void Shutdown() = 0;
59
60
  virtual void SetFakeDeviceChangeEvents() {}
61
62
protected:
63
  virtual ~MediaEngine() {}
64
};
65
66
} // namespace mozilla
67
68
#endif /* MEDIAENGINE_H_ */