Chromium Code Reviews| 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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 // webrtc::RefCountedModule implementation. | 105 // webrtc::RefCountedModule implementation. |
| 106 // The creator must call AddRef() after construction and use Release() | 106 // The creator must call AddRef() after construction and use Release() |
| 107 // to release the reference and delete this object. | 107 // to release the reference and delete this object. |
| 108 virtual int32_t AddRef() OVERRIDE; | 108 virtual int32_t AddRef() OVERRIDE; |
| 109 virtual int32_t Release() OVERRIDE; | 109 virtual int32_t Release() OVERRIDE; |
| 110 | 110 |
| 111 // We need this one to support runnable method tasks. | 111 // We need this one to support runnable method tasks. |
| 112 static bool ImplementsThreadSafeReferenceCounting() { return true; } | 112 static bool ImplementsThreadSafeReferenceCounting() { return true; } |
| 113 | 113 |
| 114 // AudioDevice::RenderCallback implementation. | 114 // AudioDevice::RenderCallback implementation. |
| 115 virtual size_t Render(const std::vector<float*>& audio_data, | 115 virtual int Render(const std::vector<float*>& audio_data, |
| 116 size_t number_of_frames, | 116 int number_of_frames, |
| 117 size_t audio_delay_milliseconds) OVERRIDE; | 117 int audio_delay_milliseconds) OVERRIDE; |
| 118 virtual void OnRenderError() OVERRIDE; | 118 virtual void OnRenderError() OVERRIDE; |
| 119 | 119 |
| 120 // AudioInputDevice::CaptureCallback implementation. | 120 // AudioInputDevice::CaptureCallback implementation. |
| 121 virtual void Capture(const std::vector<float*>& audio_data, | 121 virtual void Capture(const std::vector<float*>& audio_data, |
| 122 size_t number_of_frames, | 122 int number_of_frames, |
| 123 size_t audio_delay_milliseconds) OVERRIDE; | 123 int audio_delay_milliseconds) OVERRIDE; |
| 124 virtual void OnCaptureError() OVERRIDE; | 124 virtual void OnCaptureError() OVERRIDE; |
| 125 | 125 |
| 126 // AudioInputDevice::CaptureEventHandler implementation. | 126 // AudioInputDevice::CaptureEventHandler implementation. |
| 127 virtual void OnDeviceStarted(const std::string& device_id) OVERRIDE; | 127 virtual void OnDeviceStarted(const std::string& device_id) OVERRIDE; |
| 128 virtual void OnDeviceStopped() OVERRIDE; | 128 virtual void OnDeviceStopped() OVERRIDE; |
| 129 | 129 |
| 130 // webrtc::Module implementation. | 130 // webrtc::Module implementation. |
| 131 virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE; | 131 virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE; |
| 132 virtual int32_t TimeUntilNextProcess() OVERRIDE; | 132 virtual int32_t TimeUntilNextProcess() OVERRIDE; |
| 133 virtual int32_t Process() OVERRIDE; | 133 virtual int32_t Process() OVERRIDE; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 virtual int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const OVERRIDE; | 247 virtual int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const OVERRIDE; |
| 248 | 248 |
| 249 virtual int32_t ResetAudioDevice() OVERRIDE; | 249 virtual int32_t ResetAudioDevice() OVERRIDE; |
| 250 virtual int32_t SetLoudspeakerStatus(bool enable) OVERRIDE; | 250 virtual int32_t SetLoudspeakerStatus(bool enable) OVERRIDE; |
| 251 virtual int32_t GetLoudspeakerStatus(bool* enabled) const OVERRIDE; | 251 virtual int32_t GetLoudspeakerStatus(bool* enabled) const OVERRIDE; |
| 252 | 252 |
| 253 // Sets the session id. | 253 // Sets the session id. |
| 254 void SetSessionId(int session_id); | 254 void SetSessionId(int session_id); |
| 255 | 255 |
| 256 // Accessors. | 256 // Accessors. |
| 257 size_t input_buffer_size() const { | 257 int input_buffer_size() const { |
| 258 return input_audio_parameters_.frames_per_buffer(); | 258 return input_audio_parameters_.frames_per_buffer(); |
| 259 } | 259 } |
| 260 size_t output_buffer_size() const { | 260 int output_buffer_size() const { |
| 261 return input_audio_parameters_.frames_per_buffer(); | 261 return input_audio_parameters_.frames_per_buffer(); |
|
tommi (sloooow) - chröme
2012/03/26 10:57:25
fyi - this has been fixed on trunk.
vrk (LEFT CHROMIUM)
2012/04/02 21:17:54
D'oh! Thanks :)
| |
| 262 } | 262 } |
| 263 int input_channels() const { | 263 int input_channels() const { |
| 264 return input_audio_parameters_.channels(); | 264 return input_audio_parameters_.channels(); |
| 265 } | 265 } |
| 266 int output_channels() const { | 266 int output_channels() const { |
| 267 return output_audio_parameters_.channels(); | 267 return output_audio_parameters_.channels(); |
| 268 } | 268 } |
| 269 int input_sample_rate() const { | 269 int input_sample_rate() const { |
| 270 return input_audio_parameters_.sample_rate(); | 270 return input_audio_parameters_.sample_rate(); |
| 271 } | 271 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 333 int bytes_per_sample_; | 333 int bytes_per_sample_; |
| 334 | 334 |
| 335 bool initialized_; | 335 bool initialized_; |
| 336 bool playing_; | 336 bool playing_; |
| 337 bool recording_; | 337 bool recording_; |
| 338 | 338 |
| 339 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 339 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
| 340 }; | 340 }; |
| 341 | 341 |
| 342 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 342 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
| OLD | NEW |