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

libmadplugin.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2001 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 LIBMAD_PLUGIN_H
00021 #define LIBMAD_PLUGIN_H
00022 
00023 #include <qstring.h>
00024 #include <qpe/mediaplayerplugininterface.h>
00025 /* #include "../mediaplayerplugininterface.h" */
00026 
00027 
00028 // #define OLD_MEDIAPLAYER_API
00029 
00030 
00031 class LibMadPluginData;
00032 
00033 
00034 class LibMadPlugin : public MediaPlayerDecoder {
00035 public:
00036     LibMadPlugin();
00037     ~LibMadPlugin();
00038 
00039     const char *pluginName() { return "LibMadPlugin"; }
00040     const char *pluginComment() { return "This is the libmad library that has been wrapped as a plugin"; }
00041     double pluginVersion() { return 1.0; }
00042 
00043     bool isFileSupported( const QString& );
00044     bool open( const QString& );
00045 
00046     bool close();
00047     bool isOpen();
00048     const QString &fileInfo() { return info; }
00049 
00050     // If decoder doesn't support audio then return 0 here
00051     int audioStreams();
00052     int audioChannels( int stream );
00053     int audioFrequency( int stream );
00054     int audioSamples( int stream );
00055     bool audioSetSample( long sample, int stream );
00056 /*     int audioBitsPerSample(int) {return 0;} */
00057     long audioGetSample( int stream );
00058 #ifdef OLD_MEDIAPLAYER_API
00059     bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
00060     bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
00061     bool audioReadSamples( short *output, int channel, long samples, int stream );
00062     bool audioReReadSamples( short *output, int channel, long samples, int stream );
00063 #else
00064     bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
00065 #endif
00066 
00067 
00068     bool read();
00069     bool decode( short *output, long samples, long& samplesRead );
00070     void printID3Tags();
00071 
00072 
00073     // If decoder doesn't support video then return 0 here
00074     int videoStreams() { return 0; }
00075     int videoWidth( int ) { return 0; }
00076     int videoHeight( int ) { return 0; }
00077     double videoFrameRate( int ) { return 0.0; }
00078     int videoFrames( int ) { return 0; }
00079     bool videoSetFrame( long, int ) { return FALSE; }
00080     long videoGetFrame( int ) { return 0; }
00081     bool videoReadFrame( unsigned char **, int, int, int, int, ColorFormat, int ) { return FALSE; }
00082     bool videoReadScaledFrame( unsigned char **, int, int, int, int, int, int, ColorFormat, int ) { return FALSE; }
00083     bool videoReadYUVFrame( char *, char *, char *, int, int, int, int, int ) { return FALSE; }
00084 
00085     // Profiling
00086     double getTime();
00087 
00088     // Ignore if these aren't supported
00089     bool setSMP( int ) { return FALSE; }
00090     bool setMMX( bool ) { return FALSE; }
00091 
00092     // Capabilities
00093     bool supportsAudio() { return TRUE; }
00094     bool supportsVideo() { return FALSE; }
00095     bool supportsYUV() { return FALSE; }
00096     bool supportsMMX() { return TRUE; }
00097     bool supportsSMP() { return FALSE; }
00098     bool supportsStereo() { return TRUE; }
00099     bool supportsScaling() { return FALSE; }
00100 
00101     long getPlayTime() { return -1; }
00102 
00103 private:
00104     int is_address_multicast(unsigned long address);
00105     int udp_open(char *address, int port);
00106     int tcp_open(char *address, int port);
00107     int http_read_line(int tcp_sock, char *buf, int size) ;
00108     int http_open(const QString& path );
00109 
00110     LibMadPluginData *d;
00111     QString info;
00112 int bufferSize;
00113 };
00114 
00115 
00116 #endif

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