#ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_
#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_
#include <map>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/common/content_export.h"
#include "content/common/media/media_stream_options.h"
#include "content/public/renderer/render_process_observer.h"
#include "third_party/WebKit/public/platform/WebMediaStream.h"
#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h"
namespace blink {
class WebAudioSourceProvider;
class WebMediaStreamCenterClient;
}
namespace content {
class MediaStreamDependencyFactory;
class CONTENT_EXPORT MediaStreamCenter
: NON_EXPORTED_BASE(public blink::WebMediaStreamCenter),
public RenderProcessObserver {
public:
MediaStreamCenter(blink::WebMediaStreamCenterClient* client,
MediaStreamDependencyFactory* factory);
virtual ~MediaStreamCenter();
private:
virtual bool getMediaStreamTrackSources(
const blink::WebMediaStreamTrackSourcesRequest& request) OVERRIDE;
virtual void didCreateMediaStreamTrack(
const blink::WebMediaStreamTrack& track) OVERRIDE;
virtual void didEnableMediaStreamTrack(
const blink::WebMediaStreamTrack& track) OVERRIDE;
virtual void didDisableMediaStreamTrack(
const blink::WebMediaStreamTrack& track) OVERRIDE;
virtual void didStopLocalMediaStream(
const blink::WebMediaStream& stream) OVERRIDE;
virtual bool didStopMediaStreamTrack(
const blink::WebMediaStreamTrack& track) OVERRIDE;
virtual blink::WebAudioSourceProvider*
createWebAudioSourceFromMediaStreamTrack(
const blink::WebMediaStreamTrack& track) OVERRIDE;
virtual void didCreateMediaStream(
blink::WebMediaStream& stream) OVERRIDE;
virtual bool didAddMediaStreamTrack(
const blink::WebMediaStream& stream,
const blink::WebMediaStreamTrack& track) OVERRIDE;
virtual bool didRemoveMediaStreamTrack(
const blink::WebMediaStream& stream,
const blink::WebMediaStreamTrack& track) OVERRIDE;
virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
void OnGetSourcesComplete(int request_id,
const content::StreamDeviceInfoArray& devices);
MediaStreamDependencyFactory* rtc_factory_;
int next_request_id_;
typedef std::map<int, blink::WebMediaStreamTrackSourcesRequest> RequestMap;
RequestMap requests_;
DISALLOW_COPY_AND_ASSIGN(MediaStreamCenter);
};
}
#endif