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 |
| 6 #ifndef PPAPI_CPP_PRIVATE_CAMERA_CAPABILITIES_PRIVATE_H_ |
| 7 #define PPAPI_CPP_PRIVATE_CAMERA_CAPABILITIES_PRIVATE_H_ |
| 8 |
| 9 #include "ppapi/c/private/ppb_camera_capabilities_private.h" |
| 10 #include "ppapi/cpp/resource.h" |
| 11 #include "ppapi/cpp/size.h" |
| 12 |
| 13 /// @file |
| 14 /// This file defines the CameraCapabilities_Private interface for |
| 15 /// establishing an image capture configuration resource within the browser. |
| 16 namespace pp { |
| 17 |
| 18 /// The <code>CameraCapabilities_Private</code> interface contains methods for |
| 19 /// getting the image capture capabilities within the browser. |
| 20 class CameraCapabilities_Private : public Resource { |
| 21 public: |
| 22 /// Default constructor for creating an is_null() |
| 23 /// <code>CameraCapabilities_Private</code> object. |
| 24 CameraCapabilities_Private(); |
| 25 |
| 26 /// The copy constructor for <code>CameraCapabilities_Private</code>. |
| 27 /// |
| 28 /// @param[in] other A reference to a <code>CameraCapabilities_Private |
| 29 /// </code>. |
| 30 CameraCapabilities_Private(const CameraCapabilities_Private& other); |
| 31 |
| 32 /// Constructs a <code>CameraCapabilities_Private</code> from a <code> |
| 33 /// Resource</code>. |
| 34 /// |
| 35 /// @param[in] resource A <code>PPB_CameraCapabilities_Private</code> |
| 36 /// resource. |
| 37 explicit CameraCapabilities_Private(const Resource& resource); |
| 38 |
| 39 /// Constructs a <code>CameraCapabilities_Private</code> that outputs given |
| 40 /// frames to a new video track, which will be consumed by Javascript. |
| 41 explicit CameraCapabilities_Private(const InstanceHandle& instance); |
| 42 |
| 43 /// A constructor used when you have received a <code>PP_Resource</code> as a |
| 44 /// return value that has had 1 ref added for you. |
| 45 /// |
| 46 /// @param[in] resource A <code>PPB_CameraCapabilities_Private</code> |
| 47 /// resource. |
| 48 CameraCapabilities_Private(PassRef, PP_Resource resource); |
| 49 |
| 50 // Destructor. |
| 51 ~CameraCapabilities_Private(); |
| 52 |
| 53 /// GetSupportedPreviewSizes() returns the supported preview sizes for the |
| 54 /// given <code>CameraCapabilities_Private</code>. |
| 55 /// |
| 56 /// @param[in] capabilities A <code>Resource</code> corresponding to an |
| 57 /// image capture capabilities resource. |
| 58 /// @param[out] array_size The size of preview size array. |
| 59 /// @param[out] A NULL-terminated array of pointer to <code>PP_Size</code> |
| 60 /// corresponding to the supported preview sizes in pixels. The ownership of |
| 61 /// the array belongs to <code> CameraCapabilities_Private</code> and the |
| 62 /// caller should not free it. When a CameraCapabilities_Private is |
| 63 /// deleted, the array returning from this is no longer valid. |
| 64 void GetSupportedPreviewSizes(int32_t* array_size, Size** preview_sizes); |
| 65 |
| 66 /// GetSupportedJpegSize() returns the supported JPEG sizes for the given |
| 67 /// <code>CameraCapabilities_Private</code>. |
| 68 /// |
| 69 /// @param[in] capabilities A <code>Resource</code> corresponding to an |
| 70 /// image capture capabilities resource. |
| 71 /// @param[out] array_size The size of preview size array. |
| 72 /// @param[out] A NULL-terminated array of pointer to <code>PP_Size</code> |
| 73 /// corresponding to the supported JPEG image sizes in pixels. The ownership |
| 74 /// of the array belongs to <code>CameraCapabilities_Private</code> and |
| 75 /// the caller should not free it. When a CameraCapabilities_Private is |
| 76 /// deleted, the array returning from this is no longer valid. |
| 77 void GetSupportedJpegSizes(int32_t* array_size, Size** jpeg_sizes); |
| 78 |
| 79 /// IsCameraCapabilities() determines if the given resource is a |
| 80 /// <code>CameraCapabilities_Private</code>. |
| 81 /// |
| 82 /// @param[in] resource A <code>Resource</code> corresponding to an image |
| 83 /// capture capabilities resource. |
| 84 /// |
| 85 /// @return True if the given resource is an <code> |
| 86 /// CameraCapabilities_Private</code> resource, otherwise false. |
| 87 static bool IsCameraCapabilities(const Resource& resource); |
| 88 }; |
| 89 |
| 90 } // namespace pp |
| 91 |
| 92 #endif /* PPAPI_CPP_PRIVATE_CAMERA_CAPABILITIES_PRIVATE_H_ */ |
| 93 |
OLD | NEW |