OLD | NEW |
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // Make sure we don't call init more than once. | 271 // Make sure we don't call init more than once. |
272 DCHECK_EQ(0, stream_id_); | 272 DCHECK_EQ(0, stream_id_); |
273 | 273 |
274 client_ = client; | 274 client_ = client; |
275 | 275 |
276 ViewHostMsg_Audio_CreateStream_Params params; | 276 ViewHostMsg_Audio_CreateStream_Params params; |
277 params.params.format = AudioParameters::AUDIO_PCM_LINEAR; | 277 params.params.format = AudioParameters::AUDIO_PCM_LINEAR; |
278 params.params.channels = 2; | 278 params.params.channels = 2; |
279 params.params.sample_rate = sample_rate; | 279 params.params.sample_rate = sample_rate; |
280 params.params.bits_per_sample = 16; | 280 params.params.bits_per_sample = 16; |
281 | 281 params.params.samples_per_packet = sample_count; |
282 params.packet_size = sample_count * params.params.channels * | |
283 (params.params.bits_per_sample >> 3); | |
284 | 282 |
285 stream_id_ = filter_->AddDelegate(this); | 283 stream_id_ = filter_->AddDelegate(this); |
286 return filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params, | 284 return filter_->Send(new ViewHostMsg_CreateAudioStream(0, stream_id_, params, |
287 true)); | 285 true)); |
288 } | 286 } |
289 | 287 |
290 void PlatformAudioImpl::OnLowLatencyCreated( | 288 void PlatformAudioImpl::OnLowLatencyCreated( |
291 base::SharedMemoryHandle handle, base::SyncSocket::Handle socket_handle, | 289 base::SharedMemoryHandle handle, base::SyncSocket::Handle socket_handle, |
292 uint32 length) { | 290 uint32 length) { |
293 #if defined(OS_WIN) | 291 #if defined(OS_WIN) |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 } | 824 } |
827 | 825 |
828 void PepperPluginDelegateImpl::DidStopLoading() { | 826 void PepperPluginDelegateImpl::DidStopLoading() { |
829 render_view_->DidStopLoadingForPlugin(); | 827 render_view_->DidStopLoadingForPlugin(); |
830 } | 828 } |
831 | 829 |
832 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { | 830 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { |
833 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( | 831 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( |
834 render_view_->routing_id(), restrictions)); | 832 render_view_->routing_id(), restrictions)); |
835 } | 833 } |
OLD | NEW |