Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mediaplayerplugininterface.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #ifndef MEDIA_PLAYER_PLUGIN_INTERFACE_H
00021 #define MEDIA_PLAYER_PLUGIN_INTERFACE_H
00022 
00023 #include <qpe/qcom.h>
00024 
00025 #ifndef QT_NO_COMPONENT
00026 # ifndef IID_OpiePlayerPlugin
00027 // {F56F6CE0-1333-41FD-9B46-C0AF44D0B006}
00028 # define IID_OpiePlayerPlugin QUuid( 0xF56F6CE0, 0x1333, 0x41FD, 0x9B, 0x46, 0xC0, 0xAF, 0x44, 0xD0, 0xB0, 0x06);
00029 # endif
00030 # ifndef IID_MediaPlayerPlugin
00031 // {c0093632-b44c-4cf7-a279-d82fe8a8890c}
00032 #  define IID_MediaPlayerPlugin QUuid( 0xc0093632, 0xb44c, 0x4cf7, 0xa2, 0x79, 0xd8, 0x2f, 0xe8, 0xa8, 0x89, 0x0c )
00033 # endif
00034 #endif
00035 
00036 
00037 enum ColorFormat {
00038     RGB565,
00039     BGR565,
00040     RGBA8888,
00041     BGRA8888
00042 };
00043 
00044 
00045 class MediaPlayerDecoder {
00046 
00047 public:
00048     virtual ~MediaPlayerDecoder() { };
00049    
00050     // About Plugin 
00051     virtual const char *pluginName() = 0;
00052     virtual const char *pluginComment() = 0;
00053     virtual double pluginVersion() = 0;
00054 
00055     virtual bool isFileSupported( const QString& file ) = 0;
00056     virtual bool open( const QString& file ) = 0;
00057     virtual bool close() = 0;
00058     virtual bool isOpen() = 0;
00059     virtual const QString &fileInfo() = 0;
00060 
00061     // If decoder doesn't support audio then return 0 here
00062     virtual int audioStreams() = 0;
00063     virtual int audioChannels( int stream ) = 0;
00064     virtual int audioFrequency( int stream ) = 0;
00065     virtual int audioSamples( int stream ) = 0;
00066     virtual bool audioSetSample( long sample, int stream ) = 0;
00067     virtual long audioGetSample( int stream ) = 0;
00068     virtual bool audioReadSamples( short *samples, int channels, long samples, long& samplesRead, int stream ) = 0;
00069 
00070     // If decoder doesn't support video then return 0 here
00071     virtual int videoStreams() = 0;
00072     virtual int videoWidth( int stream ) = 0;
00073     virtual int videoHeight( int stream ) = 0;
00074     virtual double videoFrameRate( int stream ) = 0; // frames per second (this may change to frames/1000secs)
00075     virtual int videoFrames( int stream ) = 0;
00076     virtual bool videoSetFrame( long sample, int stream ) = 0;
00077     virtual long videoGetFrame( int stream ) = 0;
00078     virtual bool videoReadFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, ColorFormat color_model, int stream ) = 0;
00079     virtual bool videoReadScaledFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, ColorFormat color_model, int stream ) = 0;
00080     virtual bool videoReadYUVFrame( char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h, int stream ) = 0;
00081 
00082     // Profiling
00083     virtual double getTime() = 0;
00084 
00085     // Ignore if these aren't supported
00086     virtual bool setSMP( int cpus ) = 0;
00087     virtual bool setMMX( bool useMMX ) = 0;
00088 
00089     // Capabilities
00090     virtual bool supportsAudio() = 0;
00091     virtual bool supportsVideo() = 0;
00092     virtual bool supportsYUV() = 0;
00093     virtual bool supportsMMX() = 0;
00094     virtual bool supportsSMP() = 0;
00095     virtual bool supportsStereo() = 0;
00096     virtual bool supportsScaling() = 0;
00097 
00098     // File Properies
00099     virtual long getPlayTime() { return -1; }
00100 #ifdef IID_OpiePlayerPlugin
00101     virtual int audioBitsPerSample( int stream ) = 0;
00102 #endif    
00103 };
00104 
00105 
00106 class MediaPlayerEncoder;
00107 
00108 
00109 struct MediaPlayerPluginInterface : public QUnknownInterface
00110 {
00111     virtual MediaPlayerDecoder *decoder() = 0;
00112     virtual MediaPlayerEncoder *encoder() = 0;
00113 };
00114 
00115 #ifdef IID_OpiePlayerPlugin
00116 struct OpiePlayerPluginInterface : public QUnknownInterface
00117 {
00118     virtual MediaPlayerDecoder *decoder() = 0;
00119     virtual MediaPlayerEncoder *encoder() = 0;
00120 };
00121 #endif
00122 
00123 #endif
00124 

Generated on Sat Nov 5 16:15:38 2005 for OPIE by  doxygen 1.4.2