OLD | NEW |
1 /* Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 #ifndef PPAPI_CPP_PRIVATE_CAMERA_DEVICE_PRIVATE_H_ | 6 #ifndef PPAPI_CPP_PRIVATE_CAMERA_DEVICE_PRIVATE_H_ |
7 #define PPAPI_CPP_PRIVATE_CAMERA_DEVICE_PRIVATE_H_ | 7 #define PPAPI_CPP_PRIVATE_CAMERA_DEVICE_PRIVATE_H_ |
8 | 8 |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 /// @param[in] resource A <code>PPB_CameraDevice_Private</code> resource. | 59 /// @param[in] resource A <code>PPB_CameraDevice_Private</code> resource. |
60 CameraDevice_Private(PassRef, PP_Resource resource); | 60 CameraDevice_Private(PassRef, PP_Resource resource); |
61 | 61 |
62 // Destructor. | 62 // Destructor. |
63 ~CameraDevice_Private(); | 63 ~CameraDevice_Private(); |
64 | 64 |
65 /// Opens a camera device. | 65 /// Opens a camera device. |
66 /// | 66 /// |
67 /// @param[in] device_id A <code>Var</code> identifying a camera | 67 /// @param[in] device_id A <code>Var</code> identifying a camera |
68 /// device. The type is string. The ID can be obtained from | 68 /// device. The type is string. The ID can be obtained from |
69 /// MediaStreamTrack.getSources() or MediaStreamVideoTrack.id. | 69 /// navigator.mediaDevices.enumerateDevices() or MediaStreamVideoTrack.id. |
70 /// @param[in] callback A <code>CompletionCallback</code> to be called upon | 70 /// @param[in] callback A <code>CompletionCallback</code> to be called upon |
71 /// completion of <code>Open()</code>. | 71 /// completion of <code>Open()</code>. |
72 /// | 72 /// |
73 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. | 73 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
74 int32_t Open(const Var& device_id, const CompletionCallback& callback); | 74 int32_t Open(const Var& device_id, const CompletionCallback& callback); |
75 | 75 |
76 /// Disconnects from the camera and cancels all pending requests. | 76 /// Disconnects from the camera and cancels all pending requests. |
77 /// After this returns, no callbacks will be called. If <code> | 77 /// After this returns, no callbacks will be called. If <code> |
78 /// CameraDevice_Private</code> is destroyed and is not closed yet, this | 78 /// CameraDevice_Private</code> is destroyed and is not closed yet, this |
79 /// function will be automatically called. Calling this more than once has no | 79 /// function will be automatically called. Calling this more than once has no |
(...skipping 16 matching lines...) Expand all Loading... |
96 /// @param[in] resource The <code>Resource</code> to test. | 96 /// @param[in] resource The <code>Resource</code> to test. |
97 /// | 97 /// |
98 /// @return true if the given resource is a camera device resource or false | 98 /// @return true if the given resource is a camera device resource or false |
99 /// otherwise. | 99 /// otherwise. |
100 static bool IsCameraDevice(const Resource& resource); | 100 static bool IsCameraDevice(const Resource& resource); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace pp | 103 } // namespace pp |
104 | 104 |
105 #endif /* PPAPI_CPP_PRIVATE_CAMERA_DEVICE_PRIVATE_H_ */ | 105 #endif /* PPAPI_CPP_PRIVATE_CAMERA_DEVICE_PRIVATE_H_ */ |
OLD | NEW |