![]() |
![]() |
![]() |
![]() |
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
This chapter describes the data structures used in the multimedia components:
typedef unsigned MvPluginState_t; typedef unsigned MvPluginFlags_t; typedef unsigned MvMediaFlags_t; typedef unsigned MvVideoFlags_t; typedef unsigned MvPlaybackFlags_t; typedef unsigned MvPlaybackParam_t; typedef unsigned MvEventFlags_t; typedef unsigned MvPluginStatusFlags_t; typedef unsigned MvSeekUnit_t; typedef unsigned MvCommandType_t; typedef unsigned MvStreamType_t;
#define MV_API_VERSION 1
#define MV_API_VERSION 1
The following lines show how some structures are defined in <Mv.h>.
typedef struct MvPluginCtrl MvPluginCtrl_t; typedef struct MvPluginData MvPluginData_t; typedef struct MvPluginFunctions MvPluginFunctions_t; typedef int MvInitF_t( MvPluginCtrl_t *pctrl ); extern MvInitF_t MvInit; typedef unsigned MvRegEntryType_t;
This structure is the same as PhArea_t. (It was defined to avoid Photon dependencies.)
typedef struct MvArea //PhArea_t
{
MvPoint_t pos;
MvDim_t size;
} MvArea_t;
This structure contains the audio card(s) configuration for the media player. This info is sent by phplay to the plugin:
The MvAudioMediaInfo_t structure is filled with the mpsettings file information via these libmedia.so calls:
The information must be initialized correctly for any audio-related plugin to work. The values can be customized via the phplay preferences tabs.
typedef struct MvAudioMediaInfo
{
unsigned int pcmPlaybackCardA;
unsigned int pcmPlaybackDeviceA;
unsigned int pcmPlaybackCardB;
unsigned int pcmPlaybackDeviceB;
unsigned int pcmRecordCard;
unsigned int pcmRecordDevice;
unsigned int mixerCard;
unsigned int mixerDevice;
unsigned int spdifPlaybackCard;
unsigned int spdifPlaybackDevice;
unsigned int spdifRecordCard;
unsigned int spdifRecordDevice;
unsigned int volume; //The last volume stored in the mixer
unsigned int reserve_1;
unsigned int reserve_2;
unsigned int reserve_3;
} MvAudioMediaInfo_t;
This structure is used every time a command is sent by phplay to a plugin.
typedef struct MvCommandData
{
MvCommandType_t cmdType;
MvPluginCtrl_t *pluginCtrl;
char ** urls; // in form file://dog.mpg
char *nodeString; // in form of $HOSTNAME as defined with QNET
char *displayString; // full definition of "PHOTON=/dev/photon" less "PHOTON="
MvUserMsg_t *userMsg; // user defined message sent from phplay to a plugin
MvPlaybackParam_t which;
MvPlaybackParams_t *param;
} MvCommandData_t;
This structure sends command from phplay to a plugin. All commands are mutually exclusive, that is, you can't make two commands into one.
enum MvCommandType
{
CMD_PLUGIN_OPEN_URLS,
CMD_PLUGIN_CLOSE,
CMD_PLUGIN_START,
CMD_PLUGIN_PAUSE,
CMD_PLUGIN_STOP,
CMD_PLUGIN_SEEK_TO,
CMD_PLUGIN_SEEK_RELATIVE,
CMD_PLUGIN_SET_PARAMETER,
CMD_PLUGIN_SET_WINDOW,
CMD_PLUGIN_,
CMD_PLUGIN_SET_GUI_STATUS,
CMD_PLUGIN_DISPLAY_GUI, // synchronization of viewer/plugin GUI
CMD_PLUGIN_GET_STATUS,
CMD_PLUGIN_HOTKEY,
CMD_PLUGIN_EJECT_DISK,
CMD_PLUGIN_LOAD_DISK,
CMD_PLUGIN_DIRECT_AUDIO,
CMD_PLUGIN_SET_SPEED,
CMD_PLUGIN_BOOKMARK_SET,
CMD_PLUGIN_BOOKMARK_GOTO,
CMD_PLUGIN_BOOKMARK_VIEW,
CMD_PLUGIN_KARAOKE_RECORD,
CMD_PLUGIN_PLAY_ALL_FRAMES,
CMD_PLUGIN_PLAY_REALTIME,
CMD_PLUGIN_SEND_MESSAGE,
CMD_PLUGIN_MUTE,
CMD_PLUGIN_STEP,
CMD_PLUGIN_ZOOM_IN,
CMD_PLUGIN_ZOOM_OUT,
CMD_PLUGIN_CAPTURE_STILL,
CMD_PLUGIN_SCAN_BACK,
CMD_PLUGIN_SCAN_FORWARD,
CMD_PLUGIN_SLOW_MOTION,
CMD_PLUGIN_RESERVED_0,
CMD_PLUGIN_RESERVED_1,
CMD_PLUGIN_RESERVED_2,
CMD_PLUGIN_RESERVED_3,
CMD_PLUGIN_RESERVED_4,
CMD_PLUGIN_RESERVED_5,
CMD_PLUGIN_RESERVED_6,
CMD_PLUGIN_RESERVED_7,
CMD_PLUGIN_RESERVED_8,
CMD_PLUGIN_RESERVED_9,
CMD_PLUGIN_USER_0,
CMD_PLUGIN_USER_1,
CMD_PLUGIN_USER_2,
CMD_PLUGIN_USER_3,
CMD_PLUGIN_USER_4,
CMD_PLUGIN_USER_5,
CMD_PLUGIN_USER_6,
CMD_PLUGIN_USER_7,
CMD_PLUGIN_USER_8,
CMD_PLUGIN_USER_9,
CMD_PLUGIN_POWER, //Remote control
CMD_PLUGIN_PROGRAM, // Remote control used to navigate phplay menus
CMD_PLUGIN_TITLE, //Remote control
CMD_PLUGIN_OSD, //Remote control used for home entertainment mode toggle on/off
CMD_PLUGIN_LAST_CHAPTER, //Remote control
CMD_PLUGIN_NEXT_CHAPTER, //Remote control
CMD_PLUGIN_VOL_UP, //Remote control
CMD_PLUGIN_VOL_DOWN, //Remote control
CMD_PLUGIN_L_R, //Remote control
CMD_PLUGIN_ZERO, //Remote control
CMD_PLUGIN_ONE, //Remote control
CMD_PLUGIN_TWO, //Remote control
CMD_PLUGIN_THREE, //Remote control
CMD_PLUGIN_FOUR, //Remote control
CMD_PLUGIN_FIVE, //Remote control
CMD_PLUGIN_SIX, //Remote control
CMD_PLUGIN_SEVEN, //Remote control
CMD_PLUGIN_EIGHT, //Remote control
CMD_PLUGIN_NINE, //Remote control
CMD_PLUGIN_VGA_TV, //Remote control
CMD_PLUGIN_ENTER, //Remote control
CMD_PLUGIN_PLAY_PAUSE //Remote control
};
typedef struct MvDim //PhDim_t
{
unsigned short w;
unsigned short h;
} MvDim_t;
These flags determine which field of the MvPluginStatus_t structure is valid at any given time. These flags can be Bitwise ORed (|):
enum MvEventFlags
{
MVS_PLUGIN_STATE = 0x01,
MVS_FLAGS = 0x02,
MVS_MEDIA = 0x04,
MVS_POSITION = 0x08,
MVS_DURATION = 0x10,
MVS_VPSIZE = 0x20,
MVS_ERRORMSG = 0x40,
MVS_VIDEO_WND_TITLE = 0x80,
MVS_GUI_STATUS = 0x800,
MVS_SPEED_INFO = 0x1000,
MVS_USER_MESSAGE = 0x2000
};
phplay sends with CMD_PLUGIN_SET_GUI_STATUS
typedef struct MvGuiStatus
{
MvRepeatType_t repeatType; //uses the enum above
} MvGuiStatus_t;
Plugin returns this flag as part of Capabilities/Limitations.
enum MvMediaFlags
{
MV_MEDIA_AUDIO = 0x01,
MV_MEDIA_VIDEO = 0x02,
MV_MEDIA_SEEKABLE = 0x04,
MV_MEDIA_SPEEDABLE = 0x08,
MV_MEDIA_REMOVABLE = 0x10,
MV_MEDIA_PLAYLIST = 0x20,
MV_MEDIA_MULTITRACK = 0x40,
};
Flags that determine which fields of the MvMediaInfo_t structure (see below) is valid at any given time. These can all be used at the same time.
typedef enum MvMediaInfoFlag
{
MV_MEDIA_INFO = 0x01, //Using the "which" member variable
MV_MEDIA_VIDEO_INFO = 0x02, //video pointer is valid
MV_MEDIA_VIDEO_SETTING_INFO = 0x04, //video setting pointer is valid
MV_MEDIA_AUDIO_INFO = 0x08 //Audio pointer is valid
} MvMediaInfoFlag_t;
Plugins return this structure to phplay through the MvPluginCtrl MvViewerCallbackF_t callback function after phplay calls CMD_PLUGIN_OPEN_URLS or after phplay calls get_item().
typedef struct MvMediaInfo
{
MvMediaInfoFlag_t which;
MvMediaFlags_t type; //Plugin returns this flag as part of
//Capabilities/Limitations
const char *url;
MvTime_t duration;
const char *title;
const char *moreinfo;
unsigned plcount;
unsigned int reserve_1;
unsigned int reserve_2;
unsigned int reserve_3;
const MvVideoMediaInfo_t *video;
const MvVideoSettingInfo_t *videoSetting;
const MvAudioMediaInfo_t *audio;
} MvMediaInfo_t;
These flags set the current video window status. This info goes from phplay to the plugin as part of the MvPlaybackParams_t structure. After a phplay command, specify:
enum MvPlaybackFlags
{
MVP_RESTORE,
MVP_MAXIMIZE,
MVP_MINIMIZE,
MVP_HOME_ENTERTAINMENT,
MVP_AREA
};
All of the above flags are valid when the "Plugin Create Video Window" toggle is set in phplay. MVP_RESTORE returns the window to the display size saved before one of MVP_MAXIMIZE, MVP_MINIMIZE, or MVP_HOME_ENTERTAINMENT was received. MVP_AREA is sent in conjunction with the requested video window height and width in the MvPlaybackParams_t videoArea structure.
If the application creates the video window, MVP_RESTORE cancels the MVP_HOME_ENTERTAINMENT mode if it's been previously set. MVP_MAXIMIZE, MVP_MINIMIZE, and MVP_AREA aren't used in this case.
Flags that determine which field of the MvPlaybackParams_t structure is valid at any given time. All can be used in combination as bitwise OR (|)
enum MvPlaybackParam
{
MVP_NONE = 0x00,
MVP_FLAGS = 0x01,
MVP_STATUS_FREQ = 0x02,
MVP_AUDIO = 0x04,
MVP_VIDEO_SETTING = 0x08,
MVP_SPEED = 0x10,
MVP_VIDEO_AREA = 0x20,
MVP_ZOOM_AREA = 0x40,
MVP_VIDEO_WGT = 0x80,
MVP_SPANE_WGT = 0x100,
MVP_SEEK_UNIT = 0x200,
MVP_POSITION = 0x400,
MVP_DELTA = 0x800,
MVP_GUI_STATUS = 0x1000
};
This structure is used every time that a command with parameters is sent by phplay to a plugin. The MvCommandData_t which variable indicates which field of this structure is valid at any given time.
typedef struct MvPlaybackParams
{
MvPlaybackFlags_t flags; // full screen
MvTime_t status_frequency; // time interval for reporting;
// updates in milliseconds
MvAudioMediaInfo_t audio;
MvVideoSettingInfo_t videoSetting;
int speed; // 1000 = normal -- relative value 1000 ms per sec
MvArea_t videoArea; // phplay wants to change plugin video window area
MvArea_t zoomArea; // phplay wants to zoom this area
// (not implemented at this time)
void *video_wgt;
void *spane_wgt;
MvSeekUnit_t seekUnit; // used by CMD_PLUGIN_SEEK_RELATIVE
// (i.e. Audio CD)
MvTime_t position; // command-specific purpose.
long delta; // command-specific purpose
MvGuiStatus_t guiStatus; // tells the plugin to do a
// special repeat operation
} MvPlaybackParams_t;
The guiStatus parameter is typically used for the Audio CD plugin. For example, you can tell it to repeat a specified track continuously.
This structure is a communication handle between the media player, phplay, and a plugin. phplay fills up the player fields of that structure before loading a plugin. A plugin has to fill up the plugin fields of that structure on MvInit() on every function call:
A pointer to this structure is passed over. The phplay media player sets the version information and it's the responsibility of the plugin to verify that it has a compatible version number to that handled to it by this structure. The user-defined element is used by the calling application as an instance or context pointer.
struct MvPluginCtrl
{
/* Set by the plugin: */
MvPluginData_t *pdata; // plugin specific data
MvPluginFunctions_t const *calls; // pointer to predefined functions that
// phplay can call
MvPluginFlags_t pflags; // MV_SPANE, MV_HASDFLTURL
unsigned nhotkeys; // Not used in any current plugins
MvPluginHotkey_t const *hotkeys;
/* Set by the player: */
MvSetup_t setup; // setup parameters
MvViewerCallbackF_t *cb; // pointer to a function that a plugin call
// to communicate with phplay
void *basewin; // handle to phplay base window
void *dll_handle; // handle to currently loaded plugin dll
const char *name; // plugin name
unsigned APIversion; // set to MV_API_VERSION by phplay
unsigned MinorVersion;// set to MV_MINOR_API_VERSION by phplay
int prio; // phplay process priority
//The elements below aren't implemented in the current plugins
unsigned int audio_format;// SFMT from asoundlib.h
MvViewerAudioCallbackF_t *audio_cb; // pointer to a function that a plugin call
// to communicate with phplay
unsigned int video_format;// FourCC value from Pg.h
MvViewerVideoCallbackF_t *video_cb; // pointer to a function that a plugin call
// to communicate with phplay
unsigned int reserve_1;
void *ocb_ptr; // for devm use only - was reserve_2;
void *user_defined; // was reserve_3;
};
The MV_SPANE flag is used if the plugin controls its own GUI. The plugin returns this flag as part of Capabilities/Limitations.
enum MvPluginFlags
{
MV_SPANE = 0x01, // Plugin wants to take over spane_wgt
MV_HASDFLTURL = 0x02, // open_url(NULL) opens something
};
This structure defines and prototypes three pointers to functions that a plugin must implement for correct communication between phplay and a plugin. The plugin has to set the MvPluginCtrl_t structure member *calls with the address of this structure on MvInit() function call from phplay to the plugin.
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 );
};
Used by a plugin to send a list of hotkeys back to phplay.
![]() |
Not implemented at this time. |
typedef struct MvPluginHotkey
{
unsigned short key_sym_cap;
unsigned short flags;
unsigned long key_mods;
} MvPluginHotkey_t;
Contains the valid states for a plugin. See the MvCommandType Descriptions appendix for a description on each state.
enum MvPluginState
{
MV_DEAD,
MV_CLOSED,
MV_OPENING,
MV_STOPPED,
MV_PAUSED,
MV_PREFETCHING,
MV_PLAYING,
MV_PLAYBW,
MV_SCANFW,
MV_SCANBW,
MV_STEP,
MV_SLOW,
MV_NOTREADY,
};
These flags indicate the current video window status of the plugin. The info comes to phplay from the plugin as part of the MvPluginStatus_t structure.
enum MvPluginStatusFlags
{
MVS_RESTORE,
MVS_MAXIMIZE,
MVS_MINIMIZE,
MVS_HOME_ENTERTAINMENT, // Maximize but hide cursor
// and window frame and title bar
MVS_AREA // Normal mode with arbitrary window dimensions
};
This structure is used every time a plugin calls the phplay callback function with the MvEventFlags_t change variable that indicates which field of this structure is valid.
typedef struct MvPluginStatus
{
MvPluginState_t state;
MvPluginStatusFlags_t flags;
MvMediaInfo_t const *media_info;
MvTime_t position;
MvTime_t duration;
MvDim_t vpsize;
int speed;
const char *errormsg;
const char *videoWndTitle;
MvAudioList_t *audioList;
MvSubtitleList_t *subtitleList;
MvUserMsg_t *userMsg;
//user-define message sent from a plugin to phplay
MvGuiStatus_t guiStatus;
int reserve_1;
int reserve_2;
int reserve_3;
} MvPluginStatus_t;
typedef struct MvPoint // PhPoint_t
{
short x;
short y;
} MvPoint_t;
typedef struct MvReg MvReg_t;
enum MvRegEntryType
{
MVR_URL_PATTERN,
MVR_BUTTON_DEF
};
typedef struct MvRegEntry
{
MvRegEntryType_t type;
const char *plugin;
const char *descr;
const char *pattern;
const char *butdef;
} MvRegEntry_t;
phplay sends with CMD_PLUGIN_SET_GUI_STATUS.
typedef enum MvRepeatType
{
MV_NO_REPEAT,
MV_REPEAT_THIS_TRACK,
MV_REPEAT_SELECTED_TRACK,
MV_REPEAT_SELECTED_TRACK_ONCE
} MvRepeatType_t;
Flag used with the phplay command CMD_PLUGIN_SEEK_RELATIVE to indicate the unit of the value used for seeking.
enum MvSeekUnit
{
MVS_MS, // unit = 1 millisecond
MVS_TRACK // unit = 1 track //plugin must have multiple tracks
//(i.e. Audio CD)
};
This structure is used by phplay to send setup info to a plugin at initialization through the MvInit() function call.
typedef struct MvSetup
{
MvStreamType_t streamType; // possible types: stream,
// stream as file, stream seekable
MvArea_t videoWnd; // video window size and position
MvAudioMediaInfo_t audio; // audio cards configuration
MvVideoSettingInfo_t videoSetting; // video setting info
char mountPoint[PATH_MAX]; // mount point string of
// CDROM/DVD drive e.g. /fs/cd0
char drive[PATH_MAX]; // CDROM/DVD drive e.g. /dev/cd0
unsigned int bHomeEntertainment; // home entertainment mode selected
unsigned int bPluginHasVideoWnd; // 0 -- viewer own video window,
// 1 -- plugin own video window
unsigned int bDirectDigitalAudio; // 0 -- software audio decoder,
// 1 -- direct digital audio
unsigned int bPlayRealtime; // 0 -- play all frames
// 1 -- play realtime ( MPEG files)
unsigned int bCddbEnabled; // 0 -- cddb disabled,
// 1 -- cddb enabled
unsigned int bUseDirectOverlay;
unsigned int reserve_1;
unsigned int reserve_2;
unsigned int reserve_3;
} MvSetup_t;
Tell the plugin how data will be provided to it.
enum MvStreamType
{
MV_STREAM,
MV_STREAM_SEEKABLE,
MV_STREAM_ASFILE
};
typedef unsigned long MvTime_t; // In milliseconds
This structure holds a user-defined message that's sent between phplay and a plugin.
typedef struct MvUserMsg
{
unsigned len;
void* msg;
} MvUserMsg_t;
Returned by CMD_PLUGIN_OPEN_URLS callback, phplay checks this flag to see if the plugin can create its own video widget.
enum MvVideoFlags
{
MV_VIDEO_FIXED_SIZE = 0x01,
MV_VIDEO_NO_WIDGET = 0x02, // Don't want the widget
};
typedef structM vVideoFrameData
{
unsigned int video_format; // FourCC value from Pg.h
unsigned long Image_Height;
unsigned long Image_Width;
unsigned long Y_video_data_length;
unsigned long U_video_data_length;
unsigned long V_video_data_length;
unsigned long Y_Stride;
unsigned long U_Stride;
unsigned long V_Stride;
unsigned char *Y;
unsigned char *U;
unsigned char *V;
} MvVideoFrameData_t;
Returned through the MvPluginCtrl MvViewerCallbackF_t callback function to phplay by a plugin that handles video. After the phplay command CMD_PLUGIN_OPEN_URLS, phplay checks this structure to see the plugins Setup/Capabilities info.
typedef struct MvVideoMediaInfo
{
MvVideoFlags_t flags; // fixed size, no widget
MvDim_t preferred_size;
MvDim_t min_size;
MvDim_t max_size;
MvArea_t area; // actual video window area
unsigned int reserve_1;
} MvVideoMediaInfo_t;
These parameters are used to tell the player to change the current video-mode settings.
typedef struct MvVideoSettingInfo
{
unsigned intbVideoModeVga; // The display is a Computer Monitor, 4x3 Aspect Ratio
unsigned int bVideoModeTv; // The display is a TV , 4x3, use TV out
unsigned int bVideoModeHdtv; // The display is HDTV , 16x9 Aspect Ratio
unsigned int bTvOutputVideo; // Sigma Designs Netstream 2000 specific
unsigned int bTvOutputYuv; // Sigma Designs Netstream 2000 specific
unsigned int bTvStandardMultiSystem; // Sigma Designs Netstream 2000 specific
unsigned int bTvStandardNtsc; // Sigma Designs Netstream 2000 specific
unsigned int bTvStandardPal; // Sigma Designs Netstream 2000 specific
unsigned int bTvStandardPal60Hz; // Sigma Designs Netstream 2000 specific
unsigned int bTvScale1_1; // Sigma Designs Netstream 2000 specific
unsigned int bKeepAspectRatio; // Keep video window to fixed aspect ratio based on the vertical dimension
unsigned int bAlwaysOnTop; // Don't allow user windows to block the view of the video
unsigned long brightness; // Sigma Designs Netstream 2000 specific
unsigned long contrast; // Sigma Designs Netstream 2000 specific
unsigned long saturation; // Sigma Designs Netstream 2000 specific
unsigned long hue; // Sigma Designs Netstream 2000 specific
unsigned long gamma; // Sigma Designs Netstream 2000 specific
unsigned long highlight; // Sigma Designs Netstream 2000 specific
unsigned long shadow; // Sigma Designs Netstream 2000 specific
long yShift; // Sigma Designs Netstream 2000 specific
long uShift; // Sigma Designs Netstream 2000 specific
long vShift; // Sigma Designs Netstream 2000 specific
unsigned int reserve_1;
unsigned int reserve_2;
unsigned int reserve_3;
} MvVideoSettingInfo_t;
![]() |
![]() |
![]() |