diff options
Diffstat (limited to 'media/webrtc/signaling/src/peerconnection/MediaStreamList.h')
-rw-r--r-- | media/webrtc/signaling/src/peerconnection/MediaStreamList.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/media/webrtc/signaling/src/peerconnection/MediaStreamList.h b/media/webrtc/signaling/src/peerconnection/MediaStreamList.h new file mode 100644 index 000000000..de9040227 --- /dev/null +++ b/media/webrtc/signaling/src/peerconnection/MediaStreamList.h @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef MediaStreamList_h__ +#define MediaStreamList_h__ + +#include "mozilla/ErrorResult.h" +#include "nsISupportsImpl.h" +#include "nsAutoPtr.h" +#include "nsWrapperCache.h" + +#ifdef USE_FAKE_MEDIA_STREAMS +#include "FakeMediaStreams.h" +#else +#include "DOMMediaStream.h" +#endif + +namespace mozilla { +class PeerConnectionImpl; +namespace dom { + +class MediaStreamList : public nsISupports, + public nsWrapperCache +{ +public: + enum StreamType { + Local, + Remote + }; + + MediaStreamList(PeerConnectionImpl* peerConnection, StreamType type); + + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList) + + virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) + override; + nsISupports* GetParentObject(); + + DOMMediaStream* IndexedGetter(uint32_t index, bool& found); + uint32_t Length(); + +private: + virtual ~MediaStreamList(); + + RefPtr<PeerConnectionImpl> mPeerConnection; + StreamType mType; +}; + +} // namespace dom +} // namespace mozilla + +#endif // MediaStreamList_h__ |