summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h23
-rw-r--r--core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp8
-rw-r--r--core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h4
3 files changed, 17 insertions, 18 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
index bd31706..b573e84 100644
--- a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
+++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
@@ -15,26 +15,25 @@
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"
29 28
30 29
31// #define OLD_MEDIAPLAYER_API 30// #define OLD_MEDIAPLAYER_API
32 31
33 32
34class LibMpeg3Plugin : public MediaPlayerDecoder { 33class LibMpeg3Plugin : public MediaPlayerDecoder {
35 34
36public: 35public:
37 LibMpeg3Plugin() { file = NULL; } 36 LibMpeg3Plugin() { file = NULL; }
38 ~LibMpeg3Plugin() { close(); } 37 ~LibMpeg3Plugin() { close(); }
39 38
40 const char *pluginName() { return "LibMpeg3Plugin"; } 39 const char *pluginName() { return "LibMpeg3Plugin"; }
@@ -42,56 +41,56 @@ public:
42 double pluginVersion() { return 1.0; } 41 double pluginVersion() { return 1.0; }
43 42
44 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; }
45 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; }
46 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; }
47 bool isOpen() { return file != NULL; } 46 bool isOpen() { return file != NULL; }
48 const QString &fileInfo() { return strInfo = ""; } 47 const QString &fileInfo() { return strInfo = ""; }
49 48
50 // If decoder doesn't support audio then return 0 here 49 // If decoder doesn't support audio then return 0 here
51 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; } 50 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; }
52 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; }
53 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; }
54 int audioBitsPerSample(int) { return 0;} 53/* int audioBitsPerSample(int) { return 0;} */
55 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } 54 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; }
56 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; } 55 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; }
57 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; } 56 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; }
58#ifdef OLD_MEDIAPLAYER_API 57#ifdef OLD_MEDIAPLAYER_API
59 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 58 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
60 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 59 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
61 bool audioReadSamples( short *output, int channel, long samples, int stream ); 60 bool audioReadSamples( short *output, int channel, long samples, int stream );
62 bool audioReReadSamples( short *output, int channel, long samples, int stream ); 61 bool audioReReadSamples( short *output, int channel, long samples, int stream );
63#else 62#else
64 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); 63 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
65#endif 64#endif
66 65
67 // If decoder doesn't support video then return 0 here 66 // If decoder doesn't support video then return 0 here
68 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; } 67 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; }
69 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; } 68 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; }
70 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; } 69 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; }
71 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; } 70 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; }
72 int videoFrames( int stream ) 71 int videoFrames( int stream )
73{ return file ? mpeg3_video_frames( file, stream ) : 0; } 72{ return file ? mpeg3_video_frames( file, stream ) : 0; }
74/* 73/*
75{ 74{
76 if ( file ) { 75 if ( file ) {
77 int frames = mpeg3_video_frames( file, stream ); 76 int frames = mpeg3_video_frames( file, stream );
78 if ( frames == 1 ) { 77 if ( frames == 1 ) {
79 int res = mpeg3_seek_percentage( file, 0.99 ); 78 int res = mpeg3_seek_percentage( file, 0.99 );
80 printf("res: %i\n", res ); 79 printf("res: %i\n", res );
81 mpeg3video_seek( file->vtrack[stream]->video ); 80 mpeg3video_seek( file->vtrack[stream]->video );
82 frames = mpeg3_get_frame( file, stream ); 81 frames = mpeg3_get_frame( file, stream );
83 mpeg3_seek_percentage( file, 0.0 ); 82 mpeg3_seek_percentage( file, 0.0 );
84 } 83 }
85 return frames; 84 return frames;
86 } 85 }
87 return 0; 86 return 0;
88} 87}
89*/ 88*/
90 bool videoSetFrame( long frame, int stream ) { return file ? mpeg3_set_frame( file, frame, stream) == 1 : FALSE; } 89 bool videoSetFrame( long frame, int stream ) { return file ? mpeg3_set_frame( file, frame, stream) == 1 : FALSE; }
91 long videoGetFrame( int stream ) { return file ? mpeg3_get_frame( file, stream ) : 0; } 90 long videoGetFrame( int stream ) { return file ? mpeg3_get_frame( file, stream ) : 0; }
92 bool videoReadFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, ColorFormat color_model, int stream ); 91 bool videoReadFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, ColorFormat color_model, int stream );
93 bool videoReadScaledFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, ColorFormat color_model, int stream ); 92 bool videoReadScaledFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, ColorFormat color_model, int stream );
94 bool videoReadYUVFrame( char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h, int stream ); 93 bool videoReadYUVFrame( char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h, int stream );
95 94
96 // Profiling 95 // Profiling
97 double getTime() { return file ? mpeg3_get_time( file ) : 0.0; } 96 double getTime() { return file ? mpeg3_get_time( file ) : 0.0; }
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp
index e7216af..bf3f372 100644
--- a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp
+++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp
@@ -21,50 +21,50 @@
21#include "libmpeg3pluginimpl.h" 21#include "libmpeg3pluginimpl.h"
22 22
23 23
24LibMpeg3PluginImpl::LibMpeg3PluginImpl() 24LibMpeg3PluginImpl::LibMpeg3PluginImpl()
25 : libmpeg3plugin(0), ref(0) 25 : libmpeg3plugin(0), ref(0)
26{ 26{
27} 27}
28 28
29 29
30LibMpeg3PluginImpl::~LibMpeg3PluginImpl() 30LibMpeg3PluginImpl::~LibMpeg3PluginImpl()
31{ 31{
32 if ( libmpeg3plugin ) 32 if ( libmpeg3plugin )
33 delete libmpeg3plugin; 33 delete libmpeg3plugin;
34} 34}
35 35
36 36
37MediaPlayerDecoder *LibMpeg3PluginImpl::decoder() 37MediaPlayerDecoder *LibMpeg3PluginImpl::decoder()
38{ 38{
39 if ( !libmpeg3plugin ) 39 if ( !libmpeg3plugin )
40 libmpeg3plugin = new LibMpeg3Plugin; 40 libmpeg3plugin = new LibMpeg3Plugin;
41 return libmpeg3plugin; 41 return libmpeg3plugin;
42} 42}
43 43
44 44
45MediaPlayerEncoder *LibMpeg3PluginImpl::encoder() 45MediaPlayerEncoder *LibMpeg3PluginImpl::encoder()
46{ 46{
47 return NULL; 47 return NULL;
48} 48}
49 49
50 50
51#ifndef QT_NO_COMPONENT 51#ifndef QT_NO_COMPONENT
52 52
53 53
54QRESULT LibMpeg3PluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) 54QRESULT LibMpeg3PluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
55{ 55{
56 *iface = 0; 56 *iface = 0;
57 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) ) 57 if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) )
58 *iface = this, (*iface)->addRef(); 58 *iface = this, (*iface)->addRef();
59 return QS_OK; 59 return QS_OK;
60} 60}
61 61
62 62
63Q_EXPORT_INTERFACE() 63Q_EXPORT_INTERFACE()
64{ 64{
65 Q_CREATE_INSTANCE( LibMpeg3PluginImpl ) 65 Q_CREATE_INSTANCE( LibMpeg3PluginImpl )
66} 66}
67 67
68 68
69#endif 69#endif
70 70
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h
index a2f5211..ef3743e 100644
--- a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h
+++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h
@@ -11,26 +11,26 @@
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_IMPL_H 20#ifndef LIBMPEG3_PLUGIN_IMPL_H
21#define LIBMPEG3_PLUGIN_IMPL_H 21#define LIBMPEG3_PLUGIN_IMPL_H
22 22
23//#include <qpe/mediaplayerplugininterface.h> 23#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h" 24//#include "../mediaplayerplugininterface.h"
25 25
26 26
27class LibMpeg3Plugin; 27class LibMpeg3Plugin;
28 28
29 29
30class LibMpeg3PluginImpl : public MediaPlayerPluginInterface 30class LibMpeg3PluginImpl : public MediaPlayerPluginInterface
31{ 31{
32public: 32public:
33 LibMpeg3PluginImpl(); 33 LibMpeg3PluginImpl();
34 virtual ~LibMpeg3PluginImpl(); 34 virtual ~LibMpeg3PluginImpl();
35 35
36#ifndef QT_NO_COMPONENT 36#ifndef QT_NO_COMPONENT