com.webos.pipeline.camera

Note
This API has been supported since API level 32.

API Summary

Provide an interface to preview camera data.

Overview of the API

N/A

Methods

setWindow

ACG: None
  • Added: API level 32

Description

Sets the window's position and size, display ID, and overlay/mirror options.

Parameters

Name

Required

Type

Description

xOptionalNumber

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.

yOptionalNumber

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.

wOptionalNumber

The width of the window in pixels.

The value can range from 0 to 1920. The default value is 1920.

hOptionalNumber

The height of the window in pixels.

The value can range from 0 to 1080. The default value is 1080.

displayIdOptionalNumber

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:

  • 0 (Default): Primary display (HDMI0)
  • 1: Secondary display (HDMI1)
overlayOptionalBoolean

Indicates if the window should be an overlay on top of other content.

Possible values are:

  • true: Overlay. The window will appear above other windows.
  • false (Default): No overlay
mirrorOptionalBoolean

Indicates if the content should be mirrored horizontally.

Possible values are:

  • true: Mirror content. The content will be flipped from left to right.
  • false (Default): Do not mirror content.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates method execution status.

Possible values are:

  • true: Successful.
  • false: Not successful. For details, see the 'Error Codes' table.

Error Codes Reference

Error Code

Error Text

Error Description

1, 6-

For details, see the 'API Error Codes Reference' table.

Examples

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
}

start

ACG: None
  • Added: API level 32

Description

Starts the preview.

Parameters

Name

Required

Type

Description

appIdRequiredString

Indicates the application ID

windowIdRequiredString

Window ID.

videoDisplayModeRequiredString

Indicates the display mode of the pipeline.

widthRequiredNumber

The width of the video

heightRequiredNumber

The height of the video

formatRequiredString

Indicates the video format.

frameRateRequiredNumber

Indicates the video frame rate.

memTypeRequiredString

Indicates the memory type.

memSrcRequiredString

Indicates the memory source.

primaryRequiredBoolean

Indicates the priority.

cameraIdRequiredString

Camera ID.

Call Returns

Name

Required

Type

Description

pidRequiredNumber

Process ID

returnValueRequiredBoolean

Indicates method execution status.

Possible values are:

  • true: Successful.
  • false: Not successful. For details, see the 'Error Codes' table.

Error Codes Reference

Error Code

Error Text

Error Description

1, 2-

For details, see the 'API Error Codes Reference' table.

Examples

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
}

stop

ACG: None
  • Added: API level 32

Description

Stops the preview.

Parameters

None

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates method execution status.

Possible values are:

  • true: Successful.
  • false: Not successful. For details, see the 'Error Codes' table.

Error Codes Reference

Error Code

Error Text

Error Description

3, 4, 5-

For details, see the 'API Error Codes Reference' table.

Examples

Example : Stop

# luna-send -n 1 -f luna://com.webos.pipeline.camera._ZuqSwL30000AlU/stop '{}'

Response:

{
  "returnValue": true
}

subscribePipeLineInfo

ACG: None
  • Added: API level 32

Description

Gets notification when there is an error event from pipeline.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Subscribe to receive updates from this method.

Possible values are:

  • true (Default): Subscribed.
  • false: Not subscribed.

Call Returns

Name

Required

Type

Description

subscribedRequiredBoolean

Indicates subscription status (see the 'subscribe' parameter).

returnValueRequiredBoolean

Indicates method execution status.

Possible values are:

  • true: Successful.
  • false: Not successful. For details, see the 'Error Codes' table.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates method execution status.

Possible values are:

  • true: Successful.
  • false: Not successful. For details, see the 'Error Codes' table.
inputPosRequiredObject: inputPos

Indicates the position of user input on the screen.

Error Codes Reference

Error Code

Error Text

Error Description

7-

For details, see the 'API Error Codes Reference' table.

Examples

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
    }
}

Objects

inputPos

  • Added: API level 32

Description

Input position details.

Properties

Name

Required

Type

Description

handleRequiredNumber

Handle for the device, obtained using the open() API. 

xRequiredNumber

Horizontal position of the input.

yRequiredNumber

Vertical position of the input.

API Error Codes Reference

Error Code

Error Text

Error Description

1Player not created

Could not create a player instance.

2Failed to load player

The player could not be loaded successfully.

3Already unloaded

The player has already been unloaded.

4Fails to unload the player

An error while trying to unload the player.

5Resource release failed

The attempt to release resources associated with the player was unsuccessful.

6Window not created

Window not created

7Subscription failed

This error indicates that the subscription could not be established.

Contents