Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1428)

Side by Side Diff: ppapi/thunk/ppb_camera_capabilities_private_thunk.cc

Issue 391323002: Pepper: add Image Capture interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 // From private/ppb_camera_capabilities_private.idl,
6 // modified Wed Aug 6 14:21:54 2014.
7
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"
14
15 namespace ppapi {
16 namespace thunk {
17
18 namespace {
19
20 PP_Bool IsCameraCapabilities(PP_Resource resource) {
21 VLOG(4) << "PPB_CameraCapabilities_Private::IsCameraCapabilities()";
22 EnterResource<PPB_CameraCapabilities_API> enter(resource, false);
23 return PP_FromBool(enter.succeeded());
24 }
25
26 struct PP_Size GetSupportedPreviewSizes[](PP_Resource capabilities,
27 int32_t* count) {
28 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedPreviewSizes()";
29 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
30 if (enter.failed())
31 return NULL;
32 return enter.object()->GetSupportedPreviewSizes(count);
33 }
34
35 struct PP_Size GetSupportedJPEGSizes[](PP_Resource capabilities,
36 int32_t* count) {
37 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedJPEGSizes()";
38 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
39 if (enter.failed())
40 return NULL;
41 return enter.object()->GetSupportedJPEGSizes(count);
42 }
43
44 const PPB_CameraCapabilities_Private_0_1
45 g_ppb_cameracapabilities_private_thunk_0_1 = {
46 &IsCameraCapabilities,
47 &GetSupportedPreviewSizes,
48 &GetSupportedJPEGSizes
49 };
50
51 } // namespace
52
53 PPAPI_THUNK_EXPORT const PPB_CameraCapabilities_Private_0_1*
54 GetPPB_CameraCapabilities_Private_0_1_Thunk() {
55 return &g_ppb_cameracapabilities_private_thunk_0_1;
56 }
57
58 } // namespace thunk
59 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698