summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmad
authorllornkcor <llornkcor>2002-02-25 05:10:32 (UTC)
committer llornkcor <llornkcor>2002-02-25 05:10:32 (UTC)
commit1bebd27631a6c9d1ab967cbb32dd4e796b3b0402 (patch) (side-by-side diff)
tree8ce49800cba26f6f2c33de74a71d4efe0338843f /core/multimedia/opieplayer/libmad
parentd948361c1b475fab4660b28fbf5ec21fd34d923f (diff)
downloadopie-1bebd27631a6c9d1ab967cbb32dd4e796b3b0402.zip
opie-1bebd27631a6c9d1ab967cbb32dd4e796b3b0402.tar.gz
opie-1bebd27631a6c9d1ab967cbb32dd4e796b3b0402.tar.bz2
fixed 2
Diffstat (limited to 'core/multimedia/opieplayer/libmad') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmad/Makefile.in2
-rw-r--r--core/multimedia/opieplayer/libmad/libmad.pro0
-rw-r--r--core/multimedia/opieplayer/libmad/libmadplugin.cpp2
-rw-r--r--core/multimedia/opieplayer/libmad/libmadplugin.h4
-rw-r--r--core/multimedia/opieplayer/libmad/libmadpluginimpl.h4
5 files changed, 8 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/libmad/Makefile.in b/core/multimedia/opieplayer/libmad/Makefile.in
index e9f74e7..552043c 100644
--- a/core/multimedia/opieplayer/libmad/Makefile.in
+++ b/core/multimedia/opieplayer/libmad/Makefile.in
@@ -193,31 +193,33 @@ layer12.o: layer12.c \
frame.h \
timer.h \
layer12.h \
sf_table.dat \
qc_table.dat
layer3.o: layer3.c \
libmad_global.h \
fixed.h \
bit.h \
stream.h \
frame.h \
timer.h \
huffman.h \
layer3.h \
rq_table.dat \
imdct_s.dat
huffman.o: huffman.c \
libmad_global.h \
huffman.h
libmadplugin.o: libmadplugin.cpp \
libmadplugin.h \
+ ../mediaplayerplugininterface.h \
mad.h
libmadpluginimpl.o: libmadpluginimpl.cpp \
libmadplugin.h \
+ ../mediaplayerplugininterface.h \
libmadpluginimpl.h
diff --git a/core/multimedia/opieplayer/libmad/libmad.pro b/core/multimedia/opieplayer/libmad/libmad.pro
index 6c40a15..06e19e4 100644
--- a/core/multimedia/opieplayer/libmad/libmad.pro
+++ b/core/multimedia/opieplayer/libmad/libmad.pro
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.cpp b/core/multimedia/opieplayer/libmad/libmadplugin.cpp
index 9d04f7e..9f8ba65 100644
--- a/core/multimedia/opieplayer/libmad/libmadplugin.cpp
+++ b/core/multimedia/opieplayer/libmad/libmadplugin.cpp
@@ -444,49 +444,49 @@ bool LibMadPlugin::decode( short *output, long samples, long& samplesMade ) {
d->flush = FALSE;
}
while ( buffered < maxBuffered ) {
while (mad_frame_decode(&d->frame, &d->stream) == -1) {
if (!MAD_RECOVERABLE(d->stream.error)) {
debugMsg( "feed me" );
return FALSE; // Feed me
}
if ( d->stream.error == MAD_ERROR_BADCRC ) {
mad_frame_mute(&d->frame);
qDebug( "error decoding, bad crc" );
}
}
mad_synth_frame(&d->synth, &d->frame);
int decodedSamples = d->synth.pcm.length;
memcpy( &(buffer[0][offset]), d->synth.pcm.samples[0], decodedSamples * sizeof(mad_fixed_t) );
if ( d->synth.pcm.channels == 2 )
memcpy( &(buffer[1][offset]), d->synth.pcm.samples[1], decodedSamples * sizeof(mad_fixed_t) );
offset += decodedSamples;
buffered += decodedSamples;
}
-
+//qApp->processEvents();
audio_pcm( output, samples, buffer[0], (d->synth.pcm.channels == 2) ? buffer[1] : 0 );
// audio_pcm( output, samples, buffer[1], buffer[0] );
// audio_pcm( output, samples, buffer[0], buffer[1] );
samplesMade = samples;
memmove( buffer[0], &(buffer[0][samples]), (buffered - samples) * sizeof(mad_fixed_t) );
if ( d->synth.pcm.channels == 2 )
memmove( buffer[1], &(buffer[1][samples]), (buffered - samples) * sizeof(mad_fixed_t) );
buffered -= samples;
return TRUE;
}
/*
bool LibMadPlugin::audioReadMonoSamples( short *, long, long&, int ) {
debugMsg( "LibMadPlugin::audioReadMonoSamples" );
return FALSE;
}
bool LibMadPlugin::audioReadStereoSamples( short *output, long samples, long& samplesMade, int ) {
*/
bool LibMadPlugin::audioReadSamples( short *output, int /*channels*/, long samples, long& samplesMade, int ) {
debugMsg( "LibMadPlugin::audioReadStereoSamples" );
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.h b/core/multimedia/opieplayer/libmad/libmadplugin.h
index d85e0d4..d163458 100644
--- a/core/multimedia/opieplayer/libmad/libmadplugin.h
+++ b/core/multimedia/opieplayer/libmad/libmadplugin.h
@@ -1,78 +1,80 @@
/**********************************************************************
** Copyright (C) 2001 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** 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 LIBMAD_PLUGIN_H
#define LIBMAD_PLUGIN_H
#include <qstring.h>
-#include <qpe/mediaplayerplugininterface.h>
+//#include <qpe/mediaplayerplugininterface.h>
+#include "../mediaplayerplugininterface.h"
// #define OLD_MEDIAPLAYER_API
class LibMadPluginData;
class LibMadPlugin : public MediaPlayerDecoder {
public:
LibMadPlugin();
~LibMadPlugin();
const char *pluginName() { return "LibMadPlugin"; }
const char *pluginComment() { return "This is the libmad library that has been wrapped as a plugin"; }
double pluginVersion() { return 1.0; }
bool isFileSupported( const QString& );
bool open( const QString& );
bool close();
bool isOpen();
const QString &fileInfo() { return info; }
// If decoder doesn't support audio then return 0 here
int audioStreams();
int audioChannels( int stream );
int audioFrequency( int stream );
int audioSamples( int stream );
bool audioSetSample( long sample, int stream );
+ int audioBitsPerSample(int) {return 0;}
long audioGetSample( int stream );
#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
bool read();
bool decode( short *output, long samples, long& samplesRead );
void printID3Tags();
// If decoder doesn't support video then return 0 here
int videoStreams() { return 0; }
int videoWidth( int ) { return 0; }
int videoHeight( int ) { return 0; }
double videoFrameRate( int ) { return 0.0; }
int videoFrames( int ) { return 0; }
bool videoSetFrame( long, int ) { return FALSE; }
long videoGetFrame( int ) { return 0; }
diff --git a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
index 2c5ed3b..bc864ee 100644
--- a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
+++ b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
@@ -1,52 +1,52 @@
/**********************************************************************
** Copyright (C) 2001 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** 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 LIBMAD_PLUGIN_IMPL_H
#define LIBMAD_PLUGIN_IMPL_H
-#include <qpe/mediaplayerplugininterface.h>
+//#include <qpe/mediaplayerplugininterface.h>
+#include "../mediaplayerplugininterface.h"
class LibMadPlugin;
class LibMadPluginImpl : public MediaPlayerPluginInterface
{
public:
LibMadPluginImpl();
virtual ~LibMadPluginImpl();
#ifndef QT_NO_COMPONENT
QRESULT queryInterface( const QUuid&, QUnknownInterface** );
Q_REFCOUNT
#endif
virtual MediaPlayerDecoder *decoder();
virtual MediaPlayerEncoder *encoder();
-
private:
LibMadPlugin *libmadplugin;
ulong ref;
};
#endif