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

Side by Side Diff: content/renderer/media/renderer_webaudiodevice_impl.cc

Issue 2908073002: Make OS audio buffer size limits visible. (Closed)
Patch Set: Remove pulse-related changes. Created 3 years, 5 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/shell/renderer/layout_test/layout_test_content_renderer_client.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 #include "content/renderer/media/renderer_webaudiodevice_impl.h" 5 #include "content/renderer/media/renderer_webaudiodevice_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 break; 58 break;
59 case media::AudioLatency::LATENCY_RTC: 59 case media::AudioLatency::LATENCY_RTC:
60 return media::AudioLatency::GetRtcBufferSize( 60 return media::AudioLatency::GetRtcBufferSize(
61 hardware_params.sample_rate(), hardware_params.frames_per_buffer()); 61 hardware_params.sample_rate(), hardware_params.frames_per_buffer());
62 break; 62 break;
63 case media::AudioLatency::LATENCY_PLAYBACK: 63 case media::AudioLatency::LATENCY_PLAYBACK:
64 return media::AudioLatency::GetHighLatencyBufferSize( 64 return media::AudioLatency::GetHighLatencyBufferSize(
65 hardware_params.sample_rate(), 0); 65 hardware_params.sample_rate(), 0);
66 break; 66 break;
67 case media::AudioLatency::LATENCY_EXACT_MS: 67 case media::AudioLatency::LATENCY_EXACT_MS:
68 // TODO(andrew.macpherson@soundtrap.com): http://crbug.com/708917 68 return media::AudioLatency::GetExactBufferSize(
69 return std::min(4096, 69 base::TimeDelta::FromSecondsD(latency_hint.Seconds()),
70 media::AudioLatency::GetExactBufferSize( 70 hardware_params.sample_rate(), hardware_params.frames_per_buffer());
71 base::TimeDelta::FromSecondsD(latency_hint.Seconds()),
72 hardware_params.sample_rate(),
73 hardware_params.frames_per_buffer()));
74 break; 71 break;
75 default: 72 default:
76 NOTREACHED(); 73 NOTREACHED();
77 } 74 }
78 return 0; 75 return 0;
79 } 76 }
80 77
81 int FrameIdFromCurrentContext() { 78 int FrameIdFromCurrentContext() {
82 // Assumption: This method is being invoked within a V8 call stack. CHECKs 79 // Assumption: This method is being invoked within a V8 call stack. CHECKs
83 // will fail in the call to frameForCurrentContext() otherwise. 80 // will fail in the call to frameForCurrentContext() otherwise.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 const scoped_refptr<base::SingleThreadTaskRunner>& 238 const scoped_refptr<base::SingleThreadTaskRunner>&
242 RendererWebAudioDeviceImpl::GetMediaTaskRunner() { 239 RendererWebAudioDeviceImpl::GetMediaTaskRunner() {
243 if (!media_task_runner_) { 240 if (!media_task_runner_) {
244 media_task_runner_ = 241 media_task_runner_ =
245 RenderThreadImpl::current()->GetMediaThreadTaskRunner(); 242 RenderThreadImpl::current()->GetMediaThreadTaskRunner();
246 } 243 }
247 return media_task_runner_; 244 return media_task_runner_;
248 } 245 }
249 246
250 } // namespace content 247 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/shell/renderer/layout_test/layout_test_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698