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 // AudioRendererHost serves audio related requests from AudioRenderer which | 5 // AudioRendererHost serves audio related requests from AudioRenderer which |
6 // lives inside the render process and provide access to audio hardware. | 6 // lives inside the render process and provide access to audio hardware. |
7 // | 7 // |
8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI | 8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI |
9 // thread, but all other operations and method calls happen on IO thread, so we | 9 // thread, but all other operations and method calls happen on IO thread, so we |
10 // need to be extra careful about the lifetime of this object. AudioManager is a | 10 // need to be extra careful about the lifetime of this object. AudioManager is a |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "media/audio/simple_sources.h" | 53 #include "media/audio/simple_sources.h" |
54 | 54 |
55 namespace media { | 55 namespace media { |
56 class AudioManager; | 56 class AudioManager; |
57 class AudioParameters; | 57 class AudioParameters; |
58 } | 58 } |
59 | 59 |
60 namespace content { | 60 namespace content { |
61 | 61 |
62 class AudioMirroringManager; | 62 class AudioMirroringManager; |
63 class MediaObserver; | 63 class MediaInternals; |
64 class ResourceContext; | 64 class ResourceContext; |
65 | 65 |
66 class CONTENT_EXPORT AudioRendererHost | 66 class CONTENT_EXPORT AudioRendererHost |
67 : public BrowserMessageFilter, | 67 : public BrowserMessageFilter, |
68 public media::AudioOutputController::EventHandler { | 68 public media::AudioOutputController::EventHandler { |
69 public: | 69 public: |
70 // Called from UI thread from the owner of this object. | 70 // Called from UI thread from the owner of this object. |
71 AudioRendererHost(int render_process_id, | 71 AudioRendererHost(int render_process_id, |
72 media::AudioManager* audio_manager, | 72 media::AudioManager* audio_manager, |
73 AudioMirroringManager* mirroring_manager, | 73 AudioMirroringManager* mirroring_manager, |
74 MediaObserver* media_observer); | 74 MediaInternals* media_internals); |
75 | 75 |
76 // BrowserMessageFilter implementation. | 76 // BrowserMessageFilter implementation. |
77 virtual void OnChannelClosing() OVERRIDE; | 77 virtual void OnChannelClosing() OVERRIDE; |
78 virtual void OnDestruct() const OVERRIDE; | 78 virtual void OnDestruct() const OVERRIDE; |
79 virtual bool OnMessageReceived(const IPC::Message& message, | 79 virtual bool OnMessageReceived(const IPC::Message& message, |
80 bool* message_was_ok) OVERRIDE; | 80 bool* message_was_ok) OVERRIDE; |
81 | 81 |
82 // AudioOutputController::EventHandler implementations. | 82 // AudioOutputController::EventHandler implementations. |
83 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE; | 83 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE; |
84 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE; | 84 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // event is received. | 165 // event is received. |
166 AudioEntry* LookupByController(media::AudioOutputController* controller); | 166 AudioEntry* LookupByController(media::AudioOutputController* controller); |
167 | 167 |
168 media::AudioOutputController* LookupControllerByIdForTesting(int stream_id); | 168 media::AudioOutputController* LookupControllerByIdForTesting(int stream_id); |
169 | 169 |
170 // ID of the RenderProcessHost that owns this instance. | 170 // ID of the RenderProcessHost that owns this instance. |
171 const int render_process_id_; | 171 const int render_process_id_; |
172 | 172 |
173 media::AudioManager* const audio_manager_; | 173 media::AudioManager* const audio_manager_; |
174 AudioMirroringManager* const mirroring_manager_; | 174 AudioMirroringManager* const mirroring_manager_; |
175 MediaObserver* const media_observer_; | 175 MediaInternals* const media_internals_; |
176 | 176 |
177 // A map of stream IDs to audio sources. | 177 // A map of stream IDs to audio sources. |
178 AudioEntryMap audio_entries_; | 178 AudioEntryMap audio_entries_; |
179 | 179 |
180 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 180 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace content | 183 } // namespace content |
184 | 184 |
185 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 185 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
OLD | NEW |