1 // Copyright 2014 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 private/ppb_camera_device_private.idl modified Wed Feb 18 16:44:52 2015.
7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_camera_device_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_camera_device_api.h"
20 PP_Resource
Create(PP_Instance instance
) {
21 VLOG(4) << "PPB_CameraDevice_Private::Create()";
22 EnterResourceCreation
enter(instance
);
25 return enter
.functions()->CreateCameraDevicePrivate(instance
);
28 PP_Bool
IsCameraDevice(PP_Resource resource
) {
29 VLOG(4) << "PPB_CameraDevice_Private::IsCameraDevice()";
30 EnterResource
<PPB_CameraDevice_API
> enter(resource
, false);
31 return PP_FromBool(enter
.succeeded());
34 int32_t Open(PP_Resource camera_device
,
35 struct PP_Var device_id
,
36 struct PP_CompletionCallback callback
) {
37 VLOG(4) << "PPB_CameraDevice_Private::Open()";
38 EnterResource
<PPB_CameraDevice_API
> enter(camera_device
, callback
, true);
40 return enter
.retval();
41 return enter
.SetResult(enter
.object()->Open(device_id
, enter
.callback()));
44 void Close(PP_Resource camera_device
) {
45 VLOG(4) << "PPB_CameraDevice_Private::Close()";
46 EnterResource
<PPB_CameraDevice_API
> enter(camera_device
, true);
49 enter
.object()->Close();
52 int32_t GetCameraCapabilities(PP_Resource camera_device
,
53 PP_Resource
* capabilities
,
54 struct PP_CompletionCallback callback
) {
55 VLOG(4) << "PPB_CameraDevice_Private::GetCameraCapabilities()";
56 EnterResource
<PPB_CameraDevice_API
> enter(camera_device
, callback
, true);
58 return enter
.retval();
59 return enter
.SetResult(
60 enter
.object()->GetCameraCapabilities(capabilities
, enter
.callback()));
63 const PPB_CameraDevice_Private_0_1 g_ppb_cameradevice_private_thunk_0_1
=
64 {&Create
, &IsCameraDevice
, &Open
, &Close
, &GetCameraCapabilities
};
68 PPAPI_THUNK_EXPORT
const PPB_CameraDevice_Private_0_1
*
69 GetPPB_CameraDevice_Private_0_1_Thunk() {
70 return &g_ppb_cameradevice_private_thunk_0_1
;