summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
index e0eb930..bd31706 100644
--- a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
+++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
@@ -3,74 +3,76 @@
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#include <qstring.h> 23#include <qstring.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include "libmpeg3.h" 25#include "libmpeg3.h"
26#include "mpeg3protos.h" 26#include "mpeg3protos.h"
27#include <qpe/mediaplayerplugininterface.h> 27//#include <qpe/mediaplayerplugininterface.h>
28#include "../mediaplayerplugininterface.h"
28 29
29 30
30// #define OLD_MEDIAPLAYER_API 31// #define OLD_MEDIAPLAYER_API
31 32
32 33
33class LibMpeg3Plugin : public MediaPlayerDecoder { 34class LibMpeg3Plugin : public MediaPlayerDecoder {
34 35
35public: 36public:
36 LibMpeg3Plugin() { file = NULL; } 37 LibMpeg3Plugin() { file = NULL; }
37 ~LibMpeg3Plugin() { close(); } 38 ~LibMpeg3Plugin() { close(); }
38 39
39 const char *pluginName() { return "LibMpeg3Plugin"; } 40 const char *pluginName() { return "LibMpeg3Plugin"; }
40 const char *pluginComment() { return "This is the libmpeg3 library writen by ... which has been modified by trolltech to use fixed point maths"; } 41 const char *pluginComment() { return "This is the libmpeg3 library writen by ... which has been modified by trolltech to use fixed point maths"; }
41 double pluginVersion() { return 1.0; } 42 double pluginVersion() { return 1.0; }
42 43
43 bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; } 44 bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; }
44 bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; } 45 bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; }
45 bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; } 46 bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; }
46 bool isOpen() { return file != NULL; } 47 bool isOpen() { return file != NULL; }
47 const QString &fileInfo() { return strInfo = ""; } 48 const QString &fileInfo() { return strInfo = ""; }
48 49
49 // If decoder doesn't support audio then return 0 here 50 // If decoder doesn't support audio then return 0 here
50 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; } 51 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; }
51 int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; } 52 int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; }
52 int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; } 53 int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; }
54 int audioBitsPerSample(int) { return 0;}
53 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } 55 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; }
54 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; } 56 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; }
55 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; } 57 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; }
56#ifdef OLD_MEDIAPLAYER_API 58#ifdef OLD_MEDIAPLAYER_API
57 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 59 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
58 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 60 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
59 bool audioReadSamples( short *output, int channel, long samples, int stream ); 61 bool audioReadSamples( short *output, int channel, long samples, int stream );
60 bool audioReReadSamples( short *output, int channel, long samples, int stream ); 62 bool audioReReadSamples( short *output, int channel, long samples, int stream );
61#else 63#else
62 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); 64 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
63#endif 65#endif
64 66
65 // If decoder doesn't support video then return 0 here 67 // If decoder doesn't support video then return 0 here
66 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; } 68 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; }
67 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; } 69 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; }
68 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; } 70 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; }
69 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; } 71 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; }
70 int videoFrames( int stream ) 72 int videoFrames( int stream )
71{ return file ? mpeg3_video_frames( file, stream ) : 0; } 73{ return file ? mpeg3_video_frames( file, stream ) : 0; }
72/* 74/*
73{ 75{
74 if ( file ) { 76 if ( file ) {
75 int frames = mpeg3_video_frames( file, stream ); 77 int frames = mpeg3_video_frames( file, stream );
76 if ( frames == 1 ) { 78 if ( frames == 1 ) {