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 #ifndef WEBKIT_PLUGINS_PPAPI_DEVICE_CONTEXT_AUDIO_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_DEVICE_CONTEXT_AUDIO_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_DEVICE_CONTEXT_AUDIO_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_DEVICE_CONTEXT_AUDIO_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
11 #include "base/sync_socket.h" | 11 #include "base/sync_socket.h" |
12 #include "ppapi/c/dev/ppb_audio_dev.h" | |
13 #include "ppapi/c/dev/ppb_audio_config_dev.h" | |
14 #include "ppapi/c/dev/ppb_audio_trusted_dev.h" | |
15 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
| 13 #include "ppapi/c/ppb_audio.h" |
| 14 #include "ppapi/c/ppb_audio_config.h" |
| 15 #include "ppapi/c/trusted/ppb_audio_trusted.h" |
16 #include "ppapi/shared_impl/audio_impl.h" | 16 #include "ppapi/shared_impl/audio_impl.h" |
17 #include "webkit/plugins/ppapi/plugin_delegate.h" | 17 #include "webkit/plugins/ppapi/plugin_delegate.h" |
18 #include "webkit/plugins/ppapi/plugin_module.h" | 18 #include "webkit/plugins/ppapi/plugin_module.h" |
19 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 19 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
20 #include "webkit/plugins/ppapi/resource.h" | 20 #include "webkit/plugins/ppapi/resource.h" |
21 | 21 |
22 namespace webkit { | 22 namespace webkit { |
23 namespace ppapi { | 23 namespace ppapi { |
24 | 24 |
25 class PluginInstance; | 25 class PluginInstance; |
26 class PluginModule; | 26 class PluginModule; |
27 | 27 |
28 class PPB_AudioConfig_Impl : public Resource { | 28 class PPB_AudioConfig_Impl : public Resource { |
29 public: | 29 public: |
30 PPB_AudioConfig_Impl(PluginModule* module, | 30 PPB_AudioConfig_Impl(PluginModule* module, |
31 PP_AudioSampleRate_Dev sample_rate, | 31 PP_AudioSampleRate sample_rate, |
32 uint32_t sample_frame_count); | 32 uint32_t sample_frame_count); |
33 size_t BufferSize(); | 33 size_t BufferSize(); |
34 static const PPB_AudioConfig_Dev* GetInterface(); | 34 static const PPB_AudioConfig* GetInterface(); |
35 | 35 |
36 PP_AudioSampleRate_Dev sample_rate() { return sample_rate_; } | 36 PP_AudioSampleRate sample_rate() { return sample_rate_; } |
37 uint32_t sample_frame_count() { return sample_frame_count_; } | 37 uint32_t sample_frame_count() { return sample_frame_count_; } |
38 | 38 |
39 private: | 39 private: |
40 // Resource override. | 40 // Resource override. |
41 virtual PPB_AudioConfig_Impl* AsPPB_AudioConfig_Impl(); | 41 virtual PPB_AudioConfig_Impl* AsPPB_AudioConfig_Impl(); |
42 | 42 |
43 PP_AudioSampleRate_Dev sample_rate_; | 43 PP_AudioSampleRate sample_rate_; |
44 uint32_t sample_frame_count_; | 44 uint32_t sample_frame_count_; |
45 }; | 45 }; |
46 | 46 |
47 // Some of the backend functionality of this class is implemented by the | 47 // Some of the backend functionality of this class is implemented by the |
48 // AudioImpl so it can be shared with the proxy. | 48 // AudioImpl so it can be shared with the proxy. |
49 class PPB_Audio_Impl : public Resource, | 49 class PPB_Audio_Impl : public Resource, |
50 public pp::shared_impl::AudioImpl, | 50 public pp::shared_impl::AudioImpl, |
51 public PluginDelegate::PlatformAudio::Client { | 51 public PluginDelegate::PlatformAudio::Client { |
52 public: | 52 public: |
53 explicit PPB_Audio_Impl(PluginModule* module, PP_Instance instance_id); | 53 explicit PPB_Audio_Impl(PluginModule* module, PP_Instance instance_id); |
54 virtual ~PPB_Audio_Impl(); | 54 virtual ~PPB_Audio_Impl(); |
55 | 55 |
56 static const PPB_Audio_Dev* GetInterface(); | 56 static const PPB_Audio* GetInterface(); |
57 static const PPB_AudioTrusted_Dev* GetTrustedInterface(); | 57 static const PPB_AudioTrusted* GetTrustedInterface(); |
58 | 58 |
59 PP_Instance pp_instance() { | 59 PP_Instance pp_instance() { |
60 return pp_instance_; | 60 return pp_instance_; |
61 } | 61 } |
62 | 62 |
63 // PPB_Audio implementation. | 63 // PPB_Audio implementation. |
64 bool Init(PluginDelegate* plugin_delegate, | 64 bool Init(PluginDelegate* plugin_delegate, |
65 PP_Resource config_id, | 65 PP_Resource config_id, |
66 PPB_Audio_Callback user_callback, void* user_data); | 66 PPB_Audio_Callback user_callback, void* user_data); |
67 PP_Resource GetCurrentConfig(); | 67 PP_Resource GetCurrentConfig(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 size_t shared_memory_size_for_create_callback_; | 107 size_t shared_memory_size_for_create_callback_; |
108 scoped_ptr<base::SyncSocket> socket_for_create_callback_; | 108 scoped_ptr<base::SyncSocket> socket_for_create_callback_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); | 110 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace ppapi | 113 } // namespace ppapi |
114 } // namespace webkit | 114 } // namespace webkit |
115 | 115 |
116 #endif // WEBKIT_PLUGINS_PPAPI_DEVICE_CONTEXT_AUDIO_H_ | 116 #endif // WEBKIT_PLUGINS_PPAPI_DEVICE_CONTEXT_AUDIO_H_ |
OLD | NEW |