📄 wmdrmndcoreapi.h
字号:
/* * * Copyright (c) Sigma Designs, Inc. 2005. All rights reserved. * */#ifndef __WMDRMNDCOREAPI_H__#define __WMDRMNDCOREAPI_H__#include "rmdef/rmdef.h"#include "rmupnp/rmlibwmdrmnd/include/ms_cardea_types.h"/* WMDRM errors *//* The DMR's certificate is corrupted or its signature cannot be verified. */#define DRM_INVALID_CERTIFICATE 100/* A hash of the DMR's certificate is listed in the transmitter's Certificate * Revocation List. */#define DRM_CERTIFICATE_REVOKED 101/* The DMR must be approved before it can execute the intended operation. */#define DRM_MUST_APPROVE 102/* The transmitter does not hold a license for the requested action. */#define DRM_LICENSE_UNAVAILABLE 103/* The transmitter encountered a generic failure. */#define DRM_TRANSMITTER_FAILURE 104/* The transmitter cannot execute the requested action because the number of * devices in use has already reached the maximum permitted. */#define DRM_DEVICE_LIMIT_REACHED 105/* The proximity detection procedure could not determine that the DMR is near * the transmitter. */#define DRM_UNABLE_TO_VERIFY_PROXIMITY 106/* The DMR must be registered before it can execute the intended operation. */#define DRM_MUST_REGISTER 107/* The DMR must be revalidated before it can execute the intended operation. */#define DRM_MUST_REVALIDATE 108/* The DMR has responded to the proximity challenge message incorrectly. */#define DRM_INVALID_PROXIMITY_RESPONSE 109/* The session is no longer available. */#define DRM_INVALID_SESSION 110/* The transmitter cannot open the requested file. */#define DRM_UNABLE_TO_OPEN_FILE 111/* The request received by the transmitter is based on an unsupported protocol * version. */#define DRM_UNSUPPORTED_PROTOCOL_VERSION 112/* The format of the request is not valid. */#define DRM_BAD_REQUEST 113/* Private structure, opaque */struct ms_url_context_s; /** * Extended analog video protection */#define MAX_ANALOG_OPL_SIZE 4096struct cardea_extended_analog_video_core_s { RMuint8 guid[16]; RMuint32 size; RMuint8 data[0];};/** * Ouput protection level */struct cardea_opl_core_s { RMuint32 min_digital_uncompressed_video; RMuint32 min_digital_uncompressed_audio; RMuint32 min_analog_video; RMuint32 min_digital_compressed_video; RMuint32 min_digital_compressed_audio;};/** * Upload a cardea certificate to the xtask * * @param certificate - pointer to a cardea certificate * @param certificate_size - size in bytes of the certificate * @return RM_OK on success **/RMstatus cardea_certificate_core(RMuint8 *certificate, RMint32 certificate_size);RMstatus init_receiver( void );/** * Create an initial context for wmdrmnet. * * The proximity context holds all state describing a receiver's progress in * the proximity detection algorithm. Such state is held in a context to allow * the algorithm to be executed simulataneously with multiple receivers. * * @return NULL on error */wmdrmnet_context * init_wmdrmnet_context(void);/** * The destroy_wmdrmnet_context routine frees a proximity context. * * @param drm_context - Specifies the context to free * @return None */void destroy_wmdrmnet_context( wmdrmnet_context *drm_context);/** * Get registration message for a given drm context. The message should not be * modified by the caller. * * @param drm_context - drm context associated with the server * @param message - where the message is returned * @param message_size - message size returned * @return RM_OK on success, RM_ERROR else */RMstatus get_registration_message( wmdrmnet_context *drm_context, RMuint8 **message, RMuint32 *message_size);/** * Process the response from a registration request * * @param drm_context - drm context associated with the server * @param message - answer message received * @param message_size - message size * @return RM_OK on success */RMstatus process_registration_response( wmdrmnet_context *drm_context, RMuint8 *message, RMuint32 message_size);/** * Get proximity address for sending data * * @param drm_context - drm context associated with the server * @param address - address and port for the proximity detection * @return RM_OK on success, RM_ERROR else */RMstatus get_proximity_address( wmdrmnet_context *drm_context, RMascii **address);/** * Process the proximity message received, and returns the message to send. * * @param drm_context - drm context associated with the server * @param received - message received (should be NULL when starting) * @param received_size - (0 when starting) * @param response - response to send back to the server * @param response_size - response size * @return RM_OK on succes (the proximity is over and is a success), * RM_ERROR on error (the proximity failed), * RM_PENDING when a new message needs to be sent. */RMstatus process_proximity( wmdrmnet_context *drm_context, RMuint8 *received, RMuint32 received_size, RMuint8 **response, RMuint32 *response_size);/** * Get license request message * * @param drm_context - drm context associated with the server * @param message - where the message is returned * @param message_size - message size returned * @return RM_OK on success, RM_ERROR else */RMstatus get_license_request_message( wmdrmnet_context *drm_context, RMuint32 url_hash, RMuint8 **message, RMuint32 *message_size);/** * Proceess a license response * * @param drm_context - drm context associated with the server * @param license - where the message is returned * @param license_size - message size returned * @return RM_OK on success, RM_ERROR else */RMstatus process_license( wmdrmnet_context *drm_context, RMuint8 *license, RMuint32 license_size, RMuint8 *content_url, RMuint32 url_size);/** * Init CARDEA hardware decryption * * @param drm_context - drm_context to use * @return RM_OK on success */RMstatus init_cardea_core( wmdrmnet_context *drm_context);/** * Terminate CARDEA hardware decryption * * @return RM_OK on success */RMstatus term_cardea_core(void);#if (EM86XX_CHIP==EM86XX_CHIPID_TANGO2)/** * Decrypt CARDEA encrypted data, in place * * @param drm_context - drm context associated with the server * @param sample_id - pointer to the sample ID to use, should be 8 bytes * @param data - pointer to the encrypted data * @param size - size of encrypted data, in bytes * @param byte_count - byte count in the current media object * @return RM_OK on success */RMstatus decrypt_cardea_sample_core( wmdrmnet_context *drm_context, RMuint8 *sample_id, RMuint32 data_phys, RMuint8 *data_virt, RMuint32 size, RMuint32 byte_count, RMuint32 url_hash);#elseRMstatus decrypt_cardea_sample_core( wmdrmnet_context *drm_context, RMuint8 *sample_id, RMuint8 *data, RMuint32 size, RMuint32 byte_count, RMuint32 url_hash);#endif/** * Get the output protection level for a given drm context * * @param drm_context - drm context associated with the server * @param opl - pointer to the structure that should be * filled with the output protection level data * @return RM_OK on success */RMstatus get_cardea_opl_core( wmdrmnet_context *drm_context, RMuint32 url_hash, struct cardea_opl_core_s *opl);/** * Get the analog output protection level for a given drm context * * @param drm_context - drm context associated with the server * @param analog_opl - pointer to the structure that should be * filled with variable length analog output protection level structures * @param analog_opl_size - input - pointer to uint32 containing maximum analog opl buffer size * output - uint32 updated with actual analog opl size * @param analog_opl_count - input - pointer to uint32 * output - uint32 updated with number of analog opl structures returned * @return RM_OK on success */RMstatus get_cardea_analog_opl_core( wmdrmnet_context *drm_context, RMuint32 url_hash, struct cardea_extended_analog_video_core_s *analog_opl, RMuint32 *analog_opl_size, RMuint32 *analog_opl_count );RMstatus destroy_url_license( wmdrmnet_context *drm_context, RMuint32 url_hash); #endif /* __WMDRMNDCOREAPI_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -