Tizen HAL API  1.0
HDCP

The HDCP provides functions for hdcp devices.

Required Header

#include <hal-hdcp.h>

Overview

The hdcp devices have various specifications, so it's hard to control them using single code. The hdcp HAL provides common abstraction interfaces to control hdcp devices which are different.

The HDCP HAL allows creation of components required in secure playback including:

State Diagram

hal_hdcp_state_diagram.png

State Transitions

FUNCTION PRE-STATE POST-STATE SYNC TYPE
hal_hdcp_init() NONE INITIALIZED SYNC
hal_hdcp_deinit() INITIALIZED NONE SYNC
hal_hdcp_open() INITIALIZED OPENED SYNC
hal_hdcp_close() OPENED INITIALIZED SYNC

For more information on the HDCP features and the macros, see HAL HDCP programming guides and tutorials.

Typedefs

typedef enum hal_hdcp_error hal_hdcp_error_e
 Enumeration for the HDCP error.
typedef enum hal_hdcp_state hal_hdcp_state_e
 Enumeration for the HDCP state.
typedef enum hal_hdcp_command hal_hdcp_command_e
 Enumeration for the HDCP command.
typedef struct
hal_hdcp_batch_command_control 
hal_hdcp_batch_command_control_s
 The structure type of batch command.
typedef enum hal_hdcp_message_type hal_hdcp_message_type_e
 Enumeration for the HDCP message type.
typedef struct hal_hdcp_message hal_hdcp_message_s
 The structure type of the HDCP message.
typedef hal_hdcp_error_e(* hal_hdcp_message_cb )(hal_hdcp_message_s *message, void *user_data)
 Callback function for notification from HDCP HAL.
typedef struct
_hal_backend_hdcp_funcs 
hal_backend_hdcp_funcs
 The structure type of the HDCP HAL functions.

Data Structure Documentation

struct hal_hdcp_buffer_s

The structure type of HDCP buffer.

Since:
HAL_MODULE_HDCP 1.0

Data Fields

int index
bool is_secure
uint32_t size
unsigned char * data
int fd

Field Documentation

unsigned char* hal_hdcp_buffer_s::data

The pointer of data buffer

The fd(file descriptor) of data buffer

The index of buffer

The flag which indicates the real data is managed in secure world or not

The size of data buffer

struct hal_hdcp_crypto_info_s

The structure type of crypto information for encryption and decryption.

Since:
HAL_MODULE_HDCP 1.0

Data Fields

uint32_t iv_size
unsigned char * iv

Field Documentation

The IV(Initialization Vector) for block cipher modes of operation

The size of IV

struct hal_hdcp_custom_command_s

The structure type of the HDCP HAL custom command.

Since:
HAL_MODULE_HDCP 1.0

Data Fields

const char * name
void * value

Field Documentation

The name of custom command

The value of custom command

struct hal_hdcp_batch_command_control

The structure type of batch command.

Since:
HAL_MODULE_HDCP 1.0

Data Fields

uint64_t command_set_flag
hal_hdcp_custom_command_s custom

Field Documentation

flag for updating commands

struct hal_hdcp_message

The structure type of the HDCP message.

Since:
HAL_MODULE_HDCP 1.0

Data Fields

hal_hdcp_message_type_e type
hal_hdcp_error_e error_code

Field Documentation

struct _hal_backend_hdcp_funcs

The structure type of the HDCP HAL functions.

Since:
HAL_MODULE_HDCP 1.0

Data Fields

int(* init )(void **hdcp_handle)
int(* deinit )(void *hdcp_handle)
int(* open )(void *hdcp_handle, hal_hdcp_device_type_e type, hal_hdcp_protocol_version_e version)
int(* close )(void *hdcp_handle)
int(* start_receiver )(void *hdcp_handle, uint32_t socket_port, uint32_t *hdcp_id)
int(* stop_receiver )(void *hdcp_handle, uint32_t hdcp_id)
int(* start_transmitter )(void *hdcp_handle, const char *socket_ip, uint32_t socket_port, uint32_t *hdcp_id)
int(* stop_transmitter )(void *hdcp_handle, uint32_t hdcp_id)
int(* allocate_output_buffer )(void *hdcp_handle, uint32_t size, bool is_secure, hal_hdcp_buffer_s **buffer)
int(* release_output_buffer )(void *hdcp_handle, hal_hdcp_buffer_s *buffer)
int(* decrypt )(void *hdcp_handle, hal_hdcp_buffer_s *input, hal_hdcp_crypto_info_s *decrypt_info, hal_hdcp_buffer_s *output)
int(* encrypt )(void *hdcp_handle, hal_hdcp_buffer_s *input, uint32_t hdcp_id, hal_hdcp_crypto_info_s *encrypt_info, hal_hdcp_buffer_s *output)
int(* set_command )(void *hdcp_handle, hal_hdcp_command_e command, void *value)
int(* get_command )(void *hdcp_handle, hal_hdcp_command_e command, void **value)
int(* set_batch_command )(void *hdcp_handle, hal_hdcp_batch_command_control_s *batch_command, hal_hdcp_command_e *error_command)

Field Documentation

int(* _hal_backend_hdcp_funcs::allocate_output_buffer)(void *hdcp_handle, uint32_t size, bool is_secure, hal_hdcp_buffer_s **buffer)

Allocates hdcp output buffer

int(* _hal_backend_hdcp_funcs::close)(void *hdcp_handle)

Closes HDCP

int(* _hal_backend_hdcp_funcs::decrypt)(void *hdcp_handle, hal_hdcp_buffer_s *input, hal_hdcp_crypto_info_s *decrypt_info, hal_hdcp_buffer_s *output)

Decrypts HDCP data

int(* _hal_backend_hdcp_funcs::deinit)(void *hdcp_handle)

Deinitializes HDCP HAL backend handle

int(* _hal_backend_hdcp_funcs::encrypt)(void *hdcp_handle, hal_hdcp_buffer_s *input, uint32_t hdcp_id, hal_hdcp_crypto_info_s *encrypt_info, hal_hdcp_buffer_s *output)

Encrypts HDCP data

int(* _hal_backend_hdcp_funcs::get_command)(void *hdcp_handle, hal_hdcp_command_e command, void **value)

Gets the current value of command

int(* _hal_backend_hdcp_funcs::init)(void **hdcp_handle)

Initializes HDCP HAL backend handle

Opens HDCP

Releases hdcp output buffer

int(* _hal_backend_hdcp_funcs::set_batch_command)(void *hdcp_handle, hal_hdcp_batch_command_control_s *batch_command, hal_hdcp_command_e *error_command)

Sets a set of commands

int(* _hal_backend_hdcp_funcs::set_command)(void *hdcp_handle, hal_hdcp_command_e command, void *value)

Sets the various command and value

int(* _hal_backend_hdcp_funcs::start_receiver)(void *hdcp_handle, uint32_t socket_port, uint32_t *hdcp_id)

Starts HDCP receiver

int(* _hal_backend_hdcp_funcs::start_transmitter)(void *hdcp_handle, const char *socket_ip, uint32_t socket_port, uint32_t *hdcp_id)

Starts HDCP transmitter

int(* _hal_backend_hdcp_funcs::stop_receiver)(void *hdcp_handle, uint32_t hdcp_id)

Stops HDCP receiver

int(* _hal_backend_hdcp_funcs::stop_transmitter)(void *hdcp_handle, uint32_t hdcp_id)

Stops HDCP transmitter


Typedef Documentation

The structure type of the HDCP HAL functions.

Since:
HAL_MODULE_HDCP 1.0

The structure type of batch command.

Since:
HAL_MODULE_HDCP 1.0

Enumeration for the HDCP command.

Since:
HAL_MODULE_HDCP 1.0

Enumeration for the HDCP error.

Since:
HAL_MODULE_HDCP 1.0
typedef hal_hdcp_error_e(* hal_hdcp_message_cb)(hal_hdcp_message_s *message, void *user_data)

Callback function for notification from HDCP HAL.

Since:
HAL_MODULE_HDCP 1.0
Parameters:
[in]messageThe message from HDCP HAL
[in]user_dataThe user data for callback
See also:
hal_hdcp_add_message_callback()
hal_hdcp_remove_message_callback()

The structure type of the HDCP message.

Since:
HAL_MODULE_HDCP 1.0

Enumeration for the HDCP message type.

Since:
HAL_MODULE_HDCP 1.0

Enumeration for the HDCP state.

Since:
HAL_MODULE_HDCP 1.0

Enumeration Type Documentation

Enumeration for the HDCP command.

Since:
HAL_MODULE_HDCP 1.0
Enumerator:
HAL_HDCP_COMMAND_BASE 

Base of command

HAL_HDCP_COMMAND_CUSTOM 

Custom

HDCP device type.

Since:
HAL_MODULE_HDCP 1.0
Enumerator:
HAL_HDCP_DEVICE_RECEIVER 

Receiver

HAL_HDCP_DEVICE_TRANSMIT 

Transmitter

HAL_HDCP_DEVICE_TRANSMIT_MULTISINK 

Transmitter with multi sink

Enumeration for the HDCP error.

Since:
HAL_MODULE_HDCP 1.0
Enumerator:
HAL_HDCP_ERROR_NONE 

Error none

HAL_HDCP_ERROR_NOT_SUPPORTED 

Not supported

HAL_HDCP_ERROR_INVALID_PARAMETER 

Invalid parameter

HAL_HDCP_ERROR_INVALID_STATE 

Invalid state

HAL_HDCP_ERROR_OUT_OF_MEMORY 

Out of memory

HAL_HDCP_ERROR_INTERNAL 

Internal

HAL_HDCP_ERROR_NOT_IMPLEMENTED 

Not implemented

HAL_HDCP_ERROR_UNKNOWN 

Unknown

Enumeration for the HDCP message type.

Since:
HAL_MODULE_HDCP 1.0
Enumerator:
HAL_HDCP_MESSAGE_TYPE_ERROR 

The error

HDCP protocol version.

Since:
HAL_MODULE_HDCP 1.0
Enumerator:
HAL_HDCP_VERSION_2_0 

HDCP version 2.0

HAL_HDCP_VERSION_2_1 

HDCP version 2.1

HAL_HDCP_VERSION_2_2 

HDCP version 2.2

Enumeration for the HDCP state.

Since:
HAL_MODULE_HDCP 1.0
Enumerator:
HAL_HDCP_STATE_NONE 

None state

HAL_HDCP_STATE_INITIALIZED 

Initialized state for HDCP device

HAL_HDCP_STATE_OPENED 

Opened state for HDCP device