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 "webkit/plugins/ppapi/ppb_audio_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_audio_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/audio/audio_output_controller.h" | 8 #include "media/audio/audio_output_controller.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/ppb_audio.h" | 10 #include "ppapi/c/ppb_audio.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 // static | 48 // static |
49 PP_Resource PPB_Audio_Impl::Create(PP_Instance instance, | 49 PP_Resource PPB_Audio_Impl::Create(PP_Instance instance, |
50 PP_Resource config, | 50 PP_Resource config, |
51 PPB_Audio_Callback audio_callback, | 51 PPB_Audio_Callback audio_callback, |
52 void* user_data) { | 52 void* user_data) { |
53 scoped_refptr<PPB_Audio_Impl> audio(new PPB_Audio_Impl(instance)); | 53 scoped_refptr<PPB_Audio_Impl> audio(new PPB_Audio_Impl(instance)); |
54 if (!audio->Init(config, audio_callback, user_data)) | 54 if (!audio->Init(config, audio_callback, user_data)) |
55 return 0; | 55 return 0; |
| 56 CHECK(media::AudioOutputController::kPauseMark == |
| 57 ::ppapi::PPB_Audio_Shared::kPauseMark); |
56 return audio->GetReference(); | 58 return audio->GetReference(); |
57 } | 59 } |
58 | 60 |
59 PPB_Audio_API* PPB_Audio_Impl::AsPPB_Audio_API() { | 61 PPB_Audio_API* PPB_Audio_Impl::AsPPB_Audio_API() { |
60 return this; | 62 return this; |
61 } | 63 } |
62 | 64 |
63 bool PPB_Audio_Impl::Init(PP_Resource config, | 65 bool PPB_Audio_Impl::Init(PP_Resource config, |
64 PPB_Audio_Callback callback, void* user_data) { | 66 PPB_Audio_Callback callback, void* user_data) { |
65 // Validate the config and keep a reference to it. | 67 // Validate the config and keep a reference to it. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void PPB_Audio_Impl::OnSetStreamInfo( | 153 void PPB_Audio_Impl::OnSetStreamInfo( |
152 base::SharedMemoryHandle shared_memory_handle, | 154 base::SharedMemoryHandle shared_memory_handle, |
153 size_t shared_memory_size, | 155 size_t shared_memory_size, |
154 base::SyncSocket::Handle socket_handle) { | 156 base::SyncSocket::Handle socket_handle) { |
155 SetStreamInfo(pp_instance(), shared_memory_handle, shared_memory_size, | 157 SetStreamInfo(pp_instance(), shared_memory_handle, shared_memory_size, |
156 socket_handle); | 158 socket_handle); |
157 } | 159 } |
158 | 160 |
159 } // namespace ppapi | 161 } // namespace ppapi |
160 } // namespace webkit | 162 } // namespace webkit |
OLD | NEW |