| 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 #ifndef PPAPI_SHARED_IMPL_AUDIO_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_AUDIO_IMPL_H_ |
| 6 #define PPAPI_SHARED_IMPL_AUDIO_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_AUDIO_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
| 10 #include "base/sync_socket.h" | 10 #include "base/sync_socket.h" |
| 11 #include "base/threading/simple_thread.h" | 11 #include "base/threading/simple_thread.h" |
| 12 #include "ppapi/c/ppb_audio.h" | 12 #include "ppapi/c/ppb_audio.h" |
| 13 #include "ppapi/shared_impl/resource_object_base.h" | 13 #include "ppapi/shared_impl/resource.h" |
| 14 #include "ppapi/thunk/ppb_audio_api.h" | 14 #include "ppapi/thunk/ppb_audio_api.h" |
| 15 | 15 |
| 16 namespace ppapi { | 16 namespace ppapi { |
| 17 | 17 |
| 18 // Implements the logic to map shared memory and run the audio thread signaled | 18 // Implements the logic to map shared memory and run the audio thread signaled |
| 19 // from the sync socket. Both the proxy and the renderer implementation use | 19 // from the sync socket. Both the proxy and the renderer implementation use |
| 20 // this code. | 20 // this code. |
| 21 class AudioImpl : public thunk::PPB_Audio_API, | 21 class AudioImpl : public thunk::PPB_Audio_API, |
| 22 public base::DelegateSimpleThread::Delegate { | 22 public base::DelegateSimpleThread::Delegate { |
| 23 public: | 23 public: |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Callback to call when audio is ready to accept new samples. | 77 // Callback to call when audio is ready to accept new samples. |
| 78 PPB_Audio_Callback callback_; | 78 PPB_Audio_Callback callback_; |
| 79 | 79 |
| 80 // User data pointer passed verbatim to the callback function. | 80 // User data pointer passed verbatim to the callback function. |
| 81 void* user_data_; | 81 void* user_data_; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace ppapi | 84 } // namespace ppapi |
| 85 | 85 |
| 86 #endif // PPAPI_SHARED_IMPL_AUDIO_IMPL_H_ | 86 #endif // PPAPI_SHARED_IMPL_AUDIO_IMPL_H_ |
| OLD | NEW |