00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LIBMAD_PLUGIN_H
00021 #define LIBMAD_PLUGIN_H
00022
00023 #include <qstring.h>
00024 #include <qpe/mediaplayerplugininterface.h>
00025
00026
00027
00028
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
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
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
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
00086 double getTime();
00087
00088
00089 bool setSMP( int ) { return FALSE; }
00090 bool setMMX( bool ) { return FALSE; }
00091
00092
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