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 // From ppb_audio.idl modified Thu Dec 20 13:10:26 2012. | |
6 | |
7 #include "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/ppb_audio.h" | 6 #include "ppapi/c/ppb_audio.h" |
9 #include "ppapi/shared_impl/tracked_callback.h" | 7 #include "ppapi/shared_impl/tracked_callback.h" |
10 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
11 #include "ppapi/thunk/ppb_audio_api.h" | 9 #include "ppapi/thunk/ppb_audio_api.h" |
12 #include "ppapi/thunk/ppb_instance_api.h" | 10 #include "ppapi/thunk/ppb_instance_api.h" |
13 #include "ppapi/thunk/resource_creation_api.h" | 11 #include "ppapi/thunk/resource_creation_api.h" |
14 #include "ppapi/thunk/thunk.h" | 12 #include "ppapi/thunk/thunk.h" |
15 | 13 |
16 namespace ppapi { | 14 namespace ppapi { |
17 namespace thunk { | 15 namespace thunk { |
18 | 16 |
19 namespace { | 17 namespace { |
20 | 18 |
| 19 PP_Resource Create_1_0(PP_Instance instance, |
| 20 PP_Resource config, |
| 21 PPB_Audio_Callback_1_0 audio_callback, |
| 22 void* user_data) { |
| 23 VLOG(4) << "PPB_Audio::Create()"; |
| 24 EnterResourceCreation enter(instance); |
| 25 if (enter.failed()) |
| 26 return 0; |
| 27 return enter.functions()->CreateAudio1_0(instance, |
| 28 config, |
| 29 audio_callback, |
| 30 user_data); |
| 31 } |
| 32 |
21 PP_Resource Create(PP_Instance instance, | 33 PP_Resource Create(PP_Instance instance, |
22 PP_Resource config, | 34 PP_Resource config, |
23 PPB_Audio_Callback audio_callback, | 35 PPB_Audio_Callback audio_callback, |
24 void* user_data) { | 36 void* user_data) { |
25 VLOG(4) << "PPB_Audio::Create()"; | 37 VLOG(4) << "PPB_Audio::Create()"; |
26 EnterResourceCreation enter(instance); | 38 EnterResourceCreation enter(instance); |
27 if (enter.failed()) | 39 if (enter.failed()) |
28 return 0; | 40 return 0; |
29 return enter.functions()->CreateAudio(instance, | 41 return enter.functions()->CreateAudio(instance, |
30 config, | 42 config, |
(...skipping 25 matching lines...) Expand all Loading... |
56 | 68 |
57 PP_Bool StopPlayback(PP_Resource audio) { | 69 PP_Bool StopPlayback(PP_Resource audio) { |
58 VLOG(4) << "PPB_Audio::StopPlayback()"; | 70 VLOG(4) << "PPB_Audio::StopPlayback()"; |
59 EnterResource<PPB_Audio_API> enter(audio, true); | 71 EnterResource<PPB_Audio_API> enter(audio, true); |
60 if (enter.failed()) | 72 if (enter.failed()) |
61 return PP_FALSE; | 73 return PP_FALSE; |
62 return enter.object()->StopPlayback(); | 74 return enter.object()->StopPlayback(); |
63 } | 75 } |
64 | 76 |
65 const PPB_Audio_1_0 g_ppb_audio_thunk_1_0 = { | 77 const PPB_Audio_1_0 g_ppb_audio_thunk_1_0 = { |
| 78 &Create_1_0, |
| 79 &IsAudio, |
| 80 &GetCurrentConfig, |
| 81 &StartPlayback, |
| 82 &StopPlayback |
| 83 }; |
| 84 |
| 85 const PPB_Audio_1_1 g_ppb_audio_thunk_1_1 = { |
66 &Create, | 86 &Create, |
67 &IsAudio, | 87 &IsAudio, |
68 &GetCurrentConfig, | 88 &GetCurrentConfig, |
69 &StartPlayback, | 89 &StartPlayback, |
70 &StopPlayback | 90 &StopPlayback |
71 }; | 91 }; |
72 | 92 |
73 } // namespace | 93 } // namespace |
74 | 94 |
75 const PPB_Audio_1_0* GetPPB_Audio_1_0_Thunk() { | 95 const PPB_Audio_1_0* GetPPB_Audio_1_0_Thunk() { |
76 return &g_ppb_audio_thunk_1_0; | 96 return &g_ppb_audio_thunk_1_0; |
77 } | 97 } |
78 | 98 |
| 99 const PPB_Audio_1_1* GetPPB_Audio_1_1_Thunk() { |
| 100 return &g_ppb_audio_thunk_1_1; |
| 101 } |
| 102 |
79 } // namespace thunk | 103 } // namespace thunk |
80 } // namespace ppapi | 104 } // namespace ppapi |
OLD | NEW |