[Previous] [Contents] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

Media API Calls

The phplay plugins have four entry points. These include MvInit(), and three "calls" pointers:

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 );

Note: A specific callback handler example is provided in the documentation for each plugin.

Before calling MvInit(), you have to:

  1. 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.
  2. 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] [Contents] [Next]