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
3 // found in the LICENSE file.
5 // From ppb_audio.idl modified Thu Dec 20 13:10:26 2012.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_audio.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_audio_api.h"
12 #include "ppapi/thunk/ppb_instance_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
21 PP_Resource
Create(PP_Instance instance
,
23 PPB_Audio_Callback audio_callback
,
25 VLOG(4) << "PPB_Audio::Create()";
26 EnterResourceCreation
enter(instance
);
29 return enter
.functions()->CreateAudio(instance
,
35 PP_Bool
IsAudio(PP_Resource resource
) {
36 VLOG(4) << "PPB_Audio::IsAudio()";
37 EnterResource
<PPB_Audio_API
> enter(resource
, false);
38 return PP_FromBool(enter
.succeeded());
41 PP_Resource
GetCurrentConfig(PP_Resource audio
) {
42 VLOG(4) << "PPB_Audio::GetCurrentConfig()";
43 EnterResource
<PPB_Audio_API
> enter(audio
, true);
46 return enter
.object()->GetCurrentConfig();
49 PP_Bool
StartPlayback(PP_Resource audio
) {
50 VLOG(4) << "PPB_Audio::StartPlayback()";
51 EnterResource
<PPB_Audio_API
> enter(audio
, true);
54 return enter
.object()->StartPlayback();
57 PP_Bool
StopPlayback(PP_Resource audio
) {
58 VLOG(4) << "PPB_Audio::StopPlayback()";
59 EnterResource
<PPB_Audio_API
> enter(audio
, true);
62 return enter
.object()->StopPlayback();
65 const PPB_Audio_1_0 g_ppb_audio_thunk_1_0
= {
75 const PPB_Audio_1_0
* GetPPB_Audio_1_0_Thunk() {
76 return &g_ppb_audio_thunk_1_0
;