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_image_capture_private.idl,
6 // modified Wed Aug 13 17:26:13 2014.
8 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/private/ppb_image_capture_private.h"
11 #include "ppapi/shared_impl/tracked_callback.h"
12 #include "ppapi/thunk/enter.h"
13 #include "ppapi/thunk/ppapi_thunk_export.h"
14 #include "ppapi/thunk/ppb_image_capture_api.h"
21 PP_Resource
Create(PP_Instance instance
,
22 struct PP_Var camera_source_id
,
23 PPB_ImageCapture_Private_ErrorCallback error_callback
,
25 VLOG(4) << "PPB_ImageCapture_Private::Create()";
26 EnterResourceCreation
enter(instance
);
29 return enter
.functions()->CreateImageCapturePrivate(instance
,
35 PP_Bool
IsImageCapture(PP_Resource resource
) {
36 VLOG(4) << "PPB_ImageCapture_Private::IsImageCapture()";
37 EnterResource
<PPB_ImageCapture_API
> enter(resource
, false);
38 return PP_FromBool(enter
.succeeded());
41 int32_t Close(PP_Resource resource
, struct PP_CompletionCallback callback
) {
42 VLOG(4) << "PPB_ImageCapture_Private::Close()";
43 EnterResource
<PPB_ImageCapture_API
> enter(resource
, callback
, true);
45 return enter
.retval();
46 return enter
.SetResult(enter
.object()->Close(enter
.callback()));
49 int32_t SetConfig(PP_Resource image_capture
,
51 struct PP_CompletionCallback callback
) {
52 VLOG(4) << "PPB_ImageCapture_Private::SetConfig()";
53 EnterResource
<PPB_ImageCapture_API
> enter(image_capture
, callback
, true);
55 return enter
.retval();
56 return enter
.SetResult(enter
.object()->SetConfig(config
, enter
.callback()));
59 int32_t GetConfig(PP_Resource image_capture
,
61 struct PP_CompletionCallback callback
) {
62 VLOG(4) << "PPB_ImageCapture_Private::GetConfig()";
63 EnterResource
<PPB_ImageCapture_API
> enter(image_capture
, callback
, true);
65 return enter
.retval();
66 return enter
.SetResult(enter
.object()->GetConfig(config
, enter
.callback()));
69 int32_t GetCameraCapabilities(PP_Resource image_capture
,
70 PP_Resource
* capabilities
,
71 struct PP_CompletionCallback callback
) {
72 VLOG(4) << "PPB_ImageCapture_Private::GetCameraCapabilities()";
73 EnterResource
<PPB_ImageCapture_API
> enter(image_capture
, callback
, true);
75 return enter
.retval();
76 return enter
.SetResult(enter
.object()->GetCameraCapabilities(
81 int32_t CaptureStillImage(
82 PP_Resource image_capture
,
83 PPB_ImageCapture_Private_ShutterCallback shutter_callback
,
84 PPB_ImageCapture_Private_PreviewCallback preview_callback
,
85 PPB_ImageCapture_Private_JpegCallback jpeg_callback
,
86 int64_t* sequence_id
) {
87 VLOG(4) << "PPB_ImageCapture_Private::CaptureStillImage()";
88 EnterResource
<PPB_ImageCapture_API
> enter(image_capture
, true);
90 return enter
.retval();
91 return enter
.object()->CaptureStillImage(shutter_callback
,
97 const PPB_ImageCapture_Private_0_1 g_ppb_imagecapture_private_thunk_0_1
= {
103 &GetCameraCapabilities
,
109 PPAPI_THUNK_EXPORT
const PPB_ImageCapture_Private_0_1
*
110 GetPPB_ImageCapture_Private_0_1_Thunk() {
111 return &g_ppb_imagecapture_private_thunk_0_1
;