PM123 Output Plug-ins

Decoder plug-ins must implement and export the functions defined in output_plug.h.

     ULONG DLLENTRY output_init  ( void **a )
     ULONG DLLENTRY output_uninit( void  *a )

Init function is called when the user requests the use of your output plug-in. So only one output plug-in is active at any given time. It should initialize the control variables for an eventual call to OUTPUT_OPEN. decoder_uninit is called when another output plug-in is request by the user and should free the allocated memory for a.

     ULONG DLLENTRY output_command( void *a, ULONG msg, OUTPUT_PARAMS *info )

There is a lot of commands to implement for this function. Parameters needed for each of them are described in the definition of the structure in the .h file.

The output plug-in MUST WinPostMsg() the following messages to hwnd:

     ULONG DLLENTRY output_playing_samples( void* a, FORMAT_INFO* info,
                                            char* buf, int len )

This function is used by visual plug-ins so the user can visualize what is currently being played. len is usually not so big, so check that amount usually required by your visual plug-ins before making complicated buffering functions in your output plug-in.

     int DLLENTRY output_play_samples( void* a, FORMAT_INFO* format, 
                                       char* buf,int len, int posmarker )

This function is called by the decoder or last in chain filter plug-in to play samples.

     ULONG DLLENTRY output_playing_pos( void* a )
This function returns the posmarker from the buffer that the user currently hears.
     BOOL  DLLENTRY output_playing_data( void* a )
Returns TRUE if the output plug-in still has some buffers to play.