Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
Media API Calls
The phplay plugins have four entry points. These include MvInit(), and three "calls" pointers:
- command()
- get_item()
- terminate()
MvInit() passes back function pointers to these in the calls structure of the MvPluginCtrl_t structure as part of the MvInit() function.
MvInit()
MvInit() initializes the plugin after it's been loaded.
typedef int MvInitF_t( MvPluginCtrl_t * pctrl ); extern MvInitF_t MvInit;
The plugins generate events for the player. To do this, the media player has to set the MvPluginCtrl_t->MvViewerCallbackF_t member variable cb.
/*implemented in phplay*/
typedef void MvViewerCallbackF_t(
MvPluginCtrl_t *ctrl,
MvEventFlags_t change,
MvPluginStatus_t const *status );
![]() |
A specific callback handler example is provided in the documentation for each plugin. |
Before calling MvInit(), you have to:
- set the following values in the MvPluginCtrl_t structure:
- setup
- Parameters from mpsettings to setup the plugin.
- cb
- Pointer to a function that a plugin calls.
- basewin
- Handle to the phplay base window.
- dll_handle
- Handle of the currently loaded plugin DLL.
- name
- Plugin name.
- APIversion
- Set to MV_API_VERSION.
- MinorVersion
- Set to MV_MINOR_API_VERSION.
- prio
- Process priority of phplay.
- Load the plugin
In the plugin, declare:
static const MvPluginFunctions_t calls =
{
local_terminate, local_get_item, local_command
};
MvInit() assigns values to the MvPluginCtrl_t->MvPluginFunctions_t member variable calls. This provides the media player with the function pointers below:
struct MvPluginFunctions
{
void (*terminate)( MvPluginCtrl_t *pdata );
MvMediaInfo_t const *(*get_item)( MvPluginCtrl_t *pdata,
MvMediaInfoFlag_t which, unsigned index );
int (*command)( MvCommandData_t * cmdData );
/* MvCommandData includes MvPluginCtrl_t pointer*/
};
A call to MvInit() sets the MvPluginCtrl_t.MvPluginFlags_t pflags value to one of:
- O
- The plugin requires a valid URL to commence processing.
- MV_HASDFLTURL
- The plugin doesn't need a URL string to begin playback. This is the case for the Audio CD player.
- MV_SPANE
- The plugin needs control of the custom GUI pane inside the player to display control widgets.
- MV_SPANE | MV_HASDFLTURL
- These flags can be logically ORed together.
![]() |
![]() |
![]() |

![[Previous]](prev.gif)
![[Contents]](contents.gif)
![[Next]](next.gif)
