Commit 94bcb745 authored by Andy Wingo's avatar Andy Wingo

configure.ac (GST_PLUGIN_LDFLAGS): Change to be like -base.

Original commit message from CVS:
2005-10-02  Andy Wingo  <wingo@pobox.com>

* configure.ac (GST_PLUGIN_LDFLAGS): Change to be like -base.

* ext/flac/gstflacenc.c: Ported to 0.9.

* ext/flac/gstflacdec.c (gst_flacdec_loop): Handle errors better.

* ext/flac/Makefile.am: Add the GST_PLUGINS_BASE cflags and libs,
and link to gsttagedit. Enable flacenc.

* ext/flac/gstflacdec.c: Re-enable tag reading.
parent 75a0669d
2005-10-02 Andy Wingo <wingo@pobox.com>
* configure.ac (GST_PLUGIN_LDFLAGS): Change to be like -base.
* ext/flac/gstflacenc.c: Ported to 0.9.
* ext/flac/gstflacdec.c (gst_flacdec_loop): Handle errors better.
* ext/flac/Makefile.am: Add the GST_PLUGINS_BASE cflags and libs,
and link to gsttagedit. Enable flacenc.
* ext/flac/gstflacdec.c: Re-enable tag reading.
2005-09-30 Wim Taymans <wim@fluendo.com>
* gst/rtp/gstrtpamrenc.c: (gst_rtpamrenc_setcaps):
......
......@@ -259,7 +259,7 @@ dnl ===========================================================================
plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
AC_SUBST(plugindir)
GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '[_]*(gst_|Gst|GST_).*'"
GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' -no-undefined"
AC_SUBST(GST_PLUGIN_LDFLAGS)
dnl these are all the gst plug-ins, compilable without additional libs
......
plugin_LTLIBRARIES = libgstflac.la
libgstflac_la_SOURCES = gstflac.c gstflacdec.c
libgstflac_la_SOURCES = gstflac.c gstflacdec.c gstflacenc.c
#gstflacenc.c gstflactag.c
libgstflac_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)
libgstflac_la_LIBADD = $(GST_LIBS) $(FLAC_LIBS)
libgstflac_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir) $(GST_PLUGINS_BASE_CFLAGS)
libgstflac_la_LIBADD = $(GST_LIBS) $(FLAC_LIBS) $(GST_PLUGINS_BASE_LIBS) \
-lgsttagedit-@GST_MAJORMINOR@
libgstflac_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstflacenc.h gstflacdec.h flac_compat.h gstflactag.h
......@@ -30,11 +30,9 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
#if 0
if (!gst_element_register (plugin, "flacenc", GST_RANK_NONE,
GST_TYPE_FLACENC))
return FALSE;
#endif
if (!gst_element_register (plugin, "flacdec", GST_RANK_PRIMARY,
GST_TYPE_FLACDEC))
return FALSE;
......
......@@ -25,7 +25,7 @@
#include "gstflacdec.h"
#include <gst/gsttagsetter.h>
//#include <gst/tag/tag.h>
#include <gst/tag/tag.h>
#include "flac_compat.h"
......@@ -256,7 +256,7 @@ gst_flacdec_update_metadata (FlacDec * flacdec,
value = g_strndup (p_value + 1, str_ptr + str_len - p_value - 1);
GST_DEBUG ("%s : %s", name, value);
//gst_vorbis_tag_add (list, name, value);
gst_vorbis_tag_add (list, name, value);
g_free (name);
g_free (value);
}
......@@ -518,7 +518,6 @@ static void
gst_flacdec_loop (GstPad * sinkpad)
{
FlacDec *flacdec;
gboolean res;
FLAC__SeekableStreamDecoderState s;
flacdec = GST_FLACDEC (GST_OBJECT_PARENT (sinkpad));
......@@ -527,15 +526,10 @@ gst_flacdec_loop (GstPad * sinkpad)
GST_DEBUG ("flacdec: entering loop");
if (flacdec->init) {
FLAC__StreamDecoderState res;
GST_DEBUG ("flacdec: initializing decoder");
res = FLAC__seekable_stream_decoder_init (flacdec->decoder);
if (res != FLAC__SEEKABLE_STREAM_DECODER_OK) {
GST_ELEMENT_ERROR (flacdec, LIBRARY, INIT, (NULL),
(FLAC__SeekableStreamDecoderStateString[res]));
goto end;
}
s = FLAC__seekable_stream_decoder_init (flacdec->decoder);
if (s != FLAC__SEEKABLE_STREAM_DECODER_OK)
goto analyze_state;
/* FLAC__seekable_stream_decoder_process_metadata (flacdec->decoder); */
flacdec->init = FALSE;
}
......@@ -555,33 +549,59 @@ gst_flacdec_loop (GstPad * sinkpad)
}
GST_DEBUG ("flacdec: processing single");
res = FLAC__seekable_stream_decoder_process_single (flacdec->decoder);
if (!res)
goto end;
GST_DEBUG ("flacdec: checking for EOS");
if ((s = FLAC__seekable_stream_decoder_get_state (flacdec->decoder)) ==
FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM) {
GstEvent *event;
GST_DEBUG ("flacdec: sending EOS event");
FLAC__seekable_stream_decoder_reset (flacdec->decoder);
event = gst_event_new_eos ();
if (!gst_pad_push_event (flacdec->srcpad, event))
goto end;
} else if (s >= FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR &&
s <= FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK) {
GST_DEBUG ("Error: %d", s);
goto end;
FLAC__seekable_stream_decoder_process_single (flacdec->decoder);
analyze_state:
GST_DEBUG ("flacdec: done processing, checking encoder state");
s = FLAC__seekable_stream_decoder_get_state (flacdec->decoder);
switch (s) {
case FLAC__SEEKABLE_STREAM_DECODER_OK:
case FLAC__SEEKABLE_STREAM_DECODER_SEEKING:
GST_DEBUG ("flacdec: everything ok");
GST_STREAM_UNLOCK (sinkpad);
return;
case FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM:{
GstEvent *event;
GST_DEBUG ("flacdec: got EOS, pushing downstream");
FLAC__seekable_stream_decoder_reset (flacdec->decoder);
event = gst_event_new_eos ();
gst_pad_push_event (flacdec->srcpad, event);
GST_DEBUG ("pausing");
gst_pad_pause_task (sinkpad);
GST_STREAM_UNLOCK (sinkpad);
return;
}
case FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
case FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR:
case FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR:
case FLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR:
case FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED:
case FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK:
case FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED:
default:{
GstEvent *event;
/* fixme: this error sucks -- should try to figure out when/if an more
specific error was already sent via the callback */
GST_ELEMENT_ERROR (flacdec, STREAM, DECODE, (NULL),
("%s", FLAC__SeekableStreamDecoderStateString[s]));
event = gst_event_new_eos ();
gst_pad_push_event (flacdec->srcpad, event);
GST_DEBUG ("pausing");
gst_pad_pause_task (sinkpad);
GST_STREAM_UNLOCK (sinkpad);
return;
}
}
GST_DEBUG ("flacdec: _loop end");
GST_STREAM_UNLOCK (sinkpad);
return;
end:
GST_DEBUG ("pausing");
gst_pad_pause_task (sinkpad);
GST_STREAM_UNLOCK (sinkpad);
}
#if 0
......
This diff is collapsed.
......@@ -26,20 +26,20 @@
#include <FLAC/all.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_FLACENC flacenc_get_type()
#define GST_FLACENC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLACENC, FlacEnc)
#define GST_FLACENC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_FLACENC, FlacEnc)
G_BEGIN_DECLS
#define GST_TYPE_FLACENC (gst_flacenc_get_type())
#define GST_FLACENC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLACENC, GstFlacEnc)
#define GST_FLACENC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_FLACENC, GstFlacEnc)
#define GST_IS_FLACENC(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_FLACENC)
#define GST_IS_FLACENC_CLASS(obj) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_FLACENC)
typedef struct _FlacEnc FlacEnc;
typedef struct _FlacEncClass FlacEncClass;
typedef struct _GstFlacEnc GstFlacEnc;
typedef struct _GstFlacEncClass GstFlacEncClass;
struct _FlacEnc {
struct _GstFlacEnc {
GstElement element;
GstPad *sinkpad,*srcpad;
......@@ -62,15 +62,14 @@ struct _FlacEnc {
GstTagList * tags;
};
struct _FlacEncClass {
struct _GstFlacEncClass {
GstElementClass parent_class;
};
GType flacenc_get_type(void);
GType gst_flacenc_get_type(void);
G_END_DECLS
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __FLACENC_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment