Original commit message from CVS:

* configure.ac:
* gst/modplug/Makefile.am:
* gst/modplug/gstmodplug.cc:
* gst/modplug/gstmodplug.h:
* gst/modplug/libmodplug/sndfile.cpp:
* gst/modplug/libmodplug/sndfile.h:
modplug plugin ported to 0.10 (#332598, patch by:
Jonathan Matthew <jonathan at kaolin wh9 net>).
This commit is contained in:
Tim-Philipp Müller 2006-03-10 17:10:09 +00:00
parent e276fe38ba
commit 55e2df5153
7 changed files with 564 additions and 540 deletions

View file

@ -1,3 +1,14 @@
2006-03-10 Tim-Philipp Müller <tim at centricular dot net>
* configure.ac:
* gst/modplug/Makefile.am:
* gst/modplug/gstmodplug.cc:
* gst/modplug/gstmodplug.h:
* gst/modplug/libmodplug/sndfile.cpp:
* gst/modplug/libmodplug/sndfile.h:
modplug plugin ported to 0.10 (#332598, patch by:
Jonathan Matthew <jonathan at kaolin wh9 net>).
2006-03-10 Tim-Philipp Müller <tim at centricular dot net> 2006-03-10 Tim-Philipp Müller <tim at centricular dot net>
* ext/libmms/gstmms.c: (gst_mms_urihandler_init), * ext/libmms/gstmms.c: (gst_mms_urihandler_init),

View file

@ -290,7 +290,9 @@ GST_PLUGINS_ALL="\
dnl see if we can build C++ plug-ins dnl see if we can build C++ plug-ins
if test "x$HAVE_CXX" = "xyes"; then if test "x$HAVE_CXX" = "xyes"; then
GST_PLUGINS_ALL="$GST_PLUGINS_ALL" GST_PLUGINS_ALL="$GST_PLUGINS_ALL \
modplug \
"
else else
AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler]) AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
fi fi
@ -723,6 +725,8 @@ gst-plugins-bad.spec
gst/Makefile gst/Makefile
gst/cdxaparse/Makefile gst/cdxaparse/Makefile
gst/freeze/Makefile gst/freeze/Makefile
gst/modplug/Makefile
gst/modplug/libmodplug/Makefile
gst/speed/Makefile gst/speed/Makefile
gst/qtdemux/Makefile gst/qtdemux/Makefile
gst/tta/Makefile gst/tta/Makefile

View file

@ -5,6 +5,6 @@ plugin_LTLIBRARIES = libgstmodplug.la
libgstmodplug_la_SOURCES = gstmodplug.cc libgstmodplug_la_SOURCES = gstmodplug.cc
libgstmodplug_la_CXXFLAGS = $(GST_CFLAGS) libgstmodplug_la_CXXFLAGS = $(GST_CFLAGS)
libgstmodplug_la_LIBADD = $(top_builddir)/gst/modplug/libmodplug/libmodplug.la libgstmodplug_la_LIBADD = $(top_builddir)/gst/modplug/libmodplug/libmodplug.la
libgstmodplug_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstmodplug_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -lstdc++
noinst_HEADERS = gstmodplug.h noinst_HEADERS = gstmodplug.h

File diff suppressed because it is too large Load diff

View file

@ -21,12 +21,9 @@
#ifndef __GST_MODPLUG_H__ #ifndef __GST_MODPLUG_H__
#define __GST_MODPLUG_H__ #define __GST_MODPLUG_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/bytestream/bytestream.h>
G_BEGIN_DECLS
#define GST_TYPE_MODPLUG \ #define GST_TYPE_MODPLUG \
(gst_modplug_get_type()) (gst_modplug_get_type())
@ -34,46 +31,48 @@ extern "C" {
#define GST_MODPLUG(obj) \ #define GST_MODPLUG(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MODPLUG,GstModPlug)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MODPLUG,GstModPlug))
#define GST_MODPLUG_CLASS(klass) \ #define GST_MODPLUG_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ULAW,GstModPlug)) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MODPLUG,GstModPlug))
#define GST_IS_MODPLUG(obj) \ #define GST_IS_MODPLUG(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MODPLUG)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MODPLUG))
#define GST_IS_MODPLUG_CLASS(obj) \ #define GST_IS_MODPLUG_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MODPLUG)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MODPLUG))
struct _GstModPlug { struct _GstModPlug {
GstElement element; GstElement element;
GstPad *sinkpad, *srcpad;
guint8 *buffer_in;
GstByteStream *bs;
GstPad *sinkpad;
GstPad *srcpad;
/* properties */
const gchar *songname; const gchar *songname;
gboolean reverb; gboolean reverb;
gint reverb_depth; gint reverb_depth;
gint reverb_delay; gint reverb_delay;
gboolean megabass; gboolean megabass;
gint megabass_amount; gint megabass_amount;
gint megabass_range; gint megabass_range;
gboolean surround; gboolean surround;
gint surround_depth; gint surround_depth;
gint surround_delay; gint surround_delay;
gboolean noise_reduction; gboolean noise_reduction;
gboolean _16bit; gboolean _16bit;
gboolean oversamp; gboolean oversamp;
gint channel; gint channel;
gint frequency; gint frequency;
guchar *audiobuffer; /* state */
gint32 length; GstBuffer *buffer;
guint state;
guint bitsPerSample;
gboolean need_discont;
gboolean eos;
gint64 seek_at;
guint64 song_size;
guint64 timestamp;
CSoundFile *mSoundFile; gint32 read_bytes;
gboolean opened; /* set to TRUE when mSoundFile is created */ gint32 read_samples;
gint64 seek_at; /* pending seek, or -1 */
gint64 song_size; /* size of the raw song data in bytes */
gint64 song_length; /* duration of the song in nanoseconds */
gint64 offset; /* current position in samples */
gint64 timestamp;
CSoundFile *mSoundFile;
}; };
struct _GstModPlugClass { struct _GstModPlugClass {
@ -83,13 +82,8 @@ struct _GstModPlugClass {
typedef struct _GstModPlug GstModPlug; typedef struct _GstModPlug GstModPlug;
typedef struct _GstModPlugClass GstModPlugClass; typedef struct _GstModPlugClass GstModPlugClass;
GstPad *srcpad; GType gst_modplug_get_type (void);
int need_sync;
GType gst_modplug_get_type(void); G_END_DECLS
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GST_MODPLUG_H__ */ #endif /* __GST_MODPLUG_H__ */

View file

@ -1175,7 +1175,8 @@ UINT CSoundFile::ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR lpMemFile,
short int *pSample = (short int *)pIns->pSample; short int *pSample = (short int *)pIns->pSample;
for (UINT j=0; j<len; j+=2) for (UINT j=0; j<len; j+=2)
{ {
*pSample++ = bswapLE16(*pSample); short int s = bswapLE16(*pSample);
*pSample++ = s;
} }
} }
break; break;
@ -1366,7 +1367,8 @@ UINT CSoundFile::ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR lpMemFile,
WORD *pSampleW = (WORD *)pIns->pSample; WORD *pSampleW = (WORD *)pIns->pSample;
for (UINT j=0; j<len; j+=2) // swaparoni! for (UINT j=0; j<len; j+=2) // swaparoni!
{ {
*pSampleW++ = bswapLE16(*pSampleW); WORD s = bswapLE16(*pSampleW);
*pSampleW++ = s;
} }
} }
break; break;

View file

@ -448,6 +448,7 @@ typedef struct _MODCOMMAND
class IMixPlugin class IMixPlugin
{ {
public: public:
virtual ~IMixPlugin() {};
virtual int AddRef() = 0; virtual int AddRef() = 0;
virtual int Release() = 0; virtual int Release() = 0;
virtual void SaveAllParameters() = 0; virtual void SaveAllParameters() = 0;