OLD | NEW |
(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 #ifndef PPAPI_PROXY_CAMERA_CAPABILITIES_RESOURCE_H_ |
| 6 #define PPAPI_PROXY_CAMERA_CAPABILITIES_RESOURCE_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 11 #include "ppapi/shared_impl/resource.h" |
| 12 #include "ppapi/thunk/ppb_camera_capabilities_api.h" |
| 13 |
| 14 namespace ppapi { |
| 15 namespace proxy { |
| 16 |
| 17 class ImageCaptureResource; |
| 18 |
| 19 class PPAPI_PROXY_EXPORT CameraCapabilitiesResource |
| 20 : public Resource, |
| 21 public thunk::PPB_CameraCapabilities_API { |
| 22 public: |
| 23 CameraCapabilitiesResource(PP_Instance instance); |
| 24 |
| 25 virtual ~CameraCapabilitiesResource(); |
| 26 |
| 27 // Resource overrides: |
| 28 virtual thunk::PPB_CameraCapabilities_API* AsPPB_CameraCapabilities_API() |
| 29 override; |
| 30 |
| 31 // PPB_CameraCapabilities_API overrides |
| 32 virtual void GetSupportedPreviewSizes(int32_t* array_size, |
| 33 PP_Size** preview_sizes) override; |
| 34 virtual void GetSupportedJpegSizes(int32_t* array_size, |
| 35 PP_Size** jpeg_sizes) override; |
| 36 |
| 37 private: |
| 38 friend ImageCaptureResource; |
| 39 |
| 40 // Methods that must be called at most once at initialization to guarantee the |
| 41 // returned pointers in GetSupported*Sizes() are valid within the lifecycle of |
| 42 // this class. |
| 43 void SetPreviewSizes(const std::vector<PP_Size>& sizes); |
| 44 void SetJpegSizes(const std::vector<PP_Size>& sizes); |
| 45 |
| 46 int32_t num_preview_sizes_; |
| 47 scoped_ptr<PP_Size[]> preview_sizes_; |
| 48 |
| 49 int32_t num_jpeg_sizes_; |
| 50 scoped_ptr<PP_Size[]> jpeg_sizes_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(CameraCapabilitiesResource); |
| 53 }; |
| 54 |
| 55 } // namespace proxy |
| 56 } // namespace ppapi |
| 57 |
| 58 #endif // PPAPI_PROXY_CAMERA_CAPABILITIES_RESOURCE_H_ |
OLD | NEW |