[Previous] [Contents] [Next]

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

Appendix: MvCommandType Descriptions

This appendix describes the commands that phplay sends to a plugin. The commands are defined in the MvCommandType structure in the <Mv.h> header file.

CMD_PLUGIN_BOOKMARK_GOTO

Jump the playback to a bookmark. (Not implemented yet.)

CMD_PLUGIN_BOOKMARK_SET

Save a given playback time (in milliseconds) for later. (Not implemented yet.)

CMD_PLUGIN_BOOKMARK_VIEW

Obtain, for display, all current bookmarks. (Not implemented yet)

CMD_PLUGIN_CAPTURE_STILL

Capture a still image of the current video image. (Not implemented yet.)

CMD_PLUGIN_CLOSE

Close the plugin (in preparation for a terminate or to start playing a new file).

MvCommandData_t cmdData      = {0};
cmdData.pluginCtrl           = &mplayer.pctrl->mv;
cmdData.cmdType              = CMD_PLUGIN_CLOSE;
cmdData.which                = MVP_NONE;
mplayer.pctrl->mv.calls->command( &cmdData );

CMD_PLUGIN_DIRECT_AUDIO

Tell the plugin to use the SPDIF Preferences->Audio card and device values. This routes the PCM samples through the desired port. Valid state values are 1 (ON) or 0 (OFF).

if( mplayer.pctrl )
{
  cmdData.pluginCtrl           = &mplayer.pctrl->mv;
  cmdData.cmdType              = CMD_PLUGIN_DIRECT_AUDIO;
  cmdData.which                = MVP_DELTA;
  cmdData.param                = &mplayer.playback_parms;
  mplayer.playback_parms.delta = state;
  mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_DISPLAY_GUI

Synchronize the viewer and plugin GUI. (Not implemented yet.)

CMD_PLUGIN_EJECT_DISK

Tell the plugin to eject the disk.

CMD_PLUGIN_ENTER

Tell phplay to extract the number contained in the KeypadNum field of the MvRemoteMsg_t message and play that track number if the plugin that's currently loaded is a multitrack plugin (audiocd command).

CMD_PLUGIN_GET_STATUS

Poll for status information. The get_item() function returns the play list information for the plugin, especially for the Audio CD player because it's a multitrack plugin.

if( mplayer.pctrl )
  {
      cmdData.pluginCtrl           = &mplayer.pctrl->mv;
      cmdData.cmdType              = CMD_PLUGIN_GET_STATUS;
      cmdData.which                = MVP_NONE;
      mplayer.pctrl->mv.calls->command( &cmdData );
  }

CMD_PLUGIN_HOTKEY

Pass a hotkey value into the plugin.

CMD_PLUGIN_KARAOKE_RECORD

Record the mixed karaoke audio stream to disk. (Not implemented yet.)

CMD_PLUGIN_L_R

Not implemented yet.

CMD_PLUGIN_LAST_CHAPTER

Send the previous track command to the plugin that's currently loaded.

CMD_PLUGIN_LOAD_DISK

Close the CD drive door specified by the current phplay "Mount Point" preference.

CMD_PLUGIN_NEXT_CHAPTER

Send the next track command to the plugin that's currently loaded.

CMD_PLUGIN_MUTE

Send a command to the plugin that's currently loaded to mute the audio channel.

if( mplayer.pctrl )
{
    // plugin is loaded, let it deal with the mute on/off command
    MvCommandData_t   cmdData    = {0};
    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_MUTE;
    cmdData.which                = MVP_DELTA;
    mplayer.playback_parms.delta = bState;
    cmdData.param                = &mplayer.playback_parms;
    mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_OPEN_URLS

Tell the plugin what file to start playing. phplay: associates a plugin for the URL contained in the newurl field of the MvRemoteMsg_t message; stops the currently playing URL, if any; and starts playing the new URL if phplay preferences "Plugin Start In Play Mode" is set.

Plugins support URLS of both file:// and http://. phplay uses the MIME type to load the correct plugin, streaming from http:// servers is handled by the plugins.

if( url == NULL && !( mplayer.pctrl->mv.pflags & MV_HASDFLTURL ) )
{
    frame    = "This plugin '%s' need an url";
    errorMsg =  alloca( strlen(frame) + strlen(plugin) );
    sprintf( errorMsg, frame, plugin );
    popup_error( errorMsg );
    return FALSE;
}
else
else
{ // open the url
    MvCommandData_t cmdData = {0};
    ControllerSetActiveTrack( index );
    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_OPEN_URLS;
    cmdData.which                = MVP_DELTA;
    cmdData.urls                 = (char**)&url;
    cmdData.nodeString           = getenv("HOSTNAME");
    cmdData.displayString        = getenv("PHOTON");
    cmdData.param                = &mplayer.playback_parms;
    mplayer.playback_parms.delta = ( url ) ? 1 : 0;
    mplayer.pctrl->mv.calls->command( &cmdData );
    //fprintf(stderr,"in %s ControllerOpenIndex() sent CMD_PLUGIN_OPEN_URLS delta = %d url = %s\n",__FILE__, mplayer.playback_parms.delta, url);
    UpdateActivePlaylistSelection();
}

CMD_PLUGIN_OSD

Send the Home Entertainment toggle to the plugin that's currently loaded.

CMD_PLUGIN_PAUSE

Pause the currently loaded URL. Wait for start command.

cmdData.pluginCtrl           = &mplayer.pctrl->mv;
cmdData.cmdType              = CMD_PLUGIN_PAUSE;
cmdData.which                = MVP_NONE;
mplayer.pctrl->mv.calls->command( &cmdData );

CMD_PLUGIN_PLAY_ALL_FRAMES

Tell the plugin not to skip any video frames to maintain realtime playback. (Not implemented yet.)

CMD_PLUGIN_PLAY_PAUSE

Send a play or pause command to the plugin that's currently loaded.

CMD_PLUGIN_POWER

Tell phplay to terminate and unload the plugin, and then exit.

CMD_PLUGIN_PROGRAM

Not implemented yet.

CMD_PLUGIN_PLAY_REALTIME

Tell the plugin to skip video frames as necessary to playback video in realtime. (Not implemented yet.)

CMD_PLUGIN_RESERVED_0 ... CMD_PLUGIN_RESERVED_9

Reserved.

CMD_PLUGIN_SCAN_BACK

Tell the plugin that's currently loaded to play the video in reverse, skipping frames.

if( mplayer.pctrl )
{
    MvCommandData_t cmdData      = {0};
    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_SCAN_BACK;
    cmdData.which                = MVP_NONE;
    mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_SCAN_FORWARD

Tell the plugin that's currently loaded to play the video in fast forward, skipping frames.

if( mplayer.pctrl )
{
    MvCommandData_t cmdData      = {0};
    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_SCAN_FORWARD;
    cmdData.which                = MVP_NONE;
    mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_SEEK_RELATIVE

Seek to a specified track of a multitrack plugin. See the example in CMD_PLUGIN_START.

CMD_PLUGIN_SEEK_TO

Seek to a specific time (in milliseconds) in the file.

if( mplayer.pctrl )
    {
        PtArg_t         arg;
        long            *value;
        MvCommandData_t cmdData = {0};
        PtSetArg( &arg, Pt_ARG_GAUGE_VALUE, &value, 0 );  //range is in duration 0-? ms
        PtGetResources( ABW_curpos, 1, &arg );
        cmdData.pluginCtrl              = &mplayer.pctrl->mv;
        cmdData.cmdType                 = CMD_PLUGIN_SEEK_TO;
        cmdData.which                   = MVP_DELTA | MVP_POSITION;
        cmdData.param                   = &mplayer.playback_parms;
        mplayer.playback_parms.delta    = 0;
        mplayer.playback_parms.position = *value;
        mplayer.pctrl->mv.calls->command( &cmdData );
    }

CMD_PLUGIN_SEND_MESSAGE

Generic message passing.

//Send a generic user defined message to a plugin
if( mplayer.pctrl )
{
  MvCommandData_t cmdData = {0};
  MvUserMsg_t     msg     = { "hello from phplay", sizeof("hello from phplay") };
    cmdData.pluginCtrl      = &mplayer.pctrl->mv;
  cmdData.cmdType         = CMD_PLUGIN_SEND_MESSAGE;
  cmdData.userMsg         = &msg;
    mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_SET_GUI_STATUS

Tell the plugin how the media player expects to be told of GUI changes (the value of MvRepeatType_t repeatType).

if( mplayer.pctrl )
{
    MvCommandData_t cmdData                     = {0};
    cmdData.pluginCtrl                          = &mplayer.pctrl->mv;
    cmdData.cmdType                             = CMD_PLUGIN_SET_GUI_STATUS;
    cmdData.which                               = MVP_GUI_STATUS;
    cmdData.param                               = &mplayer.playback_parms;
    mplayer.playback_parms.guiStatus.repeatType = type;
    mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_SET_PARAMETER

Direct a change in the plugin setup parameters. The media player sets the which flag to tell the plugin which parameters have been sent.

mplayer.setup.audio.pcmPlaybackCardA =  mplayer.playback_parms.audio.pcmPlaybackCardA = *value;
if( mplayer.pctrl )
{
MvCommandData_t cmdData      = {0};
cmdData.pluginCtrl           = &mplayer.pctrl->mv;
cmdData.cmdType              = CMD_PLUGIN_SET_PARAMETER;
cmdData.which                = MVP_AUDIO;
cmdData.param                = &mplayer.playback_parms;
mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_SET_SPEED

Set a speed for a variable-speed plugin. (Not implemented yet.)

CMD_PLUGIN_SET_STOP_TIME

Set a time for playback to stop at. (Not implemented yet.)

CMD_PLUGIN_SET_WINDOW

Pass the Home Entertainment Mode flag to the plugin. The CMD_PLUGIN_SET_PARAMETER command is used to resize the video window.

if( mplayer.setup.bHomeEntertainment )
{   // the window is in home entertainment mode
// restore it to it's original state
PtArg_t         arg;
mplayer.setup.bHomeEntertainment = FALSE;
PtSetArg( &arg, Pt_ARG_WINDOW_RENDER_FLAGS, ~0, Ph_WM_RENDER_BORDER | Ph_WM_RENDER_TITLE );
PtSetResources( ABW_video, 1, &arg);
InitVideoArea();
PtWindowToFront( ABW_video );

    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_SET_WINDOW;
    cmdData.which                = MVP_DELTA;
    cmdData.param                = &mplayer.playback_parms;
    mplayer.playback_parms.delta = 0;
    mplayer.playback_parms.flags = MVP_RESTORE;
    mplayer.pctrl->mv.calls->command( &cmdData );
}
else
{ // put the window in home entertainment mode
    mplayer.setup.bHomeEntertainment = TRUE;
    InitVideoArea();
    PtWindowToFront( ABW_video );
}

CMD_PLUGIN_SLOW_MOTION

Play the video in slow motion.

if( mplayer.pctrl )
{
    MvCommandData_t cmdData      = {0};
    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_SLOW_MOTION;
    cmdData.which                = MVP_NONE;
    mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_START

Tell the plugin to start playing the file or specified URL.

The following example is for a multitrack plugin like the audiocd.so. First the player seeks the plugin to the correct track and then it submits the command to start. The seeking is only related to multitrack operations.

if( mplayer.pctrl && (mplayer.pctrl->mediaType & MV_MEDIA_MULTITRACK) && !ControllerPluginChange(url))
{
    MvCommandData_t cmdData         = {0};
    ControllerSetActiveTrack( track );
    cmdData.pluginCtrl              = &mplayer.pctrl->mv;
    cmdData.cmdType                 = CMD_PLUGIN_SEEK_RELATIVE;
    cmdData.which                   = MVP_SEEK_UNIT | MVP_DELTA;
    cmdData.param                   = &mplayer.playback_parms;
    mplayer.playback_parms.seekUnit = MVS_TRACK;
    mplayer.playback_parms.delta    = track;
    mplayer.pctrl->mv.calls->command( &cmdData );
    //fprintf(stderr,"in %s ControllerChangetrack() sent CMD_PLUGIN_SEEK_RELATIVE delta = %d\n",__FILE__, track);
    // restart the plugin
    cmdData.cmdType                     = CMD_PLUGIN_START;
    cmdData.which                       = MVP_NONE;
    mplayer.pctrl->mv.calls->command( &cmdData );
}
else  //normal plugin
{
    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_START;
    cmdData.which                = MVP_NONE;
    mplayer.pctrl->mv.calls->command( &cmdData );

}

CMD_PLUGIN_STEP

Put the plugin in frame-by-frame advance mode.

    if( mplayer.pctrl )
{
    MvCommandData_t cmdData      = {0};
    cmdData.pluginCtrl           = &mplayer.pctrl->mv;
    cmdData.cmdType              = CMD_PLUGIN_STEP;
    cmdData.which                = MVP_NONE;
    mplayer.pctrl->mv.calls->command( &cmdData );
}

CMD_PLUGIN_STOP

Stop the plugin.

cmdData.pluginCtrl           = &mplayer.pctrl->mv;
cmdData.cmdType              = CMD_PLUGIN_STOP;
cmdData.which                = MVP_NONE;
mplayer.pctrl->mv.calls->command( &cmdData );

CMD_PLUGIN_TITLE

Not implemented yet.

CMD_PLUGIN_USER_0 ... CMD_PLUGIN_USER_9

User-specific messages.

CMD_PLUGIN_VGA_TV

Not implemented yet.

CMD_PLUGIN_VOL_DOWN

Send the volume down command to the plugin that's currently loaded. If no plugin is loaded, phplay lowers the mixer master volume.

CMD_PLUGIN_VOL_UP

Send the volume up command to the plugin that's currently loaded. If no plugin is loaded, phplay raises up the mixer master volume.

CMD_PLUGIN_ZOOM_IN

Zoom in to a specific area of the display. (Not implemented yet.)

CMD_PLUGIN_ZOOM_OUT

Zoom out to a previous zoom level. (Not implemented yet.)

MV_CLOSED

The plugin is no longer active but is still loaded.

MV_DEAD

The state after a plugin is told to terminate. MvInit() sets the plugin to this state.

MV_NOTREADY

Reserved usage.

MV_OPENING

Process a CMD_PLUGIN_OPEN_URLS command.

MV_PAUSED

Playback paused, awaiting play command.

MV_PLAYBW

Play backwards.

MV_PLAYING

Play the file or stream.

MV_PREFETCHING

Reserved usage.

MV_SCANBW

Scan backwards.

MV_SCANFW

Scan forwards.

MV_SLOW

Play in slow motion.

MV_STEP

Step forwards or backwards frame by frame.

MV_STOPPED

Stop playback or reset to the start of the file.

MVS_DURATION

Tell phplay to update the GUI time label with the current duration.

MVS_ERRORMSG

Tell phplay to display the plugin error message and terminate the plugin.

MVS_FLAGS

Indicates the current video window status of the plugin.

MVS_GUI_STATUS

Update the plugin GUI according to the new setting extracted from the MvGuiStatus_t guiStatus field.

MVS_MEDIA

Flags that indicate that the media_info field is valid and points to new media. If the plugin media type is identified as:

When the plugin media type is identified as: Then phplay:
a play list extracts it
audio adjusts the audio setting
video adjusts the video setting

MVS_PLUGIN_STATE

Update the plugin's GUI with the current state and send a seek-to-0 command when the plugin state is MV_STOPPED.

MVS_POSITION

Update the plugin's GUI time label with the current position.

MVS_SPEED_INFO

Current playback speed for variable-speed plugins.

MVS_USER_MESSAGE

Pass a string from the plugin to the media player (i.e. display diagnostic information).

MVS_VIDEO_WND_TITLE

The plugin wants to change the video window title.

MVS_VPSIZE

Value that phplay uses to resize the client area size (vpane).


[Previous] [Contents] [Next]