#include <ppb_camera_device_private.h>
To query camera capabilities:
- Get a PPB_CameraDevice_Private object by Create().
- Open() camera device with track id of MediaStream video track.
- Call GetCameraCapabilities() to get a
PPB_CameraCapabilities_Private
object, which can be used to query camera capabilities.
void(* PPB_CameraDevice_Private_0_1::Close)(PP_Resource camera_device) |
Disconnects from the camera and cancels all pending requests. After this returns, no callbacks will be called. If PPB_CameraDevice_Private
is destroyed and is not closed yet, this function will be automatically called. Calling this more than once has no effect.
- Parameters
-
[in] | camera_device | A PP_Resource corresponding to a camera device resource. |
Creates a PPB_CameraDevice_Private resource.
- Parameters
-
[in] | instance | A PP_Instance identifying one instance of a module. |
- Returns
- A
PP_Resource
corresponding to a PPB_CameraDevice_Private resource if successful, 0 if failed.
Gets the camera capabilities.
The camera capabilities do not change for a given camera source.
- Parameters
-
[in] | camera_device | A PP_Resource corresponding to a camera device resource. |
[out] | capabilities | A PPB_CameraCapabilities_Private for storing the camera capabilities on success. Otherwise, the value will not be changed. |
[in] | callback | PP_CompletionCallback to be called upon completion of GetCameraCapabilities() . |
- Returns
- An int32_t containing a result code from
pp_errors.h
.
Determines if a resource is a camera device resource.
- Parameters
-
[in] | resource | The PP_Resource to test. |
- Returns
- A
PP_Bool
with PP_TRUE
if the given resource is a camera device resource or PP_FALSE
otherwise.
Opens a camera device.
- Parameters
-
[in] | camera_device | A PP_Resource corresponding to a camera device resource. |
[in] | device_id | A PP_Var identifying a camera device. The type is string. The ID can be obtained from navigator.mediaDevices.enumerateDevices() or MediaStreamVideoTrack.id. |
[in] | callback | A PP_CompletionCallback to be called upon completion of Open() . |
- Returns
- An error code from
pp_errors.h
.
The documentation for this struct was generated from the following file: