OpenCDMi API
Version: 1.0.0
Status:
OCDM interface for Thunder framework.
(Defined by OCDM.json)
Table of Contents
Introduction
Scope
This document describes purpose and functionality of the OCDM interface (version 1.0.0). It includes detailed specification about its properties provided and notifications sent.
Case Sensitivity
All identifiers of the interfaces described in this document are case-sensitive. Thus, unless stated otherwise, all keywords, entities, properties, relations and actions should be treated as such.
Acronyms, Abbreviations and Terms
The table below provides and overview of acronyms used in this document and their definitions.
Acronym | Description |
---|---|
API | Application Programming Interface |
HTTP | Hypertext Transfer Protocol |
JSON | JavaScript Object Notation; a data interchange format |
JSON-RPC | A remote procedure call protocol encoded in JSON |
The table below provides and overview of terms and abbreviations used in this document and their definitions.
Term | Description |
---|---|
callsign | The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique. |
References
Ref ID | Description |
---|---|
HTTP | HTTP specification |
JSON-RPC | JSON-RPC 2.0 specification |
JSON | JSON specification |
Thunder | Thunder API Reference |
Description
OpenCDMi JSON-RPC interface.
Properties
The following properties are provided by the OCDM interface:
OCDM interface properties:
Property | R/W | Description |
---|---|---|
drms | read-only | Supported DRM systems |
keysystems | read-only | DRM key systems |
sessions | read-only | Active sessions enumerator |
drms property
Provides access to the supported DRM systems.
This property is read-only.
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | Supported DRM systems |
(property)[#] | object | mandatory | ... |
(property)[#].name | string | mandatory | Name of the DRM |
(property)[#].keysystems | array | mandatory | Key system identifier list |
(property)[#].keysystems[#] | string | mandatory | Identifier of a key system |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.drms"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"name": "PlayReady",
"keysystems": [
"com.microsoft.playready"
]
}
]
}
keysystems property
Provides access to the DRM key systems.
This property is read-only.
The drm system parameter shall be passed as the index to the property, i.e.
keysystems@<drm-system>
.
Index
Name | Type | M/O | Description |
---|---|---|---|
drm-system | string | mandatory | ... |
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | DRM key systems |
(property)[#] | string | mandatory | Identifier of a key system |
Errors
Message | Description |
---|---|
ERROR_BAD_REQUEST |
Invalid DRM name |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.keysystems@PlayReady"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
"com.microsoft.playready"
]
}
sessions property
Provides access to the active sessions enumerator.
This property is read-only.
Value
Name | Type | M/O | Description |
---|---|---|---|
(property) | array | mandatory | Active sessions enumerator |
(property)[#] | object | mandatory | ... |
(property)[#].drm | string | mandatory | Name of the DRM system |
Example
Get Request
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.sessions"
}
Get Response
{
"jsonrpc": "2.0",
"id": 42,
"result": [
{
"drm": "PlayReady"
}
]
}
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 OCDM interface:
OCDM interface events:
Notification | Description |
---|---|
drmalreadyinitialized | Signals that the specified DRM system could not be initialized because it is already initialized by another process |
drminitializationstatus | Notifies about DRM initialization status |
drmalreadyinitialized notification
Signals that the specified DRM system could not be initialized because it is already initialized by another process.
Description
When this event is received, the application owning given DRM system should release it immediately.
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.drm | string | mandatory | Name of the DRM system |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.register",
"params": {
"event": "drmalreadyinitialized",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.drmalreadyinitialized",
"params": {
"drm": "PlayReady"
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.drmalreadyinitialized
.
drminitializationstatus notification
Notifies about DRM initialization status.
Description
Register to this event to be notified about DRM retrying status busy/failure/success
Notification Parameters
Name | Type | M/O | Description |
---|---|---|---|
params | object | mandatory | ... |
params.status | string | mandatory | BUSY - drm is used by another process, SUCCESS - recovered from BUSY state after retry, FAILED - not recovered after re-trying from BUSY (must be one of the following: BUSY, FAILED, SUCCESS) |
params.drm | string | mandatory | Name of the DRM system |
Example
Registration
{
"jsonrpc": "2.0",
"id": 42,
"method": "<callsign>.1.register",
"params": {
"event": "drminitializationstatus",
"id": "myid"
}
}
Notification
{
"jsonrpc": "2.0",
"method": "myid.drminitializationstatus",
"params": {
"status": "SUCCESS",
"drm": "PlayReady"
}
}
The client ID parameter is passed within the notification designator, i.e.
<client-id>.drminitializationstatus
.