OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "content/renderer/media/audio_message_filter.h" | 39 #include "content/renderer/media/audio_message_filter.h" |
40 #include "content/renderer/media/video_capture_impl_manager.h" | 40 #include "content/renderer/media/video_capture_impl_manager.h" |
41 #include "content/renderer/p2p/p2p_transport_impl.h" | 41 #include "content/renderer/p2p/p2p_transport_impl.h" |
42 #include "content/renderer/pepper_platform_context_3d_impl.h" | 42 #include "content/renderer/pepper_platform_context_3d_impl.h" |
43 #include "content/renderer/pepper_platform_video_decoder_impl.h" | 43 #include "content/renderer/pepper_platform_video_decoder_impl.h" |
44 #include "content/renderer/render_thread_impl.h" | 44 #include "content/renderer/render_thread_impl.h" |
45 #include "content/renderer/render_view_impl.h" | 45 #include "content/renderer/render_view_impl.h" |
46 #include "content/renderer/render_widget_fullscreen_pepper.h" | 46 #include "content/renderer/render_widget_fullscreen_pepper.h" |
47 #include "content/renderer/webplugin_delegate_proxy.h" | 47 #include "content/renderer/webplugin_delegate_proxy.h" |
48 #include "ipc/ipc_channel_handle.h" | 48 #include "ipc/ipc_channel_handle.h" |
| 49 #include "media/audio/audio_manager_base.h" |
49 #include "media/video/capture/video_capture_proxy.h" | 50 #include "media/video/capture/video_capture_proxy.h" |
50 #include "ppapi/c/dev/pp_video_dev.h" | 51 #include "ppapi/c/dev/pp_video_dev.h" |
51 #include "ppapi/c/pp_errors.h" | 52 #include "ppapi/c/pp_errors.h" |
52 #include "ppapi/c/private/ppb_flash.h" | 53 #include "ppapi/c/private/ppb_flash.h" |
53 #include "ppapi/c/private/ppb_flash_net_connector.h" | 54 #include "ppapi/c/private/ppb_flash_net_connector.h" |
54 #include "ppapi/proxy/host_dispatcher.h" | 55 #include "ppapi/proxy/host_dispatcher.h" |
55 #include "ppapi/proxy/ppapi_messages.h" | 56 #include "ppapi/proxy/ppapi_messages.h" |
56 #include "ppapi/shared_impl/ppapi_preferences.h" | 57 #include "ppapi/shared_impl/ppapi_preferences.h" |
57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserComplet
ion.h" | 59 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserComplet
ion.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 void ShutDownOnIOThread(); | 375 void ShutDownOnIOThread(); |
375 | 376 |
376 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, | 377 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, |
377 base::SyncSocket::Handle socket_handle, | 378 base::SyncSocket::Handle socket_handle, |
378 uint32 length) OVERRIDE; | 379 uint32 length) OVERRIDE; |
379 | 380 |
380 virtual void OnVolume(double volume) OVERRIDE {} | 381 virtual void OnVolume(double volume) OVERRIDE {} |
381 | 382 |
382 virtual void OnStateChanged(AudioStreamState state) OVERRIDE {} | 383 virtual void OnStateChanged(AudioStreamState state) OVERRIDE {} |
383 | 384 |
384 virtual void OnDeviceReady(int index) OVERRIDE {} | 385 virtual void OnDeviceReady(const std::string&) OVERRIDE {} |
385 | 386 |
386 // The client to notify when the stream is created. THIS MUST ONLY BE | 387 // The client to notify when the stream is created. THIS MUST ONLY BE |
387 // ACCESSED ON THE MAIN THREAD. | 388 // ACCESSED ON THE MAIN THREAD. |
388 webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client_; | 389 webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client_; |
389 | 390 |
390 // MessageFilter used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE | 391 // MessageFilter used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE |
391 // I/O thread except to send messages and get the message loop. | 392 // I/O thread except to send messages and get the message loop. |
392 scoped_refptr<AudioInputMessageFilter> filter_; | 393 scoped_refptr<AudioInputMessageFilter> filter_; |
393 | 394 |
394 // Our ID on the MessageFilter. THIS MUST ONLY BE ACCESSED ON THE I/O THREAD | 395 // Our ID on the MessageFilter. THIS MUST ONLY BE ACCESSED ON THE I/O THREAD |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 // the client on the main thread, and the delegates from the I/O thread. | 445 // the client on the main thread, and the delegates from the I/O thread. |
445 client_ = NULL; | 446 client_ = NULL; |
446 ChildProcess::current()->io_message_loop()->PostTask( | 447 ChildProcess::current()->io_message_loop()->PostTask( |
447 FROM_HERE, | 448 FROM_HERE, |
448 base::Bind(&PlatformAudioInputImpl::ShutDownOnIOThread, this)); | 449 base::Bind(&PlatformAudioInputImpl::ShutDownOnIOThread, this)); |
449 } | 450 } |
450 | 451 |
451 void PlatformAudioInputImpl::InitializeOnIOThread( | 452 void PlatformAudioInputImpl::InitializeOnIOThread( |
452 const AudioParameters& params) { | 453 const AudioParameters& params) { |
453 stream_id_ = filter_->AddDelegate(this); | 454 stream_id_ = filter_->AddDelegate(this); |
454 filter_->Send(new AudioInputHostMsg_CreateStream(stream_id_, params, true)); | 455 filter_->Send(new AudioInputHostMsg_CreateStream( |
| 456 stream_id_, params, true, AudioManagerBase::kDefaultDeviceId)); |
455 } | 457 } |
456 | 458 |
457 void PlatformAudioInputImpl::StartCaptureOnIOThread() { | 459 void PlatformAudioInputImpl::StartCaptureOnIOThread() { |
458 if (stream_id_) | 460 if (stream_id_) |
459 filter_->Send(new AudioInputHostMsg_RecordStream(stream_id_)); | 461 filter_->Send(new AudioInputHostMsg_RecordStream(stream_id_)); |
460 } | 462 } |
461 | 463 |
462 void PlatformAudioInputImpl::StopCaptureOnIOThread() { | 464 void PlatformAudioInputImpl::StopCaptureOnIOThread() { |
463 if (stream_id_) | 465 if (stream_id_) |
464 filter_->Send(new AudioInputHostMsg_CloseStream(stream_id_)); | 466 filter_->Send(new AudioInputHostMsg_CloseStream(stream_id_)); |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 if (!context) | 1939 if (!context) |
1938 return NULL; | 1940 return NULL; |
1939 if (!context->makeContextCurrent() || context->isContextLost()) | 1941 if (!context->makeContextCurrent() || context->isContextLost()) |
1940 return NULL; | 1942 return NULL; |
1941 | 1943 |
1942 RendererGLContext* parent_context = context->context(); | 1944 RendererGLContext* parent_context = context->context(); |
1943 if (!parent_context) | 1945 if (!parent_context) |
1944 return NULL; | 1946 return NULL; |
1945 return parent_context; | 1947 return parent_context; |
1946 } | 1948 } |
OLD | NEW |