#ifndef WebMediaStreamTrack_h
#define WebMediaStreamTrack_h
#include "WebCommon.h"
#include "WebNonCopyable.h"
#include "WebPrivatePtr.h"
namespace WebCore {
class MediaStreamComponent;
}
namespace blink {
class WebAudioSourceProvider;
class WebMediaStream;
class WebMediaStreamSource;
class WebString;
class WebMediaStreamTrack {
public:
class ExtraData {
public:
ExtraData() : m_owner(0) { }
virtual ~ExtraData() { }
BLINK_PLATFORM_EXPORT WebMediaStreamTrack owner();
#if INSIDE_BLINK
BLINK_PLATFORM_EXPORT void setOwner(WebCore::MediaStreamComponent*);
#endif
private:
WebCore::MediaStreamComponent* m_owner;
};
WebMediaStreamTrack() { }
WebMediaStreamTrack(const WebMediaStreamTrack& other) { assign(other); }
~WebMediaStreamTrack() { reset(); }
WebMediaStreamTrack& operator=(const WebMediaStreamTrack& other)
{
assign(other);
return *this;
}
BLINK_PLATFORM_EXPORT void assign(const WebMediaStreamTrack&);
BLINK_PLATFORM_EXPORT void initialize(const WebMediaStreamSource&);
BLINK_PLATFORM_EXPORT void initialize(const WebString& id, const WebMediaStreamSource&);
BLINK_PLATFORM_EXPORT void reset();
bool isNull() const { return m_private.isNull(); }
BLINK_PLATFORM_EXPORT WebString id() const;
BLINK_PLATFORM_EXPORT WebMediaStreamSource source() const;
BLINK_PLATFORM_EXPORT bool isEnabled() const;
BLINK_PLATFORM_EXPORT ExtraData* extraData() const;
BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
BLINK_PLATFORM_EXPORT void setSourceProvider(WebAudioSourceProvider*);
#if INSIDE_BLINK
BLINK_PLATFORM_EXPORT WebMediaStreamTrack(PassRefPtr<WebCore::MediaStreamComponent>);
BLINK_PLATFORM_EXPORT WebMediaStreamTrack(WebCore::MediaStreamComponent*);
BLINK_PLATFORM_EXPORT WebMediaStreamTrack& operator=(WebCore::MediaStreamComponent*);
BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::MediaStreamComponent>() const;
BLINK_PLATFORM_EXPORT operator WebCore::MediaStreamComponent*() const;
#endif
private:
WebPrivatePtr<WebCore::MediaStreamComponent> m_private;
};
}
#endif