| OLD | NEW |
| 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/pepper/pepper_audio_input_host.h" | 5 #include "content/renderer/pepper/pepper_audio_input_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/common/pepper_file_util.h" | 9 #include "content/common/pepper_file_util.h" |
| 10 #include "content/renderer/pepper/pepper_media_device_manager.h" | 10 #include "content/renderer/pepper/pepper_media_device_manager.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance()); | 83 GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance()); |
| 84 if (!document_url.is_valid()) | 84 if (!document_url.is_valid()) |
| 85 return PP_ERROR_FAILED; | 85 return PP_ERROR_FAILED; |
| 86 | 86 |
| 87 // When it is done, we'll get called back on StreamCreated() or | 87 // When it is done, we'll get called back on StreamCreated() or |
| 88 // StreamCreationFailed(). | 88 // StreamCreationFailed(). |
| 89 audio_input_ = PepperPlatformAudioInput::Create( | 89 audio_input_ = PepperPlatformAudioInput::Create( |
| 90 renderer_ppapi_host_->GetRenderFrameForInstance(pp_instance())-> | 90 renderer_ppapi_host_->GetRenderFrameForInstance(pp_instance())-> |
| 91 GetRoutingID(), | 91 GetRoutingID(), |
| 92 device_id, | 92 device_id, |
| 93 document_url, | |
| 94 static_cast<int>(sample_rate), | 93 static_cast<int>(sample_rate), |
| 95 static_cast<int>(sample_frame_count), | 94 static_cast<int>(sample_frame_count), |
| 96 this); | 95 this); |
| 97 if (audio_input_) { | 96 if (audio_input_) { |
| 98 open_context_ = context->MakeReplyMessageContext(); | 97 open_context_ = context->MakeReplyMessageContext(); |
| 99 return PP_OK_COMPLETIONPENDING; | 98 return PP_OK_COMPLETIONPENDING; |
| 100 } else { | 99 } else { |
| 101 return PP_ERROR_FAILED; | 100 return PP_ERROR_FAILED; |
| 102 } | 101 } |
| 103 } | 102 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 SendOpenReply(PP_ERROR_ABORTED); | 189 SendOpenReply(PP_ERROR_ABORTED); |
| 191 } | 190 } |
| 192 | 191 |
| 193 void PepperAudioInputHost::SendOpenReply(int32_t result) { | 192 void PepperAudioInputHost::SendOpenReply(int32_t result) { |
| 194 open_context_.params.set_result(result); | 193 open_context_.params.set_result(result); |
| 195 host()->SendReply(open_context_, PpapiPluginMsg_AudioInput_OpenReply()); | 194 host()->SendReply(open_context_, PpapiPluginMsg_AudioInput_OpenReply()); |
| 196 open_context_ = ppapi::host::ReplyMessageContext(); | 195 open_context_ = ppapi::host::ReplyMessageContext(); |
| 197 } | 196 } |
| 198 | 197 |
| 199 } // namespace content | 198 } // namespace content |
| OLD | NEW |