Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h index 54f259b..e0eb930 100644 --- a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h +++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h | |||
@@ -1,79 +1,76 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef LIBMPEG3_PLUGIN_H | 20 | #ifndef LIBMPEG3_PLUGIN_H |
21 | #define LIBMPEG3_PLUGIN_H | 21 | #define LIBMPEG3_PLUGIN_H |
22 | 22 | ||
23 | |||
24 | #include <qstring.h> | 23 | #include <qstring.h> |
25 | #include <qapplication.h> | 24 | #include <qapplication.h> |
26 | #include "libmpeg3.h" | 25 | #include "libmpeg3.h" |
27 | #include "mpeg3protos.h" | 26 | #include "mpeg3protos.h" |
28 | //#include <qpe/mediaplayerplugininterface.h> | 27 | #include <qpe/mediaplayerplugininterface.h> |
29 | #include "../mediaplayerplugininterface.h" | ||
30 | 28 | ||
31 | 29 | ||
32 | // #define OLD_MEDIAPLAYER_API | 30 | // #define OLD_MEDIAPLAYER_API |
33 | 31 | ||
34 | 32 | ||
35 | class LibMpeg3Plugin : public MediaPlayerDecoder { | 33 | class LibMpeg3Plugin : public MediaPlayerDecoder { |
36 | 34 | ||
37 | public: | 35 | public: |
38 | LibMpeg3Plugin() { file = NULL; } | 36 | LibMpeg3Plugin() { file = NULL; } |
39 | ~LibMpeg3Plugin() { close(); } | 37 | ~LibMpeg3Plugin() { close(); } |
40 | 38 | ||
41 | const char *pluginName() { return "LibMpeg3Plugin"; } | 39 | const char *pluginName() { return "LibMpeg3Plugin"; } |
42 | const char *pluginComment() { return "This is the libmpeg3 library writen by ... which has been modified by trolltech to use fixed point maths"; } | 40 | const char *pluginComment() { return "This is the libmpeg3 library writen by ... which has been modified by trolltech to use fixed point maths"; } |
43 | double pluginVersion() { return 1.0; } | 41 | double pluginVersion() { return 1.0; } |
44 | 42 | ||
45 | bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; } | 43 | bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; } |
46 | bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; } | 44 | bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; } |
47 | bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; } | 45 | bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; } |
48 | bool isOpen() { return file != NULL; } | 46 | bool isOpen() { return file != NULL; } |
49 | const QString &fileInfo() { return strInfo = ""; } | 47 | const QString &fileInfo() { return strInfo = ""; } |
50 | 48 | ||
51 | // If decoder doesn't support audio then return 0 here | 49 | // If decoder doesn't support audio then return 0 here |
52 | int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; } | 50 | int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; } |
53 | int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; } | 51 | int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; } |
54 | int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; } | 52 | int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; } |
55 | int audioBitsPerSample(int) { return 0;} | ||
56 | int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } | 53 | int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } |
57 | bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; } | 54 | bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; } |
58 | long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; } | 55 | long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; } |
59 | #ifdef OLD_MEDIAPLAYER_API | 56 | #ifdef OLD_MEDIAPLAYER_API |
60 | bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); | 57 | bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); |
61 | bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); | 58 | bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); |
62 | bool audioReadSamples( short *output, int channel, long samples, int stream ); | 59 | bool audioReadSamples( short *output, int channel, long samples, int stream ); |
63 | bool audioReReadSamples( short *output, int channel, long samples, int stream ); | 60 | bool audioReReadSamples( short *output, int channel, long samples, int stream ); |
64 | #else | 61 | #else |
65 | bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); | 62 | bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); |
66 | #endif | 63 | #endif |
67 | 64 | ||
68 | // If decoder doesn't support video then return 0 here | 65 | // If decoder doesn't support video then return 0 here |
69 | int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; } | 66 | int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; } |
70 | int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; } | 67 | int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; } |
71 | int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; } | 68 | int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; } |
72 | double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; } | 69 | double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; } |
73 | int videoFrames( int stream ) | 70 | int videoFrames( int stream ) |
74 | { return file ? mpeg3_video_frames( file, stream ) : 0; } | 71 | { return file ? mpeg3_video_frames( file, stream ) : 0; } |
75 | /* | 72 | /* |
76 | { | 73 | { |
77 | if ( file ) { | 74 | if ( file ) { |
78 | int frames = mpeg3_video_frames( file, stream ); | 75 | int frames = mpeg3_video_frames( file, stream ); |
79 | if ( frames == 1 ) { | 76 | if ( frames == 1 ) { |