summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3
Side-by-side diff
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 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef LIBMPEG3_PLUGIN_H
#define LIBMPEG3_PLUGIN_H
#include <qstring.h>
#include <qapplication.h>
#include "libmpeg3.h"
#include "mpeg3protos.h"
-//#include <qpe/mediaplayerplugininterface.h>
-#include "../mediaplayerplugininterface.h"
+#include <qpe/mediaplayerplugininterface.h>
// #define OLD_MEDIAPLAYER_API
class LibMpeg3Plugin : public MediaPlayerDecoder {
public:
LibMpeg3Plugin() { file = NULL; }
~LibMpeg3Plugin() { close(); }
const char *pluginName() { return "LibMpeg3Plugin"; }
@@ -42,56 +41,56 @@ public:
double pluginVersion() { return 1.0; }
bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; }
bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; }
bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; }
bool isOpen() { return file != NULL; }
const QString &fileInfo() { return strInfo = ""; }
// If decoder doesn't support audio then return 0 here
int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; }
int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; }
int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; }
- int audioBitsPerSample(int) { return 0;}
+/* int audioBitsPerSample(int) { return 0;} */
int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; }
bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; }
long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; }
#ifdef OLD_MEDIAPLAYER_API
bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
bool audioReadSamples( short *output, int channel, long samples, int stream );
bool audioReReadSamples( short *output, int channel, long samples, int stream );
#else
bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
#endif
// If decoder doesn't support video then return 0 here
int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; }
int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; }
int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; }
double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; }
int videoFrames( int stream )
{ return file ? mpeg3_video_frames( file, stream ) : 0; }
/*
{
if ( file ) {
- int frames = mpeg3_video_frames( file, stream );
- if ( frames == 1 ) {
- int res = mpeg3_seek_percentage( file, 0.99 );
- printf("res: %i\n", res );
- mpeg3video_seek( file->vtrack[stream]->video );
- frames = mpeg3_get_frame( file, stream );
- mpeg3_seek_percentage( file, 0.0 );
- }
- return frames;
+ int frames = mpeg3_video_frames( file, stream );
+ if ( frames == 1 ) {
+ int res = mpeg3_seek_percentage( file, 0.99 );
+ printf("res: %i\n", res );
+ mpeg3video_seek( file->vtrack[stream]->video );
+ frames = mpeg3_get_frame( file, stream );
+ mpeg3_seek_percentage( file, 0.0 );
+ }
+ return frames;
}
return 0;
}
*/
bool videoSetFrame( long frame, int stream ) { return file ? mpeg3_set_frame( file, frame, stream) == 1 : FALSE; }
long videoGetFrame( int stream ) { return file ? mpeg3_get_frame( file, stream ) : 0; }
bool videoReadFrame( unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, ColorFormat color_model, int stream );
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 );
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 );
// Profiling
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 @@
#include "libmpeg3pluginimpl.h"
LibMpeg3PluginImpl::LibMpeg3PluginImpl()
: libmpeg3plugin(0), ref(0)
{
}
LibMpeg3PluginImpl::~LibMpeg3PluginImpl()
{
if ( libmpeg3plugin )
- delete libmpeg3plugin;
+ delete libmpeg3plugin;
}
MediaPlayerDecoder *LibMpeg3PluginImpl::decoder()
{
if ( !libmpeg3plugin )
- libmpeg3plugin = new LibMpeg3Plugin;
+ libmpeg3plugin = new LibMpeg3Plugin;
return libmpeg3plugin;
}
MediaPlayerEncoder *LibMpeg3PluginImpl::encoder()
{
return NULL;
}
#ifndef QT_NO_COMPONENT
QRESULT LibMpeg3PluginImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
- if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) )
- *iface = this, (*iface)->addRef();
+ if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MediaPlayerPlugin ) )
+ *iface = this, (*iface)->addRef();
return QS_OK;
}
Q_EXPORT_INTERFACE()
{
Q_CREATE_INSTANCE( LibMpeg3PluginImpl )
}
#endif
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 @@
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef LIBMPEG3_PLUGIN_IMPL_H
#define LIBMPEG3_PLUGIN_IMPL_H
-//#include <qpe/mediaplayerplugininterface.h>
-#include "../mediaplayerplugininterface.h"
+#include <qpe/mediaplayerplugininterface.h>
+//#include "../mediaplayerplugininterface.h"
class LibMpeg3Plugin;
class LibMpeg3PluginImpl : public MediaPlayerPluginInterface
{
public:
LibMpeg3PluginImpl();
virtual ~LibMpeg3PluginImpl();
#ifndef QT_NO_COMPONENT