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

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 review 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 (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 Thu Aug 7 17:22:52 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 int32_t* array_size,
28 struct PP_Size* preview_sizes[]) {
29 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedPreviewSizes()";
30 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
31 if (enter.failed())
32 return;
33 enter.object()->GetSupportedPreviewSizes(array_size, preview_sizes);
34 }
35
36 void GetSupportedJpegSizes(PP_Resource capabilities,
37 int32_t* array_size,
38 struct PP_Size* jpeg_sizes[]) {
39 VLOG(4) << "PPB_CameraCapabilities_Private::GetSupportedJpegSizes()";
40 EnterResource<PPB_CameraCapabilities_API> enter(capabilities, true);
41 if (enter.failed())
42 return;
43 enter.object()->GetSupportedJpegSizes(array_size, jpeg_sizes);
44 }
45
46 const PPB_CameraCapabilities_Private_0_1
47 g_ppb_cameracapabilities_private_thunk_0_1 = {
48 &IsCameraCapabilities,
49 &GetSupportedPreviewSizes,
50 &GetSupportedJpegSizes
51 };
52
53 } // namespace
54
55 PPAPI_THUNK_EXPORT const PPB_CameraCapabilities_Private_0_1*
56 GetPPB_CameraCapabilities_Private_0_1_Thunk() {
57 return &g_ppb_cameracapabilities_private_thunk_0_1;
58 }
59
60 } // namespace thunk
61 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698