Qtopia library API Documentation

mediaplayerplugininterface.h

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 // {c0093632-b44c-4cf7-a279-d82fe8a8890c}
00027 # ifndef IID_MediaPlayerPlugin
00028 #  define IID_MediaPlayerPlugin QUuid( 0xc0093632, 0xb44c, 0x4cf7, 0xa2, 0x79, 0xd8, 0x2f, 0xe8, 0xa8, 0x89, 0x0c )
00029 # endif
00030 #endif
00031 
00032 
00033 enum ColorFormat {
00034     RGB565,
00035     BGR565,
00036     RGBA8888,
00037     BGRA8888
00038 };
00039 
00040 
00041 class MediaPlayerDecoder {
00042 
00043 public:
00044     virtual ~MediaPlayerDecoder() { };
00045    
00046     // About Plugin 
00047     virtual const char *pluginName() = 0;
00048     virtual const char *pluginComment() = 0;
00049     virtual double pluginVersion() = 0;
00050 
00051     virtual bool isFileSupported( const QString& file ) = 0;
00052     virtual bool open( const QString& file ) = 0;
00053     virtual bool close() = 0;
00054     virtual bool isOpen() = 0;
00055     virtual const QString &fileInfo() = 0;
00056 
00057     // If decoder doesn't support audio then return 0 here
00058     virtual int audioStreams() = 0;
00059     virtual int audioChannels( int stream ) = 0;
00060     virtual int audioFrequency( int stream ) = 0;
00061     virtual int audioSamples( int stream ) = 0;
00062     virtual bool audioSetSample( long sample, int stream ) = 0;
00063     virtual long audioGetSample( int stream ) = 0;
00064     virtual bool audioReadSamples( short *samples, int channels, long samples, long& samplesRead, int stream ) = 0;
00065 
00066     // If decoder doesn't support video then return 0 here
00067     virtual int videoStreams() = 0;
00068     virtual int videoWidth( int stream ) = 0;
00069     virtual int videoHeight( int stream ) = 0;
00070     virtual double videoFrameRate( int stream ) = 0; // frames per second (this may change to frames/1000secs)
00071     virtual int videoFrames( int stream ) = 0;
00072     virtual bool videoSetFrame( long sample, int stream ) = 0;
00073     virtual long videoGetFrame( int stream ) = 0;
00074     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;
00075     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;
00076     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;
00077 
00078     // Profiling
00079     virtual double getTime() = 0;
00080 
00081     // Ignore if these aren't supported
00082     virtual bool setSMP( int cpus ) = 0;
00083     virtual bool setMMX( bool useMMX ) = 0;
00084 
00085     // Capabilities
00086     virtual bool supportsAudio() = 0;
00087     virtual bool supportsVideo() = 0;
00088     virtual bool supportsYUV() = 0;
00089     virtual bool supportsMMX() = 0;
00090     virtual bool supportsSMP() = 0;
00091     virtual bool supportsStereo() = 0;
00092     virtual bool supportsScaling() = 0;
00093 
00094     // File Properies
00095     virtual long getPlayTime() { return -1; }
00096 };
00097 
00098 
00099 class MediaPlayerEncoder;
00100 
00101 
00102 struct MediaPlayerPluginInterface : public QUnknownInterface
00103 {
00104     virtual MediaPlayerDecoder *decoder() = 0;
00105     virtual MediaPlayerEncoder *encoder() = 0;
00106 };
00107 
00108 
00109 #endif
00110 
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:06 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001