|
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 MediaStreamList_h__ |
|
6 #define MediaStreamList_h__ |
|
7 |
|
8 #include "mozilla/ErrorResult.h" |
|
9 #include "nsISupportsImpl.h" |
|
10 #include "nsAutoPtr.h" |
|
11 #include "nsWrapperCache.h" |
|
12 |
|
13 #ifdef USE_FAKE_MEDIA_STREAMS |
|
14 #include "FakeMediaStreams.h" |
|
15 #else |
|
16 #include "DOMMediaStream.h" |
|
17 #endif |
|
18 |
|
19 namespace sipcc { |
|
20 class PeerConnectionImpl; |
|
21 } // namespace sipcc |
|
22 |
|
23 namespace mozilla { |
|
24 namespace dom { |
|
25 |
|
26 class MediaStreamList : public nsISupports, |
|
27 public nsWrapperCache |
|
28 { |
|
29 public: |
|
30 enum StreamType { |
|
31 Local, |
|
32 Remote |
|
33 }; |
|
34 |
|
35 MediaStreamList(sipcc::PeerConnectionImpl* peerConnection, StreamType type); |
|
36 virtual ~MediaStreamList(); |
|
37 |
|
38 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
39 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList) |
|
40 |
|
41 virtual JSObject* WrapObject(JSContext *cx) |
|
42 MOZ_OVERRIDE; |
|
43 nsISupports* GetParentObject(); |
|
44 |
|
45 DOMMediaStream* IndexedGetter(uint32_t index, bool& found); |
|
46 uint32_t Length(); |
|
47 |
|
48 private: |
|
49 nsRefPtr<sipcc::PeerConnectionImpl> mPeerConnection; |
|
50 StreamType mType; |
|
51 }; |
|
52 |
|
53 } // namespace dom |
|
54 } // namespace mozilla |
|
55 |
|
56 #endif // MediaStreamList_h__ |