teletextdec: New teletext decoder plugin based in zvbi

https://bugzilla.gnome.org/show_bug.cgi?id=619739
This commit is contained in:
Andoni Morales Alastruey 2010-09-13 11:59:18 +02:00 committed by Sebastian Dröge
parent 0e596670ef
commit 8bb6ff414f
6 changed files with 1289 additions and 0 deletions

View file

@ -1382,6 +1382,12 @@ AG_GST_CHECK_FEATURE(TIMIDITY, [timidity midi soft synth plugin], timidity, [
AC_SUBST(TIMIDITY_LIBS)
])
dnl *** teletextdec ***
translit(dnm, m, l) AM_CONDITIONAL(USE_TELETEXTDEC, true)
AG_GST_CHECK_FEATURE(TELETEXTDEC, [Teletext decoder], teletextdec, [
AG_GST_PKG_CHECK_MODULES(TELETEXTDEC, zvbi-0.2)
])
dnl *** wildmidi ***
translit(dnm, m, l) AM_CONDITIONAL(USE_WILDMIDI, true)
AG_GST_CHECK_FEATURE(WILDMIDI, [wildmidi midi soft synth plugin], wildmidi, [
@ -1719,6 +1725,7 @@ AM_CONDITIONAL(USE_SCHRO, false)
AM_CONDITIONAL(USE_ZBAR, false)
AM_CONDITIONAL(USE_VP8, false)
AM_CONDITIONAL(USE_RTMP, false)
AM_CONDITIONAL(USE_TELETEXTDEC, false)
fi dnl of EXT plugins
@ -1947,6 +1954,7 @@ ext/schroedinger/Makefile
ext/sdl/Makefile
ext/sndfile/Makefile
ext/soundtouch/Makefile
ext/teletextdec/Makefile
ext/gme/Makefile
ext/gsettings/Makefile
ext/gsettings/org.freedesktop.gstreamer.default-elements.gschema.xml

View file

@ -336,6 +336,12 @@ else
SWFDEC_DIR=
endif
if USE_TELETEXTDEC
TELETEXT_DIR=teletextdec
else
TELETEXT_DIR=
endif
if USE_VP8
VP8_DIR=vp8
else
@ -423,6 +429,7 @@ SUBDIRS=\
$(GME_DIR) \
$(SPC_DIR) \
$(SWFDEC_DIR) \
$(TELETEXTDEC_DIR) \
$(TIMIDITY_DIR) \
$(VP8_DIR) \
$(XVID_DIR) \
@ -473,6 +480,7 @@ DIST_SUBDIRS = \
spc \
gme \
swfdec \
teletextdec \
timidity \
voaacenc \
voamrwbenc \

View file

@ -0,0 +1,10 @@
plugin_LTLIBRARIES = libgstteletextdec.la
libgstteletextdec_la_SOURCES = gstteletextdec.c teletext.c
libgstteletextdec_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) $(TELETEXTDEC_CFLAGS)
libgstteletextdec_la_LIBADD = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_LIBS) $(TELETEXTDEC_LIBS)
libgstteletextdec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstteletextdec_la_LIBTOOLFLAGS = --tag=disable-static
noinst_HEADERS = gstteletextdec.h

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,106 @@
/*
* GStreamer
* Copyright (C) 2009 Sebastian <sebp@k-d-w.org>
* Copyright (C) 2010 Andoni Morales Alastruey <ylatuya@gmail.com>
*
* This library is free software; you can redistribute it and/or
* mod1ify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef __GST_TELETEXTDEC_H__
#define __GST_TELETEXTDEC_H__
#include <gst/gst.h>
#include <libzvbi.h>
G_BEGIN_DECLS
#define GST_TYPE_TELETEXTDEC \
(gst_teletextdec_get_type())
#define GST_TELETEXTDEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TELETEXTDEC,GstTeletextDec))
#define GST_TELETEXTDEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TELETEXTDEC,GstTeletextDecClass))
#define GST_IS_TELETEXTDEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TELETEXTDEC))
#define GST_IS_TELETEXTDEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TELETEXTDEC))
typedef struct _GstTeletextDec GstTeletextDec;
typedef struct _GstTeletextDecClass GstTeletextDecClass;
typedef struct _GstTeletextFrame GstTeletextFrame;
typedef enum _GstTeletextOutputFormat GstTeletextOutputFormat;
enum _GstTeletextOutputFormat
{
GST_TELETEXTDEC_OUTPUT_FORMAT_RGBA,
GST_TELETEXTDEC_OUTPUT_FORMAT_TEXT,
GST_TELETEXTDEC_OUTPUT_FORMAT_HTML,
GST_TELETEXTDEC_OUTPUT_FORMAT_SUBTITLES
};
typedef void (*GstTeletextProcessBufferFunc) (GstTeletextDec *
teletext, GstBuffer * buf);
struct _GstTeletextDec
{
GstElement element;
GstPad *sinkpad;
GstPad *srcpad;
GstClockTime in_timestamp;
GstClockTime in_duration;
gint rate_numerator;
gint rate_denominator;
/* Props */
gint pageno;
gint subno;
gboolean subtitles_mode;
gchar *subtitles_template;
vbi_dvb_demux *demux;
vbi_decoder *decoder;
vbi_export *exporter;
GQueue *queue;
GMutex *queue_lock;
GstTeletextFrame *frame;
float last_ts;
GstTeletextOutputFormat output_format;
GstTeletextProcessBufferFunc process_buf_func;
};
struct _GstTeletextFrame
{
vbi_sliced *sliced_begin;
vbi_sliced *sliced_end;
vbi_sliced *current_slice;
guint last_field;
guint last_field_line;
guint last_frame_line;
};
struct _GstTeletextDecClass
{
GstElementClass parent_class;
};
GType gst_teletextdec_get_type (void);
G_END_DECLS
#endif /* __GST_TELETEXTDEC_H__ */

View file

@ -0,0 +1,43 @@
/*
* GStreamer
* Copyright (C) 2009 Sebastian <sebp@k-d-w.org>
*
* This library is free software; you can redistribute it and/or
* mod1ify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include "gstteletextdec.h"
/* entry point to initialize the plug-in
* initialize the plug-in itself
* register the element factories and other features
*/
static gboolean
teletext_init (GstPlugin * teletext)
{
return gst_element_register (teletext, "teletextdec", GST_RANK_NONE,
GST_TYPE_TELETEXTDEC);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"teletext",
"Teletext plugin",
teletext_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/")