summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
index 0a06264..54f259b 100644
--- a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
+++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
@@ -22,13 +22,17 @@
22 22
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qapplication.h> 25#include <qapplication.h>
26#include "libmpeg3.h" 26#include "libmpeg3.h"
27#include "mpeg3protos.h" 27#include "mpeg3protos.h"
28#include "mediaplayerplugininterface.h" 28//#include <qpe/mediaplayerplugininterface.h>
29#include "../mediaplayerplugininterface.h"
30
31
32// #define OLD_MEDIAPLAYER_API
29 33
30 34
31class LibMpeg3Plugin : public MediaPlayerDecoder { 35class LibMpeg3Plugin : public MediaPlayerDecoder {
32 36
33public: 37public:
34 LibMpeg3Plugin() { file = NULL; } 38 LibMpeg3Plugin() { file = NULL; }
@@ -39,26 +43,30 @@ public:
39 double pluginVersion() { return 1.0; } 43 double pluginVersion() { return 1.0; }
40 44
41 bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; } 45 bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; }
42 bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; } 46 bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; }
43 bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; } 47 bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; }
44 bool isOpen() { return file != NULL; } 48 bool isOpen() { return file != NULL; }
45 const QString &fileInfo() { return strInfo = QString( "" ); } 49 const QString &fileInfo() { return strInfo = ""; }
46 50
47 // If decoder doesn't support audio then return 0 here 51 // If decoder doesn't support audio then return 0 here
48 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; } 52 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; }
49 int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; } 53 int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; }
50 int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; } 54 int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; }
55 int audioBitsPerSample(int) { return 0;}
51 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } 56 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; }
52 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; } 57 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; }
53 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; } 58 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; }
54// bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 59#ifdef OLD_MEDIAPLAYER_API
55// bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 60 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
61 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
62 bool audioReadSamples( short *output, int channel, long samples, int stream );
63 bool audioReReadSamples( short *output, int channel, long samples, int stream );
64#else
56 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); 65 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
57// bool audioReadSamples( short *output, int channel, long samples, int stream ); 66#endif
58// bool audioReReadSamples( short *output, int channel, long samples, int stream );
59 67
60 // If decoder doesn't support video then return 0 here 68 // If decoder doesn't support video then return 0 here
61 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; } 69 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; }
62 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; } 70 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; }
63 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; } 71 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; }
64 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; } 72 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; }
@@ -99,12 +107,14 @@ public:
99 bool supportsYUV() { return TRUE; } 107 bool supportsYUV() { return TRUE; }
100 bool supportsMMX() { return TRUE; } 108 bool supportsMMX() { return TRUE; }
101 bool supportsSMP() { return TRUE; } 109 bool supportsSMP() { return TRUE; }
102 bool supportsStereo() { return TRUE; } 110 bool supportsStereo() { return TRUE; }
103 bool supportsScaling() { return TRUE; } 111 bool supportsScaling() { return TRUE; }
104 112
113 long getPlayTime() { return -1; }
114
105private: 115private:
106 mpeg3_t *file; 116 mpeg3_t *file;
107 QString strInfo; 117 QString strInfo;
108 118
109}; 119};
110 120