| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/media/media_stream_options.h" | 13 #include "content/common/media/media_stream_options.h" |
| 14 #include "content/public/renderer/render_process_observer.h" | 14 #include "content/public/renderer/render_process_observer.h" |
| 15 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 15 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 16 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 16 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
| 17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 18 #include "third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h
" | 18 #include "third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h
" |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 class WebAudioSourceProvider; | 21 class WebAudioSourceProvider; |
| 22 class WebMediaStreamCenterClient; | 22 class WebMediaStreamCenterClient; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 class MediaStreamDependencyFactory; | 26 class PeerConnectionDependencyFactory; |
| 27 | 27 |
| 28 class CONTENT_EXPORT MediaStreamCenter | 28 class CONTENT_EXPORT MediaStreamCenter |
| 29 : NON_EXPORTED_BASE(public blink::WebMediaStreamCenter), | 29 : NON_EXPORTED_BASE(public blink::WebMediaStreamCenter), |
| 30 public RenderProcessObserver { | 30 public RenderProcessObserver { |
| 31 public: | 31 public: |
| 32 MediaStreamCenter(blink::WebMediaStreamCenterClient* client, | 32 MediaStreamCenter(blink::WebMediaStreamCenterClient* client, |
| 33 MediaStreamDependencyFactory* factory); | 33 PeerConnectionDependencyFactory* factory); |
| 34 virtual ~MediaStreamCenter(); | 34 virtual ~MediaStreamCenter(); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 virtual bool getMediaStreamTrackSources( | 37 virtual bool getMediaStreamTrackSources( |
| 38 const blink::WebMediaStreamTrackSourcesRequest& request) OVERRIDE; | 38 const blink::WebMediaStreamTrackSourcesRequest& request) OVERRIDE; |
| 39 | 39 |
| 40 virtual void didCreateMediaStreamTrack( | 40 virtual void didCreateMediaStreamTrack( |
| 41 const blink::WebMediaStreamTrack& track) OVERRIDE; | 41 const blink::WebMediaStreamTrack& track) OVERRIDE; |
| 42 | 42 |
| 43 virtual void didEnableMediaStreamTrack( | 43 virtual void didEnableMediaStreamTrack( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 69 const blink::WebMediaStreamTrack& track) OVERRIDE; | 69 const blink::WebMediaStreamTrack& track) OVERRIDE; |
| 70 | 70 |
| 71 // RenderProcessObserver implementation. | 71 // RenderProcessObserver implementation. |
| 72 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 72 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 73 | 73 |
| 74 void OnGetSourcesComplete(int request_id, | 74 void OnGetSourcesComplete(int request_id, |
| 75 const content::StreamDeviceInfoArray& devices); | 75 const content::StreamDeviceInfoArray& devices); |
| 76 | 76 |
| 77 // |rtc_factory_| is a weak pointer and is owned by the RenderThreadImpl. | 77 // |rtc_factory_| is a weak pointer and is owned by the RenderThreadImpl. |
| 78 // It is valid as long as RenderThreadImpl exist. | 78 // It is valid as long as RenderThreadImpl exist. |
| 79 MediaStreamDependencyFactory* rtc_factory_; | 79 PeerConnectionDependencyFactory* rtc_factory_; |
| 80 | 80 |
| 81 // A strictly increasing id that's used to label incoming GetSources() | 81 // A strictly increasing id that's used to label incoming GetSources() |
| 82 // requests. | 82 // requests. |
| 83 int next_request_id_; | 83 int next_request_id_; |
| 84 | 84 |
| 85 typedef std::map<int, blink::WebMediaStreamTrackSourcesRequest> RequestMap; | 85 typedef std::map<int, blink::WebMediaStreamTrackSourcesRequest> RequestMap; |
| 86 // Maps request ids to request objects. | 86 // Maps request ids to request objects. |
| 87 RequestMap requests_; | 87 RequestMap requests_; |
| 88 | 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(MediaStreamCenter); | 89 DISALLOW_COPY_AND_ASSIGN(MediaStreamCenter); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace content | 92 } // namespace content |
| 93 | 93 |
| 94 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_ | 94 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_CENTER_H_ |
| OLD | NEW |