Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / renderer / media / media_stream_center.h
blobd36275570225298203b5811e086b707789f68653
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 ~MediaStreamCenter() override;
35 private:
36 void didCreateMediaStreamTrack(
37 const blink::WebMediaStreamTrack& track) override;
39 void didEnableMediaStreamTrack(
40 const blink::WebMediaStreamTrack& track) override;
42 void didDisableMediaStreamTrack(
43 const blink::WebMediaStreamTrack& track) override;
45 void didStopLocalMediaStream(const blink::WebMediaStream& stream) override;
47 bool didStopMediaStreamTrack(
48 const blink::WebMediaStreamTrack& track) override;
50 blink::WebAudioSourceProvider* createWebAudioSourceFromMediaStreamTrack(
51 const blink::WebMediaStreamTrack& track) override;
53 void didCreateMediaStream(blink::WebMediaStream& stream) override;
55 bool didAddMediaStreamTrack(const blink::WebMediaStream& stream,
56 const blink::WebMediaStreamTrack& track) override;
58 bool didRemoveMediaStreamTrack(
59 const blink::WebMediaStream& stream,
60 const blink::WebMediaStreamTrack& track) override;
62 // |rtc_factory_| is a weak pointer and is owned by the RenderThreadImpl.
63 // It is valid as long as RenderThreadImpl exist.
64 PeerConnectionDependencyFactory* rtc_factory_;
66 DISALLOW_COPY_AND_ASSIGN(MediaStreamCenter);
69 } // namespace content
71 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_