summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gme/gstgme.c4
-rw-r--r--ext/opus/gstopusparse.c3
-rw-r--r--ext/schroedinger/gstschrodec.c19
-rw-r--r--ext/schroedinger/gstschroenc.c28
-rw-r--r--ext/schroedinger/gstschroutils.c27
-rw-r--r--gst/mpegtsdemux/mpegtsbase.c20
-rw-r--r--gst/mpegtsdemux/mpegtspacketizer.c5
-rw-r--r--sys/decklink/Makefile.am3
-rw-r--r--sys/decklink/gstdecklink.h2
-rw-r--r--sys/decklink/gstdecklinksink.cpp17
-rw-r--r--sys/decklink/gstdecklinksink.h1
-rwxr-xr-xtools/gst-project-maker324
12 files changed, 409 insertions, 44 deletions
diff --git a/ext/gme/gstgme.c b/ext/gme/gstgme.c
index a3cfdaaba..1cd6161ac 100644
--- a/ext/gme/gstgme.c
+++ b/ext/gme/gstgme.c
@@ -363,7 +363,7 @@ gst_gme_play (GstPad * pad)
gst_buffer_unmap (out, &map);
if (gme_err) {
- GST_ELEMENT_ERROR (gme, STREAM, DEMUX, (NULL), (gme_err));
+ GST_ELEMENT_ERROR (gme, STREAM, DEMUX, (NULL), ("%s", gme_err));
gst_pad_pause_task (pad);
gst_pad_push_event (pad, gst_event_new_eos ());
gst_object_unref (gme);
@@ -433,7 +433,7 @@ gme_setup (GstGmeDec * gme)
gme->player = NULL;
}
- GST_ELEMENT_ERROR (gme, STREAM, DEMUX, (NULL), (gme_err));
+ GST_ELEMENT_ERROR (gme, STREAM, DEMUX, (NULL), ("%s", gme_err));
return FALSE;
}
diff --git a/ext/opus/gstopusparse.c b/ext/opus/gstopusparse.c
index 9bb2c2216..fe6a77334 100644
--- a/ext/opus/gstopusparse.c
+++ b/ext/opus/gstopusparse.c
@@ -154,7 +154,8 @@ gst_opus_parse_check_valid_frame (GstBaseParse * base,
parse = GST_OPUS_PARSE (base);
data = gst_buffer_map (frame->buffer, &size, NULL, GST_MAP_READ);
- GST_DEBUG_OBJECT (parse, "Checking for frame, %u bytes in buffer", size);
+ GST_DEBUG_OBJECT (parse,
+ "Checking for frame, %" G_GSIZE_FORMAT " bytes in buffer", size);
/* check for headers */
is_idheader = gst_opus_header_is_id_header (frame->buffer);
diff --git a/ext/schroedinger/gstschrodec.c b/ext/schroedinger/gstschrodec.c
index 7508b3885..68e143fa7 100644
--- a/ext/schroedinger/gstschrodec.c
+++ b/ext/schroedinger/gstschrodec.c
@@ -99,10 +99,11 @@ GST_STATIC_PAD_TEMPLATE ("sink",
);
static GstStaticPadTemplate gst_schro_dec_src_template =
-GST_STATIC_PAD_TEMPLATE ("src",
+ GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV (GST_SCHRO_YUV_LIST))
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV (GST_SCHRO_YUV_LIST) ";"
+ GST_VIDEO_CAPS_ARGB)
);
GST_BOILERPLATE (GstSchroDec, gst_schro_dec, GstBaseVideoDecoder,
@@ -313,13 +314,15 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
ret = schro_parse_decode_sequence_header (data + 13, size - 13,
&video_format);
if (ret) {
-#if SCHRO_CHECK_VERSION(1,0,11)
int bit_depth;
+#if SCHRO_CHECK_VERSION(1,0,11)
bit_depth = schro_video_format_get_bit_depth (&video_format);
+#else
+ bit_depth = 8;
+#endif
if (bit_depth == 8) {
-#endif
if (video_format.chroma_format == SCHRO_CHROMA_444) {
state->format = GST_VIDEO_FORMAT_AYUV;
} else if (video_format.chroma_format == SCHRO_CHROMA_422) {
@@ -329,14 +332,18 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
}
#if SCHRO_CHECK_VERSION(1,0,11)
} else if (bit_depth <= 10) {
- state->format = GST_VIDEO_FORMAT_v210;
+ if (video_format.colour_matrix == SCHRO_COLOUR_MATRIX_REVERSIBLE) {
+ state->format = GST_VIDEO_FORMAT_ARGB;
+ } else {
+ state->format = GST_VIDEO_FORMAT_v210;
+ }
} else if (bit_depth <= 16) {
state->format = GST_VIDEO_FORMAT_AYUV64;
} else {
GST_ERROR ("bit depth too large (%d > 16)", bit_depth);
state->format = GST_VIDEO_FORMAT_AYUV64;
- }
#endif
+ }
state->fps_n = video_format.frame_rate_numerator;
state->fps_d = video_format.frame_rate_denominator;
GST_DEBUG_OBJECT (schro_dec, "Frame rate is %d/%d", state->fps_n,
diff --git a/ext/schroedinger/gstschroenc.c b/ext/schroedinger/gstschroenc.c
index 933a92102..3836d2115 100644
--- a/ext/schroedinger/gstschroenc.c
+++ b/ext/schroedinger/gstschroenc.c
@@ -103,11 +103,16 @@ static GstFlowReturn gst_schro_enc_shape_output (GstBaseVideoEncoder *
base_video_encoder, GstVideoFrame * frame);
static void gst_schro_enc_finalize (GObject * object);
+#if SCHRO_CHECK_VERSION(1,0,12)
+#define ARGB_CAPS ";" GST_VIDEO_CAPS_ARGB
+#else
+#define ARGB_CAPS
+#endif
static GstStaticPadTemplate gst_schro_enc_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV (GST_SCHRO_YUV_LIST))
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV (GST_SCHRO_YUV_LIST) ARGB_CAPS)
);
static GstStaticPadTemplate gst_schro_enc_src_template =
@@ -285,15 +290,15 @@ gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
schro_enc->video_format->chroma_format = SCHRO_CHROMA_422;
break;
case GST_VIDEO_FORMAT_AYUV:
+#if SCHRO_CHECK_VERSION(1,0,12)
+ case GST_VIDEO_FORMAT_ARGB:
+#endif
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_AYUV64:
#endif
schro_enc->video_format->chroma_format = SCHRO_CHROMA_444;
break;
- case GST_VIDEO_FORMAT_ARGB:
- schro_enc->video_format->chroma_format = SCHRO_CHROMA_420;
- break;
default:
g_assert_not_reached ();
}
@@ -311,14 +316,12 @@ gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
schro_enc->video_format->aspect_ratio_numerator = state->par_n;
schro_enc->video_format->aspect_ratio_denominator = state->par_d;
-#if SCHRO_CHECK_VERSION(1,0,11)
switch (state->format) {
default:
-#endif
schro_video_format_set_std_signal_range (schro_enc->video_format,
SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
-#if SCHRO_CHECK_VERSION(1,0,11)
break;
+#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_v210:
schro_video_format_set_std_signal_range (schro_enc->video_format,
SCHRO_SIGNAL_RANGE_10BIT_VIDEO);
@@ -330,8 +333,16 @@ gst_schro_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
schro_enc->video_format->chroma_offset = 128 << 8;
schro_enc->video_format->chroma_excursion = 224 << 8;
break;
- }
#endif
+#if SCHRO_CHECK_VERSION(1,0,12)
+ case GST_VIDEO_FORMAT_ARGB:
+ schro_enc->video_format->luma_offset = 256;
+ schro_enc->video_format->luma_excursion = 511;
+ schro_enc->video_format->chroma_offset = 256;
+ schro_enc->video_format->chroma_excursion = 511;
+ break;
+#endif
+ }
schro_video_format_set_std_colour_spec (schro_enc->video_format,
SCHRO_COLOUR_SPEC_HDTV);
@@ -505,6 +516,7 @@ gst_schro_enc_handle_frame (GstBaseVideoEncoder * base_video_encoder,
GST_DEBUG ("granule offset %" G_GINT64_FORMAT, schro_enc->granule_offset);
}
+ GST_ERROR ("sink buffer %p", frame->sink_buffer);
schro_frame = gst_schro_buffer_wrap (gst_buffer_ref (frame->sink_buffer),
state->format, state->width, state->height);
diff --git a/ext/schroedinger/gstschroutils.c b/ext/schroedinger/gstschroutils.c
index 5ee2317f0..f23abf7e5 100644
--- a/ext/schroedinger/gstschroutils.c
+++ b/ext/schroedinger/gstschroutils.c
@@ -72,6 +72,12 @@ gst_schro_buffer_wrap (GstBuffer * buf, GstVideoFormat format, int width,
frame =
schro_frame_new_from_data_AYUV (GST_BUFFER_DATA (buf), width, height);
break;
+#if SCHRO_CHECK_VERSION(1,0,12)
+ case GST_VIDEO_FORMAT_ARGB:
+ frame =
+ schro_frame_new_from_data_ARGB (GST_BUFFER_DATA (buf), width, height);
+ break;
+#endif
#if SCHRO_CHECK_VERSION(1,0,11)
case GST_VIDEO_FORMAT_Y42B:
frame =
@@ -94,27 +100,6 @@ gst_schro_buffer_wrap (GstBuffer * buf, GstVideoFormat format, int width,
schro_frame_new_from_data_AY64 (GST_BUFFER_DATA (buf), width, height);
break;
#endif
-#if 0
- case GST_VIDEO_FORMAT_ARGB:
- {
- SchroFrame *rgbframe =
- schro_frame_new_from_data_AYUV (GST_BUFFER_DATA (buf), width, height);
- SchroFrame *vframe1;
- SchroFrame *vframe2;
- SchroFrame *vframe3;
-
- vframe1 = schro_virt_frame_new_unpack (rgbframe);
- vframe2 = schro_virt_frame_new_color_matrix (vframe1);
- vframe3 =
- schro_virt_frame_new_subsample (vframe2, SCHRO_FRAME_FORMAT_U8_420);
-
- frame = schro_frame_new_and_alloc (NULL, SCHRO_FRAME_FORMAT_U8_420,
- width, height);
- schro_virt_frame_render (vframe3, frame);
- schro_frame_unref (vframe3);
- }
- break;
-#endif
default:
g_assert_not_reached ();
return NULL;
diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c
index 129e9dd1e..9b30a1d5c 100644
--- a/gst/mpegtsdemux/mpegtsbase.c
+++ b/gst/mpegtsdemux/mpegtsbase.c
@@ -959,6 +959,8 @@ mpegts_base_handle_psi (MpegTSBase * base, MpegTSPacketizerSection * section)
{
gboolean res = TRUE;
GstStructure *structure = NULL;
+ gint program_number;
+ MpegTSBaseProgram *program = NULL;
/* table ids 0x70 - 0x73 do not have a crc */
if (G_LIKELY (section->table_id < 0x70 || section->table_id > 0x73)) {
@@ -992,10 +994,22 @@ mpegts_base_handle_psi (MpegTSBase * base, MpegTSPacketizerSection * section)
break;
case 0x02:
structure = mpegts_packetizer_parse_pmt (base->packetizer, section);
- if (G_LIKELY (structure))
+ if (G_UNLIKELY (structure == NULL))
+ return FALSE;
+
+ gst_structure_id_get (structure, QUARK_PROGRAM_NUMBER, G_TYPE_UINT,
+ &program_number, NULL);
+ program = mpegts_base_get_program (base, program_number);
+
+ /* We already have the same PMT for the current program in use, so we do
+ * not need to reset it */
+ if (program && program->active && program->pmt_pid == section->pid) {
+ GST_DEBUG ("Already have the PMT %u for program %i, not applying again",
+ program->pmt_pid, program_number);
+ res = TRUE;
+ } else {
mpegts_base_apply_pmt (base, section->pid, structure);
- else
- res = FALSE;
+ }
break;
case 0x40:
diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c
index f16514ba0..f79bdfe4e 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.c
+++ b/gst/mpegtsdemux/mpegtspacketizer.c
@@ -24,6 +24,11 @@
#include <string.h>
+/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray
+ * with newer GLib versions (>= 2.31.0) */
+#define GLIB_DISABLE_DEPRECATION_WARNINGS
+
+
#include "mpegtspacketizer.h"
#include "gstmpegdesc.h"
diff --git a/sys/decklink/Makefile.am b/sys/decklink/Makefile.am
index 22863edc3..a35658f6f 100644
--- a/sys/decklink/Makefile.am
+++ b/sys/decklink/Makefile.am
@@ -2,12 +2,15 @@ plugin_LTLIBRARIES = libgstdecklink.la
libgstdecklink_la_CPPFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
+ $(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CXXFLAGS) \
$(DECKLINK_CXXFLAGS)
libgstdecklink_la_LIBADD = \
+ $(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
+ -lgstvideo-@GST_MAJORMINOR@ \
$(DECKLINK_LIBS) \
$(LIBM)
libgstdecklink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
diff --git a/sys/decklink/gstdecklink.h b/sys/decklink/gstdecklink.h
index e69d14bb8..bd1d1d30b 100644
--- a/sys/decklink/gstdecklink.h
+++ b/sys/decklink/gstdecklink.h
@@ -108,7 +108,7 @@ GstCaps * gst_decklink_mode_get_caps (GstDecklinkModeEnum e);
GstCaps * gst_decklink_mode_get_template_caps (void);
#define GST_DECKLINK_MODE_CAPS(w,h,n,d,i) \
- "video/x-raw-yuv,format=(fourcc)UYVY,width=" #w ",height=" #h \
+ "video/x-raw-yuv,format=(fourcc){ UYVY, v210 },width=" #w ",height=" #h \
",framerate=" #n "/" #d ",interlaced=" #i
#define GST_DECKLINK_CAPS \
diff --git a/sys/decklink/gstdecklinksink.cpp b/sys/decklink/gstdecklinksink.cpp
index 9fd9b0ced..a09e49bf8 100644
--- a/sys/decklink/gstdecklinksink.cpp
+++ b/sys/decklink/gstdecklinksink.cpp
@@ -36,6 +36,7 @@
#include <gst/gst.h>
#include <gst/glib-compat-private.h>
+#include <gst/video/video.h>
#include "gstdecklink.h"
#include "gstdecklinksink.h"
#include <string.h>
@@ -596,11 +597,24 @@ static gboolean
gst_decklink_sink_videosink_setcaps (GstPad * pad, GstCaps * caps)
{
GstDecklinkSink *decklinksink;
+ gboolean ret;
+ GstVideoFormat format;
+ int width;
+ int height;
decklinksink = GST_DECKLINK_SINK (gst_pad_get_parent (pad));
GST_DEBUG_OBJECT (decklinksink, "setcaps");
+ ret = gst_video_format_parse_caps (caps, &format, &width, &height);
+ if (ret) {
+ if (format == GST_VIDEO_FORMAT_v210) {
+ decklinksink->pixel_format = bmdFormat10BitYUV;
+ } else {
+ decklinksink->pixel_format = bmdFormat8BitYUV;
+ }
+ }
+
gst_object_unref (decklinksink);
return TRUE;
@@ -713,7 +727,7 @@ gst_decklink_sink_videosink_chain (GstPad * pad, GstBuffer * buffer)
mode = gst_decklink_get_mode (decklinksink->mode);
decklinksink->output->CreateVideoFrame (mode->width,
- mode->height, mode->width * 2, bmdFormat8BitYUV,
+ mode->height, mode->width * 2, decklinksink->pixel_format,
bmdFrameFlagDefault, &frame);
frame->GetBytes (&data);
@@ -864,7 +878,6 @@ gst_decklink_sink_audiosink_setcaps (GstPad * pad, GstCaps * caps)
GST_DEBUG_OBJECT (decklinksink, "setcaps");
-
gst_object_unref (decklinksink);
return TRUE;
}
diff --git a/sys/decklink/gstdecklinksink.h b/sys/decklink/gstdecklinksink.h
index b5f07005a..31d70cd78 100644
--- a/sys/decklink/gstdecklinksink.h
+++ b/sys/decklink/gstdecklinksink.h
@@ -67,6 +67,7 @@ struct _GstDecklinkSink
IDeckLinkOutput *output;
Output *callback;
BMDDisplayMode display_mode;
+ BMDPixelFormat pixel_format;
gboolean video_enabled;
gboolean sched_started;
diff --git a/tools/gst-project-maker b/tools/gst-project-maker
new file mode 100755
index 000000000..c2acc0846
--- /dev/null
+++ b/tools/gst-project-maker
@@ -0,0 +1,324 @@
+#!/bin/sh
+
+
+prefix=gst
+templatedir=element-templates
+
+while [ "$1" ] ; do
+ case $1 in
+ --help)
+ cat <<-EOF
+Usage: gst-project-maker [OPTIONS] PROJECT_NAME
+Create an autotools project based on GStreamer from a template.
+Options:
+ --help Print this information
+ --prefix PREFIX Use PREFIX instead of "gst"
+Example: 'gst-project-maker my_project' will create the project gst-my-project.
+EOF
+ exit 0
+ ;;
+ --prefix)
+ shift
+ prefix=$1
+ ;;
+ -*)
+ echo Unknown option: $1
+ exit 1
+ ;;
+ *)
+ if [ "$name" = "" ]; then
+ name=$1
+ else
+ echo Ignored: $1
+ fi
+ esac
+ shift
+done
+
+if [ "$name" = "" ] ; then
+ echo "Usage: gst-project-maker [OPTIONS] PROJECT_NAME"
+ exit 1
+fi
+
+
+PREFIX=$(echo $prefix | sed -e 's/\(.*\)/\U\1/')
+NAME=$(echo $name | sed -e 's/\(.*\)/\U\1/')
+Prefix=$(echo $prefix | sed -e 's/_\(.\)/\U\1/g' -e 's/^\(.\)/\U\1/')
+Name=$(echo $name | sed -e 's/_\(.\)/\U\1/g' -e 's/^\(.\)/\U\1/')
+
+GST_IS_REPLACE=${PREFIX}_IS_${NAME}
+GST_REPLACE=${PREFIX}_${NAME}
+GST_TYPE_REPLACE=${PREFIX}_TYPE_${NAME}
+GstReplace=${Prefix}${Name}
+gst_replace=${prefix}_${name}
+gst__replace=${prefix}-${name}
+gstreplace=${prefix}$(echo $name | sed -e 's/_//g')
+replace=$(echo $name | sed -e 's/_//g')
+
+if [ "$REAL_NAME" = "" ] ; then
+ REAL_NAME=FIXME
+fi
+if [ "$EMAIL_ADDRESS" = "" ] ; then
+ EMAIL_ADDRESS=fixme@example.com
+fi
+
+
+
+basedir=`pwd`/$gst__replace
+
+rm -rf $basedir
+mkdir $basedir
+
+cat >$basedir/AUTHORS <<EOF
+$REAL_NAME <$EMAIL_ADDRESS>
+EOF
+
+cat >$basedir/COPYING <<EOF
+Put your license here.
+EOF
+
+cat >$basedir/ChangeLog <<EOF
+Put your changelog here.
+EOF
+
+cat >$basedir/NEWS <<EOF
+News about your project.
+EOF
+
+cat >$basedir/README <<EOF
+README for your project.
+EOF
+
+cat >$basedir/autogen.sh <<EOF
+#!/bin/sh
+# you can either set the environment variables AUTOCONF, AUTOHEADER, AUTOMAKE,
+# ACLOCAL, AUTOPOINT and/or LIBTOOLIZE to the right versions, or leave them
+# unset and get the defaults
+
+autoreconf --verbose --force --install --make || {
+ echo 'autogen.sh failed';
+ exit 1;
+}
+
+./configure || {
+ echo 'configure failed';
+ exit 1;
+}
+
+echo
+echo "Now type 'make' to compile this module."
+echo
+EOF
+chmod 755 $basedir/autogen.sh
+
+cat >$basedir/configure.ac <<EOF
+dnl required version of autoconf
+AC_PREREQ([2.53])
+
+dnl TODO: fill in your package name and package version here
+AC_INIT([${gst__replace}],[0.10.0])
+
+dnl required versions of gstreamer and plugins-base
+GST_REQUIRED=0.10.16
+GSTPB_REQUIRED=0.10.16
+
+AC_CONFIG_SRCDIR([plugins/${gstreplace}.c])
+AC_CONFIG_HEADERS([config.h])
+
+dnl required version of automake
+AM_INIT_AUTOMAKE([1.10])
+AC_CONFIG_MACRO_DIR([m4])
+
+dnl enable mainainer mode by default
+AM_MAINTAINER_MODE([enable])
+
+dnl check for tools (compiler etc.)
+AC_PROG_CC
+
+dnl required version of libtool
+LT_PREREQ([2.2.6])
+LT_INIT
+
+dnl give error and exit if we don't have pkgconfig
+AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [
+ AC_MSG_ERROR([You need to have pkg-config installed!])
+])
+
+dnl Check for the required version of GStreamer core (and gst-plugins-base)
+dnl This will export GST_CFLAGS and GST_LIBS variables for use in Makefile.am
+dnl
+dnl If you need libraries from gst-plugins-base here, also add:
+dnl for libgstaudio-0.10: gstreamer-audio-0.10 >= \$GST_REQUIRED
+dnl for libgstvideo-0.10: gstreamer-video-0.10 >= \$GST_REQUIRED
+dnl for libgsttag-0.10: gstreamer-tag-0.10 >= \$GST_REQUIRED
+dnl for libgstpbutils-0.10: gstreamer-pbutils-0.10 >= \$GST_REQUIRED
+dnl for libgstfft-0.10: gstreamer-fft-0.10 >= \$GST_REQUIRED
+dnl for libgstinterfaces-0.10: gstreamer-interfaces-0.10 >= \$GST_REQUIRED
+dnl for libgstrtp-0.10: gstreamer-rtp-0.10 >= \$GST_REQUIRED
+dnl for libgstrtsp-0.10: gstreamer-rtsp-0.10 >= \$GST_REQUIRED
+dnl etc.
+PKG_CHECK_MODULES(GST, [
+ gstreamer-0.10 >= \$GST_REQUIRED
+ gstreamer-base-0.10 >= \$GST_REQUIRED
+ gstreamer-controller-0.10 >= \$GST_REQUIRED
+], [
+ AC_SUBST(GST_CFLAGS)
+ AC_SUBST(GST_LIBS)
+], [
+ AC_MSG_ERROR([
+ You need to install or upgrade the GStreamer development
+ packages on your system. On debian-based systems these are
+ libgstreamer0.10-dev and libgstreamer-plugins-base0.10-dev.
+ on RPM-based systems gstreamer0.10-devel, libgstreamer0.10-devel
+ or similar. The minimum version required is \$GST_REQUIRED.
+ ])
+])
+
+dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS)
+AC_MSG_CHECKING([to see if compiler understands -Wall])
+save_CFLAGS="\$CFLAGS"
+CFLAGS="\$CFLAGS -Wall"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [
+ GST_CFLAGS="\$GST_CFLAGS -Wall"
+ AC_MSG_RESULT([yes])
+], [
+ AC_MSG_RESULT([no])
+])
+
+dnl set the plugindir where plugins should be installed (for plugins/Makefile.am)
+if test "x\${prefix}" = "x\$HOME"; then
+ plugindir="\$HOME/.gstreamer-0.10/plugins"
+else
+ plugindir="\\\$(libdir)/gstreamer-0.10"
+fi
+AC_SUBST(plugindir)
+
+dnl set proper LDFLAGS for plugins
+GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
+AC_SUBST(GST_PLUGIN_LDFLAGS)
+
+AC_CONFIG_FILES([Makefile plugins/Makefile])
+AC_OUTPUT
+EOF
+
+cat >$basedir/Makefile.am <<EOF
+SUBDIRS = plugins
+
+EXTRA_DIST = autogen.sh
+
+ACLOCAL_AMFLAGS = -I m4
+EOF
+
+mkdir -p $basedir/m4
+
+mkdir -p $basedir/plugins
+
+cat >$basedir/plugins/Makefile.am <<EOF
+plugin_LTLIBRARIES = lib$gstreplace.la
+
+# sources used to compile this plug-in
+lib${gstreplace}_la_SOURCES = ${gstreplace}.c
+
+# compiler and linker flags used to compile this plugin, set in configure.ac
+lib${gstreplace}_la_CFLAGS = \$(GST_CFLAGS)
+lib${gstreplace}_la_LIBADD = \$(GST_LIBS)
+lib${gstreplace}_la_LDFLAGS = \$(GST_PLUGIN_LDFLAGS)
+lib${gstreplace}_la_LIBTOOLFLAGS = --tag=disable-static
+
+EOF
+
+
+generate()
+{
+cat <<EOF
+/*
+ * GStreamer
+ * Copyright (C) $(date +%Y) $REAL_NAME <$EMAIL_ADDRESS>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
+ * which case the following provisions apply instead of the ones
+ * mentioned above:
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+#if 0
+ gst_element_register (replace, "replace", GST_RANK_NONE,
+ GST_TYPE_REPLACE_TEMPLATE);
+#endif
+
+ return TRUE;
+}
+
+GST_PLUGIN_DEFINE (
+ GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "replace",
+ "FIXME Template plugin",
+ plugin_init,
+ VERSION,
+ "LGPL", /* FIXME */
+ "GStreamer",
+ "http://gstreamer.net/"
+)
+EOF
+}
+
+
+generate | sed \
+ -e "s/GST_BASE_REPLACE/$GST_BASE_REPLACE/g" \
+ -e "s/GST_TYPE_BASE_REPLACE/$GST_TYPE_BASE_REPLACE/g" \
+ -e "s/GstBaseReplace/$GstBaseReplace/g" \
+ -e "s/GST_IS_REPLACE/$GST_IS_REPLACE/g" \
+ -e "s/GST_REPLACE/$GST_REPLACE/g" \
+ -e "s/GST_TYPE_REPLACE/$GST_TYPE_REPLACE/g" \
+ -e "s/GstReplace/$GstReplace/g" \
+ -e "s/gst_replace/$gst_replace/g" \
+ -e "s/gstreplace/$gstreplace/g" \
+ -e "s/replace/$replace/g" >$basedir/plugins/$gstreplace.c
+
+gst-indent $basedir/plugins/$gstreplace.c
+rm -f $basedir/plugins/$gstreplace.c~
+
+