Commit dd75c216 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

annodex: remove annodex plugin and CMML elements

This never really took off and is most likely completely
unused. If there is still a need for this, it should
probably be done differently, perhaps inside oggdemux/mux.
parent 3f833f75
...@@ -686,12 +686,6 @@ AG_GST_CHECK_FEATURE(AALIB, [aalib ASCII Art library], aasink, [ ...@@ -686,12 +686,6 @@ AG_GST_CHECK_FEATURE(AALIB, [aalib ASCII Art library], aasink, [
AS_SCRUB_INCLUDE(AALIB_CFLAGS) AS_SCRUB_INCLUDE(AALIB_CFLAGS)
]) ])
dnl *** annodex ***
translit(dnm, m, l) AM_CONDITIONAL(USE_ANNODEX, true)
AG_GST_CHECK_FEATURE(ANNODEX, [XML library], annodex, [
AG_GST_PKG_CHECK_MODULES(ANNODEX, libxml-2.0 >= 2.4.9)
])
dnl *** cairo *** dnl *** cairo ***
translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true) translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true)
AG_GST_CHECK_FEATURE(CAIRO, [Cairo graphics rendering], cairo, [ AG_GST_CHECK_FEATURE(CAIRO, [Cairo graphics rendering], cairo, [
...@@ -954,7 +948,6 @@ else ...@@ -954,7 +948,6 @@ else
dnl not building plugins with external dependencies, dnl not building plugins with external dependencies,
dnl but we still need to set the conditionals dnl but we still need to set the conditionals
AM_CONDITIONAL(USE_AALIB, false) AM_CONDITIONAL(USE_AALIB, false)
AM_CONDITIONAL(USE_ANNODEX, false)
AM_CONDITIONAL(USE_BZ2, false) AM_CONDITIONAL(USE_BZ2, false)
AM_CONDITIONAL(USE_CAIRO, false) AM_CONDITIONAL(USE_CAIRO, false)
AM_CONDITIONAL(USE_CAIRO_GOBJECT, false) AM_CONDITIONAL(USE_CAIRO_GOBJECT, false)
...@@ -1093,7 +1086,6 @@ gst/flx/Makefile ...@@ -1093,7 +1086,6 @@ gst/flx/Makefile
gst/y4m/Makefile gst/y4m/Makefile
ext/Makefile ext/Makefile
ext/aalib/Makefile ext/aalib/Makefile
ext/annodex/Makefile
ext/cairo/Makefile ext/cairo/Makefile
ext/dv/Makefile ext/dv/Makefile
ext/flac/Makefile ext/flac/Makefile
......
...@@ -53,8 +53,6 @@ IGNORE_CFILES = ...@@ -53,8 +53,6 @@ IGNORE_CFILES =
EXTRA_HFILES = \ EXTRA_HFILES = \
$(top_srcdir)/ext/aalib/gstaasink.h \ $(top_srcdir)/ext/aalib/gstaasink.h \
$(top_srcdir)/ext/annodex/gstcmmldec.h \
$(top_srcdir)/ext/annodex/gstcmmlenc.h \
$(top_srcdir)/ext/cairo/gsttextoverlay.h \ $(top_srcdir)/ext/cairo/gsttextoverlay.h \
$(top_srcdir)/ext/cairo/gsttimeoverlay.h \ $(top_srcdir)/ext/cairo/gsttimeoverlay.h \
$(top_srcdir)/ext/cairo/gstcairorender.h \ $(top_srcdir)/ext/cairo/gstcairorender.h \
......
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
<xi:include href="xml/element-cairorender.xml" /> <xi:include href="xml/element-cairorender.xml" />
<xi:include href="xml/element-cairooverlay.xml" /> <xi:include href="xml/element-cairooverlay.xml" />
<xi:include href="xml/element-capssetter.xml" /> <xi:include href="xml/element-capssetter.xml" />
<xi:include href="xml/element-cmmldec.xml" />
<xi:include href="xml/element-cmmlenc.xml" />
<xi:include href="xml/element-cutter.xml" /> <xi:include href="xml/element-cutter.xml" />
<xi:include href="xml/element-dcaparse.xml" /> <xi:include href="xml/element-dcaparse.xml" />
<xi:include href="xml/element-deinterlace.xml" /> <xi:include href="xml/element-deinterlace.xml" />
...@@ -187,7 +185,6 @@ ...@@ -187,7 +185,6 @@
<xi:include href="xml/plugin-alaw.xml" /> <xi:include href="xml/plugin-alaw.xml" />
<xi:include href="xml/plugin-alpha.xml" /> <xi:include href="xml/plugin-alpha.xml" />
<xi:include href="xml/plugin-alphacolor.xml" /> <xi:include href="xml/plugin-alphacolor.xml" />
<xi:include href="xml/plugin-annodex.xml" />
<xi:include href="xml/plugin-apetag.xml" /> <xi:include href="xml/plugin-apetag.xml" />
<xi:include href="xml/plugin-audiofx.xml" /> <xi:include href="xml/plugin-audiofx.xml" />
<xi:include href="xml/plugin-auparse.xml" /> <xi:include href="xml/plugin-auparse.xml" />
......
...@@ -540,38 +540,6 @@ GST_IS_CAPS_SETTER_CLASS ...@@ -540,38 +540,6 @@ GST_IS_CAPS_SETTER_CLASS
gst_caps_setter_get_type gst_caps_setter_get_type
</SECTION> </SECTION>
<SECTION>
<FILE>element-cmmldec</FILE>
<TITLE>cmmldec</TITLE>
GstCmmlDec
<SUBSECTION Standard>
GstCmmlDecClass
GST_TYPE_CMML_DEC
GST_CMML_DEC
GST_CMML_DEC_CLASS
GST_CMML_DEC_GET_CLASS
GST_IS_CMML_DEC
GST_IS_CMML_DEC_CLASS
gst_cmml_dec_plugin_init
gst_cmml_dec_get_type
</SECTION>
<SECTION>
<FILE>element-cmmlenc</FILE>
<TITLE>cmmlenc</TITLE>
GstCmmlEnc
<SUBSECTION Standard>
GstCmmlEncClass
GST_TYPE_CMML_ENC
GST_CMML_ENC
GST_CMML_ENC_CLASS
GST_CMML_ENC_GET_CLASS
GST_IS_CMML_ENC
GST_IS_CMML_ENC_CLASS
gst_cmml_enc_plugin_init
gst_cmml_enc_get_type
</SECTION>
<SECTION> <SECTION>
<FILE>element-cutter</FILE> <FILE>element-cutter</FILE>
<TITLE>cutter</TITLE> <TITLE>cutter</TITLE>
......
<plugin>
<name>annodex</name>
<description>annodex stream manipulation (info about annodex: http://www.annodex.net)</description>
<filename>../../ext/annodex/.libs/libgstannodex.so</filename>
<basename>libgstannodex.so</basename>
<version>0.11.90</version>
<license>LGPL</license>
<source>gst-plugins-good</source>
<package>GStreamer Good Plug-ins source release</package>
<origin>Unknown package origin</origin>
<elements>
<element>
<name>cmmldec</name>
<longname>CMML stream decoder</longname>
<class>Codec/Decoder</class>
<description>Decodes CMML streams</description>
<author>Alessandro Decina &lt;alessandro@nnva.org&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>text/x-cmml, encoded=(boolean)true</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>text/x-cmml, encoded=(boolean)false</details>
</caps>
</pads>
</element>
<element>
<name>cmmlenc</name>
<longname>CMML streams encoder</longname>
<class>Codec/Encoder</class>
<description>Encodes CMML streams</description>
<author>Alessandro Decina &lt;alessandro@nnva.org&gt;</author>
<pads>
<caps>
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>text/x-cmml, encoded=(boolean)false</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>text/x-cmml, encoded=(boolean)true</details>
</caps>
</pads>
</element>
</elements>
</plugin>
\ No newline at end of file
...@@ -4,12 +4,6 @@ else ...@@ -4,12 +4,6 @@ else
AALIB_DIR = AALIB_DIR =
endif endif
if USE_ANNODEX
ANNODEX_DIR = annodex
else
ANNODEX_DIR =
endif
if USE_CAIRO if USE_CAIRO
CAIRO_DIR = cairo CAIRO_DIR = cairo
else else
...@@ -115,7 +109,6 @@ endif ...@@ -115,7 +109,6 @@ endif
SUBDIRS = \ SUBDIRS = \
$(AALIB_DIR) \ $(AALIB_DIR) \
$(ANNODEX_DIR) \
$(CAIRO_DIR) \ $(CAIRO_DIR) \
$(DV1394_DIR) \ $(DV1394_DIR) \
$(FLAC_DIR) \ $(FLAC_DIR) \
...@@ -136,7 +129,6 @@ SUBDIRS = \ ...@@ -136,7 +129,6 @@ SUBDIRS = \
DIST_SUBDIRS = \ DIST_SUBDIRS = \
aalib \ aalib \
annodex \
cairo \ cairo \
dv \ dv \
flac \ flac \
......
plugin_LTLIBRARIES = libgstannodex.la
# FIXME 0.11: ignore GValueArray warnings for now until this is sorted
ERROR_CFLAGS=
libgstannodex_la_SOURCES = \
gstannodex.c \
gstcmmlutils.c \
gstcmmldec.c \
gstcmmlenc.c \
gstcmmltag.c \
gstcmmlparser.c
libgstannodex_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_CFLAGS) $(ANNODEX_CFLAGS)
libgstannodex_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) \
$(GST_LIBS) $(ANNODEX_LIBS) $(LIBM)
libgstannodex_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstannodex_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS = gstannodex.h gstcmmlutils.h gstcmmltag.h gstcmmlparser.h \
gstcmmldec.h gstcmmlenc.h
/*
* gstannodex.c - GStreamer annodex plugin
* Copyright (C) 2005 Alessandro Decina
*
* Authors:
* Alessandro Decina <alessandro@nnva.org>
*
* 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.
*/
/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray
* with newer GLib versions (>= 2.31.0) */
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h>
#include <string.h>
#include <gst/tag/tag.h>
#include "gstannodex.h"
#include "gstcmmlparser.h"
#include "gstcmmlenc.h"
#include "gstcmmldec.h"
GstClockTime
gst_annodex_granule_to_time (gint64 granulepos, gint64 granulerate_n,
gint64 granulerate_d, guint8 granuleshift)
{
gint64 keyindex, keyoffset;
gint64 granulerate;
GstClockTime res;
g_return_val_if_fail (granuleshift <= 64, GST_CLOCK_TIME_NONE);
if (granulepos == -1)
return GST_CLOCK_TIME_NONE;
if (granulepos == 0 || granulerate_n == 0 || granulerate_d == 0)
return 0;
if (granuleshift != 0 && granuleshift != 64) {
keyindex = granulepos >> granuleshift;
keyoffset = granulepos - (keyindex << granuleshift);
granulepos = keyindex + keyoffset;
}
/* GST_SECOND / (granulerate_n / granulerate_d) */
granulerate = gst_util_uint64_scale (GST_SECOND,
granulerate_d, granulerate_n);
/* granulepos * granulerate */
res = gst_util_uint64_scale (granulepos, granulerate, 1);
return res;
}
GValueArray *
gst_annodex_parse_headers (const gchar * headers)
{
GValueArray *array;
GValue val = { 0 };
gchar *header_name = NULL;
gchar *header_value = NULL;
gchar *line, *column, *space, *tmp;
gchar **lines;
gint i = 0;
array = g_value_array_new (0);
g_value_init (&val, G_TYPE_STRING);
lines = g_strsplit (headers, "\r\n", 0);
line = lines[i];
while (line != NULL && *line != '\0') {
if (line[0] == '\t' || line[0] == ' ') {
/* WSP: continuation line */
if (header_value == NULL)
/* continuation line without a previous value */
goto fail;
tmp = g_strjoin (" ", header_value, g_strstrip (line), NULL);
g_free (header_value);
header_value = tmp;
} else {
if (header_name) {
g_value_take_string (&val, header_name);
g_value_array_append (array, &val);
g_value_take_string (&val, header_value);
g_value_array_append (array, &val);
}
/* search the column starting from line[1] as an header name can't be
* empty */
column = g_strstr_len (line + 1, strlen (line) - 1, ":");
if (column == NULL)
/* bad syntax */
goto fail;
if (*(space = column + 1) != ' ')
/* bad syntax */
goto fail;
header_name = g_strndup (line, column - line);
header_value = g_strdup (space + 1);
}
line = lines[++i];
}
if (header_name) {
g_value_take_string (&val, header_name);
g_value_array_append (array, &val);
g_value_take_string (&val, header_value);
g_value_array_append (array, &val);
}
g_value_unset (&val);
g_strfreev (lines);
return array;
fail:
GST_WARNING ("could not parse annodex headers");
g_free (header_name);
g_free (header_value);
g_strfreev (lines);
g_value_array_free (array);
g_value_unset (&val);
return NULL;
}
static gboolean
plugin_init (GstPlugin * plugin)
{
gst_tag_register (GST_TAG_CMML_STREAM, GST_TAG_FLAG_META,
GST_TYPE_CMML_TAG_STREAM, "cmml-stream", "annodex CMML stream tag", NULL);
gst_tag_register (GST_TAG_CMML_HEAD, GST_TAG_FLAG_META,
GST_TYPE_CMML_TAG_HEAD, "cmml-head", "annodex CMML head tag", NULL);
gst_tag_register (GST_TAG_CMML_CLIP, GST_TAG_FLAG_META,
GST_TYPE_CMML_TAG_CLIP, "cmml-clip", "annodex CMML clip tag", NULL);
gst_cmml_parser_init ();
if (!gst_cmml_enc_plugin_init (plugin))
return FALSE;
if (!gst_cmml_dec_plugin_init (plugin))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
annodex,
"annodex stream manipulation (info about annodex: http://www.annodex.net)",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
/*
* gstannodex.h - GStreamer annodex utility functions
* Copyright (C) 2005 Alessandro Decina
*
* Authors:
* Alessandro Decina <alessandro@nnva.org>
*
* 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.
*/
#ifndef __GST_ANNODEX_H__
#define __GST_ANNODEX_H__
#include <gst/gst.h>
GstClockTime gst_annodex_granule_to_time (gint64 granulepos,
gint64 granulerate_n, gint64 granulerate_d, guint8 granuleshift);
gchar *gst_annodex_time_to_npt (GstClockTime time);
GValueArray *gst_annodex_parse_headers (const gchar * headers);
#endif /* __GST_ANNODEX_H__ */
This diff is collapsed.
/*
* gstcmmldec.h - GStreamer annodex CMML decoder
* Copyright (C) 2005 Alessandro Decina
*
* Authors:
* Alessandro Decina <alessandro@nnva.org>
*
* 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.
*/
#ifndef __GST_CMML_DEC_H__
#define __GST_CMML_DEC_H__
#include <gst/gst.h>
#include <gst/gstformat.h>
#include "gstcmmlparser.h"
/* GstCmmlDec */
#define GST_TYPE_CMML_DEC (gst_cmml_dec_get_type())
#define GST_CMML_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_CMML_DEC, GstCmmlDec))
#define GST_CMML_DEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_CMML_DEC, GstCmmlDecClass))
#define GST_IS_CMML_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_CMML_DEC))
#define GST_IS_CMML_DEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_CMML_DEC))
#define GST_CMML_DEC_GET_CLASS(klass) \
(G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_CMML_DEC, GstCmmlDecClass))
typedef struct _GstCmmlDec GstCmmlDec;
typedef struct _GstCmmlDecClass GstCmmlDecClass;
typedef enum _GstCmmlPacketType GstCmmlPacketType;
enum _GstCmmlPacketType
{
GST_CMML_PACKET_UNKNOWN,
GST_CMML_PACKET_IDENT_HEADER,
GST_CMML_PACKET_FIRST_HEADER,
GST_CMML_PACKET_SECOND_HEADER,
GST_CMML_PACKET_CLIP
};
struct _GstCmmlDec
{
GstElement element;
/* element part */
GstPad *sinkpad;
GstPad *srcpad;
/* bitstream part */
gint16 major; /* bitstream version major */
gint16 minor; /* bitstream version minor */
gint64 granulerate_n; /* bitrstream granulerate numerator */
gint64 granulerate_d; /* bitstream granulerate denominator */
gint8 granuleshift; /* bitstreamgranuleshift */
gint64 granulepos; /* bitstream granule position */
GstClockTime timestamp; /* timestamp of the last buffer */
/* decoder part */
GstCmmlParser *parser; /* cmml parser */
gboolean sent_root;
GstFlowReturn flow_return; /* _chain return value */
gboolean wait_clip_end; /* when TRUE, the GST_TAG_MESSAGE for a
* clip is sent when the next clip (or EOS)
* is found, so that the clip end-time is
* known. This is useful for pre-extracting
* the clips.
*/
GHashTable *tracks;
};
struct _GstCmmlDecClass
{
GstElementClass parent_class;
};
GType gst_cmml_dec_get_type (void);
gboolean gst_cmml_dec_plugin_init (GstPlugin * plugin);
#endif /* __GST_CMML_DEC_H__ */
/*
* gstcmmlenc.c - GStreamer CMML encoder
* Copyright (C) 2005 Alessandro Decina
*
* Authors:
* Alessandro Decina <alessandro@nnva.org>
*
* 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.
*/
/**
* SECTION:element-cmmlenc
* @see_also: cmmldec, oggmux
*
* Cmmlenc encodes a CMML document into a CMML stream. <ulink
* url="http://www.annodex.net/TR/draft-pfeiffer-cmml-02.html">CMML</ulink> is
* an XML markup language for time-continuous data maintained by the <ulink
* url="http:/www.annodex.org/">Annodex Foundation</ulink>.
*
* <refsect2>
* <title>Example pipeline</title>
* |[
* gst-launch -v filesrc location=annotations.cmml ! cmmlenc ! oggmux name=mux ! filesink location=annotated.ogg
* ]|
* </refsect2>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "gstcmmlenc.h"
#include "gstannodex.h"
GST_DEBUG_CATEGORY_STATIC (cmmlenc);
#define GST_CAT_DEFAULT cmmlenc
#define CMML_IDENT_HEADER_SIZE 29
enum
{
ARG_0,
GST_CMML_ENC_GRANULERATE_N,
GST_CMML_ENC_GRANULERATE_D,
GST_CMML_ENC_GRANULESHIFT
};
enum
{