📄 ms_cardea.h
字号:
/* * * Copyright (c) Sigma Designs, Inc. 2005. All rights reserved. * */#ifndef __MS_CARDEA_H__#define __MS_CARDEA_H__#include "rmdef/rmdef.h"#include "rmcci/include/output_cci.h"#include "ms_cardea_types.h" // Per: "Compliance Rules for WMDRM 10 Network Devices Applications 9-01-05"#define CARDEA_OPL_UNPROTECTED_UNCOMPRESSED_DIGITAL_VIDEO 100 // All video outputs#define CARDEA_OPL_PROTECTED_UNCOMPRESSED_DIGITAL_VIDEO 300 // HDCP enabled video outputs#define CARDEA_OPL_UNPROTECTED_UNCOMPRESSED_DIGITAL_AUDIO 149 // All audio outputs#define CARDEA_OPL_PROTECTED_1_UNCOMPRESSED_DIGITAL_AUDIO 200 // All audio outputs via secure drivers#define CARDEA_OPL_PROTECTED_2_UNCOMPRESSED_DIGITAL_AUDIO 300 // Analog/USB audio outputs only#define CARDEA_OPL_UNPROTECTED_COMPRESSED_DIGITAL_VIDEO 100#define CARDEA_OPL_PROTECTED_COMPRESSED_DIGITAL_VIDEO 300 // HDCP enabled video outputs#define CARDEA_OPL_UNPROTECTED_COMPRESSED_DIGITAL_AUDIO 100 // All audio outputs#define CARDEA_OPL_PROTECTED_1_COMPRESSED_DIGITAL_AUDIO 200 // All audio outputs via secure drivers#define CARDEA_OPL_PROTECTED_2_COMPRESSED_DIGITAL_AUDIO 300 // Analog/USB audio outputs only#define CARDEA_OPL_UNPROTECTED_ANALOG_VIDEO 100#define CARDEA_OPL_PROTECTED_ANALOG_VIDEO 200 // CGMS-A = 11b/** * Extended analog video protection */struct cardea_extended_analog_video_s { RMuint8 guid[16]; RMuint32 size; RMuint8 data[0];};/** * Ouput protection level */struct cardea_opl_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;};/** * Initialize CARDEA for a given URL * * This function tries to get the CARDEA session associated with the URL. If no * session is opened for this URL, it returns -1 * * @param url - url for which a session header is required * @return -1 if no session header is available */RMint32 init_cardea(const RMascii *url);/** * Release CARDEA session * * Releases a session previously allocated via init_cardea() * * @param cardea_context - value returned by init_cardea() * @return RM_OK on success * RM_ERROR otherwise */RMstatus release_cardea(void *);/** * Initialize Cardea URL * * This creates a cardea url context as part of a upnp device and populates * it with a session header * * @param ms_upnp - the server device that the url is obtained from * @param url - the url that will be associated with this context * @param session_header - a pointer to the session header, parsed out of a license request * @return NULL on error */void * init_cardea_url(struct ms_upnp_extension_s *ms_upnp, RMascii *url, RMascii *session_header);/* * Destroy a url context * * This deallocates the url context and all of the memory it owns. * * @param url_ctx - the pointer to the context to destroy * @return RM_OK on success * RM_ERROR on failure */RMstatus destroy_url_context(void *url_ctx);/* * Find cardea url context * * When given the passed url a pointer to the associated url context is * returned, or NULL if the context is not found. * * @param url - the url to search for * @return pointer to the url context on success, NULL otherwise * */void * find_cardea_url(RMascii *url);/* * Find cardea url device * * When given the passed url a pointer to the associated ms_upnp device * for that url is returned, or NULL if the context is not found. * * @param url - the url to search for * @return pointer to the upnp device on success, NULL otherwise * */void * find_cardea_device(RMascii *url);/* * should decrypt * * returns the truth value for the presence of a license for playback. * If a license is present, then the media needs packets to be decrypted, * if there is no license then no packets need to be decrypted * * @param cardea_url - the url context * @return TRUE if packets need to be decrypted, FALSE otherwise * */RMbool should_decrypt(void *cardea_url);/** * Terminate CARDEA * * This function handles the termination all CARDEA services * * @return RM_OK on success */RMstatus term_cardea(void);/** * Update the sample ID for a particuler stream and media object * * @param cardea_context - the context to update * @param stream_index - current stream index * @param media_object_number - current media object number * @param sample_id - pointer to the sample ID data * @param sample_id_size - size of the sample id (should be 8) */void update_cardea_sample_id( void * cardea_context, RMuint16 stream_index, RMuint32 media_object_number, RMuint8 *sample_id, RMuint32 sample_id_size);#if (EM86XX_CHIP==EM86XX_CHIPID_TANGO2) /** * Decrypt cardea encrypted data (in place) * * @param cardea_context - the current cardea context * @param stream_index - current stream index * @param media_object_number - current media object number * @param buf - pointer to the data to decrypt * @param size - size of the data to decrypt * @return RM_OK on success * */RMstatus decrypt_cardea_sample( void * cardea_context, RMuint16 stream_index, RMuint32 media_object_number, RMuint32 buf_phys, RMuint8 *buf, RMuint32 size);#elseRMstatus decrypt_cardea_sample( void * cardea_context, RMuint16 stream_index, RMuint32 media_object_number, RMuint8 *buf, RMuint32 size);#endif /* TANGO2 *//** * Get the session ID header for a given URL * * This function tries to get the session header associated with a URL. If no * MS DRM session header is required, or if a license has not been obtained, * this function will return NUL. * * @param url - url for which a session header is required * @return NULL if no session header is available */RMascii * get_ms_session_header(const RMascii *url);/** * Get the output protection level for a given cardea context * * @param cardea_context - the current cardea context * @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( void * cardea_context, struct cardea_opl_s *opl);/** * Get the extended analog output protection level for a given cardea context * * @param cardea_context - the current cardea context * @param analog_opl - buffer to receive array of variable length analog opl structures * @param analog_opl_size - input - pointer to uint32 containing maximum buffer size, * output - uint32 updated with actual buffer size for analog opl data * @param analog_opl_count input - pointer to uint32 output - uint32 updated with #of analog opl structures returned * @return RM_OK on success */RMstatus get_cardea_analog_opl( void * cardea_context, struct cardea_extended_analog_video_s *analog_opl, RMuint32 *analog_opl_size, RMuint32 *analog_opl_count);/** * Get copy control information for a given cardea context. * * Converts the cardea license restrictions into a rmcci structure. * * @param cardea_context - the current cardea context * @param cci_info - pointer to the structure that should be * filled with copy control information. * @return RM_OK on success*/RMstatus get_cardea_cci( void * cardea_context, struct rmcci *cci_info );/** * Load Cardea xtask and certificate * * Loads the cardea xtask, starts it, and uploads the device certificate. * * @param certificate - A pointer to the certificate for this device * @param size - size in bytes of the certificate * @return RM_OK on success * */RMstatus load_cardea(RMuint8 *certificate, RMint32 size);/** * destroy cardea license information * * Destroys xtask side information associated with the current url context * call this method before destroying a url context. * * @param cardea_context - the current cardea context * @return RM_OK on success * */RMstatus destroy_cardea_license_data(void *cardea_context); #endif /* __MS_CARDEA_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -