Note
This API has been available since API level 32.
This API has been available since API level 32.
Provide an interface to preview camera data.
N/A
API level 32Starts the preview.
Name | Required | Type | Description |
|---|---|---|---|
| appId | Required | String | Indicates the application ID |
| windowId | Required | String | Window ID. |
| videoDisplayMode | Required | String | Indicates the display mode of the pipeline. |
| width | Required | Number | The width of the video |
| height | Required | Number | The height of the video |
| format | Required | String | Indicates the video format. |
| frameRate | Required | Number | Indicates the video frame rate. |
| memType | Required | String | Indicates the memory type. |
| memSrc | Required | String | Indicates the memory source. |
| primary | Required | Boolean | Indicates the priority. |
| cameraId | Required | String | Camera ID. |
Name | Required | Type | Description |
|---|---|---|---|
| pid | Required | Number | Process ID |
| returnValue | Required | Boolean | Indicates method execution status. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 1, 2 | - | For details, see the 'API Error Codes Reference' table. |
Example : Start
# luna-send -n 1 -f luna://com.webos.pipeline.camera._ZuqSwL30000AlU/start '{
"appId": "com.webos.app.mediaevents-test",
"windowId": "_Window_Id_1",
"videoDisplayMode": "Textured",
"width": 1280,
"height": 720,
"format": "JPEG",
"frameRate": 30,
"memType": "shmem",
"memSrc": "7010",
"primary": true,
"cameraId": "camera1"
}'
(_ZuqSwL30000AlU : A random ID to identify the pipeline)
Response:
{
"returnValue": true,
"pid": 2322
}
API level 32Stops the preview.
None
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates method execution status. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 3, 4, 5 | - | For details, see the 'API Error Codes Reference' table. |
Example : Stop
# luna-send -n 1 -f luna://com.webos.pipeline.camera._ZuqSwL30000AlU/stop '{}'
Response:
{
"returnValue": true
}
Error Code | Error Text | Error Description |
|---|---|---|
| 1 | Player not created | Could not create a player instance. |
| 2 | Failed to load player | The player could not be loaded successfully. |
| 3 | Already unloaded | The player has already been unloaded. |
| 4 | Fails to unload the player | An error while trying to unload the player. |
| 5 | Resource release failed | The attempt to release resources associated with the player was unsuccessful. |
Contents