Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Typedefs | Enumerations | Functions
SHI_License Class

The Marlin license processing module. More...

Typedefs

typedef struct SHI_License SHI_License
 A SHI_License object represents the license information for a piece of content. More...
 

Enumerations

enum  SHI_ContentKeyFormat {
  SHI_CONTENT_KEY_FORMAT_CLEARTEXT,
  SHI_CONTENT_KEY_FORMAT_SKB_STANDARD,
  SHI_CONTENT_KEY_FORMAT_SKB_CUSTOM
}
 Format indenfifier for content keys. More...
 

Functions

SHI_PUBLIC_API void * SHI_License_GetInterface (SHI_License *self, SHI_InterfaceId iface_id)
 Obtains a pointer to a SHI_License object with a different interface. More...
 
SHI_PUBLIC_API SHI_Result SHI_License_Destroy (SHI_License *self)
 Destroys this license object. More...
 
SHI_PUBLIC_API SHI_Result SHI_License_Describe (SHI_License *self, SHI_LicenseInfo **description)
 Gets a description for this license. More...
 
SHI_PUBLIC_API SHI_Result SHI_License_ProcessLicenseData (SHI_License *self, const void *data, SHI_Size size)
 Registers a license data element that contains Octopus data for this license. More...
 
SHI_PUBLIC_API SHI_Result SHI_License_SetContentIds (SHI_License *self, const char *const *ids, SHI_Cardinal id_count)
 Specifies a set of content IDs for this license. More...
 
SHI_PUBLIC_API SHI_Result SHI_License_GetContentKey (SHI_License *self, const char *content_id, SHI_ContentKeyFormat format, const void *format_parameters, SHI_Data **data)
 Gets the content key for a specific content ID. More...
 
SHI_PUBLIC_API SHI_Result SHI_License_CreateAction (SHI_License *self, const char *name, const void *parameters, SHI_Action **action)
 Creates a SHI_Action object for this license. More...
 
SHI_PUBLIC_API SHI_Result SHI_License_CreateActionEx (SHI_License *self, const char *name, const void *parameters, SHI_Size parameters_size, SHI_Action **action)
 This function is similar to SHI_License_CreateAction, but can be used for arbitrary actions, even those for which this programming interface does not define any data structure to represent the parameters. More...
 

Detailed Description

The Marlin license processing module.

Typedef Documentation

◆ SHI_License

typedef struct SHI_License SHI_License

A SHI_License object represents the license information for a piece of content.

Enumeration Type Documentation

◆ SHI_ContentKeyFormat

Format indenfifier for content keys.

Enumerator
SHI_CONTENT_KEY_FORMAT_CLEARTEXT 
SHI_CONTENT_KEY_FORMAT_SKB_STANDARD 
SHI_CONTENT_KEY_FORMAT_SKB_CUSTOM 

Function Documentation

◆ SHI_License_CreateAction()

SHI_PUBLIC_API SHI_Result SHI_License_CreateAction ( SHI_License self,
const char *  name,
const void *  parameters,
SHI_Action **  action 
)

Creates a SHI_Action object for this license.

The SHI_Action object returned must be destroyed before this license is destroyed. For a given license, at most one SHI_Action object at a time can exist. Thus, in order to create a SHI_Action object by calling this method, any SHI_Action object previously returned by calling this method on the same license object must have been destroyed. If there is a SHI_Action object that has not yet been destroyed, this method returns SHI_ERROR_LICENSE_ACTION_PENDING.

Parameters
selfThe SHI_License for which a SHI_Action object is created.
nameName of the action, such as SHI_ACTION_PLAY or SHI_ACTION_EXPORT.
parametersParameters for the action. Each type of action has different parameters encoded as a specific data structure type. This parameter is a pointer to that data structure, cast to a const void* generic pointer. For actions that do not require parameters (such as SHI_ACTION_PLAY), the value of this parameter must be NULL. For actions that require parameters (such as SHI_ACTION_EXPORT), it must point to a struct of the type defined for that action in ShiAction.h. Action names have the form SHI_ACTION_<NAME> and the corresponding parameters type, if any, is a struct type named SHI_Action<Name>Parameters. For example, if the action name is SHI_ACTION_EXPORT, parameters must point to a SHI_ActionExportParameters struct. For actions that have parameters but for which this API does not define any parameter struct type, the caller must use the SHI_License_CreateActionEx method and pass parameters in a pre-encoded form.
actionAddress of a SHI_Action pointer that will be set to refer to the SHI_Action created.
Returns
SHI_SUCCESS if the SHI_Action object was successfully created and returned, SHI_ERROR_LICENSE_NO_SUCH_ACTION if the license does not support this action, SHI_ERROR_INVALID_PARAMETERS if the parameters do not match what this type of action requires. Other error codes are also possible.

◆ SHI_License_CreateActionEx()

SHI_PUBLIC_API SHI_Result SHI_License_CreateActionEx ( SHI_License self,
const char *  name,
const void *  parameters,
SHI_Size  parameters_size,
SHI_Action **  action 
)

This function is similar to SHI_License_CreateAction, but can be used for arbitrary actions, even those for which this programming interface does not define any data structure to represent the parameters.

This can be used, for example, for custom actions. NOTE: this is an advanced function and should always be used with care, since the encoding of the parameters is left up to the caller, and must be done according to the data format specified in the Octopus Plankton specification.

Parameters
selfThe SHI_License for which a SHI_Action object is created.
nameName of the action, such as "MyCustomAction".
parametersParameters for the action. This parameter points to data encoded as a Plankton parameter block. That parameter block must be named 'Parameters', must have the type OBJECT_TYPE_CONTAINER (0), and must contain all entries required by the action to be created.
parameters_sizeThe size in bytes of parameters.
actionAddress of a SHI_Action pointer that will be set to refer to the SHI_Action created.

◆ SHI_License_Describe()

SHI_PUBLIC_API SHI_Result SHI_License_Describe ( SHI_License self,
SHI_LicenseInfo **  description 
)

Gets a description for this license.

The SHI_LicenseInfo object returned must be released before this license is destroyed. If no description is available for this license, this method returns SHI_ERROR_NOT_AVAILABLE.

Parameters
selfThe SHI_License whose description is obtained.
descriptionAddress of a SHI_LicenseInfo pointer that will be set to refer to a SHI_LicenseInfo object containing the license description.

◆ SHI_License_Destroy()

SHI_PUBLIC_API SHI_Result SHI_License_Destroy ( SHI_License self)

Destroys this license object.

The object can no longer be used after this method returns. All objects obtained from method calls to this object must be released or destroyed before this object is destroyed.

Parameters
selfThe SHI_License to destroy.

◆ SHI_License_GetContentKey()

SHI_PUBLIC_API SHI_Result SHI_License_GetContentKey ( SHI_License self,
const char *  content_id,
SHI_ContentKeyFormat  format,
const void *  format_parameters,
SHI_Data **  data 
)

Gets the content key for a specific content ID.

The content ID must be one of the content IDs previously passed to the SHI_License_SetContentIds method for this license. The SHI_Data object returned must be released before this license is destroyed. The application must have performed an action on the license before the keys may be returned. If no SHI_Action_Perform method has yet been called with a GRANTED status, this method returns SHI_ERROR_LICENSE_MUST_PERFORM.

Parameters
selfThe SHI_License from which the content key is obtained.
content_idThe content ID string.
formatIdentifier of the format in which the key should be returned.
format_parametersPointer to the parameters for the format, or NULL if the format does not require parameters.
dataAddress of a SHI_Data pointer that will be set to refer to a SHI_Data object containing the content key.

◆ SHI_License_GetInterface()

SHI_PUBLIC_API void* SHI_License_GetInterface ( SHI_License self,
SHI_InterfaceId  iface_id 
)

Obtains a pointer to a SHI_License object with a different interface.

This method returns NULL if the object does not implement the requested interface.

Parameters
selfThe SHI_License whose interface will be returned.
iface_idThe ID of the interface that is requested.
Returns
A pointer to the requested interface, or NULL if the object does not implement it.

◆ SHI_License_ProcessLicenseData()

SHI_PUBLIC_API SHI_Result SHI_License_ProcessLicenseData ( SHI_License self,
const void *  data,
SHI_Size  size 
)

Registers a license data element that contains Octopus data for this license.

Parameters
selfThe SHI_License with which the license data is registered.
dataA pointer to the license data.
sizeThe size in bytes of the license data.

◆ SHI_License_SetContentIds()

SHI_PUBLIC_API SHI_Result SHI_License_SetContentIds ( SHI_License self,
const char *const *  ids,
SHI_Cardinal  id_count 
)

Specifies a set of content IDs for this license.

The content IDs are those for individual parts of a single multimedia presentation. Such IDs are typically obtained from the multimedia file in which the content is stored. (For example, for MP4 files, there is one content ID for each media track in the file.) All the license data elements must have previously been processed by one or more calls to SHI_License_ProcessLicenseData(). This method may only be called once for this license. If it is called more than once, it returns SHI_ERROR_LICENSE_IDS_ALREADY_SET. If one of the IDs in the list is not found in the license data (the license is not applicable to this content ID), this method returns SHI_ERROR_LICENSE_ID_NOT_FOUND.

Parameters
selfThe SHI_License with which the content IDs are associated.
idsAn array of the (string) content IDs.
id_countThe number of elements in the array.