| 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 notes: | 5 // Implementation notes: |
| 6 // | 6 // |
| 7 // - It is recommended to first acquire the native sample rate of the default | 7 // - It is recommended to first acquire the native sample rate of the default |
| 8 // output device and then use the same rate when creating this object. | 8 // output device and then use the same rate when creating this object. |
| 9 // Use AUAudioOutputStream::HardwareSampleRate() to retrieve the sample rate. | 9 // Use AUAudioOutputStream::HardwareSampleRate() to retrieve the sample rate. |
| 10 // - Calling Close() also leads to self destruction. | 10 // - Calling Close() also leads to self destruction. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 virtual ~AUAudioOutputStream(); | 39 virtual ~AUAudioOutputStream(); |
| 40 | 40 |
| 41 // Implementation of AudioOutputStream. | 41 // Implementation of AudioOutputStream. |
| 42 virtual bool Open() OVERRIDE; | 42 virtual bool Open() OVERRIDE; |
| 43 virtual void Close() OVERRIDE; | 43 virtual void Close() OVERRIDE; |
| 44 virtual void Start(AudioSourceCallback* callback) OVERRIDE; | 44 virtual void Start(AudioSourceCallback* callback) OVERRIDE; |
| 45 virtual void Stop() OVERRIDE; | 45 virtual void Stop() OVERRIDE; |
| 46 virtual void SetVolume(double volume) OVERRIDE; | 46 virtual void SetVolume(double volume) OVERRIDE; |
| 47 virtual void GetVolume(double* volume) OVERRIDE; | 47 virtual void GetVolume(double* volume) OVERRIDE; |
| 48 | 48 |
| 49 static double HardwareSampleRate(); | 49 static int HardwareSampleRate(); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // DefaultOutputUnit callback. | 52 // DefaultOutputUnit callback. |
| 53 static OSStatus InputProc(void* user_data, | 53 static OSStatus InputProc(void* user_data, |
| 54 AudioUnitRenderActionFlags* flags, | 54 AudioUnitRenderActionFlags* flags, |
| 55 const AudioTimeStamp* time_stamp, | 55 const AudioTimeStamp* time_stamp, |
| 56 UInt32 bus_number, | 56 UInt32 bus_number, |
| 57 UInt32 number_of_frames, | 57 UInt32 number_of_frames, |
| 58 AudioBufferList* io_data); | 58 AudioBufferList* io_data); |
| 59 | 59 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 90 // Volume level from 0 to 1. | 90 // Volume level from 0 to 1. |
| 91 float volume_; | 91 float volume_; |
| 92 | 92 |
| 93 // Fixed playout hardware latency in frames. | 93 // Fixed playout hardware latency in frames. |
| 94 double hardware_latency_frames_; | 94 double hardware_latency_frames_; |
| 95 | 95 |
| 96 DISALLOW_COPY_AND_ASSIGN(AUAudioOutputStream); | 96 DISALLOW_COPY_AND_ASSIGN(AUAudioOutputStream); |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_OUTPUT_MAC_H_ | 99 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_OUTPUT_MAC_H_ |
| OLD | NEW |