OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 private/ppb_image_capture_private.idl modified Mon Feb 2 21:41:55 2015. | 5 // From private/ppb_image_capture_private.idl modified Tue Feb 3 22:24:35 2015. |
6 | 6 |
7 #include "ppapi/c/pp_completion_callback.h" | 7 #include "ppapi/c/pp_completion_callback.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/c/private/ppb_image_capture_private.h" | 9 #include "ppapi/c/private/ppb_image_capture_private.h" |
10 #include "ppapi/shared_impl/tracked_callback.h" | 10 #include "ppapi/shared_impl/tracked_callback.h" |
11 #include "ppapi/thunk/enter.h" | 11 #include "ppapi/thunk/enter.h" |
12 #include "ppapi/thunk/ppapi_thunk_export.h" | 12 #include "ppapi/thunk/ppapi_thunk_export.h" |
13 #include "ppapi/thunk/ppb_image_capture_api.h" | 13 #include "ppapi/thunk/ppb_image_capture_api.h" |
14 | 14 |
15 namespace ppapi { | 15 namespace ppapi { |
(...skipping 26 matching lines...) Expand all Loading... |
42 } | 42 } |
43 | 43 |
44 void Close(PP_Resource image_capture) { | 44 void Close(PP_Resource image_capture) { |
45 VLOG(4) << "PPB_ImageCapture_Private::Close()"; | 45 VLOG(4) << "PPB_ImageCapture_Private::Close()"; |
46 EnterResource<PPB_ImageCapture_API> enter(image_capture, true); | 46 EnterResource<PPB_ImageCapture_API> enter(image_capture, true); |
47 if (enter.failed()) | 47 if (enter.failed()) |
48 return; | 48 return; |
49 enter.object()->Close(); | 49 enter.object()->Close(); |
50 } | 50 } |
51 | 51 |
52 int32_t SetConfig(PP_Resource image_capture, | |
53 PP_Resource config, | |
54 struct PP_CompletionCallback callback) { | |
55 VLOG(4) << "PPB_ImageCapture_Private::SetConfig()"; | |
56 EnterResource<PPB_ImageCapture_API> enter(image_capture, callback, true); | |
57 if (enter.failed()) | |
58 return enter.retval(); | |
59 return enter.SetResult(enter.object()->SetConfig(config, enter.callback())); | |
60 } | |
61 | |
62 int32_t GetConfig(PP_Resource image_capture, | |
63 PP_Resource* config, | |
64 struct PP_CompletionCallback callback) { | |
65 VLOG(4) << "PPB_ImageCapture_Private::GetConfig()"; | |
66 EnterResource<PPB_ImageCapture_API> enter(image_capture, callback, true); | |
67 if (enter.failed()) | |
68 return enter.retval(); | |
69 return enter.SetResult(enter.object()->GetConfig(config, enter.callback())); | |
70 } | |
71 | |
72 int32_t GetCameraCapabilities(PP_Resource image_capture, | 52 int32_t GetCameraCapabilities(PP_Resource image_capture, |
73 PP_Resource* capabilities, | 53 PP_Resource* capabilities, |
74 struct PP_CompletionCallback callback) { | 54 struct PP_CompletionCallback callback) { |
75 VLOG(4) << "PPB_ImageCapture_Private::GetCameraCapabilities()"; | 55 VLOG(4) << "PPB_ImageCapture_Private::GetCameraCapabilities()"; |
76 EnterResource<PPB_ImageCapture_API> enter(image_capture, callback, true); | 56 EnterResource<PPB_ImageCapture_API> enter(image_capture, callback, true); |
77 if (enter.failed()) | 57 if (enter.failed()) |
78 return enter.retval(); | 58 return enter.retval(); |
79 return enter.SetResult( | 59 return enter.SetResult( |
80 enter.object()->GetCameraCapabilities(capabilities, enter.callback())); | 60 enter.object()->GetCameraCapabilities(capabilities, enter.callback())); |
81 } | 61 } |
82 | 62 |
83 int32_t CaptureStillImage( | 63 const PPB_ImageCapture_Private_0_1 g_ppb_imagecapture_private_thunk_0_1 = |
84 PP_Resource image_capture, | 64 {&Create, &IsImageCapture, &Open, &Close, &GetCameraCapabilities}; |
85 PPB_ImageCapture_Private_ShutterCallback shutter_callback, | |
86 PPB_ImageCapture_Private_PreviewCallback preview_callback, | |
87 PPB_ImageCapture_Private_JpegCallback jpeg_callback, | |
88 int64_t* sequence_id) { | |
89 VLOG(4) << "PPB_ImageCapture_Private::CaptureStillImage()"; | |
90 EnterResource<PPB_ImageCapture_API> enter(image_capture, true); | |
91 if (enter.failed()) | |
92 return enter.retval(); | |
93 return enter.object()->CaptureStillImage(shutter_callback, preview_callback, | |
94 jpeg_callback, sequence_id); | |
95 } | |
96 | |
97 const PPB_ImageCapture_Private_0_1 g_ppb_imagecapture_private_thunk_0_1 = { | |
98 &Create, | |
99 &IsImageCapture, | |
100 &Open, | |
101 &Close, | |
102 &SetConfig, | |
103 &GetConfig, | |
104 &GetCameraCapabilities, | |
105 &CaptureStillImage}; | |
106 | 65 |
107 } // namespace | 66 } // namespace |
108 | 67 |
109 PPAPI_THUNK_EXPORT const PPB_ImageCapture_Private_0_1* | 68 PPAPI_THUNK_EXPORT const PPB_ImageCapture_Private_0_1* |
110 GetPPB_ImageCapture_Private_0_1_Thunk() { | 69 GetPPB_ImageCapture_Private_0_1_Thunk() { |
111 return &g_ppb_imagecapture_private_thunk_0_1; | 70 return &g_ppb_imagecapture_private_thunk_0_1; |
112 } | 71 } |
113 | 72 |
114 } // namespace thunk | 73 } // namespace thunk |
115 } // namespace ppapi | 74 } // namespace ppapi |
OLD | NEW |