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_
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"
21 class WebAudioSourceProvider
;
22 class WebMediaStreamCenterClient
;
26 class PeerConnectionDependencyFactory
;
28 class CONTENT_EXPORT MediaStreamCenter
29 : NON_EXPORTED_BASE(public blink::WebMediaStreamCenter
) {
31 MediaStreamCenter(blink::WebMediaStreamCenterClient
* client
,
32 PeerConnectionDependencyFactory
* factory
);
33 virtual ~MediaStreamCenter();
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_