8.2.1.4 Using SecureENCODE callback structures


   Using SecureENCODE callback structures


During the SecureENCODING process, the engine calls back a function through the function pointer _sd_sdk_secure_callback_function


Header file:        

SecureEncodeSDK.h


Type:                

pf_secure_encode_sdk_event_cb


TypeDef:                

typedef const SD_SDK_SECURE_ENCODE_RETURN_ID (__stdcall *pf_secure_encode_sdk_event_cb)(_SD_SDK_SECURE_ENCODE_CALLBACK_EVENT _cb_sdk_event, void *p_sd_sdk_user_data);



The SecureENCODE Callback Structure and its data members:


1
2
3
4
5
6
7
8
typedef struct _CB_SD_SDK_SECURE_ENCODE_EVENT_TYPE
{
        SD_SDK_SECURE_ENCODE_EVENT_ID even_param_ID;
        uint32_t event_param_type;
        double   dbl_operation_progress_indicator;
        uint32_t uint_main_progress_indicator;
}
_SD_SDK_SECURE_ENCODE_CALLBACK_EVENT, *P__SD_SDK_SECURE_ENCODE_CALLBACK_EVENT;


Using this Callback Structure, SecureDELTA engines return special event IDs along with progress indicators or other string information.


Type SD_SDK_SECURE_ENCODE_EVENT_ID is also defined in the same file as (see below) and represents different stages of SecureENCODING action:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
typedef enum
{
	SD_SDK_ENCODE_SD_ENGINE_ERROR_MEMORY_INIT_NONE_ = 0x0000,
	SD_SDK_ENCODE_XTREME_ENGINE_ERROR_MEMORY_INIT_NONE_ = 0x0001,

	SD_SDK_ENCODE_XTREME_ENGINE_ERROR_OPERATION_CANCELED_ = 0x0003,
	SD_SDK_ENCODE_SD_ENGINE_ERROR_OPERATION_CANCELED_ = 0x0004,

	// File Errors
	SD_SDK_ENCODE_ENGINE_INVALID_FILE_SIZE = 0xE000,
	SD_SDK_ENCODE_ENGINE_COULD_NOT_OPEN_FILE = 0xE001,

	SD_SDK_ENCODE_XTREME_ENGINE_INVALID_FILE_SIZE = 0xE010,
	SD_SDK_ENCODE_XTREME_ENGINE_COULD_NOT_OPEN_FILE = 0xE011,

	// Dictionary Errors
	SD_SDK_ENCODE_ENGINE_START_CRC_CHECK = 0xE100,
	SD_SDK_ENCODE_XTREME_ENGINE_START_CRC_CHECK = 0xE110,

	// Dictionary Errors
	SD_SDK_ENCODE_ENGINE_WRITE_HEADER = 0xE200,
	SD_SDK_ENCODE_ENGINE_UPDAT_HEADER = 0xE210,

	SD_SDK_ENCODE_XTREME_ENGINE_WRITE_HEADER = 0xE220,
	SD_SDK_ENCODE_XTREME_ENGINE_UPDAT_HEADER = 0xE221,

	// Dictionary Errors
	SD_SDK_ENCODE_ENGINE_START_LOAD_DICT = 0xE300,
	SD_SDK_ENCODE_ENGINE_LOAD_DICT_PERCENT = 0xE301,
	SD_SDK_ENCODE_ENGINE_STARTED_DONE_LOAD_DICT_NO_ERROR = 0xE312,
	SD_SDK_ENCODE_ENGINE_STARTED_DONE_LOAD_DICT_ERROR_NOT_ENOUGH_MEM = 0xE313,

	SD_SDK_ENCODE_XTREME_ENGINE_START_LOAD_DICT = 0xE320,
	SD_SDK_ENCODE_XTREME_ENGINE_LOAD_DICT_PERCENT = 0xE321,
	SD_SDK_ENCODE_XTREME_ENGINE_STARTED_DONE_LOAD_DICT_NO_ERROR = 0xE332,
	SD_SDK_ENCODE_XTREME_ENGINE_STARTED_DONE_LOAD_DICT_ERROR_NOT_ENOUGH_MEM = 0xE333,

	// Performing SecureENCODE using SecureDELTA Engine
	SD_SDK_ENCODE_ENGINE_START_DELTA = 0xD400,
	SD_SDK_ENCODE_ENGINE_DELTA_PERCENT = 0xD401,
	SD_SDK_ENCODE_ENGINE_DELTA_FINALIZING = 0xD402,
	SD_SDK_ENCODE_ENGINE_DELTA_NO_ERROR = 0xD403,
	SD_SDK_ENCODE_ENGINE_DELTA_CLOSING_ARCHIVE = 0xD404,
	SD_SDK_ENCODE_ENGINE_DELTA_AT_END = 0xD405,
	SD_SDK_ENCODE_ENGINE_DELTA_ERROR = 0xD406,

	// Performing SecureENCODE using XtremeDELTA Engine
	SD_SDK_ENCODE_XTREME_ENGINE_START_DELTA = 0xD500,
	SD_SDK_ENCODE_XTREME_ENGINE_DELTA_PERCENT = 0xD501,
	SD_SDK_ENCODE_XTREME_ENGINE_DELTA_FINALIZING = 0xD502,
	SD_SDK_ENCODE_XTREME_ENGINE_DELTA_NO_ERROR = 0xD503,
	SD_SDK_ENCODE_XTREME_ENGINE_DELTA_CLOSING_ARCHIVE = 0xD504,
	SD_SDK_ENCODE_XTREME_ENGINE_DELTA_AT_END = 0xD505,
	SD_SDK_ENCODE_XTREME_ENGINE_DELTA_ERROR = 0xD506
}
SD_SDK_SECURE_ENCODE_EVENT_ID;