Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: content/renderer/media/webrtc_audio_renderer.h

Issue 646033007: Use the optimal buffer size for the local audio renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "base/threading/non_thread_safe.h" 10 #include "base/threading/non_thread_safe.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void set_volume(float volume) { 62 void set_volume(float volume) {
63 DCHECK(CalledOnValidThread()); 63 DCHECK(CalledOnValidThread());
64 volume_ = volume; 64 volume_ = volume;
65 } 65 }
66 66
67 private: 67 private:
68 bool playing_; 68 bool playing_;
69 float volume_; 69 float volume_;
70 }; 70 };
71 71
72
73 // Returns platform specific optimal buffer size for rendering audio.
74 static int GetOptimalBufferSize(int sample_rate, int hardware_buffer_size);
75
72 WebRtcAudioRenderer( 76 WebRtcAudioRenderer(
73 const scoped_refptr<webrtc::MediaStreamInterface>& media_stream, 77 const scoped_refptr<webrtc::MediaStreamInterface>& media_stream,
74 int source_render_view_id, 78 int source_render_view_id,
75 int source_render_frame_id, 79 int source_render_frame_id,
76 int session_id, 80 int session_id,
77 int sample_rate, 81 int sample_rate,
78 int frames_per_buffer); 82 int frames_per_buffer);
79 83
80 // Initialize function called by clients like WebRtcAudioDeviceImpl. 84 // Initialize function called by clients like WebRtcAudioDeviceImpl.
81 // Stop() has to be called before |source| is deleted. 85 // Stop() has to be called before |source| is deleted.
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 // Used for triggering new UMA histogram. Counts number of render 236 // Used for triggering new UMA histogram. Counts number of render
233 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. 237 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|.
234 int render_callback_count_; 238 int render_callback_count_;
235 239
236 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); 240 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer);
237 }; 241 };
238 242
239 } // namespace content 243 } // namespace content
240 244
241 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ 245 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webrtc_audio_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698