Callback function prototype.
typedef int (__stdcall * TCallbackFunc)(void* instance, void *user_data, TCallbackMessage message, unsigned int param1, unsigned int param2);
Parameters |
Description |
instance |
interface instance. Use cast from void pointer to ZPlay instance or ZPLAY_HANDLE. |
user_data |
User data specified by SetCallbackFunc. |
message | |
param1 |
First message parameter. Specifies additional message-specific information. |
param2 |
Second message parameter. Specifies additional message-specific information. |
Return value depends on message parameter.
See TCallbackMessage for return value of each message.
This is prototype for callback function.
Use SetCallbackFunc or zplay_SetCallbackFunc to enable callback mechanism.
There are 2 types of messages. Sync (blocking) and async (non blocking) messages.
Sync message is sent from decoding thread and thread is waiting until callback function returns, so thread is blocked until user process sync message. Return value from sync message can be used to control decoding thread.
Note: DON'T CALL other interface function from sync message because this will block decoding thread and calling thread.
Async message is sent from another thread and this message is not blocking, decoding thread continues to play. Return value from async message is not used.
Copyright (c) 2010. Zoran Cindori - All rights reserved.
Web: http://libzplay.sourceforge.net/ Email: zcindori@inet.hr |