OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/audio_renderer_host.h" | 5 #include "chrome/browser/renderer_host/audio_renderer_host.h" |
6 | 6 |
7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/lock.h" | 8 #include "base/lock.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
12 #include "base/waitable_event.h" | |
13 #include "chrome/browser/renderer_host/audio_sync_reader.h" | 12 #include "chrome/browser/renderer_host/audio_sync_reader.h" |
14 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
15 #include "ipc/ipc_logging.h" | 14 #include "ipc/ipc_logging.h" |
16 | 15 |
17 // The minimum number of samples in a hardware packet. | 16 // The minimum number of samples in a hardware packet. |
18 // This value is selected so that we can handle down to 5khz sample rate. | 17 // This value is selected so that we can handle down to 5khz sample rate. |
19 static const int kMinSamplesPerHardwarePacket = 1024; | 18 static const int kMinSamplesPerHardwarePacket = 1024; |
20 | 19 |
21 // The maximum number of samples in a hardware packet. | 20 // The maximum number of samples in a hardware packet. |
22 // This value is selected so that we can handle up to 192khz sample rate. | 21 // This value is selected so that we can handle up to 192khz sample rate. |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 572 |
574 // Iterate the map of entries. | 573 // Iterate the map of entries. |
575 // TODO(hclam): Implement a faster look up method. | 574 // TODO(hclam): Implement a faster look up method. |
576 for (AudioEntryMap::iterator i = audio_entries_.begin(); | 575 for (AudioEntryMap::iterator i = audio_entries_.begin(); |
577 i != audio_entries_.end(); ++i) { | 576 i != audio_entries_.end(); ++i) { |
578 if (controller == i->second->controller.get()) | 577 if (controller == i->second->controller.get()) |
579 return i->second; | 578 return i->second; |
580 } | 579 } |
581 return NULL; | 580 return NULL; |
582 } | 581 } |
OLD | NEW |