#ifndef WebMediaStream_h
#define WebMediaStream_h
#include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h"
#include "WebVector.h"
namespace WebCore {
class MediaStreamDescriptor;
}
namespace blink {
class WebMediaStreamSource;
class WebMediaStreamTrack;
class WebString;
class WebMediaStream {
public:
class ExtraData {
public:
virtual ~ExtraData() { }
};
WebMediaStream() { }
WebMediaStream(const WebMediaStream& other) { assign(other); }
~WebMediaStream() { reset(); }
WebMediaStream& operator=(const WebMediaStream& other)
{
assign(other);
return *this;
}
BLINK_PLATFORM_EXPORT void assign(const WebMediaStream&);
BLINK_PLATFORM_EXPORT void initialize(const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks);
BLINK_PLATFORM_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks);
BLINK_PLATFORM_EXPORT void reset();
bool isNull() const { return m_private.isNull(); }
BLINK_PLATFORM_EXPORT WebString id() const;
BLINK_PLATFORM_EXPORT void audioTracks(WebVector<WebMediaStreamTrack>&) const;
BLINK_PLATFORM_EXPORT void videoTracks(WebVector<WebMediaStreamTrack>&) const;
BLINK_PLATFORM_EXPORT void addTrack(const WebMediaStreamTrack&);
BLINK_PLATFORM_EXPORT void removeTrack(const WebMediaStreamTrack&);
BLINK_PLATFORM_EXPORT ExtraData* extraData() const;
BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
#if INSIDE_BLINK
BLINK_PLATFORM_EXPORT WebMediaStream(WebCore::MediaStreamDescriptor*);
BLINK_PLATFORM_EXPORT WebMediaStream(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&);
BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::MediaStreamDescriptor>() const;
BLINK_PLATFORM_EXPORT operator WebCore::MediaStreamDescriptor*() const;
BLINK_PLATFORM_EXPORT WebMediaStream& operator=(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&);
#endif
private:
WebPrivatePtr<WebCore::MediaStreamDescriptor> m_private;
};
}
#endif