This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
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.
Jump the playback to a bookmark. (Not implemented yet.)
Save a given playback time (in milliseconds) for later. (Not implemented yet.)
Obtain, for display, all current bookmarks. (Not implemented yet)
Capture a still image of the current video image. (Not implemented yet.)
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 );
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 ); }
Synchronize the viewer and plugin GUI. (Not implemented yet.)
Tell the plugin to eject the disk.
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).
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 ); }
Pass a hotkey value into the plugin.
Record the mixed karaoke audio stream to disk. (Not implemented yet.)
Not implemented yet.
Send the previous track command to the plugin that's currently loaded.
Close the CD drive door specified by the current phplay "Mount Point" preference.
Send the next track command to the plugin that's currently loaded.
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 ); }
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(); }
Send the Home Entertainment toggle to the plugin that's currently loaded.
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 );
Tell the plugin not to skip any video frames to maintain realtime playback. (Not implemented yet.)
Send a play or pause command to the plugin that's currently loaded.
Tell phplay to terminate and unload the plugin, and then exit.
Not implemented yet.
Tell the plugin to skip video frames as necessary to playback video in realtime. (Not implemented yet.)
Reserved.
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 ); }
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 ); }
Seek to a specified track of a multitrack plugin. See the example in CMD_PLUGIN_START.
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 ); }
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 ); }
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 ); }
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 ); }
Set a speed for a variable-speed plugin. (Not implemented yet.)
Set a time for playback to stop at. (Not implemented yet.)
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 ); }
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 ); }
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 ); }
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 ); }
Stop the plugin.
cmdData.pluginCtrl = &mplayer.pctrl->mv; cmdData.cmdType = CMD_PLUGIN_STOP; cmdData.which = MVP_NONE; mplayer.pctrl->mv.calls->command( &cmdData );
Not implemented yet.
User-specific messages.
Not implemented yet.
Send the volume down command to the plugin that's currently loaded. If no plugin is loaded, phplay lowers the mixer master volume.
Send the volume up command to the plugin that's currently loaded. If no plugin is loaded, phplay raises up the mixer master volume.
Zoom in to a specific area of the display. (Not implemented yet.)
Zoom out to a previous zoom level. (Not implemented yet.)
The plugin is no longer active but is still loaded.
The state after a plugin is told to terminate. MvInit() sets the plugin to this state.
Reserved usage.
Process a CMD_PLUGIN_OPEN_URLS command.
Playback paused, awaiting play command.
Play backwards.
Play the file or stream.
Reserved usage.
Scan backwards.
Scan forwards.
Play in slow motion.
Step forwards or backwards frame by frame.
Stop playback or reset to the start of the file.
Tell phplay to update the GUI time label with the current duration.
Tell phplay to display the plugin error message and terminate the plugin.
Indicates the current video window status of the plugin.
Update the plugin GUI according to the new setting extracted from the MvGuiStatus_t guiStatus field.
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 |
Update the plugin's GUI with the current state and send a seek-to-0 command when the plugin state is MV_STOPPED.
Update the plugin's GUI time label with the current position.
Current playback speed for variable-speed plugins.
Pass a string from the plugin to the media player (i.e. display diagnostic information).
The plugin wants to change the video window title.
Value that phplay uses to resize the client area size (vpane).