| 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_RENDERER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void set_volume(float volume) { | 66 void set_volume(float volume) { |
| 67 DCHECK(CalledOnValidThread()); | 67 DCHECK(CalledOnValidThread()); |
| 68 volume_ = volume; | 68 volume_ = volume; |
| 69 } | 69 } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 bool playing_; | 72 bool playing_; |
| 73 float volume_; | 73 float volume_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 | |
| 77 // Returns platform specific optimal buffer size for rendering audio. | |
| 78 static int GetOptimalBufferSize(int sample_rate, int hardware_buffer_size); | |
| 79 | |
| 80 WebRtcAudioRenderer( | 76 WebRtcAudioRenderer( |
| 81 const scoped_refptr<base::SingleThreadTaskRunner>& signaling_thread, | 77 const scoped_refptr<base::SingleThreadTaskRunner>& signaling_thread, |
| 82 const blink::WebMediaStream& media_stream, | 78 const blink::WebMediaStream& media_stream, |
| 83 int source_render_frame_id, | 79 int source_render_frame_id, |
| 84 int session_id, | 80 int session_id, |
| 85 const std::string& device_id, | 81 const std::string& device_id, |
| 86 const url::Origin& security_origin); | 82 const url::Origin& security_origin); |
| 87 | 83 |
| 88 // Initialize function called by clients like WebRtcAudioDeviceImpl. | 84 // Initialize function called by clients like WebRtcAudioDeviceImpl. |
| 89 // Stop() has to be called before |source| is deleted. | 85 // Stop() has to be called before |source| is deleted. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // Used for triggering new UMA histogram. Counts number of render | 253 // Used for triggering new UMA histogram. Counts number of render |
| 258 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. | 254 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. |
| 259 int render_callback_count_; | 255 int render_callback_count_; |
| 260 | 256 |
| 261 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); | 257 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); |
| 262 }; | 258 }; |
| 263 | 259 |
| 264 } // namespace content | 260 } // namespace content |
| 265 | 261 |
| 266 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 262 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| OLD | NEW |