Note
This API has been available since API level 11.
This API has been available since API level 11.
Provides access to the functionality provided by the webOS media server. The webOS media server supports both managed and unmanaged pipelines. For managed pipelines, com.webos.media provides high-level methods to control the playback of media content (e.g. load, play, seek). For unmanaged pipelines, com.webos.media provides low-level methods for resource management and display control.
Direct use of com.webos.media by application developers is strongly discouraged. Instead, the media interfaces native to a particular application framework (e.g. Web, QT, SDL/NDL) should be used.
See Summary.
API level 11
Requests resources from the mediaserver. Typical usage is to request the number of audio and video decoders or other hardware components used by the pipeline. Acquire calls can be used to dynamically add more resources to the pipeline. This allows the pipeline to dynamically grow or shrink without monopolizing the resources from startup. Each time a resource is acquired, the indexes of the newly acquired resources are included in the acquireComplete event.
Note:
Name | Required | Type | Description |
---|---|---|---|
resources | Required | String | Resource information. Note: Resources information must be provided as a stringified form of the "resources" object array. |
connectionId | Required | String | Indicates the unique identifier of the pipeline to acquire resources. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | String | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example code
# luna-send -n 1 -f luna://com.webos.media/acquire '{
"resources": "[{\"resource\":\"DISP0\",\"qty\":1}, {\"resource\":\"VDEC\",\"qty\":1},{\"resource\":\"ADEC\",\"qty\":1}]",
"connectionId": "_UZRkgE3EJgXvwl"
}'
Response:
{
"returnValue": true
}
API level 11
Allows to transfer the control of a pipeline to be handed over to a different client. When this occurs, the original client gets notified that it got detached from the pipeline and can no longer control the pipeline.
Note: This method was added to address a specific early boot situation where the pipeline was initially created by one client process and then another client process takes over control of the pipeline.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested to subscribe. |
Example code
# luna-send -n 1 -f luna://com.webos.media/attach '{
"mediaId":"_IsGbw614gu7xRB"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
API level 11
Gets JSON formatted output of currently active media pipelines.
Note: Typically, a luna methods returns a JSON object as response. However, in this case, an array of object will be returned.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Optional | String | Indicates unique identifier of the media object. |
Name | Required | Type | Description |
---|---|---|---|
Id | Optional | String | Indicates unique identifier of the media object. |
type | Optional | String | Indicates the type of media. |
pid | Optional | Number (int16_t) | Indicates the process id of media content provider. |
is_managed | Optional | Boolean | Indicates whether media Content Provider is a managed pipeline or not.
|
is_foreground | Optional | Boolean | Indicates whether media object is currently in the foreground or not
|
mediaState | Optional | String | Indicates the current state of Media Content Provider. Possible values are:
|
policy_state | Optional | Boolean | Media is currently selected for Resource Management Policy Action and is in suspended state |
uri | Optional | String | Indicate the uri of media object. |
appId | Optional | String | Indicates the application id of application using media object. |
processState | Optional | String | Indicates the status of the media content provider process. Possible values are:
|
is_focus | Optional | String | Indicates that the media object is currently selected for focus. Note: Focus is not the same thing as "visible". |
timestamp | Optional | String | Indicates the timestamp of the last activity on Media Content Provider pipeline. Pipeline activity is used to adjust the Resource Manager Policy Action Candidate Selection Policy. Events which update pipeline activity are:
|
resources | Required | Object array: resources | See "resources" object. |
mediaId | Optional | String | Indicates mediaId of the object. |
errorCode | Optional | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
returnValue | Optional | Boolean | Indicates the status of operation. Possible values are:
|
Example code
# luna-send -n 1 -f luna://com.webos.media/getActivePipelines '{}'
Response:
[
{
"pid":1521,
"resources":[
{
"resource":"ADEC",
"index":3
},
{
"resource":"VDEC",
"index":3
}
],
"type":"media",
"id":"_IzddeO9d8fP1jO",
"is_managed":true,
"mediaState":"play",
"is_foreground":true,
"policy_state":0,
"uri":"http://media.w3.org/2010/05/sintel/trailer.mp4",
"appId":"com.webos.app.enactbrowser",
"processState":"media_loaded",
"is_focus":false,
"timestamp":1423867226706,
"mediaId":"_IzddeO9d8fP1jO"
}
]
API level 21
Gets information about the display on which the specified application instance is launched.
Note: This method supports multi-screen playback.
Name | Required | Type | Description |
---|---|---|---|
instanceId | Required | String | Indicates the unique identifier of the application instance. |
Name | Required | Type | Description |
---|---|---|---|
displayId | Optional | Number | Indicates the identifier of the display used. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example: For application launched in primary screen
# luna-send -n 1 -f luna://com.webos.media/getDisplayId '{"instanceId": "9582089b-3a1c-4a37-acf8-83df8d1b6eec0"}'
Response:
{
"displayId": 0,
"returnValue": true
}
Example: For application launched in secondary screen
# luna-send -n 1 -f luna://com.webos.media/getDisplayId '{"instanceId": "df6d8057-611d-4080-b5ba-0de59f2a40210"}'
Response:
{
"displayId": 1,
"returnValue": true
}
API level 11
Provides the application's foreground information.
None
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
appId | Required | String | Indicates the application ID (appId). |
acbs | Required | Object array: acbs | Contains an array of objects that gives details of the media. (pipeline ID, playstate, position and so on) |
Example code
# luna-send -n 1 -f luna://com.webos.media/getForegroundAppInfo '{}'
Response:
{
"acbs":[
{
"positionY":0,
"playStateNow":"",
"width":0,
"height":0,
"isFullScreen":false,
"pipelineId":"",
"positionX":0,
"playStateNext":""
}
],
"appId":"com.webos.app.enactbrowser",
"returnValue":true
}
API level 21
Requests the media server to retrieve pipeline state information.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Required | Number | The error code for the operation. Returns 0 when the returnValue is true and returns '-1' if JSON parsing fails. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Required | String | Indicates the reason for the failure of the operation. Returns "No Error" if there is no failure. |
data | Optional | String | Pipeline state information. |
mediaId | Optional | String | Media ID of the object. |
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method "getPipelineState" for category "/" was not handled | JSON parsing fails. |
0 | No Error | when the returnValue is true |
Example scenario
# luna-send -n 2 -f luna://com.webos.media/getPipelineState '{"mediaId":"_pwvgD9ivrcVkYV"}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"data":"{\"seekPos\":0,\"loadCompleted\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"currentTime\":52249,\"seekDone\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"bufferingEnd\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"videoInfo\":{\"video\":{\"codec\":0,\"width\":854,\"frame_rate\":{\"num\":0,\"den\":1},\"bitrate\":0,\"height\":480}},\"mediaState\":\"play\",\"subscription\":true,\"endOfStream\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"bufferingStart\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"playing\":{\"mediaId\":\"_pwvgD9ivrcVkYV\"},\"bufferRange\":{\"beginTime\":52249,\"endTime\":52,\"remainingTime\":1,\"percent\":100},\"procState\":\"media_loaded\",\"sourceInfo\":{\"audio_streams\":[{\"codec\":0,\"sample_rate\":48000,\"bit_rate\":80000}],\"duration\":52250,\"programs\":[{\"video_stream\":1,\"audio_stream\":1}],\"video_streams\":[{\"video\":{\"codec\":0,\"width\":854,\"frame_rate\":{\"num\":0,\"den\":1},\"bitrate\":0,\"height\":480}}],\"container\":\"\",\"seekable\":true}}",
"mediaId":"_pwvgD9ivrcVkYV"
}
API level 11
Loads a new pipeline for the specified URI. The media server returns a unique id to the client which is used for subsequent operations on the pipeline.
Name | Required | Type | Description |
---|---|---|---|
uri | Required | String | Indicates the uri of the media object. Example: http://mymovie.mp4, file://mymovie.mp4 |
type | Required | String | Indicates the type of pipeline to load. Note:
|
payload | Optional | Object: payload | See "payload" object. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns '0' even when the returnValue is true and returns '-1' if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is used for subsequent operations. |
Example code
# luna-send -n 1 -f luna://com.webos.media/load '{
"uri":"https://media.w3.org/2010/05/sintel/trailer.mp4",
"type":"media",
"payload":{
"option":{
"appId":"com.webos.app.enactbrowser",
"windowId":"_Window_Id_2"
}
}
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_Pvzj2FRn42sL99"
}
Example: Load camera with System V shared memory
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"shmem",
"memSrc":"7010"
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
Note: For Open Emulator, while executing the luna-send command directly in console, send "windowId" as empty. The first frame of camera data directly displays on the emulator window.
Example : Load camera with Posix shared memory
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"posixshm",
"memSrc":"9",
"handle":4286
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
Note: For Open Emulator, while executing the luna-send command directly in console, send "windowId" as empty. The first frame of camera data directly displays on the emulator window.
Example : Load camera with MMAP mode
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"device",
"memSrc":"/dev/video1"
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
Note: For Open Emulator, while executing the luna-send command directly in console, send "windowId" as empty. The first frame of camera data directly displays on the emulator window.
Example : Load camera with DMABUF mode
# luna-send -n 1 luna://com.webos.media/load '{
"uri":"camera://com.webos.service.camera2/7010",
"payload":{
"option":{
"appId":"com.webos.app.mediaevents-test",
"windowId":"_Window_Id_1",
"videoDisplayMode":"Textured",
"width":640,
"height":480,
"format":"JPEG",
"frameRate":30,
"memType":"device",
"memSrc":"/dev/video1",
"iomode":2
}
},
"type":"camera"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_puV0o3WTEsbgDt"
}
API level 11
Notifies the media server that the specific pipeline is currently in use. This command raises the timestamp record of the corresponding pipeline to lessen the chance to be picked as the target for a policyAction, which would require the pipeline to release its resources.
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example code
# luna-send -n 1 -f luna://com.webos.media/notifyActivity '{"connectionId":"_EYv0VPazu3aGo0"}'
Response:
{
"returnValue": true
}
API level 11
Marks a pipeline as background. This API is called when the media object in question is carded, deleted, or otherwise removed from view.
Note: Background video content is not currently visible on the display surface.
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: The notifyBackground method may fail because of:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example code
# luna-send -n 1 -f luna://com.webos.media/notifyBackground '{"connectionId":"_c5zE4w2k7rqmC5"}'
Response:
{
"returnValue": true
}
API level 11
Marks a pipeline as foreground. This API is called when the media object in question is un-carded and made visible.
Note: Foreground pipeline video content is currently visible on the display surface.
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
Note: The notifyForeground method may fail because of:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example code
# luna-send -n 1 -f luna://com.webos.media/notifyForeground '{"connectionId":"_z6SJt11Yx0mVp1"}'
Response:
{
"returnValue":true
}
API level 21
Notifies the playback status of media pipelines.
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the media pipeline. |
pipelineStatus | Required | String | Indicates the pipeline status. Possible values are:
|
pid | Optional | Number | Indicates the Process ID of the pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method "notifyPipelineStatus" for category "/" was not handled | JSON parsing fails. |
0 | No Error | when the return value is true |
Example scenario
# luna-send -n 1 -f luna://com.webos.media/notifyPipelineStatus '{"connectionId":"_gu6P54bK8fkGgo","pipelineStatus":"pause","pid":3190}'
Response:
{
"returnValue": true
}
API level 11
Requests the media server to pause the media object.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is requested to pause. |
Example code
# luna-send -n 1 -f luna://com.webos.media/pause '{
"mediaId":"_IsGbw614gu7xRB"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
API level 11
Requests the media server to play the media object.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is requested to play. |
Example code
# luna-send -n 1 -f luna://com.webos.media/play '{"mediaId":"_IsGbw614gu7xRB"}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
API level 21
Dynamically adds more resources to the pipeline.
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | The unique identifier of the pipeline to add resources. |
resources | Required | String | Resource list to be allocated. Note: Resources information must be provided as a stringified form of one of the following objects:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested. Note: This parameter is returned only in error cases. |
Error Code | Error Text | Error Description |
---|---|---|
601 | Resource Allocation Error | This error occurs when there is failure in releasing already acquired resources. |
602 | Invalid Payload | This error occurs when invalid payload is detected. |
603 | Resources not Provided | This error occurs when argument "resources" is not provided. |
604 | ConnectionId Not Provided | This error occurs when "argument" connection id is not provided. |
605 | Invalid Connection | This error occurs when provided "connection id" is not available. |
606 | Internal Error | This error occurs when an internal error occurs. |
607 | Invalid Resource | This error occurs when provided with improper resource. |
Example : Reacquire using resources_new object
# luna-send -n 1 -f luna://com.webos.media/reacquire '{
"connectionId": "_dqEYC2bXztCwsj",
"resources":"{
\"new\":\"[{\\\"qty\\\":3,\\\"resource\\\":\\\"VDEC\\\"}]\",
\"old\":\"[{\\\"index\\\":31,\\\"resource\\\":\\\"VDEC\\\"}]\"}"
}'
Response:
{
"returnValue": true
}
Example : Reacquire using resources object (recommended approach)
# luna-send -n 1 luna://com.webos.media/reacquire '{
"resources": "[{\"resource\":\"VDEC\",\"qty\":3}]",
"connectionId": "_ABQqg8An9msDLC"
}'
Response:
{
"returnValue": true
}
API level 11
API level 21
API level 23
Media Content Provider (unmanaged) must register with Media Display Controller to allow proper management of video content and displays or audio outputs.
NOTE: In managed case, this API is internally invoked from 'load' API. Thus, using this API with load is strongly discouraged.
(Duplicated calls for same mediaId are not allowed.)
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the media object to be registered |
appId | Required | String | Application ID |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
mediaId | Optional | String | Unique identifier of the media object registered |
Example code
# luna-send -n 1 -f luna://com.webos.media/registerMedia '{"mediaId":"_IsGbw614gu7xRB", "appId":"com.webos.app.enactbrowser"}'
Response:
{
"returnValue": true
}
API level 11
Registers with the Resource Manager. Session is persistent across all start/end transaction and acquire/release cycles. Registered clients and their current resource requirements will be tracked by Resource Manager. Param type as specified in Resource Manager configuration file pipeline settings.
Note: This method is applicable for unmanaged pipelines only. For managed pipelines, this is taken care of internally by the mediaserver.
Name | Required | Type | Description |
---|---|---|---|
type | Required | String | Indicates the type of pipeline to register. Possible values are:
|
appId | Optional | String | Application ID |
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the registered pipeline. |
returnValue | Optional | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example code
# luna-send -n 1 -f luna://com.webos.media/registerPipeline '{"type":"media"}'
Response:
{
"connectionId": "_KXpMET1Sxc1eGO"
}
API level 11
Informs media server the resources are released correctly and are not being used anymore.
Note: This method is applicable for unmanaged pipelines only.
Name | Required | Type | Description |
---|---|---|---|
resources | Required | String | Resource information. Note: Resources information must be provided as a stringified form of the "resources" object array. |
connectionId | Required | String | Indicates the unique identifier of the pipeline to release resources. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method \"release\" for category \"/\" was not handled | JSON parsing fails. |
602 | Invalid Payload | This error occurs when invalid payload is detected. |
603 | Resources not Provided | This error occurs when argument "resources" is not provided. |
604 | ConnectionId Not Provided | This error occurs when "argument" connection id is not provided. |
605 | Invalid Connection | This error occurs when provided "connection id" is not available |
607 | Invalid Resource | This error occurs when provided with improper resource. |
608 | Resource Release Error | This error occurs when there is failure in releasing resources. |
Example code
# luna-send -n 1 -f luna://com.webos.media/release '{
"resources":"[{\"resource\":\"DISP0\",\"qty\":1,\"index\":3},{\"resource\":\"VDEC\",\"qty\":1,\"index\":3},{\"resource\":\"ADEC\",\"qty\":1,\"index\":3}}]",
"connectionId":"_QY7tkX1XEfBct3"
}'
Response:
{
"returnValue": true
}
API level 11
Seeks the media object to a specified time position.
Name | Required | Type | Description |
---|---|---|---|
position | Required | Number | Indicates the position (in milliseconds) from the start position to seek position. |
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested to seek. |
Example code
# luna-send -n 1 -f luna://com.webos.media/seek '{
"position":64935,
"mediaId":"_IsGbw614gu7xRB"
}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
API level 11
Sets the pipeline media play rate.
Name | Required | Type | Description |
---|---|---|---|
playRate | Required | Number (double) | Indicates the play back rate for the media. |
mediaId | Required | String | Indicates the unique identifier for the requested loaded media pipeline. |
audioOutput | Required | Boolean | Determine to mute audio |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the media object. |
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method "setPlayRate" for category "/" was not handled | JSON parsing fails.
|
0 | No Error | when the returnValue is true |
Example code
# luna-send -n 1 -f luna://com.webos.media/setPlayRate '{
"playRate":2.0,
"mediaId":"_QnGGXr7BdWsOV1",
"audioOutput":true
}'
Response:
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_QnGGXr7BdWsOV1"
}
API level 11
Sets the volume for the specified media object. Additionally, it specifies the ease (fade-in and fade-out) properties for the media object.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the media object. |
volume | Required | Number | The volume to be set. Can be set to any value between 0 and 100. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation.
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Unique identifier of the media object. |
Example code
# luna-send -n 1 -f luna://com.webos.media/setVolume '{"mediaId":"_IsGbw614gu7xRB","volume":60}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_IsGbw614gu7xRB"
}
API level 11
Starts camera recording. Camera pipeline stores streamed data from the camera and microphone (if required) at the specified location.
Name | Required | Type | Description |
---|---|---|---|
location | Required | String | Indicates the path for storing the recorded file. |
format | Required | String | Indicates the format in which data is stored. Possible values are:
|
mediaId | Required | String | Indicates the unique identifier of the camera pipeline obtained using the load() API. |
audio | Required | Boolean | Indicates whether the audio data from the microphone also has to be recorded along with video. Possible values are:
|
audioSrc | Required | String | Indicates the name of the microphone device from which the audio data has to be captured. Note: Supports only one audio source (pcm_input). |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. Note: errorCode always defaults to 0. Details of the error will be available in the logs. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: errorText is always empty. Details of the error will be available in the logs. |
mediaId | Required | String | Indicates the unique identifier of the camera pipeline. |
Example : Camera recording without audio
# luna-send -n 1 luna://com.webos.media/startCameraRecord '{
"mediaId" :"_5nxnM2Xiw55PYS" ,
"location":"/media/internal/",
"format" :"MP4",
"audio":false,
"audioSrc":"pcm_input"
}'
Example : Camera recording with audio
# luna-send -n 1 luna://com.webos.media/startCameraRecord '{
"mediaId" :"_5nxnM2Xiw55PYS" ,
"location":"/media/internal/",
"format" :"MP4",
"audio":true,
"audioSrc":"pcm_input"
}'
API level 11
Requests media server to stop camera recording and change to the preview state.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the camera pipeline obtained using the load() API. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the failed operation. Note: errorCode always defaults to 0. Details of the error will be available in the logs. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: errorText is always empty. Details of the error will be available in the logs. |
mediaId | Optional | String | Indicates the unique identifier of the camera pipeline. |
Example code
# luna-send -n 1 luna://com.webos.media/stopCameraRecord '{"mediaId":"_JtLZrGoEAoRa1d"}'
Response:
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_JtLZrGoEAoRa1d"
}
API level 11
Subscribes the media client to receive events from a media pipeline. These events, described in the tables above, allow the media client (generally an app or test tool) to monitor pipeline status (including playback position) and adjust their internal state appropriately.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the operation Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Optional | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested to subscribe. |
subscription | Optional | String | Indicates the current subscription status. Possible values are:
Note: This property is returned in a separate object from the returns object. |
Name | Required | Type | Description |
---|---|---|---|
loadCompleted | Optional | Object | See "loadCompleted" event. |
seekDone | Optional | Object | See "seekDone" event. |
endOfStream | Optional | Object | See "endOfStream" event. |
currentTime | Optional | Object | See "currentTime" event. |
bufferRange | Optional | Object | See "bufferRange" event. |
bufferingStart | Optional | Object | See "bufferingStart" event. |
bufferingEnd | Optional | Object | See "bufferingEnd" event. |
sourceInfo | Optional | Object | See "sourceInfo" event. |
videoInfo | Optional | Object | See "videoInfo" event. |
audioInfo | Optional | Object | See "audioInfo" event. |
error | Optional | Object | See "error" event. |
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method \"subscribe\" for category \"/\" was not handled | JSON parsing fails. |
Example code
# luna-send -n 2 -f luna://com.webos.media/subscribe '{"mediaId":"_rTNwzp81clPsxX"}'
Response:
{
"subscription": true
}
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_rTNwzp81clPsxX"
}
API level 11
Captures a frame from the camera preview.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the camera pipeline which is obtained using the load() API. |
location | Required | String | Indicates the path of the captured image to be stored. |
format | Required | String | Indicates the format of the frame is to be captured. Possible values are:
|
width | Required | Number | Indicates the width of the captured image in pixels. Note: Width should be within the range supported by the camera hardware. |
height | Required | Number | Indicates the height of the captured image in pixels. Note: Height should be within the range supported by the camera hardware. |
pictureQuality | Required | Number | Indicates the percentage of the picture quality. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the failed operation. Note: errorCode always defaults to 0. Details of the error will be available in the logs. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: errorText is always empty. Details of the error will be available in the logs. |
mediaId | Optional | String | Indicates the unique identifier the camera pipeline. |
Example code
# luna-send -n 1 luna://com.webos.media/takeCameraSnapshot '{
"mediaId":"",
"location":"/tmp/",
"format":"jpg",
"width":640,
"height":480,
"pictureQuality":30
}'
API level 11
Subscribes to messages containing the mapping of application ID (appID) and pipeline process ID (PID), i.e. it returns information about which application each managed pipeline belongs to.The subscription messages contain information about changes to these mappings, i.e. new mappings when a pipeline is associated with an application or destroyed mappings when a pipeline exits.
Note: The return value of the method contains an array of the PIDs of all currently existing pipelines mapped to the corresponding appIDs.
None
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Returns true if the subscriber was successfully added. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
mediaPipelines | Required | Object array: mediaPipelines | See "mediaPipelines" object. |
subscription | Required | Boolean | Indicates the current subscription status. Possible values are:
Note: This property is returned in a separate object from the returns object. |
Name | Required | Type | Description |
---|---|---|---|
procUpdate | Required | Object: procUpdate | See "procUpdate" object. |
Example code
# luna-send -n 2 -f luna://com.webos.media/trackAppProcesses '{}'
Response:
{
"subscription": true
}
{
"subscribed": true,
"mediaPipelines": [
{
"appId": "com.webos.app.enactbrowser",
"pid": 1685
}
],
"returnValue": true
}
Subscription Response:
{
"procUpdate":{
"appId":"com.webos.app.enactbrowser",
"exec":false,
"pid":1685
}
}
API level 11
Tries to acquire resources from mediaserver.
Note:
Name | Required | Type | Description |
---|---|---|---|
resources | Required | String | Resource information. Note: Resources information must be provided as a stringified form of the "resources" object array. |
connectionId | Required | String | Indicates the unique identifier of the pipeline to acquire resources. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Example code
# luna-send -n 1 luna://com.webos.media/tryAcquire '{
"resources": "[{\"resource\":\"DISP0\",\"qty\":1},{\"resource\":\"VDEC\",\"qty\":1},{\"resource\":\"ADEC\",\"qty\":1}]",
"connectionId": "_7P3y7e9AcPv8t1"
}'
Response:
{
"returnValue": true
}
API level 11
Unloads the pipeline and releases all AV resources.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the loaded media/camera pipeline. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | String | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media/camera pipeline which is requested to unload. |
Example code
# luna-send -n 1 -f luna://com.webos.media/unload '{"mediaId":"_Pvzj2FRn42sL99"}'
Response:
{
"errorCode":0,
"returnValue":true,
"errorText":"No Error",
"mediaId":"_Pvzj2FRn42sL99"
}
API level 11
Unregisters pipeline with Resource Manager.
Note: This method is applicable to unmanaged pipelines only.
Name | Required | Type | Description |
---|---|---|---|
connectionId | Required | String | Indicates the unique identifier of the pipeline to unregister. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline which is requested. |
Example code
# luna-send -n 1 -f luna://com.webos.media/unregisterPipeline '{"connectionId":"_KXpMET1Sxc1eGO"}'
Response:
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_KXpMET1Sxc1eGO"
}
API level 11
Unsubscribes from media pipeline related events.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates the unique identifier of the media object to unsubscribe. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Required | Number | The error code for the operation. Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails. |
errorText | Required | String | Indicates the reason for the failure of the operation. Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly. |
mediaId | Optional | String | Indicates the unique identifier of the loaded media pipeline requested to unsubscribe. |
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method \"unsubscribe\" for category \"/\" was not handled | JSON parsing fails. |
Example code
# luna-send -n 1 -f luna://com.webos.media/unsubscribe '{"mediaId":"_gmkaR0OtGWxr6z"}'
Response:
{
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_gmkaR0OtGWxr6z"
}
Details of the resource.
Name | Required | Type | Description |
---|---|---|---|
resource | Required | String | Name of resource to acquire. Possible values are:
|
qty | Optional | Number | Quantity of resources to acquire. Range: [1, 32] (depends on the configuration). Note: Only applicable for the resource to be acquired. |
index | Optional | Number | Specific index of resources to be released. Range: [0, 31] (depends on the configuration). Note: Only applicable for the resource to be released. |
Provides a detailed description of the object. Limit to 2-3 paragraphs.
Name | Required | Type | Description |
---|---|---|---|
returnValue | Optional | Boolean | Return value of command. Command succeeded true/false. |
errorCode | Optional | Number | Error Code (if failure) of command. |
errorText | Optional | String | Human readable and HMI/UX displayable text of reported error. If any. |
mediaId | Optional | String | Media ID |
Array of objects that gives details of media for foreground application (such as pipeline Id, playstate, position, etc.)
Name | Required | Type | Description |
---|---|---|---|
pipelineId | Required | String | Pipeline id |
playStateNow | Required | String | Current playback status |
playStateNext | Required | String | Next playback status |
isFullScreen | Required | Boolean | Specifies if the app is in full screen mode. |
positionX | Required | Number (int32_t) | X Position of window |
positionY | Required | Number (int32_t) | Y Position of window |
width | Required | Number (int32_t) | Width of the app window. |
height | Required | Number (int32_t) | Height of the app window. |
Set a audio information for either video and audio or audio only recording.
Name | Required | Type | Description |
---|---|---|---|
codec | Optional | String | Codec information. Default: AAC |
sampleRate | Optional | Number | Sample rate value of content. Default: 44100 |
channelCount | Optional | Number | Channel count value of content. Default: 2 |
bitRate | Optional | Number | Bit rate value of content. |
Provides information related to audio.
Name | Required | Type | Description |
---|---|---|---|
codec | Optional | String | Codec information |
bitrate | Optional | Number (int64_t) | Bit rate value of content. |
sample_rate | Optional | Number (int32_t) | Samples of audio carried per second, measured in kHz. |
Provides detailed information for display resource.
Name | Required | Type | Description |
---|---|---|---|
crtc-id | Required | Number (int32_t) | Crtc id of display |
plane-id | Required | Number (uint32_t) | Plane id of display |
conn-id | Required | Number (int32_t) | Connector id of display |
Provides information about the number of frames per second at which the video is being played.
It is represented as a combination of numerator and denominator.
Name | Required | Type | Description |
---|---|---|---|
num | Required | Number (int32_t) | Numerator of frame rate |
den | Required | Number (int32_t) | Denominator of frame rate |
Set a image information for snapshot a image.
Name | Required | Type | Description |
---|---|---|---|
videoSrc | Required | String | Unique ID of the media record pipeline. Note:
|
codec | Optional | String | Codec information. Default: JPEG |
width | Optional | Number | Width value. Default : The value obtained from video object. |
height | Optional | Number | Height value. Default : The value obtained from video object. |
quality | Optional | Number | Image Quality value. Default: 90 |
Unique identifier of the loaded media/camera pipeline.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Indicates mediaId of the object. |
Contains the AppID-PID mapping of the currently running pipelines. Returns an empty array if no pipelines associated with any applications.
Each array element is an object of type {"appId": string, "pid": number}. If the appId string is empty it means the pipeline was loaded without an application ID being provided.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates application id |
pid | Required | Number | Indicates process id of pipeline |
Provides parameters for pipeline's Information.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates the application id. |
windowId | Required | String | Indicates the windowId attached to the video sink. The value should be specified in the format: "_Window_Id_X" (X is number). Note: The value should be given by the surface manager before the load API is called. |
videoDisplayMode | Optional | String | Indicates the display mode of the pipeline. Default: Textured Note: Only Textured value is supported. |
display-path | Optional | Number | Indicates the display path. Default: 0 Note:
|
width | Optional | Number | Indicates the width of the image to be taken from the camera device. The value can vary from supported width of the image. Note: This is required when load API is used for the camera. |
height | Optional | Number | Indicates the height of the image to be taken from the camera device. The value can vary from supported height of the image. Note: This is required when the load API is used for the camera. |
format | Optional | String | Indicates the type of the camera data to be taken from the camera device. Possible values are:
Note
|
frameRate | Optional | Number | Indicates the number of frames captured per sec from a camera device. Based on the camera supported values, provide the frameRate such as 30 / 15 and so on. Note: This is required when the load API is used for the camera. |
memType | Optional | String | Indicates the type of access with camera device. Possible values are:
Note: This is required when the load API is used for the camera. |
memSrc | Optional | String | Indicates the source of the camera data. Possible value: Device node like "/dev/video0" / shared memory key "7010" ( which is returned by camera service ). Note: This is required when the load API is used for the camera. |
handle | Optional | Number | Indicates the handle for the device obtained using the open() API of camera service. This parameter is required only when "memType" is "posixshm" for camera functionality. |
iomode | Optional | Number | Represents the memory mode value which are defined using an enum like mmap, user pointer & dma buffer, when "memType" is "device" for camera functionality. Possible values are:
|
cameraId | Optional | String | Reserved. Note: Applications are advised not to use this parameter. |
video | Optional | Object: video | see "video" object. Note: Applications are advised not to use this parameter. |
audio | Optional | Object: audio | see "audio" object. Note: Applications are advised not to use this parameter. |
image | Optional | Object: image | see "image" object. Note: Applications are advised not to use this parameter. |
path | Optional | String | Indicates the location and file name where the recored files and snapshot images are to be saved. For location, You can specify the path parameter for recording with "com.webo.service.mediarecorder/setOutputFile" and for taking a snapshot with "com.webos.service.mediarecorder/takeSnapshot". By default, recorded files and snapshot images are saved in the /media/internal/ folder. Possible values are:
The default file name is of the format RecordDDMMYYYY-HHMMSS, where DDMMYYYY-HHMMSS is current date and time. Example: /media/internal/Record03122023-17171504.mp4, /media/internal/Capture03122023-17173792.jpeg Note: Applications are advised not to use this parameter. |
Payload format used in load API. It represents the JSON payload object for a specific type of pipeline.
Name | Required | Type | Description |
---|---|---|---|
option | Optional | Object: option | See "option" object. |
The procUpdate object value is an object of type: {"appId" : string, "exec" : bool, "pid" : number}
where exec is true when a pipeline appid mapping is added and false when it is destroyed.
If the appId string is empty it means the pipeline was loaded without an application ID being provided.
Name | Required | Type | Description |
---|---|---|---|
appId | Required | String | Indicates application ID. |
pid | Required | Number | Indicates process ID of pipeline. |
exec | Required | Boolean | Provides information on the mapping status of app ID and a pipeline. Possible values are:
|
Provides audio/video stream information.
Name | Required | Type | Description |
---|---|---|---|
video_stream | Required | Number (int32_t) | The number of video streams in program. |
audio_stream | Required | Number (int32_t) | The number of audio streams in program. |
Object of resource name, quantity, and index.
Resources can hold more than one set of resource, quantity, and index.
Example
{
"resources": " [{
"resource": "DISP0",
"qty": 1,
"index": 3,
},
{
"resource": "VDEC",
"qty": 1,
"index": 3
},
{
"resource": "ADEC",
"qty": 1,
"index": 3
}
]
}
Name | Required | Type | Description |
---|---|---|---|
qty | Optional | Number | Quantity of resource to acquire. Note: Below points applicable to Open and Open-Emulator as per current configuration
|
index | Optional | Number | Specific index of resource to acquire. Note: Below points applicable to Open and Open-Emulator as per current configuration
|
resource | Optional | String | Name of resource to acquire. Possible values are:
Note:
|
Object indicating the new and old resource.
Name | Required | Type | Description |
---|---|---|---|
old | Required | Object array: ResourceDetails | The resources to be released. |
new | Required | Object array: ResourceDetails | The resources to be acquired. |
Provides information of the media that has just been loaded.
Example
{
"sourceInfo": {
"programs": [{
"audio_stream": 1,
"video_stream": 1
}],
"seekable": true,
"video_streams": [{
"width": 854,
"frame_rate": {
"num": 24,
"den": 1
},
"bitrate": 535929,
"height": 480
}],
"audio_streams": [{
"sample_rate": 48000,
"bit_rate": 0
}],
"container": "",
"duration": 52209
}
}
Name | Required | Type | Description |
---|---|---|---|
programs | Required | Object array: programs | See "programs" object. |
seekable | Required | Boolean | Flag indicating whether the media supports seek operations.
|
video_streams | Required | Object array: videoInfo | See "videoInfo" object. |
audio_streams | Required | Object array: audioInfo | See "audioInfo" object. |
container | Optional | String | Media format (container type) of source
|
duration | Required | Number (int64_t) | Total duration in milli-seconds of the program. |
Set a video information for either video and audio or video only recording.
Name | Required | Type | Description |
---|---|---|---|
videoSrc | Required | String | Unique ID of the media record pipeline. Note:
|
width | Optional | Number | Width value. Default: The value obtained from "luna://com.webos.service.camera2/getFormat" |
height | Optional | Number | Height value. Default: The value obtained from "luna://com.webos.service.camera2/getFormat" |
codec | Optional | String | Codec information. Default: H264 |
fps | Optional | Number | Frames per second value. Default : The value obtained from "luna://com.webos.service.camera2/getFormat" |
bitRate | Optional | Number | Bit rate value of content. |
Provides information related to video.
Name | Required | Type | Description |
---|---|---|---|
width | Required | Number (uint32_t) | Actual width value of input video (before cropping in video decoder. Used for UI presentation.) |
height | Required | Number (uint32_t) | Actual height value of input video (before cropping in video decoder. Used for UI presentation.) |
frameRate | Required | Object: frameRate | See "frameRate" object. |
codec | Optional | String | Codec information. |
bitRate | Optional | Number (uint64_t) | Bit rate value of content. |
The acquireCompete event is invoked when the acquire request is performed and the result comes out.
Name | Required | Type | Description |
---|---|---|---|
resources | Required | Object | See "resources" object. |
state | Required | Boolean | Flag indicating the result of acquire request.
|
connectionId | Required | String | Unique identifier of the pipeline to acquire resource. |
The audioInfo event provides information related to audio.
Name | Required | Type | Description |
---|---|---|---|
audioInfo | Required | Object: audioInfo | See "audioInfo" object. |
Indicates the buffering range of the particular media content. It is raised multiple times when specific media is loaded.
Name | Required | Type | Description |
---|---|---|---|
beginTime | Required | Number | Starting time of the bufferRange of the media. |
endTime | Required | Number | End time of the bufferRange of the media. |
mediaId | Required | String | Unique identifier of pipeline reports bufferRange. |
percent | Required | Number | Percent of the total buffer the current buffer range represents. |
Indicates the pipeline is resuming playback after filling buffers.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the pipeline that buffering is complete. |
Indicates the pipeline is temporarily pausing playback internally in order to buffer more data.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the pipeline that starts buffering. |
The currentTime event is raised multiple times when a specific media is playing. It indicates the progress of the media being played and provides the current time at which the media is being played.
Name | Required | Type | Description |
---|---|---|---|
currentTime | Required | Number (int64_t) | Current time at which the media is being played. |
mediaId | Required | String | Unique identifier of pipeline which reports current time. |
The detached event is raised when a specific media has been detached from the client by another client attaching to the corresponding pipeline. The detached event is related to the attach command. Attach allows to transfer the control of a pipeline to be handed over to a different client. When that happens the original client gets notified that it got detached from the pipeline and is hence no longer able to control the pipeline. This feature is related to fast boot scenarios where we have a mini-app controlling media upon initial launch and the control is handed over to the real/full application once the system has started in full.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Optional | String | Unique identifier of detached pipeline. |
The endOfStream event is raised when a specific media has received all of its data.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of pipeline met end of stream. |
The error event reports errors thrown by pipelines.
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | Error code from the service. |
errorText | Optional | String | Error code description from the service. |
mediaId | Required | String | Unique identifier of pipeline sending error information. |
The loadCompleted event is raised when a specific media pipeline has been successfully loaded.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the loaded pipeline. |
The paused event is raised when a specific media has been successfully paused.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the requested pipeline to pause. |
The playing event is raised once, in response to the play method, when a specified media pipeline has transitioned into the playing state.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the requested pipeline to play. |
The policyAction event is invoked when the resources are short of quantity to playing new media content and request pipeline to release regarding resource.
Name | Required | Type | Description |
---|---|---|---|
requestor_type | Required | String | Type of pipeline that made a new request. This is the pipeline requesting the additional resources. |
requestor_name | Required | String | Name of pipeline that made new request. This is the pipeline requesting additional resources. |
action | Required | String | Action requested to do at the pipeline when this policyAction is delivered. |
resources | Required | Object | See "resources" object. |
connectionId | Required | String | Unique identifier of the pipeline to get policyAction event |
The seekDone event is raised when a seek operation for a media has been successfully completed.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the requested pipeline to seek. |
The sourceInfo event provides information about the media that has just been loaded.
Name | Required | Type | Description |
---|---|---|---|
sourceInfo | Required | Object: sourceInfo | See "sourceInfo" object. |
The unloadCompleted event is raised when a specific media pipeline has been successfully unloaded.
Name | Required | Type | Description |
---|---|---|---|
mediaId | Required | String | Unique identifier of the unloaded pipeline. |
The videoInfo event provides information related to video.
Name | Required | Type | Description |
---|---|---|---|
videoInfo | Required | Object: videoInfo | See "videoInfo" object. |
Error Code | Error Text | Error Description |
---|---|---|
-1 | Method "methodname" for category "category" was not handled | JSON parsing failed. |
0 | No Error | Indicates operation is successful. |
600 | PolicyAction | Media related errors reported by the media pipeline are reported into several categories.
|
601 | Resource Allocation Error | Media related errors reported by the media pipeline are reported into several categories.
|
Contents