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

Side by Side Diff: chrome/renderer/pepper_plugin_delegate_impl.cc

Issue 4661001: Simplified AudioOutputStream interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <cmath> 5 #include <cmath>
6 6
7 #include "chrome/renderer/pepper_plugin_delegate_impl.h" 7 #include "chrome/renderer/pepper_plugin_delegate_impl.h"
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/surface/transport_dib.h" 10 #include "app/surface/transport_dib.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // Make sure we don't call init more than once. 262 // Make sure we don't call init more than once.
263 DCHECK_EQ(0, stream_id_); 263 DCHECK_EQ(0, stream_id_);
264 264
265 client_ = client; 265 client_ = client;
266 266
267 ViewHostMsg_Audio_CreateStream_Params params; 267 ViewHostMsg_Audio_CreateStream_Params params;
268 params.params.format = AudioParameters::AUDIO_PCM_LINEAR; 268 params.params.format = AudioParameters::AUDIO_PCM_LINEAR;
269 params.params.channels = 2; 269 params.params.channels = 2;
270 params.params.sample_rate = sample_rate; 270 params.params.sample_rate = sample_rate;
271 params.params.bits_per_sample = 16; 271 params.params.bits_per_sample = 16;
272 272 params.params.samples_per_packet = sample_count;
273 params.packet_size = sample_count * params.params.channels *
274 (params.params.bits_per_sample >> 3);
275 273
276 stream_id_ = filter_->AddDelegate(this); 274 stream_id_ = filter_->AddDelegate(this);
277 return filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params, 275 return filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params,
278 true)); 276 true));
279 } 277 }
280 278
281 void PlatformAudioImpl::OnLowLatencyCreated( 279 void PlatformAudioImpl::OnLowLatencyCreated(
282 base::SharedMemoryHandle handle, base::SyncSocket::Handle socket_handle, 280 base::SharedMemoryHandle handle, base::SyncSocket::Handle socket_handle,
283 uint32 length) { 281 uint32 length) {
284 #if defined(OS_WIN) 282 #if defined(OS_WIN)
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 } 800 }
803 801
804 void PepperPluginDelegateImpl::DidStopLoading() { 802 void PepperPluginDelegateImpl::DidStopLoading() {
805 render_view_->DidStopLoadingForPlugin(); 803 render_view_->DidStopLoadingForPlugin();
806 } 804 }
807 805
808 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { 806 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) {
809 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( 807 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions(
810 render_view_->routing_id(), restrictions)); 808 render_view_->routing_id(), restrictions));
811 } 809 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698