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

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: address comments 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 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 Tue Aug 12 14:54:03 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 void GetSupportedPreviewSizes(PP_Resource capabilities,
27 struct PP_Size* preview_sizes[]) {
28 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedPreviewSizes()";
29 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
30 if (enter.failed())
31 return;
32 enter.object()->GetSupportedPreviewSizes(preview_sizes);
33 }
34
35 void GetSupportedJpegSizes(PP_Resource capabilities,
36 struct PP_Size* jpeg_sizes[]) {
37 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedJpegSizes()";
38 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
39 if (enter.failed())
40 return;
41 enter.object()->GetSupportedJpegSizes(jpeg_sizes);
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