Note
This API has been supported since API level 32.
This API has been supported since API level 32.
Provide an interface to preview camera data.
N/A
API level 32Sets the window's position and size, display ID, and overlay/mirror options.
Name | Required | Type | Description |
|---|---|---|---|
| x | Optional | Number | The horizontal position of the window on the screen. It is measured in pixels from the left edge. The value can range from 0 to 1920. The default value is 0. |
| y | Optional | Number | The vertical position of the window on the screen. It is measured in pixels from the top edge. The value can range from 0 to 1080. The default value is 0. |
| w | Optional | Number | The width of the window in pixels. The value can range from 0 to 1920. The default value is 1920. |
| h | Optional | Number | The height of the window in pixels. The value can range from 0 to 1080. The default value is 1080. |
| displayId | Optional | Number | The identifier for the display where the window will appear. This helps to specify which screen to use. https://www.webosose.org/docs/guides/setup/setting-up-dual-displays/ Possible values are:
|
| overlay | Optional | Boolean | Indicates if the window should be an overlay on top of other content. Possible values are:
|
| mirror | Optional | Boolean | Indicates if the content should be mirrored horizontally. Possible values are:
|
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates method execution status. Possible values are:
|
Error Code | Error Text | Error Description |
|---|---|---|
| 1, 6 | - | For details, see the 'API Error Codes Reference' table. |
Example :
# luna-send -n 1 -f luna://com.webos.pipeline.camera._ZuqSwL30000AlU/setWindow '{
"x": 0,
"y": 0,
"w": 960,
"h": 540,
"displayId": 0,
"overlay": false,
"mirror": false
}'
Response:
{
"returnValue": true
}
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
}
API level 32Gets notification when there is an error event from pipeline.
Name | Required | Type | Description |
|---|---|---|---|
| subscribe | Optional | Boolean | Subscribe to receive updates from this method. Possible values are:
|
Name | Required | Type | Description |
|---|---|---|---|
| subscribed | Required | Boolean | Indicates subscription status (see the 'subscribe' parameter). |
| returnValue | Required | Boolean | Indicates method execution status. Possible values are:
|
Name | Required | Type | Description |
|---|---|---|---|
| returnValue | Required | Boolean | Indicates method execution status. Possible values are:
|
| inputPos | Required | Object: inputPos | Indicates the position of user input on the screen. |
Error Code | Error Text | Error Description |
|---|---|---|
| 7 | - | For details, see the 'API Error Codes Reference' table. |
Example
# luna-send -n 1 -f luna://com.webos.pipeline.camera._ZuqSwL30000AlU/subscribePipeLineInfo '{"subscribe":true}'
Response:
{
"subscribed": true,
"returnValue": true
}
Subscription Response: If there is a user input in window
{
"returnValue":true,
"inputPos": {
"handle": 3245,
"y": 550,
"x": 1068
}
}
API level 32Input position details.
Name | Required | Type | Description |
|---|---|---|---|
| handle | Required | Number | Handle for the device, obtained using the open() API. |
| x | Required | Number | Horizontal position of the input. |
| y | Required | Number | Vertical position of the input. |
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. |
| 6 | Window not created | Window not created |
| 7 | Subscription failed | This error indicates that the subscription could not be established. |
Contents