media/webrtc/signaling/src/peerconnection/MediaStreamList.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/signaling/src/peerconnection/MediaStreamList.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef MediaStreamList_h__
     1.9 +#define MediaStreamList_h__
    1.10 +
    1.11 +#include "mozilla/ErrorResult.h"
    1.12 +#include "nsISupportsImpl.h"
    1.13 +#include "nsAutoPtr.h"
    1.14 +#include "nsWrapperCache.h"
    1.15 +
    1.16 +#ifdef USE_FAKE_MEDIA_STREAMS
    1.17 +#include "FakeMediaStreams.h"
    1.18 +#else
    1.19 +#include "DOMMediaStream.h"
    1.20 +#endif
    1.21 +
    1.22 +namespace sipcc {
    1.23 +class PeerConnectionImpl;
    1.24 +} // namespace sipcc
    1.25 +
    1.26 +namespace mozilla {
    1.27 +namespace dom {
    1.28 +
    1.29 +class MediaStreamList : public nsISupports,
    1.30 +                        public nsWrapperCache
    1.31 +{
    1.32 +public:
    1.33 +  enum StreamType {
    1.34 +    Local,
    1.35 +    Remote
    1.36 +  };
    1.37 +
    1.38 +  MediaStreamList(sipcc::PeerConnectionImpl* peerConnection, StreamType type);
    1.39 +  virtual ~MediaStreamList();
    1.40 +
    1.41 +  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    1.42 +  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList)
    1.43 +
    1.44 +  virtual JSObject* WrapObject(JSContext *cx)
    1.45 +    MOZ_OVERRIDE;
    1.46 +  nsISupports* GetParentObject();
    1.47 +
    1.48 +  DOMMediaStream* IndexedGetter(uint32_t index, bool& found);
    1.49 +  uint32_t Length();
    1.50 +
    1.51 +private:
    1.52 +  nsRefPtr<sipcc::PeerConnectionImpl> mPeerConnection;
    1.53 +  StreamType mType;
    1.54 +};
    1.55 +
    1.56 +} // namespace dom
    1.57 +} // namespace mozilla
    1.58 +
    1.59 +#endif // MediaStreamList_h__

mercurial