2002-03-20 21:45:03 +00:00
|
|
|
/* GStreamer
|
2001-12-22 22:14:34 +00:00
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2008-05-28 13:28:20 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-aasink
|
|
|
|
* @see_also: #GstCACASink
|
|
|
|
*
|
|
|
|
* Displays video as b/w ascii art.
|
2009-01-28 15:46:06 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
2008-05-28 13:28:20 +00:00
|
|
|
* <title>Example launch line</title>
|
2009-01-28 15:46:06 +00:00
|
|
|
* |[
|
2008-05-28 13:28:20 +00:00
|
|
|
* gst-launch filesrc location=test.avi ! decodebin ! ffmpegcolorspace ! aasink
|
2009-01-28 15:46:06 +00:00
|
|
|
* ]| This pipeline renders a video to ascii art into a separate window.
|
|
|
|
* |[
|
2008-05-28 13:28:20 +00:00
|
|
|
* gst-launch filesrc location=test.avi ! decodebin ! ffmpegcolorspace ! aasink driver=curses
|
2009-01-28 15:46:06 +00:00
|
|
|
* ]| This pipeline renders a video to ascii art into the current terminal.
|
2008-05-28 13:28:20 +00:00
|
|
|
* </refsect2>
|
|
|
|
*/
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2001-12-22 22:14:34 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
2001-12-23 00:29:20 +00:00
|
|
|
#include "gstaasink.h"
|
2001-12-22 22:14:34 +00:00
|
|
|
|
|
|
|
/* aasink signals and args */
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2001-12-22 22:14:34 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2011-06-08 16:05:20 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_WIDTH,
|
|
|
|
PROP_HEIGHT,
|
|
|
|
PROP_DRIVER,
|
|
|
|
PROP_DITHER,
|
|
|
|
PROP_BRIGHTNESS,
|
|
|
|
PROP_CONTRAST,
|
|
|
|
PROP_GAMMA,
|
|
|
|
PROP_INVERSION,
|
|
|
|
PROP_RANDOMVAL,
|
|
|
|
PROP_FRAMES_DISPLAYED,
|
|
|
|
PROP_FRAME_TIME
|
2001-12-22 22:14:34 +00:00
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2011-07-06 15:50:54 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("I420"))
|
2004-03-14 22:34:33 +00:00
|
|
|
);
|
2003-11-01 01:37:51 +00:00
|
|
|
|
2011-11-10 10:03:18 +00:00
|
|
|
static void gst_aasink_fixate (GstBaseSink * bsink, GstCaps * caps);
|
|
|
|
static gboolean gst_aasink_setcaps (GstBaseSink * bsink, GstCaps * caps);
|
|
|
|
static void gst_aasink_get_times (GstBaseSink * bsink, GstBuffer * buffer,
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
GstClockTime * start, GstClockTime * end);
|
|
|
|
static GstFlowReturn gst_aasink_render (GstBaseSink * basesink,
|
|
|
|
GstBuffer * buffer);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_aasink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_aasink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
static GstStateChangeReturn gst_aasink_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2011-06-08 16:05:20 +00:00
|
|
|
#define gst_aasink_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE (GstAASink, gst_aasink, GST_TYPE_BASE_SINK);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
|
|
|
#define GST_TYPE_AADRIVERS (gst_aasink_drivers_get_type())
|
|
|
|
static GType
|
|
|
|
gst_aasink_drivers_get_type (void)
|
|
|
|
{
|
|
|
|
static GType driver_type = 0;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2001-12-22 22:14:34 +00:00
|
|
|
if (!driver_type) {
|
|
|
|
GEnumValue *drivers;
|
|
|
|
const struct aa_driver *driver;
|
2003-05-05 21:26:01 +00:00
|
|
|
gint n_drivers;
|
|
|
|
gint i;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
for (n_drivers = 0; aa_drivers[n_drivers]; n_drivers++) {
|
2003-05-05 21:26:01 +00:00
|
|
|
/* count number of drivers */
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
drivers = g_new0 (GEnumValue, n_drivers + 1);
|
|
|
|
|
|
|
|
for (i = 0; i < n_drivers; i++) {
|
2003-05-05 21:26:01 +00:00
|
|
|
driver = aa_drivers[i];
|
2001-12-22 22:14:34 +00:00
|
|
|
drivers[i].value = i;
|
2005-11-22 18:11:58 +00:00
|
|
|
drivers[i].value_name = g_strdup (driver->name);
|
|
|
|
drivers[i].value_nick = g_utf8_strdown (driver->shortname, -1);
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
drivers[i].value = 0;
|
|
|
|
drivers[i].value_name = NULL;
|
|
|
|
drivers[i].value_nick = NULL;
|
|
|
|
|
|
|
|
driver_type = g_enum_register_static ("GstAASinkDrivers", drivers);
|
|
|
|
}
|
|
|
|
return driver_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define GST_TYPE_AADITHER (gst_aasink_dither_get_type())
|
|
|
|
static GType
|
|
|
|
gst_aasink_dither_get_type (void)
|
|
|
|
{
|
|
|
|
static GType dither_type = 0;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2001-12-22 22:14:34 +00:00
|
|
|
if (!dither_type) {
|
|
|
|
GEnumValue *ditherers;
|
2003-05-05 21:26:01 +00:00
|
|
|
gint n_ditherers;
|
|
|
|
gint i;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
for (n_ditherers = 0; aa_dithernames[n_ditherers]; n_ditherers++) {
|
2003-05-05 21:26:01 +00:00
|
|
|
/* count number of ditherers */
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
ditherers = g_new0 (GEnumValue, n_ditherers + 1);
|
|
|
|
|
|
|
|
for (i = 0; i < n_ditherers; i++) {
|
2001-12-22 22:14:34 +00:00
|
|
|
ditherers[i].value = i;
|
|
|
|
ditherers[i].value_name = g_strdup (aa_dithernames[i]);
|
2005-11-22 18:11:58 +00:00
|
|
|
ditherers[i].value_nick =
|
|
|
|
g_strdelimit (g_strdup (aa_dithernames[i]), " _", '-');
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
ditherers[i].value = 0;
|
|
|
|
ditherers[i].value_name = NULL;
|
|
|
|
ditherers[i].value_nick = NULL;
|
|
|
|
|
|
|
|
dither_type = g_enum_register_static ("GstAASinkDitherers", ditherers);
|
|
|
|
}
|
|
|
|
return dither_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_aasink_class_init (GstAASinkClass * klass)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
GstBaseSinkClass *gstbasesink_class;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gstbasesink_class = (GstBaseSinkClass *) klass;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gobject_class->set_property = gst_aasink_set_property;
|
|
|
|
gobject_class->get_property = gst_aasink_get_property;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2010-10-13 13:34:09 +00:00
|
|
|
/* FIXME: add long property descriptions */
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_WIDTH,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HEIGHT,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DRIVER,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_enum ("driver", "driver", "driver", GST_TYPE_AADRIVERS, 0,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DITHER,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_enum ("dither", "dither", "dither", GST_TYPE_AADITHER, 0,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BRIGHTNESS,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_int ("brightness", "brightness", "brightness", G_MININT,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CONTRAST,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_int ("contrast", "contrast", "contrast", G_MININT, G_MAXINT,
|
2010-10-13 13:25:15 +00:00
|
|
|
0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_GAMMA,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_float ("gamma", "gamma", "gamma", 0.0, 5.0, 1.0,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_INVERSION,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_boolean ("inversion", "inversion", "inversion", TRUE,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_RANDOMVAL,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_int ("randomval", "randomval", "randomval", G_MININT,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
|
|
|
PROP_FRAMES_DISPLAYED, g_param_spec_int ("frames-displayed",
|
|
|
|
"frames displayed", "frames displayed", G_MININT, G_MAXINT, 0,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
2011-06-08 16:05:20 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FRAME_TIME,
|
2010-10-13 13:34:09 +00:00
|
|
|
g_param_spec_int ("frame-time", "frame time", "frame time", G_MININT,
|
2010-10-13 13:25:15 +00:00
|
|
|
G_MAXINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2011-06-09 09:37:47 +00:00
|
|
|
gst_element_class_add_pad_template (gstelement_class,
|
|
|
|
gst_static_pad_template_get (&sink_template));
|
|
|
|
|
|
|
|
gst_element_class_set_details_simple (gstelement_class,
|
|
|
|
"ASCII art video sink", "Sink/Video", "An ASCII art videosink",
|
|
|
|
"Wim Taymans <wim.taymans@chello.be>");
|
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_aasink_change_state);
|
|
|
|
|
2011-11-10 10:03:18 +00:00
|
|
|
gstbasesink_class->fixate = GST_DEBUG_FUNCPTR (gst_aasink_fixate);
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_aasink_setcaps);
|
|
|
|
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_aasink_get_times);
|
|
|
|
gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_aasink_render);
|
|
|
|
gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_aasink_render);
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
|
2005-07-04 09:29:51 +00:00
|
|
|
static void
|
2011-11-10 10:03:18 +00:00
|
|
|
gst_aasink_fixate (GstBaseSink * bsink, GstCaps * caps)
|
2004-03-06 04:51:15 +00:00
|
|
|
{
|
|
|
|
GstStructure *structure;
|
|
|
|
|
2005-07-04 09:29:51 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2004-03-06 04:51:15 +00:00
|
|
|
|
2005-11-21 14:31:05 +00:00
|
|
|
gst_structure_fixate_field_nearest_int (structure, "width", 320);
|
|
|
|
gst_structure_fixate_field_nearest_int (structure, "height", 240);
|
2005-11-23 14:22:18 +00:00
|
|
|
gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1);
|
2011-11-10 10:03:18 +00:00
|
|
|
|
|
|
|
GST_BASE_SINK_CLASS (parent_class)->fixate (bsink, caps);
|
2004-03-06 04:51:15 +00:00
|
|
|
}
|
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
static gboolean
|
|
|
|
gst_aasink_setcaps (GstBaseSink * basesink, GstCaps * caps)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
|
|
|
GstAASink *aasink;
|
2011-07-06 15:50:54 +00:00
|
|
|
GstVideoInfo info;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
aasink = GST_AASINK (basesink);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2011-07-06 15:50:54 +00:00
|
|
|
if (!gst_video_info_from_caps (&info, caps))
|
|
|
|
goto invalid_caps;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2011-07-06 15:50:54 +00:00
|
|
|
aasink->info = info;
|
2002-01-13 22:27:25 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
return TRUE;
|
2011-07-06 15:50:54 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
invalid_caps:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (aasink, "invalid caps");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2002-02-03 20:10:04 +00:00
|
|
|
}
|
|
|
|
|
2001-12-22 22:14:34 +00:00
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_aasink_init (GstAASink * aasink)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
memcpy (&aasink->ascii_surf, &aa_defparams,
|
|
|
|
sizeof (struct aa_hardware_params));
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_parms.bright = 0;
|
|
|
|
aasink->ascii_parms.contrast = 16;
|
|
|
|
aasink->ascii_parms.gamma = 1.0;
|
|
|
|
aasink->ascii_parms.dither = 0;
|
|
|
|
aasink->ascii_parms.inversion = 0;
|
|
|
|
aasink->ascii_parms.randomval = 0;
|
|
|
|
aasink->aa_driver = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-06-29 16:36:15 +00:00
|
|
|
gst_aasink_scale (GstAASink * aasink, guchar * src, guchar * dest,
|
2004-03-14 22:34:33 +00:00
|
|
|
gint sw, gint sh, gint dw, gint dh)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
|
|
|
gint ypos, yinc, y;
|
|
|
|
gint xpos, xinc, x;
|
|
|
|
|
|
|
|
g_return_if_fail ((dw != 0) && (dh != 0));
|
|
|
|
|
|
|
|
ypos = 0x10000;
|
|
|
|
yinc = (sh << 16) / dh;
|
|
|
|
xinc = (sw << 16) / dw;
|
|
|
|
|
|
|
|
for (y = dh; y; y--) {
|
|
|
|
while (ypos > 0x10000) {
|
|
|
|
ypos -= 0x10000;
|
2004-03-14 22:34:33 +00:00
|
|
|
src += sw;
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
xpos = 0x10000;
|
|
|
|
{
|
|
|
|
guchar *destp = dest;
|
|
|
|
guchar *srcp = src;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
for (x = dw; x; x--) {
|
2004-03-15 19:32:27 +00:00
|
|
|
while (xpos >= 0x10000L) {
|
|
|
|
srcp++;
|
|
|
|
xpos -= 0x10000L;
|
|
|
|
}
|
|
|
|
*destp++ = *srcp;
|
|
|
|
xpos += xinc;
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
dest += dw;
|
|
|
|
ypos += yinc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gst_aasink_get_times (GstBaseSink * sink, GstBuffer * buffer,
|
|
|
|
GstClockTime * start, GstClockTime * end)
|
|
|
|
{
|
|
|
|
*start = GST_BUFFER_TIMESTAMP (buffer);
|
2011-06-08 16:05:20 +00:00
|
|
|
if (GST_BUFFER_DURATION_IS_VALID (buffer))
|
|
|
|
*end = *start + GST_BUFFER_DURATION (buffer);
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_aasink_render (GstBaseSink * basesink, GstBuffer * buffer)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
|
|
|
GstAASink *aasink;
|
2011-07-06 15:50:54 +00:00
|
|
|
GstVideoFrame frame;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
aasink = GST_AASINK (basesink);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
GST_DEBUG ("render");
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2011-07-06 15:50:54 +00:00
|
|
|
if (!gst_video_frame_map (&frame, &aasink->info, buffer, GST_MAP_READ))
|
|
|
|
goto invalid_frame;
|
|
|
|
|
|
|
|
gst_aasink_scale (aasink, GST_VIDEO_FRAME_PLANE_DATA (&frame, 0), /* src */
|
2004-03-15 19:32:27 +00:00
|
|
|
aa_image (aasink->context), /* dest */
|
2011-07-06 15:50:54 +00:00
|
|
|
GST_VIDEO_INFO_WIDTH (&aasink->info), /* sw */
|
|
|
|
GST_VIDEO_INFO_HEIGHT (&aasink->info), /* sh */
|
2004-03-15 19:32:27 +00:00
|
|
|
aa_imgwidth (aasink->context), /* dw */
|
|
|
|
aa_imgheight (aasink->context)); /* dh */
|
2001-12-22 22:14:34 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
aa_render (aasink->context, &aasink->ascii_parms,
|
|
|
|
0, 0, aa_imgwidth (aasink->context), aa_imgheight (aasink->context));
|
2001-12-22 22:14:34 +00:00
|
|
|
aa_flush (aasink->context);
|
|
|
|
aa_getevent (aasink->context, FALSE);
|
2011-07-06 15:50:54 +00:00
|
|
|
gst_video_frame_unmap (&frame);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
return GST_FLOW_OK;
|
2011-07-06 15:50:54 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
invalid_frame:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (aasink, "invalid frame");
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_aasink_set_property (GObject * object, guint prop_id, const GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
|
|
|
GstAASink *aasink;
|
|
|
|
|
|
|
|
aasink = GST_AASINK (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_WIDTH:
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_surf.width = g_value_get_int (value);
|
|
|
|
break;
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_HEIGHT:
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_surf.height = g_value_get_int (value);
|
|
|
|
break;
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_DRIVER:{
|
2002-02-04 19:45:59 +00:00
|
|
|
aasink->aa_driver = g_value_get_enum (value);
|
2001-12-22 22:14:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_DITHER:{
|
2002-02-04 19:45:59 +00:00
|
|
|
aasink->ascii_parms.dither = g_value_get_enum (value);
|
2001-12-22 22:14:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_BRIGHTNESS:{
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_parms.bright = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_CONTRAST:{
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_parms.contrast = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_GAMMA:{
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_parms.gamma = g_value_get_float (value);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_INVERSION:{
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_parms.inversion = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_RANDOMVAL:{
|
2001-12-22 22:14:34 +00:00
|
|
|
aasink->ascii_parms.randomval = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_aasink_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
|
|
|
GstAASink *aasink;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
aasink = GST_AASINK (object);
|
2001-12-22 22:14:34 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_WIDTH:{
|
2001-12-22 22:14:34 +00:00
|
|
|
g_value_set_int (value, aasink->ascii_surf.width);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_HEIGHT:{
|
2001-12-22 22:14:34 +00:00
|
|
|
g_value_set_int (value, aasink->ascii_surf.height);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_DRIVER:{
|
2002-02-04 19:45:59 +00:00
|
|
|
g_value_set_enum (value, aasink->aa_driver);
|
2001-12-22 22:14:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_DITHER:{
|
2002-02-04 19:45:59 +00:00
|
|
|
g_value_set_enum (value, aasink->ascii_parms.dither);
|
2001-12-22 22:14:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_BRIGHTNESS:{
|
2001-12-22 22:14:34 +00:00
|
|
|
g_value_set_int (value, aasink->ascii_parms.bright);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_CONTRAST:{
|
2001-12-22 22:14:34 +00:00
|
|
|
g_value_set_int (value, aasink->ascii_parms.contrast);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_GAMMA:{
|
2001-12-22 22:14:34 +00:00
|
|
|
g_value_set_float (value, aasink->ascii_parms.gamma);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_INVERSION:{
|
2002-02-04 19:45:59 +00:00
|
|
|
g_value_set_boolean (value, aasink->ascii_parms.inversion);
|
2001-12-22 22:14:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_RANDOMVAL:{
|
2002-02-04 19:45:59 +00:00
|
|
|
g_value_set_int (value, aasink->ascii_parms.randomval);
|
2001-12-22 22:14:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_FRAMES_DISPLAYED:{
|
2001-12-22 22:14:34 +00:00
|
|
|
g_value_set_int (value, aasink->frames_displayed);
|
|
|
|
break;
|
|
|
|
}
|
2011-06-08 16:05:20 +00:00
|
|
|
case PROP_FRAME_TIME:{
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_int (value, aasink->frame_time / 1000000);
|
2001-12-22 22:14:34 +00:00
|
|
|
break;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
default:{
|
2001-12-22 22:14:34 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_aasink_open (GstAASink * aasink)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
2010-09-09 18:42:46 +00:00
|
|
|
if (!aasink->context) {
|
|
|
|
aa_recommendhidisplay (aa_drivers[aasink->aa_driver]->shortname);
|
|
|
|
|
|
|
|
aasink->context = aa_autoinit (&aasink->ascii_surf);
|
|
|
|
if (aasink->context == NULL) {
|
|
|
|
GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, (NULL),
|
|
|
|
("error opening aalib context"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
aa_autoinitkbd (aasink->context, 0);
|
|
|
|
aa_resizehandler (aasink->context, (void *) aa_resize);
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_aasink_close (GstAASink * aasink)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
|
|
|
aa_close (aasink->context);
|
2010-09-09 18:42:46 +00:00
|
|
|
aasink->context = NULL;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
return TRUE;
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_aasink_change_state (GstElement * element, GstStateChange transition)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
2005-09-02 15:44:50 +00:00
|
|
|
GstStateChangeReturn ret;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2001-12-22 22:14:34 +00:00
|
|
|
if (!gst_aasink_open (GST_AASINK (element)))
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
goto open_failed;
|
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
gst_aasink_close (GST_AASINK (element));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
return ret;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
open_failed:
|
|
|
|
{
|
2005-09-02 15:44:50 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm sure someone will fix it.
Original commit message from CVS:
* configure.ac:
* ext/aalib/Makefile.am:
* ext/aalib/gstaasink.c: (gst_aasink_get_type),
(gst_aasink_class_init), (gst_aasink_fixate), (gst_aasink_setcaps),
(gst_aasink_init), (gst_aasink_get_times), (gst_aasink_render),
(gst_aasink_set_property), (gst_aasink_get_property),
(gst_aasink_open), (gst_aasink_close), (gst_aasink_change_state):
* ext/aalib/gstaasink.h:
* gst/smpte/Makefile.am:
* gst/smpte/gstsmpte.c: (gst_smpte_setcaps), (gst_smpte_init),
(gst_smpte_collected):
* gst/smpte/gstsmpte.h:
Ported 2 more plugins. usgly hack in the Makefile.am though, I'm
sure someone will fix it.
2005-05-06 19:55:22 +00:00
|
|
|
}
|
2001-12-22 22:14:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2001-12-22 22:14:34 +00:00
|
|
|
{
|
2003-11-01 01:37:51 +00:00
|
|
|
if (!gst_element_register (plugin, "aasink", GST_RANK_NONE, GST_TYPE_AASINK))
|
|
|
|
return FALSE;
|
2001-12-22 22:14:34 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"aasink",
|
|
|
|
"ASCII Art video sink",
|
2005-11-22 18:11:58 +00:00
|
|
|
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|