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_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace media_stream { | 22 namespace media_stream { |
23 | 23 |
24 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by | 24 // MediaStreamDispatcherHost is a delegate for Media Stream API messages used by |
25 // MediaStreamImpl. It's the complement of MediaStreamDispatcher | 25 // MediaStreamImpl. It's the complement of MediaStreamDispatcher |
26 // (owned by RenderView). | 26 // (owned by RenderView). |
27 class CONTENT_EXPORT MediaStreamDispatcherHost | 27 class CONTENT_EXPORT MediaStreamDispatcherHost |
28 : public content::BrowserMessageFilter, | 28 : public content::BrowserMessageFilter, |
29 public MediaStreamRequester { | 29 public MediaStreamRequester { |
30 public: | 30 public: |
31 MediaStreamDispatcherHost(content::ResourceContext* resource_context, | 31 MediaStreamDispatcherHost(content::ResourceContext* resource_context, |
32 int render_process_id, | 32 int render_process_id); |
33 media::AudioManager* audio_manager); | |
34 | 33 |
35 // MediaStreamRequester implementation. | 34 // MediaStreamRequester implementation. |
36 virtual void StreamGenerated( | 35 virtual void StreamGenerated( |
37 const std::string& label, | 36 const std::string& label, |
38 const StreamDeviceInfoArray& audio_devices, | 37 const StreamDeviceInfoArray& audio_devices, |
39 const StreamDeviceInfoArray& video_devices) OVERRIDE; | 38 const StreamDeviceInfoArray& video_devices) OVERRIDE; |
40 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; | 39 virtual void StreamGenerationFailed(const std::string& label) OVERRIDE; |
41 virtual void AudioDeviceFailed(const std::string& label, int index) OVERRIDE; | 40 virtual void AudioDeviceFailed(const std::string& label, int index) OVERRIDE; |
42 virtual void VideoDeviceFailed(const std::string& label, int index) OVERRIDE; | 41 virtual void VideoDeviceFailed(const std::string& label, int index) OVERRIDE; |
43 virtual void DevicesEnumerated(const std::string& label, | 42 virtual void DevicesEnumerated(const std::string& label, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 const std::string& device_id, | 75 const std::string& device_id, |
77 media_stream::MediaStreamType type, | 76 media_stream::MediaStreamType type, |
78 const GURL& security_origin); | 77 const GURL& security_origin); |
79 | 78 |
80 // Returns the media stream manager to forward events to, | 79 // Returns the media stream manager to forward events to, |
81 // creating one if needed. | 80 // creating one if needed. |
82 MediaStreamManager* manager(); | 81 MediaStreamManager* manager(); |
83 | 82 |
84 content::ResourceContext* resource_context_; | 83 content::ResourceContext* resource_context_; |
85 int render_process_id_; | 84 int render_process_id_; |
86 media::AudioManager* audio_manager_; | |
87 | 85 |
88 struct StreamRequest; | 86 struct StreamRequest; |
89 typedef std::map<std::string, StreamRequest> StreamMap; | 87 typedef std::map<std::string, StreamRequest> StreamMap; |
90 // Streams generated for this host. | 88 // Streams generated for this host. |
91 StreamMap streams_; | 89 StreamMap streams_; |
92 | 90 |
93 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); | 91 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcherHost); |
94 }; | 92 }; |
95 | 93 |
96 } // namespace media_stream | 94 } // namespace media_stream |
97 | 95 |
98 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ | 96 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DISPATCHER_HOST_H_ |
OLD | NEW |