📄 bluraycps_callbacks.h
字号:
/* * * Copyright (c) Sigma Designs, Inc. 2006. All rights reserved. * */#ifndef __BLURAYCPS_CALLBACKS_H__#define __BLURAYCPS_CALLBACKS_H__#include "rmdef/rmdef.h"/** Callbacks function type definitions **//** * BD+ application layer callback * * @param ctx - context from application * @param resource - resource to access * 0 : app layer register 0 * 1 : app layer register 1 * 2 : app layer register 2 * @param direction - direction in which data transfer takes place * 0 : from app to BD+ * 1 : BD+ to app * @param data_ptr * @param len */typedef RMstatus (*cps_bdp_app_layer_callback_t) (void *ctx, RMuint32 resource, RMuint32 direction, RMuint32 *data_ptr);/** * BD+ getclock callback * * @param ctx - context from application * @param clock - clock value as defined in BD+, Annex C, Table C-4 */typedef RMstatus (*cps_bdp_getclock_callback_t) (void *ctx, RMuint32 clock[3]);/** * BD+ getportinfo callback * * @param ctx - context from application * @param portIndex - Index of port * @param portInfo - port information as defined by BD+ 3.2.2.4.2 and Annex C, Table C-5 */typedef RMstatus (*cps_bdp_getportinfo_callback_t) (void *ctx, RMuint32 portIndex, RMuint32 portInfo[32]);/** * BD+ discoveryRAM callbacks * * @param ctx - context from application * @param addr - address to read in the player memory space * @param dstptr - data buffer address * @param len - size to read */typedef RMstatus (*cps_bdp_discoveryram_callback_t) (void *ctx, RMuint32 addr, RMuint8 *dstptr, RMuint32 len);/** * BD+ RunNative callback : Run native code. * * @param ctx - context from application * @param code - buffer containing the native code * @param len - size of the code * @param mode - (0=New code, 1=Use Existing) * * When called this callback execute the native code buffer. * The code is already authentified and cached by the library. * */typedef RMstatus (*cps_bdp_runnative_callback_t) (void *ctx, RMuint8 *code, RMint32 len, RMuint32 mode);/** * Drive Packet Command callback : send a packet command to the drive * * @param ctx - context from application * @param command - packet command (struct is defined in rmdef) */typedef RMstatus (*cps_packetcommand_callback_t) (void *ctx, RMpacketCommand *cmd);/** * Drive read file callback : read the content of a file on the disc * * @param ctx - context from application * @param filename - filename * @param offset - read offset in file * @param buffer - destination buffer * @param size - max size to read, updated with actual read size * */typedef RMstatus (*cps_file_read_callback_t) (void *ctx, const RMascii *filename, RMuint64 offset, RMuint8 *buffer, RMuint32 *size);/** * Drive file size callback : return the size of a file on the disc * * @param ctx - context from application * @param filename - filename * @param size - updated with actual read size * */typedef RMstatus (*cps_file_size_callback_t) (void *ctx, const RMascii *filename, RMuint64 *size);/** * File logical address callback: return the logical address of the start * of a file on the disc. * * @param ctx - context from application (see aacs_open) * @param filename - name of the file * @param pLogicalAddress - return parameter for logical address. Must not * be NULL * @return RM_OK on success */typedef RMstatus (*cps_file_logical_address_callback_t) (void *ctx, const RMascii *filename, RMuint32 *pLogicalAddress);/** * Non Volatile Storage read callback : read the content of a NVS file * * @param ctx - context from application * @param filename - filename * @param buffer - destination buffer * @param size - in:max read size, out: actual read size */typedef RMstatus (*cps_nvs_read_callback_t) (void *ctx, const RMascii *filename, RMuint8 *buffer, RMuint32 *size, RMuint32 offset);/** * Non Volatile Storage write callback : write the content of a NVS file * * @param ctx - context from application * @param filename - filename * @param buffer - destination buffer * @param size - in:write size, out: actual write size */typedef RMstatus (*cps_nvs_write_callback_t) (void *ctx, const RMascii *filename, RMuint8 *buffer, RMuint32 *size, RMuint32 offset);/** * Lock the semaphore controlling access to the INTRP_Q * * @param ctx - context from application */typedef RMstatus (*cps_bdp_lock_q_t) (void *ctx);/** * Unlock the semaphore controlling access to the INTRP_Q * * @param ctx - context from application */typedef RMstatus (*cps_bdp_unlock_q_t) (void *ctx);/** * Lock the semaphore controlling access to the VM * * @param ctx - context from application */typedef RMstatus (*cps_bdp_lock_vm_t) (void *ctx);/** * Unlock the semaphore controlling access to the VM * * @param ctx - context from application */typedef RMstatus (*cps_bdp_unlock_vm_t) (void *ctx);/** * Sleep the VM Background thread. * */typedef void (*cps_bdp_sleep_vm_t) (void *ctx);/** * Callback structure definition */struct cps_callbacks_s { /* Drive / Filesystem callbacks */ cps_packetcommand_callback_t packetcommand_callback; cps_file_read_callback_t file_read_callback; cps_file_size_callback_t file_size_callback; cps_file_logical_address_callback_t file_lba_callback; /* Non Volatile Storage Callbacks */ cps_nvs_read_callback_t nvs_read_callback; cps_nvs_write_callback_t nvs_write_callback; /* BD+ Callbacks */ cps_bdp_app_layer_callback_t bdp_app_layer_callback; cps_bdp_getclock_callback_t bdp_getclock_callback; cps_bdp_getportinfo_callback_t bdp_getportinfo_callback; cps_bdp_discoveryram_callback_t bdp_discoveryram_callback; cps_bdp_runnative_callback_t bdp_runnative_callback; cps_bdp_lock_q_t bdp_lock_q_callback; cps_bdp_unlock_q_t bdp_unlock_q_callback; cps_bdp_sleep_vm_t bdp_sleep_vm_callback; cps_bdp_lock_vm_t bdp_lock_vm_callback; cps_bdp_unlock_vm_t bdp_unlock_vm_callback; };#endif /* __BLURAYCPS_CALLBACKS_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -