PECompact CODEC Plug-ins

CodecCallback API


BOOL WINAPI CodecCallback(DWORD dwAction, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);

Parameters:

dwAction
This is the action being performed. See the table below for more information.

dwParam1
The value of this parameter varies depending on the action. See the table below for more information.

dwParam2
The value of this parameter varies depending on the action. See the table below for more information.

dwParam3
The value of this parameter varies depending on the action. See the table below for more information.

Return Value:

PECompact will return TRUE if the action should continue, or FALSE if it should stop. See the table below for more information.

Remarks:

The table below describes valid action codes and what the dwParam1 and dwParam2 are defined as for each:
 
  PEC2_CODEC_ACTION_ENCODE (1) PEC2_CODEC_ACTION_DONE (0) PEC2_CODEC_ACTION_ERROR (-1)
dwParam1 unsigned integer, last offset into the source data. unsigned integer, original size of the processed data. One of PEC_CODC_ERROR codes:
PEC_CODEC_ERROR_UNSPECIFIED (-1)
PEC_CODEC_ERROR_ABORTED (-2)
dwParam2 unsigned integer, last offset into the destination data. unsigned integer, new size of the processed data undefined
dwParam3 unsigned integer, total size of the source data. undefined undefined
Return value if FALSE, abort. if TRUE, continue. undefined undefined

PEC2_CODEC_ACTION_DONE and PEC2_CODEC_ACTION_ERROR may be called even if PEC2_CODEC_ACTION_ENCODE has never been called. 

Either PEC2_CODEC_ACTION_DONE or PEC2_CODEC_ACTION_ERROR must be called if a callback procedure is available.

The user may defined his or her own action codes as PEC2_CODEC_ACTION_USER_DEFINED (10) or greater.