| 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 // Implementation of AudioOutputStream for Windows using Windows Core Audio | 5 // Implementation of AudioOutputStream for Windows using Windows Core Audio |
| 6 // WASAPI for low latency rendering. | 6 // WASAPI for low latency rendering. |
| 7 // | 7 // |
| 8 // Overview of operation and performance: | 8 // Overview of operation and performance: |
| 9 // | 9 // |
| 10 // - An object of WASAPIAudioOutputStream is created by the AudioManager | 10 // - An object of WASAPIAudioOutputStream is created by the AudioManager |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 #define MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ | 152 #define MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ |
| 153 | 153 |
| 154 #include <Audioclient.h> | 154 #include <Audioclient.h> |
| 155 #include <audiopolicy.h> | 155 #include <audiopolicy.h> |
| 156 #include <MMDeviceAPI.h> | 156 #include <MMDeviceAPI.h> |
| 157 | 157 |
| 158 #include <string> | 158 #include <string> |
| 159 | 159 |
| 160 #include "base/compiler_specific.h" | 160 #include "base/compiler_specific.h" |
| 161 #include "base/gtest_prod_util.h" | 161 #include "base/gtest_prod_util.h" |
| 162 #include "base/memory/scoped_ptr.h" |
| 162 #include "base/threading/platform_thread.h" | 163 #include "base/threading/platform_thread.h" |
| 163 #include "base/threading/simple_thread.h" | 164 #include "base/threading/simple_thread.h" |
| 164 #include "base/win/scoped_co_mem.h" | 165 #include "base/win/scoped_co_mem.h" |
| 165 #include "base/win/scoped_com_initializer.h" | 166 #include "base/win/scoped_com_initializer.h" |
| 166 #include "base/win/scoped_comptr.h" | 167 #include "base/win/scoped_comptr.h" |
| 167 #include "base/win/scoped_handle.h" | 168 #include "base/win/scoped_handle.h" |
| 168 #include "media/audio/audio_io.h" | 169 #include "media/audio/audio_io.h" |
| 169 #include "media/audio/audio_parameters.h" | 170 #include "media/audio/audio_parameters.h" |
| 170 #include "media/base/media_export.h" | 171 #include "media/base/media_export.h" |
| 171 | 172 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 base::win::ScopedCOMInitializer com_init_; | 302 base::win::ScopedCOMInitializer com_init_; |
| 302 | 303 |
| 303 // Contains the thread ID of the creating thread. | 304 // Contains the thread ID of the creating thread. |
| 304 base::PlatformThreadId creating_thread_id_; | 305 base::PlatformThreadId creating_thread_id_; |
| 305 | 306 |
| 306 // Our creator, the audio manager needs to be notified when we close. | 307 // Our creator, the audio manager needs to be notified when we close. |
| 307 AudioManagerWin* manager_; | 308 AudioManagerWin* manager_; |
| 308 | 309 |
| 309 // Rendering is driven by this thread (which has no message loop). | 310 // Rendering is driven by this thread (which has no message loop). |
| 310 // All OnMoreData() callbacks will be called from this thread. | 311 // All OnMoreData() callbacks will be called from this thread. |
| 311 base::DelegateSimpleThread* render_thread_; | 312 scoped_ptr<base::DelegateSimpleThread> render_thread_; |
| 312 | 313 |
| 313 // Contains the desired audio format which is set up at construction. | 314 // Contains the desired audio format which is set up at construction. |
| 314 // Extended PCM waveform format structure based on WAVEFORMATEXTENSIBLE. | 315 // Extended PCM waveform format structure based on WAVEFORMATEXTENSIBLE. |
| 315 // Use this for multiple channel and hi-resolution PCM data. | 316 // Use this for multiple channel and hi-resolution PCM data. |
| 316 WAVEFORMATPCMEX format_; | 317 WAVEFORMATPCMEX format_; |
| 317 | 318 |
| 318 // Copy of the audio format which we know the audio engine supports. | 319 // Copy of the audio format which we know the audio engine supports. |
| 319 // It is recommended to ensure that the sample rate in |format_| is identical | 320 // It is recommended to ensure that the sample rate in |format_| is identical |
| 320 // to the sample rate in |audio_engine_mix_format_|. | 321 // to the sample rate in |audio_engine_mix_format_|. |
| 321 base::win::ScopedCoMem<WAVEFORMATPCMEX> audio_engine_mix_format_; | 322 base::win::ScopedCoMem<WAVEFORMATPCMEX> audio_engine_mix_format_; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 392 |
| 392 // This event will be signaled when stream switching shall take place. | 393 // This event will be signaled when stream switching shall take place. |
| 393 base::win::ScopedHandle stream_switch_event_; | 394 base::win::ScopedHandle stream_switch_event_; |
| 394 | 395 |
| 395 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); | 396 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); |
| 396 }; | 397 }; |
| 397 | 398 |
| 398 } // namespace media | 399 } // namespace media |
| 399 | 400 |
| 400 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ | 401 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ |
| OLD | NEW |