com.webos.pipeline.camera

Note
This API has been available since API level 32.

API Summary

Provide an interface to preview camera data.

Overview of the API

N/A

Methods

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.

Example

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.

Example

Example : Stop

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

Response:

{
  "returnValue": true
}

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.