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_sync_reader.h" | 5 #include "content/browser/renderer_host/media/audio_sync_reader.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
12 #include "media/audio/audio_buffers_state.h" | 12 #include "media/audio/audio_buffers_state.h" |
13 #include "media/audio/audio_util.h" | 13 #include "media/audio/audio_util.h" |
14 | 14 |
| 15 #if defined(OS_WIN) |
15 const int kMinIntervalBetweenReadCallsInMs = 10; | 16 const int kMinIntervalBetweenReadCallsInMs = 10; |
| 17 #endif |
16 | 18 |
17 AudioSyncReader::AudioSyncReader(base::SharedMemory* shared_memory) | 19 AudioSyncReader::AudioSyncReader(base::SharedMemory* shared_memory) |
18 : shared_memory_(shared_memory) { | 20 : shared_memory_(shared_memory) { |
19 } | 21 } |
20 | 22 |
21 AudioSyncReader::~AudioSyncReader() { | 23 AudioSyncReader::~AudioSyncReader() { |
22 } | 24 } |
23 | 25 |
24 bool AudioSyncReader::DataReady() { | 26 bool AudioSyncReader::DataReady() { |
25 return !media::IsUnknownDataSize( | 27 return !media::IsUnknownDataSize( |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 bool AudioSyncReader::PrepareForeignSocketHandle( | 113 bool AudioSyncReader::PrepareForeignSocketHandle( |
112 base::ProcessHandle process_handle, | 114 base::ProcessHandle process_handle, |
113 base::FileDescriptor* foreign_handle) { | 115 base::FileDescriptor* foreign_handle) { |
114 foreign_handle->fd = foreign_socket_->handle(); | 116 foreign_handle->fd = foreign_socket_->handle(); |
115 foreign_handle->auto_close = false; | 117 foreign_handle->auto_close = false; |
116 if (foreign_handle->fd != -1) | 118 if (foreign_handle->fd != -1) |
117 return true; | 119 return true; |
118 return false; | 120 return false; |
119 } | 121 } |
120 #endif | 122 #endif |
OLD | NEW |