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_capabilities_private.idl,
6 // modified Tue Aug 19 14:43:34 2014.
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_camera_capabilities_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_capabilities_api.h"
20 PP_Resource
Create(PP_Instance instance
) {
21 VLOG(4) << "PPB_CameraCapabilities_Private::Create()";
22 EnterResourceCreation
enter(instance
);
25 return enter
.functions()->CreateCameraCapabilitiesPrivate(instance
);
28 PP_Bool
IsCameraCapabilities(PP_Resource resource
) {
29 VLOG(4) << "PPB_CameraCapabilities_Private::IsCameraCapabilities()";
30 EnterResource
<PPB_CameraCapabilities_API
> enter(resource
, false);
31 return PP_FromBool(enter
.succeeded());
34 void GetSupportedPreviewSizes(PP_Resource capabilities
,
36 struct PP_Size
** preview_sizes
) {
37 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedPreviewSizes()";
38 EnterResource
<PPB_CameraCapabilities_API
> enter(capabilities
, true);
41 enter
.object()->GetSupportedPreviewSizes(array_size
, preview_sizes
);
44 void GetSupportedJpegSizes(PP_Resource capabilities
,
46 struct PP_Size
** jpeg_sizes
) {
47 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedJpegSizes()";
48 EnterResource
<PPB_CameraCapabilities_API
> enter(capabilities
, true);
51 enter
.object()->GetSupportedJpegSizes(array_size
, jpeg_sizes
);
54 const PPB_CameraCapabilities_Private_0_1
55 g_ppb_cameracapabilities_private_thunk_0_1
= {
57 &IsCameraCapabilities
,
58 &GetSupportedPreviewSizes
,
59 &GetSupportedJpegSizes
64 PPAPI_THUNK_EXPORT
const PPB_CameraCapabilities_Private_0_1
*
65 GetPPB_CameraCapabilities_Private_0_1_Thunk() {
66 return &g_ppb_cameracapabilities_private_thunk_0_1
;