Skip to content

Latest commit

 

History

History
439 lines (327 loc) · 9.7 KB

File metadata and controls

439 lines (327 loc) · 9.7 KB

Linear Playback Control Plugin

A LinearPlaybackControl plugin for Thunder framework.

Table of Contents

Abbreviation, Acronyms and Terms

[Refer to this link]

Configuration

The table below lists configuration options of the plugin.

Name Type Description
callsign string Plugin instance name (default: LinearPlaybackControl)
classname string Class name: LinearPlaybackControl
locator string Library name: libWPEFrameworkLinearPlaybackControl.so
autostart boolean Determines if the plugin shall be started automatically along with the framework

Properties

The following properties are provided by the LinearPlaybackControl plugin:

LinearPlaybackControl interface properties:

Property Description
channel Current channel
seek TSB seek position offset, from live position, in seconds
trickPlay Trick play speed and direction
status RO Current TSB status information containing buffer size, seek position and health status
tracing Tracing enable/disable flag

channel

Provides access to the current channel.

Events

No Events

Value

Name Type Description
(property) object Current channel
(property).channel string Channel address

The muxid argument shall be passed as the index to the property, e.g. LinearPlaybackControl.1.channel@0.

Errors

Code Message Description
30 ERROR_BAD_REQUEST Bad JSON param data format.
39 ERROR_READ_ERROR Error reading file or parsing one or more values.
40 ERROR_WRITE_ERROR Error writing to file.

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.channel@0"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": {
        "channel": "chan_select"
    }
}

Set Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.channel@0",
    "params": {
        "channel": "chan_select"
    }
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "null"
}

seek

Provides access to the TSB seek position offset, from live position, in seconds.

Events

No Events

Value

Name Type Description
(property) object TSB seek position offset, from live position, in seconds
(property).seekPosInSeconds number TSB seek position offset from live in seconds. The value must be an unsigned integer. If the value exceeds the current TSB size, the seek position will be reduced accordingly

The muxid argument shall be passed as the index to the property, e.g. LinearPlaybackControl.1.seek@0.

Errors

Code Message Description
30 ERROR_BAD_REQUEST Bad JSON param data format.
39 ERROR_READ_ERROR Error reading file or parsing one or more values.
40 ERROR_WRITE_ERROR Error writing to file.

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.seek@0"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": {
        "seekPosInSeconds": 0
    }
}

Set Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.seek@0",
    "params": {
        "seekPosInSeconds": 0
    }
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "null"
}

trickPlay

Provides access to the trick play speed and direction.

Events

No Events

Value

Name Type Description
(property) object Trick play speed and direction
(property).speed number Trick play speed. The direction is defined by the sign of speed, where a negative value means rewind and positive value means fast forward

The muxid argument shall be passed as the index to the property, e.g. LinearPlaybackControl.1.trickPlay@0.

Errors

Code Message Description
30 ERROR_BAD_REQUEST Bad JSON param data format.
39 ERROR_READ_ERROR Error reading file or parsing one or more values.
40 ERROR_WRITE_ERROR Error writing to file.

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.trickPlay@0"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": {
        "speed": -4
    }
}

Set Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.trickPlay@0",
    "params": {
        "speed": -4
    }
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "null"
}

status

Provides access to the current TSB status information containing buffer size, seek position and health status.

This property is read-only.

Events

No Events

Value

Name Type Description
(property) object Current TSB status information containing buffer size, seek position and health status
(property).maxSizeInBytes number Maximum TSB size in bytes
(property).currentSizeInBytes number Current TSB size in bytes
(property).currentSizeInSeconds number Current TSB size in seconds
(property).seekPosInBytes number Current TSB seek position offset from live in bytes. The value is an unsigned integer and cannot exceed the current TSB size in bytes
(property).seekPosInSeconds number Current TSB seek position offset from live in seconds. The value is an unsigned integer and cannot exceed the current TSB size in seconds
(property).trickPlaySpeed number Current trick play speed and direction. The direction is defined by the sign of speed, where a negative value means rewind and positive value means fast forward
(property).streamSourceLost boolean Boolean indicating if the buffer source is lost (true) as a result of e.g. network connectivity issues or not (false)
(property).streamSourceLossCount number Number of times the streaming is lost and the TSB stopped receiving data from the stream source, during a valid channel selected

The muxid argument shall be passed as the index to the property, e.g. LinearPlaybackControl.1.status@0.

Errors

Code Message Description
39 ERROR_READ_ERROR Error reading file or parsing one or more values.

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.status@0"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": {
        "maxSizeInBytes": 0,
        "currentSizeInBytes": 0,
        "currentSizeInSeconds": 0,
        "seekPosInBytes": 0,
        "seekPosInSeconds": 0,
        "trickPlaySpeed": -4,
        "streamSourceLost": false,
        "streamSourceLossCount": 0
    }
}

tracing

Provides access to the tracing enable/disable flag.

Events

No Events

Value

Name Type Description
(property) object Tracing enable/disable flag
(property).tracing boolean Tracing enable (true) / disable (false)

Errors

Code Message Description
1 ERROR_GENERAL General failure.
30 ERROR_BAD_REQUEST Bad JSON param data format.

Example

Get Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.tracing"
}

Get Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": {
        "tracing": true
    }
}

Set Request

{
    "jsonrpc": "2.0",
    "id": 42,
    "method": "LinearPlaybackControl.tracing",
    "params": {
        "tracing": true
    }
}

Set Response

{
    "jsonrpc": "2.0",
    "id": 42,
    "result": "null"
}

Notifications

Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.

The following events are provided by the LinearPlaybackControl plugin:

LinearPlaybackControl interface events:

Event Description
speedchanged Indicates that the trick play speed has changed

speedchanged

Indicates that the trick play speed has changed.

Parameters

Name Type Description
params object
params.speed number New trick play speed. The direction is defined by the sign of speed, where a negative value means rewind and positive value means fast forward
params.muxId number Stream muxId

Example

{
    "jsonrpc": "2.0",
    "method": "client.events.speedchanged",
    "params": {
        "speed": -4,
        "muxId": 0
    }
}