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 #include "content/browser/renderer_host/media/audio_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 if (!reader->PrepareForeignSocketHandle(peer_handle(), | 176 if (!reader->PrepareForeignSocketHandle(peer_handle(), |
177 &foreign_socket_handle)) { | 177 &foreign_socket_handle)) { |
178 DeleteEntryOnError(entry); | 178 DeleteEntryOnError(entry); |
179 return; | 179 return; |
180 } | 180 } |
181 | 181 |
182 Send(new AudioMsg_NotifyStreamCreated( | 182 Send(new AudioMsg_NotifyStreamCreated( |
183 entry->stream_id, | 183 entry->stream_id, |
184 foreign_memory_handle, | 184 foreign_memory_handle, |
185 foreign_socket_handle, | 185 foreign_socket_handle, |
186 media::PacketSizeInBytes(entry->shared_memory.created_size()))); | 186 media::PacketSizeInBytes(entry->shared_memory.requested_size()))); |
187 } | 187 } |
188 | 188 |
189 void AudioRendererHost::DoSendPlayingMessage( | 189 void AudioRendererHost::DoSendPlayingMessage( |
190 media::AudioOutputController* controller) { | 190 media::AudioOutputController* controller) { |
191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
192 | 192 |
193 AudioEntry* entry = LookupByController(controller); | 193 AudioEntry* entry = LookupByController(controller); |
194 if (!entry) | 194 if (!entry) |
195 return; | 195 return; |
196 | 196 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 return NULL; | 527 return NULL; |
528 } | 528 } |
529 | 529 |
530 media::AudioOutputController* AudioRendererHost::LookupControllerByIdForTesting( | 530 media::AudioOutputController* AudioRendererHost::LookupControllerByIdForTesting( |
531 int stream_id) { | 531 int stream_id) { |
532 AudioEntry* const entry = LookupById(stream_id); | 532 AudioEntry* const entry = LookupById(stream_id); |
533 return entry ? entry->controller : NULL; | 533 return entry ? entry->controller : NULL; |
534 } | 534 } |
535 | 535 |
536 } // namespace content | 536 } // namespace content |
OLD | NEW |