Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / renderer / media / media_stream_center.h
blobef4fbaa0db559ed3c94ab1b1107b6f16d796b6bc
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_
8 #include <map>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "content/common/content_export.h"
13 #include "content/common/media/media_stream_options.h"
14 #include "content/public/renderer/render_process_observer.h"
15 #include "third_party/WebKit/public/platform/WebMediaStream.h"
16 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
18 #include "third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h"
20 namespace blink {
21 class WebAudioSourceProvider;
22 class WebMediaStreamCenterClient;
25 namespace content {
26 class PeerConnectionDependencyFactory;
28 class CONTENT_EXPORT MediaStreamCenter
29 : NON_EXPORTED_BASE(public blink::WebMediaStreamCenter) {
30 public:
31 MediaStreamCenter(blink::WebMediaStreamCenterClient* client,
32 PeerConnectionDependencyFactory* factory);
33 virtual ~MediaStreamCenter();
35 private:
36 virtual void didCreateMediaStreamTrack(
37 const blink::WebMediaStreamTrack& track) override;
39 virtual void didEnableMediaStreamTrack(
40 const blink::WebMediaStreamTrack& track) override;
42 virtual void didDisableMediaStreamTrack(
43 const blink::WebMediaStreamTrack& track) override;
45 virtual void didStopLocalMediaStream(
46 const blink::WebMediaStream& stream) override;
48 virtual bool didStopMediaStreamTrack(
49 const blink::WebMediaStreamTrack& track) override;
51 virtual blink::WebAudioSourceProvider*
52 createWebAudioSourceFromMediaStreamTrack(
53 const blink::WebMediaStreamTrack& track) override;
56 virtual void didCreateMediaStream(
57 blink::WebMediaStream& stream) override;
59 virtual bool didAddMediaStreamTrack(
60 const blink::WebMediaStream& stream,
61 const blink::WebMediaStreamTrack& track) override;
63 virtual bool didRemoveMediaStreamTrack(
64 const blink::WebMediaStream& stream,
65 const blink::WebMediaStreamTrack& track) override;
67 // |rtc_factory_| is a weak pointer and is owned by the RenderThreadImpl.
68 // It is valid as long as RenderThreadImpl exist.
69 PeerConnectionDependencyFactory* rtc_factory_;
71 DISALLOW_COPY_AND_ASSIGN(MediaStreamCenter);
74 } // namespace content
76 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_