wtay's version

Original commit message from CVS:
wtay's version
This commit is contained in:
Thomas Vander Stichele 2001-12-20 22:27:35 +00:00
parent 1d55b3c653
commit 37770a0f4c
4 changed files with 506 additions and 31 deletions

View file

@ -1,11 +1,11 @@
filterdir = $(libdir)/gst
plugindir = $(libdir)/gst
filter_LTLIBRARIES = libgstmad.la
plugin_LTLIBRARIES = libgstmad.la
libgstmad_la_SOURCES = \
gstmad.c
libgstmad_la_CFLAGS = $(GST_CFLAGS)
libgstmad_la_LIBADD = -lmad
libgstmad_la_LIBADD = $(MAD_LIBS)
noinst_HEADERS = gstmad.h

View file

@ -0,0 +1,460 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
AALIB_CFLAGS = @AALIB_CFLAGS@
AALIB_CONFIG = @AALIB_CONFIG@
AALIB_LIBS = @AALIB_LIBS@
ALSA_CFLAGS = @ALSA_CFLAGS@
ALSA_LIBS = @ALSA_LIBS@
AMTAR = @AMTAR@
ARTSC_CFLAGS = @ARTSC_CFLAGS@
ARTSC_CONFIG = @ARTSC_CONFIG@
ARTSC_LIBS = @ARTSC_LIBS@
ARTS_CONFIG = @ARTS_CONFIG@
ARTS_CXXFLAGS = @ARTS_CXXFLAGS@
ARTS_LIBS = @ARTS_LIBS@
AS = @AS@
ASFLAGS = @ASFLAGS@
AVIFILE_CFLAGS = @AVIFILE_CFLAGS@
AVIFILE_LIBS = @AVIFILE_LIBS@
AWK = @AWK@
CC = @CC@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXFLAGS = @CXXFLAGS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
ECHO = @ECHO@
ESD_CFLAGS = @ESD_CFLAGS@
ESD_CONFIG = @ESD_CONFIG@
ESD_LIBS = @ESD_LIBS@
EXEEXT = @EXEEXT@
GHTTP_LIBS = @GHTTP_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_CONFIG = @GLIB_CONFIG@
GLIB_LIBS = @GLIB_LIBS@
GNOME_CFLAGS = @GNOME_CFLAGS@
GNOME_LIBS = @GNOME_LIBS@
GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
GST_AGE = @GST_AGE@
GST_CFLAGS = @GST_CFLAGS@
GST_CONFIG_DIR = @GST_CONFIG_DIR@
GST_CURRENT = @GST_CURRENT@
GST_DISABLE_ = @GST_DISABLE_@
GST_HTTPSRC_GET_TYPE = @GST_HTTPSRC_GET_TYPE@
GST_LIBS = @GST_LIBS@
GST_LIBVERSION = @GST_LIBVERSION@
GST_PKG_DEPS = @GST_PKG_DEPS@
GST_REVISION = @GST_REVISION@
GST_VERSION = @GST_VERSION@
GST_VERSION_MAJOR = @GST_VERSION_MAJOR@
GST_VERSION_MICRO = @GST_VERSION_MICRO@
GST_VERSION_MINOR = @GST_VERSION_MINOR@
GST_VERSION_RELEASE = @GST_VERSION_RELEASE@
GST_WIN32_LIBDIR = @GST_WIN32_LIBDIR@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_CONFIG = @GTK_CONFIG@
GTK_LIBS = @GTK_LIBS@
HAVE_ = @HAVE_@
HAVE_GNOME = @HAVE_GNOME@
HAVE_GTK_DOC = @HAVE_GTK_DOC@
HAVE_LIBGLADE_GNOME = @HAVE_LIBGLADE_GNOME@
HAVE_LIBLAME = @HAVE_LIBLAME@
HAVE_PKGCONFIG = @HAVE_PKGCONFIG@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBAUDIOFILE_CFLAGS = @LIBAUDIOFILE_CFLAGS@
LIBAUDIOFILE_LIBS = @LIBAUDIOFILE_LIBS@
LIBGLADE_CFLAGS = @LIBGLADE_CFLAGS@
LIBGLADE_CONFIG = @LIBGLADE_CONFIG@
LIBGLADE_GNOME_CFLAGS = @LIBGLADE_GNOME_CFLAGS@
LIBGLADE_GNOME_LIBS = @LIBGLADE_GNOME_LIBS@
LIBGLADE_LIBS = @LIBGLADE_LIBS@
LIBGST_CFLAGS = @LIBGST_CFLAGS@
LIBGST_LIBS = @LIBGST_LIBS@
LIBHERMES_LIBS = @LIBHERMES_LIBS@
LIBLAME_LIBS = @LIBLAME_LIBS@
LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@
LIBMIKMOD_CONFIG = @LIBMIKMOD_CONFIG@
LIBMIKMOD_LDADD = @LIBMIKMOD_LDADD@
LIBMIKMOD_LIBS = @LIBMIKMOD_LIBS@
LIBTOOL = @LIBTOOL@
LIBXML_PKG = @LIBXML_PKG@
LN_S = @LN_S@
MAINT = @MAINT@
NASM_PATH = @NASM_PATH@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PKG_CONFIG = @PKG_CONFIG@
PLUGINS_BUILDDIR = @PLUGINS_BUILDDIR@
PLUGINS_DIR = @PLUGINS_DIR@
RANLIB = @RANLIB@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SIDPLAY_CFLAGS = @SIDPLAY_CFLAGS@
SIDPLAY_LIBS = @SIDPLAY_LIBS@
STRIP = @STRIP@
USE_GLIB2 = @USE_GLIB2@
USE_GNOME2 = @USE_GNOME2@
VERSION = @VERSION@
VORBISENC_LIBS = @VORBISENC_LIBS@
VORBISFILE_LIBS = @VORBISFILE_LIBS@
VORBIS_CFLAGS = @VORBIS_CFLAGS@
VORBIS_LIBS = @VORBIS_LIBS@
XML_CFLAGS = @XML_CFLAGS@
XML_CONFIG = @XML_CONFIG@
XML_LIBS = @XML_LIBS@
XMMS_CFLAGS = @XMMS_CFLAGS@
XMMS_CONFIG = @XMMS_CONFIG@
XMMS_DATA_DIR = @XMMS_DATA_DIR@
XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@
XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@
XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@
XMMS_LIBS = @XMMS_LIBS@
XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@
XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@
XMMS_VERSION = @XMMS_VERSION@
XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
sidplay_cflags = @sidplay_cflags@
sidplay_library = @sidplay_library@
filterdir = $(libdir)/gst
filter_LTLIBRARIES = libgstmad.la
libgstmad_la_SOURCES = \
gstmad.c
libgstmad_la_CFLAGS = $(GST_CFLAGS)
libgstmad_la_LIBADD = -lmad
noinst_HEADERS = gstmad.h
subdir = ext/mad
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(filter_LTLIBRARIES)
libgstmad_la_LDFLAGS =
libgstmad_la_DEPENDENCIES =
am_libgstmad_la_OBJECTS = libgstmad_la-gstmad.lo
libgstmad_la_OBJECTS = $(am_libgstmad_la_OBJECTS)
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/libgstmad_la-gstmad.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CFLAGS = @CFLAGS@
DIST_SOURCES = $(libgstmad_la_SOURCES)
HEADERS = $(noinst_HEADERS)
DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in
SOURCES = $(libgstmad_la_SOURCES)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu ext/mad/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
install-filterLTLIBRARIES: $(filter_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(filterdir)
@list='$(filter_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(filterdir)/$$p"; \
$(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(filterdir)/$$p; \
else :; fi; \
done
uninstall-filterLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(filter_LTLIBRARIES)'; for p in $$list; do \
echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(filterdir)/$$p"; \
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(filterdir)/$$p; \
done
clean-filterLTLIBRARIES:
-test -z "$(filter_LTLIBRARIES)" || rm -f $(filter_LTLIBRARIES)
libgstmad_la-gstmad.lo: gstmad.c
libgstmad.la: $(libgstmad_la_OBJECTS) $(libgstmad_la_DEPENDENCIES)
$(LINK) -rpath $(filterdir) $(libgstmad_la_LDFLAGS) $(libgstmad_la_OBJECTS) $(libgstmad_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/libgstmad_la-gstmad.Plo@am__quote@
distclean-depend:
-rm -rf $(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
.c.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
libgstmad_la-gstmad.o: gstmad.c
@AMDEP_TRUE@ source='gstmad.c' object='libgstmad_la-gstmad.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgstmad_la-gstmad.Po' tmpdepfile='$(DEPDIR)/libgstmad_la-gstmad.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstmad_la_CFLAGS) $(CFLAGS) -c -o libgstmad_la-gstmad.o `test -f gstmad.c || echo '$(srcdir)/'`gstmad.c
libgstmad_la-gstmad.obj: gstmad.c
@AMDEP_TRUE@ source='gstmad.c' object='libgstmad_la-gstmad.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgstmad_la-gstmad.Po' tmpdepfile='$(DEPDIR)/libgstmad_la-gstmad.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstmad_la_CFLAGS) $(CFLAGS) -c -o libgstmad_la-gstmad.obj `cygpath -w gstmad.c`
libgstmad_la-gstmad.lo: gstmad.c
@AMDEP_TRUE@ source='gstmad.c' object='libgstmad_la-gstmad.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/libgstmad_la-gstmad.Plo' tmpdepfile='$(DEPDIR)/libgstmad_la-gstmad.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgstmad_la_CFLAGS) $(CFLAGS) -c -o libgstmad_la-gstmad.lo `test -f gstmad.c || echo '$(srcdir)/'`gstmad.c
CCDEPMODE = @CCDEPMODE@
uninstall-info-am:
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(filterdir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-filterLTLIBRARIES clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am: install-filterLTLIBRARIES
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-filterLTLIBRARIES uninstall-info-am
.PHONY: GTAGS all all-am check check-am clean clean-filterLTLIBRARIES \
clean-generic clean-libtool distclean distclean-compile \
distclean-depend distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
install-exec-am install-filterLTLIBRARIES install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool tags uninstall \
uninstall-am uninstall-filterLTLIBRARIES uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -19,9 +19,6 @@
#include <string.h>
#include "gstmad.h"
#include <libs/audio/gstaudio.h>
//#define DEBUG_TIMESTAMP
/* elementfactory information */
static GstElementDetails gst_mad_details = {
@ -136,7 +133,7 @@ gst_mad_init (GstMad *mad)
gst_element_set_loop_function (GST_ELEMENT (mad), GST_DEBUG_FUNCPTR(gst_mad_loop));
// the MAD API is broken, so we have to set this
// GST_FLAG_SET(GST_ELEMENT(mad), GST_ELEMENT_NO_ENTRY);
//GST_FLAG_SET(GST_ELEMENT(mad), GST_ELEMENT_NO_ENTRY);
mad_decoder_init (&mad->decoder, mad,
gst_mad_input, 0 /* header */, 0 /* filter */, gst_mad_output,
@ -147,6 +144,7 @@ gst_mad_init (GstMad *mad)
mad->need_sync = TRUE;
mad->last_time = 0;
mad->framestamp = 0;
mad->new_header = TRUE;
}
static enum mad_flow
@ -239,8 +237,8 @@ gst_mad_input (void *user_data,
mad_stream_buffer (stream, mad->tempbuffer, mad->tempsize);
/* this doesn't seem to work very well.. */
//if (mad->need_sync)
// mad_stream_sync (stream);
/*if (mad->need_sync)
mad_stream_sync (stream); */
GST_DEBUG (0, "decoder_in done %p\n", stream->next_frame);
@ -263,6 +261,37 @@ scale (mad_fixed_t sample)
return sample >> (MAD_F_FRACBITS + 1 - 16);
}
static gchar *layers[] = { "unknown", "I", "II", "III" };
static gchar *modes[] = { "single channel", "dual channel", "joint stereo", "stereo" };
static gchar *emphases[] = { "none", "50/15 microseconds", "CCITT J.17" };
static void
gst_mad_update_info (GstMad *mad, struct mad_header const *header)
{
#define CHECK_HEADER(h1,str,prop) \
G_STMT_START{ \
if (mad->header.h1 != header->h1 || mad->new_header) { \
mad->header.h1 = header->h1; \
gst_element_send_event (GST_ELEMENT (mad), \
gst_event_new_info (str, prop, NULL)); \
}; \
}G_STMT_END
CHECK_HEADER (layer, "layer", GST_PROPS_STRING (layers[header->layer]));
CHECK_HEADER (mode, "mode", GST_PROPS_STRING (modes[header->mode]));
CHECK_HEADER (emphasis, "emphasis", GST_PROPS_STRING (emphases[header->emphasis]));
CHECK_HEADER (bitrate, "bitrate", GST_PROPS_INT (header->bitrate));
CHECK_HEADER (samplerate, "samplerate", GST_PROPS_INT (header->samplerate));
if (mad->channels != MAD_NCHANNELS (header) || mad->new_header) {
mad->channels = MAD_NCHANNELS (header);
gst_element_send_event (GST_ELEMENT (mad),
gst_event_new_info ("channels", GST_PROPS_INT (mad->channels), NULL));
}
mad->new_header = FALSE;
}
static enum mad_flow
gst_mad_output (void *data,
struct mad_header const *header,
@ -284,22 +313,13 @@ gst_mad_output (void *data,
left_ch = pcm->samples[0];
right_ch = pcm->samples[1];
gst_mad_update_info (mad, header);
buffer = gst_buffer_new ();
outdata = (gint16 *) GST_BUFFER_DATA (buffer) = g_malloc (nsamples*nchannels*2);
GST_BUFFER_SIZE (buffer) = nsamples*nchannels*2;
GST_BUFFER_TIMESTAMP (buffer) = mad->last_time;
/* this bit added by thomas to try timestamps */
#ifdef DEBUG_TIMESTAMP
mad->framestamp += gst_audio_frame_length (mad->srcpad, buffer);
if (GST_BUFFER_TIMESTAMP (buffer) == 0)
{
GST_BUFFER_TIMESTAMP (buffer) = mad->framestamp * 1E9
/ gst_audio_frame_rate (mad->srcpad);
printf ("DEBUG: mad: timestamp set on output buffer: %f sec\n",
GST_BUFFER_TIMESTAMP (buffer) / 1E9);
}
#endif
/* end of new bit */
while (nsamples--) {
/* output sample(s) in 16-bit signed native-endian PCM */
@ -331,8 +351,7 @@ gst_mad_output (void *data,
}
if (mad->need_sync) {
// use an event FIXME
// GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLUSH);
/* use an event FIXME */
mad->need_sync = FALSE;
}
if (GST_PAD_CONNECTED (mad->srcpad))
@ -384,15 +403,6 @@ plugin_init (GModule *module, GstPlugin *plugin)
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
/* load audio support library */
/*
if (!gst_library_load ("gstaudio"))
{
gst_info ("mad: could not load support library: 'gstaudio'\n");
return FALSE;
}
*/
return TRUE;
}

View file

@ -57,6 +57,11 @@ struct _GstMad {
gboolean need_sync;
guint64 last_time;
guint64 framestamp; /* timestamp-like, but counted in frames */
/* info */
struct mad_header header;
gboolean new_header;
gint channels;
};
struct _GstMadClass {