Caution
This API has been retired since API level 23.
This API has been retired since API level 23.
Connects the video source to the video output device and also controls post-processing and scaling on the video device. The service exposes methods that make the HAL calls to connect source to sink and position output as needed.
Note: Application developers must not use this service directly.
This service is responsible for connecting the input pipeline to the backend video. The Media Framework is responsible for determining the life cycle of a connection and pipeline policy (which application is in foreground and has focus, resources, and so on). Media Framework uses VideoOutput APIs to achieve connection and video post-processing.
Direct use of videooutputd by application developers is strongly discouraged. Instead, the modules of media framework like UMS, LSM are supposed to use these APIs.
API level 11
API level 13
API level 23
Connects a video source to a video sink
Name | Required | Type | Description |
---|---|---|---|
source | Required | String | Video source. Possible values are:
|
sourcePort | Optional | Number (int8_t) | Video port number. Note: For VDEC, the possible values are 0 and 1. |
sink | Required | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the ID values above. Possible values are:
|
context | Optional | String | Registered pipeline ID. |
appId | Optional | String | Registered application ID. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
planeID | Required | Number (int8_t) | Numeric plane ID of the sink. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.videooutput/connect '{"source": "VDEC", "sourcePort":0, "sink":"MAIN"}'
Response:
{
"planeID": 44,
"returnValue": true
}
API level 11
API level 13
API level 23
Disconnects video from sink.
Name | Required | Type | Description |
---|---|---|---|
sink | Required | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the ID values above. Possible values are:
|
context | Optional | String | Specifies registered pipeline ID |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.videooutput/disconnect '{"sink":"MAIN"}'
Response:
{
"returnValue": true
}
API level 11
API level 13
API level 23
Helper method to query the set video limits
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
numPlanes | Required | Number (int8_t) | Total hardware planes available on the platform for rendering |
planes | Required | Object array: Planes | See "Planes" object. |
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.videooutput/display/getOutputCapabilities '{}'
Response:
{
"numPlanes": 4,
"planes": [
{
"maxDownscaleSize": {
"width": 0,
"height": 0
},
"sinkId": "MAIN",
"maxUpscaleSize": {
"width": 1920,
"height": 1080
}
},
{
"maxDownscaleSize": {
"width": 0,
"height": 0
},
"sinkId": "SUB0",
"maxUpscaleSize": {
"width": 1920,
"height": 1080
}
}
],
"returnValue": true
}
API level 11
API level 13
API level 23
Gets information of parameters for video sinks to render video frames
Name | Required | Type | Description |
---|---|---|---|
command | Required | String | Type of command. Possible values are:
|
sink | Optional | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the ID values above. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
sink | Optional | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the ID values above. Possible values are:
|
planeId | Optional | Number (int32_t) | Numeric plane ID of the sink. |
crtcId | Optional | Number (int32_t) | Numeric crtc ID of the sink. |
connId | Optional | Number (int32_t) | Numeric connector ID of the sink. |
numConnector | Optional | Number (int32_t) | Number of connected displays |
Example : Get DRM/KMS related information
# luna-send -n 1 -f luna://com.webos.service.videooutput/display/getParam '{"command":"DRMResources","sink":"MAIN"}'
Response:
{
"planeId": 44,
"sink": "MAIN",
"crtcId": 43,
"returnValue": true,
"connId": 19
}
Example : Get the number of connected displays
# luna-send -n 1 -f luna://com.webos.service.videooutput/display/getParam '{"command":"NumConnector"}'
Response:
{
"numConnector": 1,
"returnValue": true
}
API level 11
API level 13
API level 23
Sets compositing parameters for the video sinks.
This maps directly to adapter call and changes the compositing parameters for both video outputs simultaneously.
Name | Required | Type | Description |
---|---|---|---|
composeOrder | Required | Object array: ComposeOrder | See "ComposeOrder" object. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.videooutput/display/setCompositing '{
"composeOrder":[
{
"sink":"MAIN",
"opacity":255,
"zOrder":0
},
{
"sink":"SUB0",
"opacity":255,
"zOrder":1
}
]
}'
Response:
{
"returnValue": true
}
API level 11
API level 13
API level 23
Setup video output location on the screen for specified sink.
Name | Required | Type | Description |
---|---|---|---|
sink | Required | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the ID values above. Possible values are:
|
fullScreen | Required | Boolean | Indicates whether the output is fullscreen. Possible values are:
|
sourceInput | Optional | Object: VideoRect | Source input rectangle. Note: Full video frame if not set. |
displayOutput | Optional | Object: VideoRect | Display output rectangle. Note: Required if fullscreen is false. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example : Verify video position and size is correctly changed - the video should be placed in bottom right corner
# luna-send -n 1 -f luna://com.webos.service.videooutput/display/setDisplayWindow '{
"sink":"MAIN",
"fullScreen":false,
"displayOutput":{
"x":1000,
"y":500,
"width":920,
"height":580
}
}'
Response:
{
"returnValue": true
}
Example : Verify video source rect is correctly changed - the video should be zoomed in to center 2x
# luna-send -n 1 -f luna://com.webos.service.videooutput/display/setDisplayWindow '{
"sink":"MAIN",
"fullScreen":false,
"displayOutput":{
"x":1000,
"y":500,
"width":1280,
"height":720
},
"sourceInput":{
"x":80,
"y":60,
"width":640,
"height":360
}
}'
Response:
{
"returnValue": true
}
Example : Verify full-screen mode
# luna-send -n 1 -f luna://com.webos.service.videooutput/display/setDisplayWindow '{"sink":"MAIN", "fullScreen":true}'
Response:
{
"returnValue": true
}
API level 11
API level 13
API level 23
Lists all video sinks and their status.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Subscribe for notifications when value changes. Possible values are:
Note: This returns one entry for each video sink |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
subscribed | Optional | Boolean | If it is subscribed, subscribed will contain true. |
video | Optional | Object array: Video | See "Video" object. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.videooutput/getStatus '{"subscribe":true}'
Response:
{
"video": [
{
"connected": true,
"displayOutput": {
"width": 1280,
"height": 720,
"x": 0,
"y": 0
},
"connectedSource": "VDEC",
"fullScreen": false,
"frameRate": 24,
"muted": true,
"connectedSourcePort": 0,
"zOrder": 0,
"width": 1280,
"contentType": "movie",
"opacity": 255,
"height": 720,
"videoInfo": null,
"sourceInput": {
"width": 854,
"height": 480,
"x": 0,
"y": 0
},
"sink": "MAIN",
"context": "_TMnGr2TKCjdpKL",
"scanType": "progressive"
},
{
"connected": false,
"displayOutput": {
"width": 0,
"height": 0,
"x": 0,
"y": 0
},
"connectedSource": null,
"fullScreen": false,
"frameRate": 0,
"muted": true,
"connectedSourcePort": 0,
"zOrder": 1,
"width": 0,
"contentType": "unknown",
"opacity": 255,
"height": 0,
"videoInfo": null,
"sourceInput": {
"width": 0,
"height": 0,
"x": 0,
"y": 0
},
"sink": "SUB0",
"context": "",
"scanType": "unknown"
}
],
"subscribed": true,
"returnValue": true
}
API level 11
API level 13
API level 23
Registers pipeline ID to videooutputd.
Note: If this API is required to be called, make sure it is called before the connect API call.
Name | Required | Type | Description |
---|---|---|---|
context | Required | String | Pipeline ID for registration. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example scenario
Example:
# luna-send -n 1 -f luna://com.webos.service.videooutput/register '{"context":"_rf8D3OiiIsX6Wk"}'
Response:
{
"returnValue": true
}
API level 11
API level 13
API level 23
Sets video data needed for playback.
Name | Required | Type | Description |
---|---|---|---|
contentType | Optional | String | Type of media content. Possible values are:
|
context | Optional | String | Registered pipeline ID. |
frameRate | Required | Number (double) | Video frame rate. |
width | Required | Number (uint32_t) | Video frame width. |
height | Required | Number (uint32_t) | Video frame height. |
scanType | Optional | String | Type of scan. Possible values are:
|
sink | Required | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the ID values above. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.videooutput/setVideoData '{"sink":"MAIN","frameRate":24,"width":854,"height":480}'
Response:
{
"returnValue": true
}
API level 11
API level 13
API level 23
Unregisters pipeline ID from videooutputd.
Name | Required | Type | Description |
---|---|---|---|
context | Required | String | Registered pipeline ID. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | String | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number (int8_t) | The error code for the failed operation. |
errorMessage | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example scenario
Example:
# luna-send -n 1 -f luna://com.webos.service.videooutput/unregister '{"context":"_fkluA2iyTUgqNM"}'
Response:
{
"returnValue": true
}
Object to represent compositing parameters for the video sinks.
Name | Required | Type | Description |
---|---|---|---|
sink | Required | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the id values above. Possible values are:
Note: For Signage 'sink' will be calculated inside the logic and its possible values are 'MAIN' and 'SUB0'. |
opacity | Required | Number (int32_t) | Opacity value. Value can be between 0 and 255, where:
|
zOrder | Required | Number (int32_t) | Relative order between Main and Sub. Value can be between 0 and 3, where:
Note: Range: 0 (MAIN) – 1 (SUB0) for Signage. |
context | Required | String | Context ID to set composition. Note: In Signage: 'context' is the name of the context, can be any string and multple contexts can be registered (test, LG, korea), but only one will be connected at a time, in every connect method, previous connected context will be disconnected, and at the end need to unregister all the registered context. |
Object to represent video planes and available size of scaling.
Name | Required | Type | Description |
---|---|---|---|
sinkId | Required | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the ID values above. Possible values are:
|
maxDownscaleSize | Required | Object: VideoSize | See "VideoSize" object. |
maxUpscaleSize | Required | Object: VideoSize | See "VideoSize" object. |
Object to represent the status of video sinks.
Name | Required | Type | Description |
---|---|---|---|
connected | Required | Boolean | Specifies a video source is connected to a video sink |
connectedSource | Required | String | Video source connected. Note: Returns 'null' if not connected. |
connectedSourcePort | Required | Number (int8_t) | Port of the source to which sink is connected |
contentType | Optional | String | Type of media content. Possible values are:
|
context | Optional | String | Specifies registered pipeline ID |
displayOutput | Required | Object: VideoRect | Specifies display output location. |
frameRate | Required | Number (double) | Frame rate of video. |
fullscreen | Required | Boolean | Possible values are:
|
height | Required | Number (int16_t) | Frame height of video. |
muted | Required | Boolean | Possible values are:
|
opacity | Required | Number (int8_t) | Possible values are in the range of 0..255.
|
scanType | Required | String | Type of scan. Possible values are:
|
sink | Required | String | Video sink. Each value corresponds to overlay plane ID of display. For example, raspberrypi have overlay planes whose IDs are 44, 45, 46, 47. Each possible string value corresponds to the id values above. Possible values are:
|
sourceInput | Required | Object: VideoRect | Specifies source or input cropping location. |
width | Required | Number (int16_t) | Frame width of video. |
zOrder | Required | Number (int8_t) | Possible values are:
|
Object to represent the video window coordinates.
Name | Required | Type | Description |
---|---|---|---|
x | Required | Number (int32_t) | Horizontal offset from top left of the screen or origin (0,0) |
y | Required | Number (int32_t) | Vertical offset from top left of the screen |
width | Required | Number (int32_t) | Width of the video window |
height | Required | Number (int32_t) | Height of the video window |
Object to represent video size.
Name | Required | Type | Description |
---|---|---|---|
width | Required | Number (int16_t) | Width of the video window. Range: 0 - 3840. |
height | Required | Number (int16_t) | Height of the video window. Range: 0 - 2160. |
Contents