mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
changes to accomodate the standardization of installed libs some left over changes
Original commit message from CVS: changes to accomodate the standardization of installed libs some left over changes
This commit is contained in:
parent
ad7ed0fa5b
commit
f7a82644ec
6 changed files with 96 additions and 647 deletions
3
TODO
3
TODO
|
@ -14,3 +14,6 @@
|
|||
add plugins with AC stuff (maybe from bits ?)
|
||||
write script that builds rpm's one from one
|
||||
get postun script right; gstreamer-register should be installed for example
|
||||
|
||||
* check options in a52, it has some arch stuff and some opti stuff that
|
||||
looks dodgy
|
||||
|
|
19
configure.ac
19
configure.ac
|
@ -413,10 +413,10 @@ echo
|
|||
echo
|
||||
AC_MSG_NOTICE(Checking for plugin libraries)
|
||||
|
||||
dnl *** a52dec ***
|
||||
translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
|
||||
GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
|
||||
GST_CHECK_LIBHEADER(A52DEC, a52, a52_init, -lm, a52dec/a52.h, A52DEC_LIBS="-la52")
|
||||
dnl *** a52 ***
|
||||
translit(dnm, m, l) AM_CONDITIONAL(USE_A52, true)
|
||||
GST_CHECK_FEATURE(A52, [a52], a52dec, [
|
||||
GST_CHECK_LIBHEADER(A52, a52, a52_init, -lm, a52dec/a52.h, A52_LIBS="-la52")
|
||||
])
|
||||
|
||||
dnl *** aalib ***
|
||||
|
@ -951,10 +951,6 @@ if test "x$HAVE_LIBMIKMOD" = xyes; then
|
|||
AC_DEFINE(HAVE_LIBMIKMOD)
|
||||
fi
|
||||
|
||||
if test "x$HAVE_AALIB" = "xyes"; then
|
||||
AC_DEFINE(HAVE_AALIB)
|
||||
fi
|
||||
|
||||
if test "x$HAVE_LIBJPEG" = xyes; then
|
||||
AC_DEFINE(HAVE_LIBJPEG)
|
||||
fi
|
||||
|
@ -1046,7 +1042,6 @@ AM_CONDITIONAL(HAVE_ARTS, test "x$HAVE_ARTS" = "xyes")
|
|||
AM_CONDITIONAL(HAVE_XMMS, test "x$HAVE_XMMS" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_RAW1394, test "x$HAVE_RAW1394" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_LIBDV, test "x$HAVE_LIBDV" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_AALIB, test "x$HAVE_AALIB" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_GNOME_VFS, test "x$HAVE_GNOME_VFS" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_LIBOPENQUICKTIME, test "x$HAVE_LIBOPENQUICKTIME" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_LIBGSM, test "x$HAVE_LIBGSM" = "xyes")
|
||||
|
@ -1090,6 +1085,7 @@ dnl Vars for everyone else
|
|||
dnl FIXME: is there a reason to add this top_builddir stuff ? don't think so
|
||||
dnl GST_LIBS="\$(top_builddir)/gst/libgst.la $LIBGST_LIBS"
|
||||
dnl GST_CFLAGS="-I\$(top_srcdir) -I\$(top_srcdir)/include $LIBGST_CFLAGS"
|
||||
GST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir)/gst-libs"
|
||||
AC_SUBST(GST_LIBS)
|
||||
AC_SUBST(GST_CFLAGS)
|
||||
|
||||
|
@ -1154,6 +1150,8 @@ sys/vcd/Makefile
|
|||
sys/vga/Makefile
|
||||
sys/xvideo/Makefile
|
||||
ext/Makefile
|
||||
ext/a52/Makefile
|
||||
ext/aalib/Makefile
|
||||
ext/audiofile/Makefile
|
||||
ext/esd/Makefile
|
||||
ext/lame/Makefile
|
||||
|
@ -1161,7 +1159,8 @@ ext/mad/Makefile
|
|||
ext/sdl/Makefile
|
||||
ext/vorbis/Makefile
|
||||
gst-libs/Makefile
|
||||
gst-libs/audio/Makefile
|
||||
gst-libs/gst/Makefile
|
||||
gst-libs/gst/audio/Makefile
|
||||
gst-plugins.spec
|
||||
)
|
||||
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
if USE_A52
|
||||
A52_DIR=a52
|
||||
else
|
||||
A52_DIR=
|
||||
endif
|
||||
|
||||
if USE_AALIB
|
||||
AALIB_DIR=aalib
|
||||
else
|
||||
AALIB_DIR=
|
||||
endif
|
||||
|
||||
if USE_AUDIOFILE
|
||||
AUDIOFILE_DIR=audiofile
|
||||
else
|
||||
|
@ -35,7 +47,8 @@ VORBIS_DIR=
|
|||
endif
|
||||
|
||||
|
||||
SUBDIRS=$(AUDIOFILE_DIR) $(ESD_DIR) $(LAME_DIR) $(MAD_DIR) \
|
||||
SUBDIRS=$(A52_DIR) $(AALIB_DIR) $(AUDIOFILE_DIR) $(ESD_DIR) \
|
||||
$(LAME_DIR) $(MAD_DIR) \
|
||||
$(SDL_DIR) $(VORBIS_DIR)
|
||||
|
||||
DIST_SUBDIRS=audiofile esd lame mad sdl vorbis
|
||||
DIST_SUBDIRS=a52 aalib audiofile esd lame mad sdl vorbis
|
||||
|
|
|
@ -1,542 +0,0 @@
|
|||
/* Gnome-Streamer
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "aasink.h"
|
||||
|
||||
static GstElementDetails gst_aasink_details = {
|
||||
"Video sink",
|
||||
"Sink/Video",
|
||||
"An ASCII art videosink",
|
||||
VERSION,
|
||||
"Wim Taymans <wim.taymans@chello.be>",
|
||||
"(C) 2001",
|
||||
};
|
||||
|
||||
/* aasink signals and args */
|
||||
enum {
|
||||
SIGNAL_FRAME_DISPLAYED,
|
||||
SIGNAL_HAVE_SIZE,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
ARG_0,
|
||||
ARG_WIDTH,
|
||||
ARG_HEIGHT,
|
||||
ARG_DRIVER,
|
||||
ARG_DITHER,
|
||||
ARG_BRIGHTNESS,
|
||||
ARG_CONTRAST,
|
||||
ARG_GAMMA,
|
||||
ARG_INVERSION,
|
||||
ARG_RANDOMVAL,
|
||||
ARG_FRAMES_DISPLAYED,
|
||||
ARG_FRAME_TIME,
|
||||
};
|
||||
|
||||
GST_PADTEMPLATE_FACTORY (sink_template,
|
||||
"sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_CAPS_NEW (
|
||||
"aasink_caps",
|
||||
"video/raw",
|
||||
"format", GST_PROPS_FOURCC (GST_STR_FOURCC ("I420"))
|
||||
)
|
||||
)
|
||||
|
||||
static void gst_aasink_class_init (GstAASinkClass *klass);
|
||||
static void gst_aasink_init (GstAASink *aasink);
|
||||
|
||||
static void gst_aasink_chain (GstPad *pad, GstBuffer *buf);
|
||||
|
||||
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);
|
||||
|
||||
static GstElementStateReturn gst_aasink_change_state (GstElement *element);
|
||||
|
||||
static GstElementClass *parent_class = NULL;
|
||||
static guint gst_aasink_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
GType
|
||||
gst_aasink_get_type (void)
|
||||
{
|
||||
static GType aasink_type = 0;
|
||||
|
||||
if (!aasink_type) {
|
||||
static const GTypeInfo aasink_info = {
|
||||
sizeof(GstAASinkClass), NULL, NULL, (GClassInitFunc)gst_aasink_class_init, NULL, NULL,
|
||||
sizeof(GstAASink),
|
||||
0,
|
||||
(GInstanceInitFunc)gst_aasink_init,
|
||||
};
|
||||
aasink_type = g_type_register_static(GST_TYPE_ELEMENT, "GstAASink", &aasink_info, 0);
|
||||
}
|
||||
return aasink_type;
|
||||
}
|
||||
|
||||
#define GST_TYPE_AADRIVERS (gst_aasink_drivers_get_type())
|
||||
static GType
|
||||
gst_aasink_drivers_get_type (void)
|
||||
{
|
||||
static GType driver_type = 0;
|
||||
if (!driver_type) {
|
||||
GEnumValue *drivers;
|
||||
const struct aa_driver *driver;
|
||||
gint i = 0;
|
||||
|
||||
driver = aa_drivers[i++];
|
||||
while (driver) {
|
||||
driver = aa_drivers[i++];
|
||||
}
|
||||
|
||||
drivers = g_new0(GEnumValue, i);
|
||||
|
||||
i = 0;
|
||||
driver = aa_drivers[i];
|
||||
while (driver) {
|
||||
drivers[i].value = i;
|
||||
drivers[i].value_name = g_strdup (driver->shortname);
|
||||
drivers[i].value_nick = g_strdup (driver->name);
|
||||
i++;
|
||||
driver = aa_drivers[i];
|
||||
}
|
||||
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;
|
||||
if (!dither_type) {
|
||||
GEnumValue *ditherers;
|
||||
gint i = 0;
|
||||
|
||||
while (aa_dithernames[i]) {
|
||||
i++;
|
||||
}
|
||||
|
||||
ditherers = g_new0(GEnumValue, i);
|
||||
|
||||
i = 0;
|
||||
while (aa_dithernames[i]) {
|
||||
ditherers[i].value = i;
|
||||
ditherers[i].value_name = g_strdup (aa_dithernames[i]);
|
||||
ditherers[i].value_nick = g_strdup (aa_dithernames[i]);
|
||||
i++;
|
||||
}
|
||||
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
|
||||
gst_aasink_class_init (GstAASinkClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class;
|
||||
GstElementClass *gstelement_class;
|
||||
|
||||
gobject_class = (GObjectClass*)klass;
|
||||
gstelement_class = (GstElementClass*)klass;
|
||||
|
||||
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
||||
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_WIDTH,
|
||||
g_param_spec_int("width","width","width",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_HEIGHT,
|
||||
g_param_spec_int("height","height","height",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DRIVER,
|
||||
g_param_spec_enum("driver","driver","driver",
|
||||
GST_TYPE_AADRIVERS,0,G_PARAM_READWRITE)); /* CHECKME! */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DITHER,
|
||||
g_param_spec_enum("dither","dither","dither",
|
||||
GST_TYPE_AADITHER,0,G_PARAM_READWRITE)); /* CHECKME! */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BRIGHTNESS,
|
||||
g_param_spec_int("brightness","brightness","brightness",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CONTRAST,
|
||||
g_param_spec_int("contrast","contrast","contrast",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_GAMMA,
|
||||
g_param_spec_float("gamma","gamma","gamma",
|
||||
0.0,5.0,1.0,G_PARAM_READWRITE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_INVERSION,
|
||||
g_param_spec_boolean("inversion","inversion","inversion",
|
||||
TRUE,G_PARAM_READWRITE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_RANDOMVAL,
|
||||
g_param_spec_int("randomval","randomval","randomval",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FRAMES_DISPLAYED,
|
||||
g_param_spec_int("frames_displayed","frames_displayed","frames_displayed",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READABLE)); /* CHECKME */
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FRAME_TIME,
|
||||
g_param_spec_int("frame_time","frame_time","frame_time",
|
||||
G_MININT,G_MAXINT,0,G_PARAM_READABLE)); /* CHECKME */
|
||||
|
||||
gobject_class->set_property = gst_aasink_set_property;
|
||||
gobject_class->get_property = gst_aasink_get_property;
|
||||
|
||||
gst_aasink_signals[SIGNAL_FRAME_DISPLAYED] =
|
||||
g_signal_new ("frame_displayed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstAASinkClass, frame_displayed), NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
|
||||
gst_aasink_signals[SIGNAL_HAVE_SIZE] =
|
||||
g_signal_new ("have_size", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstAASinkClass, have_size), NULL, NULL,
|
||||
gst_marshal_VOID__INT_INT, G_TYPE_NONE, 2,
|
||||
G_TYPE_UINT, G_TYPE_UINT);
|
||||
|
||||
gstelement_class->change_state = gst_aasink_change_state;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_aasink_newcaps (GstPad *pad, GstCaps *caps)
|
||||
{
|
||||
GstAASink *aasink;
|
||||
gulong print_format;
|
||||
|
||||
aasink = GST_AASINK (gst_pad_get_parent (pad));
|
||||
|
||||
aasink->width = gst_caps_get_int (caps, "width");
|
||||
aasink->height = gst_caps_get_int (caps, "height");
|
||||
|
||||
print_format = GULONG_FROM_LE (aasink->format);
|
||||
|
||||
GST_DEBUG (0, "aasink: setting %08lx (%4.4s)\n", aasink->format, (gchar*)&print_format);
|
||||
|
||||
g_signal_emit( G_OBJECT (aasink), gst_aasink_signals[SIGNAL_HAVE_SIZE], 0,
|
||||
aasink->width, aasink->height);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_aasink_init (GstAASink *aasink)
|
||||
{
|
||||
aasink->sinkpad = gst_pad_new_from_template (
|
||||
GST_PADTEMPLATE_GET (sink_template), "sink");
|
||||
gst_element_add_pad (GST_ELEMENT (aasink), aasink->sinkpad);
|
||||
gst_pad_set_chain_function (aasink->sinkpad, gst_aasink_chain);
|
||||
gst_pad_set_newcaps_function (aasink->sinkpad, gst_aasink_newcaps);
|
||||
|
||||
aasink->clock = gst_clock_get_system();
|
||||
gst_clock_register(aasink->clock, GST_OBJECT(aasink));
|
||||
|
||||
memcpy(&aasink->ascii_surf, &aa_defparams, sizeof (struct aa_hardware_params));
|
||||
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;
|
||||
|
||||
aasink->width = -1;
|
||||
aasink->height = -1;
|
||||
|
||||
GST_FLAG_SET(aasink, GST_ELEMENT_THREAD_SUGGESTED);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_aasink_scale (GstAASink *aasink, gchar *src, gchar *dest,
|
||||
gint sw, gint sh,
|
||||
gint dw, gint dh)
|
||||
{
|
||||
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;
|
||||
src += sw;
|
||||
}
|
||||
xpos = 0x10000;
|
||||
{
|
||||
guchar *destp = dest;
|
||||
guchar *srcp = src;
|
||||
|
||||
for ( x=dw; x; x-- ) {
|
||||
while (xpos >= 0x10000L) {
|
||||
srcp++;
|
||||
xpos -= 0x10000L;
|
||||
}
|
||||
*destp++ = *srcp;
|
||||
xpos += xinc;
|
||||
}
|
||||
}
|
||||
dest += dw;
|
||||
ypos += yinc;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_aasink_chain (GstPad *pad, GstBuffer *buf)
|
||||
{
|
||||
GstAASink *aasink;
|
||||
GstClockTimeDiff jitter;
|
||||
|
||||
g_return_if_fail (pad != NULL);
|
||||
g_return_if_fail (GST_IS_PAD (pad));
|
||||
g_return_if_fail (buf != NULL);
|
||||
|
||||
aasink = GST_AASINK (gst_pad_get_parent (pad));
|
||||
|
||||
gst_aasink_scale (aasink,
|
||||
GST_BUFFER_DATA (buf), /* src */
|
||||
aa_image (aasink->context), /* dest */
|
||||
aasink->width, /* sw */
|
||||
aasink->height, /* sh */
|
||||
aa_imgwidth (aasink->context), /* dw */
|
||||
aa_imgheight (aasink->context)); /* dh */
|
||||
|
||||
if (!GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLUSH)) {
|
||||
GST_DEBUG (0,"videosink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP(buf));
|
||||
|
||||
jitter = gst_clock_current_diff(aasink->clock, GST_BUFFER_TIMESTAMP (buf));
|
||||
|
||||
if (jitter > 500000 || jitter < -500000)
|
||||
{
|
||||
GST_DEBUG (0, "jitter: %lld\n", jitter);
|
||||
gst_clock_set (aasink->clock, GST_BUFFER_TIMESTAMP (buf));
|
||||
}
|
||||
else {
|
||||
gst_clock_wait(aasink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(aasink));
|
||||
}
|
||||
}
|
||||
|
||||
aa_render (aasink->context, &aasink->ascii_parms,
|
||||
0, 0, aa_imgwidth (aasink->context), aa_imgheight (aasink->context));
|
||||
aa_flush (aasink->context);
|
||||
aa_getevent (aasink->context, FALSE);
|
||||
|
||||
g_signal_emit(G_OBJECT(aasink),gst_aasink_signals[SIGNAL_FRAME_DISPLAYED], 0);
|
||||
|
||||
gst_buffer_unref(buf);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_aasink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
GstAASink *aasink;
|
||||
|
||||
/* it's not null if we got it, but it might not be ours */
|
||||
g_return_if_fail (GST_IS_AASINK (object));
|
||||
|
||||
aasink = GST_AASINK (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case ARG_WIDTH:
|
||||
aasink->ascii_surf.width = g_value_get_int (value);
|
||||
break;
|
||||
case ARG_HEIGHT:
|
||||
aasink->ascii_surf.height = g_value_get_int (value);
|
||||
break;
|
||||
case ARG_DRIVER: {
|
||||
aasink->aa_driver = g_value_get_int (value);
|
||||
break;
|
||||
}
|
||||
case ARG_DITHER: {
|
||||
aasink->ascii_parms.dither = g_value_get_int (value);
|
||||
break;
|
||||
}
|
||||
case ARG_BRIGHTNESS: {
|
||||
aasink->ascii_parms.bright = g_value_get_int (value);
|
||||
break;
|
||||
}
|
||||
case ARG_CONTRAST: {
|
||||
aasink->ascii_parms.contrast = g_value_get_int (value);
|
||||
break;
|
||||
}
|
||||
case ARG_GAMMA: {
|
||||
aasink->ascii_parms.gamma = g_value_get_float (value);
|
||||
break;
|
||||
}
|
||||
case ARG_INVERSION: {
|
||||
aasink->ascii_parms.inversion = g_value_get_boolean (value);
|
||||
break;
|
||||
}
|
||||
case ARG_RANDOMVAL: {
|
||||
aasink->ascii_parms.randomval = g_value_get_int (value);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_aasink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
GstAASink *aasink;
|
||||
|
||||
/* it's not null if we got it, but it might not be ours */
|
||||
aasink = GST_AASINK(object);
|
||||
|
||||
switch (prop_id) {
|
||||
case ARG_WIDTH: {
|
||||
g_value_set_int (value, aasink->ascii_surf.width);
|
||||
break;
|
||||
}
|
||||
case ARG_HEIGHT: {
|
||||
g_value_set_int (value, aasink->ascii_surf.height);
|
||||
break;
|
||||
}
|
||||
case ARG_DRIVER: {
|
||||
g_value_set_int (value, aasink->aa_driver);
|
||||
break;
|
||||
}
|
||||
case ARG_DITHER: {
|
||||
g_value_set_int (value, aasink->ascii_parms.dither);
|
||||
break;
|
||||
}
|
||||
case ARG_BRIGHTNESS: {
|
||||
g_value_set_int (value, aasink->ascii_parms.bright);
|
||||
break;
|
||||
}
|
||||
case ARG_CONTRAST: {
|
||||
g_value_set_int (value, aasink->ascii_parms.contrast);
|
||||
break;
|
||||
}
|
||||
case ARG_GAMMA: {
|
||||
g_value_set_float (value, aasink->ascii_parms.gamma);
|
||||
break;
|
||||
}
|
||||
case ARG_INVERSION: {
|
||||
g_value_set_int (value, aasink->ascii_parms.inversion);
|
||||
break;
|
||||
}
|
||||
case ARG_RANDOMVAL: {
|
||||
g_value_set_boolean (value, aasink->ascii_parms.randomval);
|
||||
break;
|
||||
}
|
||||
case ARG_FRAMES_DISPLAYED: {
|
||||
g_value_set_int (value, aasink->frames_displayed);
|
||||
break;
|
||||
}
|
||||
case ARG_FRAME_TIME: {
|
||||
g_value_set_int (value, aasink->frame_time/1000000);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_aasink_open (GstAASink *aasink)
|
||||
{
|
||||
g_return_val_if_fail (!GST_FLAG_IS_SET (aasink ,GST_AASINK_OPEN), FALSE);
|
||||
|
||||
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),
|
||||
g_strdup("opening aalib context"));
|
||||
return FALSE;
|
||||
}
|
||||
aa_autoinitkbd(aasink->context, 0);
|
||||
aa_resizehandler(aasink->context, (void *)aa_resize);
|
||||
|
||||
GST_FLAG_SET (aasink, GST_AASINK_OPEN);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_aasink_close (GstAASink *aasink)
|
||||
{
|
||||
g_return_if_fail (GST_FLAG_IS_SET (aasink ,GST_AASINK_OPEN));
|
||||
|
||||
aa_close (aasink->context);
|
||||
|
||||
GST_FLAG_UNSET (aasink, GST_AASINK_OPEN);
|
||||
}
|
||||
|
||||
static GstElementStateReturn
|
||||
gst_aasink_change_state (GstElement *element)
|
||||
{
|
||||
g_return_val_if_fail (GST_IS_AASINK (element), GST_STATE_FAILURE);
|
||||
|
||||
if (GST_STATE_PENDING (element) == GST_STATE_NULL) {
|
||||
if (GST_FLAG_IS_SET (element, GST_AASINK_OPEN))
|
||||
gst_aasink_close (GST_AASINK (element));
|
||||
} else {
|
||||
if (!GST_FLAG_IS_SET (element, GST_AASINK_OPEN)) {
|
||||
if (!gst_aasink_open (GST_AASINK (element)))
|
||||
return GST_STATE_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
||||
return GST_ELEMENT_CLASS (parent_class)->change_state (element);
|
||||
|
||||
return GST_STATE_SUCCESS;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
plugin_init (GModule *module, GstPlugin *plugin)
|
||||
{
|
||||
GstElementFactory *factory;
|
||||
|
||||
/* create an elementfactory for the aasink element */
|
||||
factory = gst_elementfactory_new("aasink",GST_TYPE_AASINK,
|
||||
&gst_aasink_details);
|
||||
g_return_val_if_fail(factory != NULL, FALSE);
|
||||
|
||||
gst_elementfactory_add_padtemplate (factory,
|
||||
GST_PADTEMPLATE_GET (sink_template));
|
||||
|
||||
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GstPluginDesc plugin_desc = {
|
||||
GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"aasink",
|
||||
plugin_init
|
||||
};
|
|
@ -1,88 +0,0 @@
|
|||
/* Gnome-Streamer
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GST_AASINK_H__
|
||||
#define __GST_AASINK_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include <aalib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#define GST_TYPE_AASINK \
|
||||
(gst_aasink_get_type())
|
||||
#define GST_AASINK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AASINK,GstAASink))
|
||||
#define GST_AASINK_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AASINK,GstAASink))
|
||||
#define GST_IS_AASINK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AASINK))
|
||||
#define GST_IS_AASINK_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AASINK))
|
||||
|
||||
typedef enum {
|
||||
GST_AASINK_OPEN = GST_ELEMENT_FLAG_LAST,
|
||||
|
||||
GST_AASINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
|
||||
} GstAASinkFlags;
|
||||
|
||||
typedef struct _GstAASink GstAASink;
|
||||
typedef struct _GstAASinkClass GstAASinkClass;
|
||||
|
||||
struct _GstAASink {
|
||||
GstElement element;
|
||||
|
||||
GstPad *sinkpad;
|
||||
|
||||
gulong format;
|
||||
gint width, height;
|
||||
|
||||
gint frames_displayed;
|
||||
guint64 frame_time;
|
||||
|
||||
GstClock *clock;
|
||||
|
||||
aa_context *context;
|
||||
struct aa_hardware_params ascii_surf;
|
||||
struct aa_renderparams ascii_parms;
|
||||
aa_palette palette;
|
||||
gint aa_driver;
|
||||
};
|
||||
|
||||
struct _GstAASinkClass {
|
||||
GstElementClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (*frame_displayed) (GstElement *element);
|
||||
void (*have_size) (GstElement *element, guint width, guint height);
|
||||
};
|
||||
|
||||
GType gst_aasink_get_type(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* __GST_AASINKE_H__ */
|
|
@ -62,11 +62,75 @@ make prefix=$RPM_BUILD_ROOT%{prefix} install
|
|||
@USE_ESD_TRUE@%files -n gstreamer-esd
|
||||
@USE_ESD_TRUE@%defattr(-, root, root)
|
||||
@USE_ESD_TRUE@%{prefix}/lib/gst/libesd*
|
||||
@USE_ESD_TRUE@
|
||||
@USE_ESD_TRUE@%post -n gstreamer-esd
|
||||
@USE_ESD_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_ESD_TRUE@
|
||||
@USE_ESD_TRUE@%postun -n gstreamer-esd
|
||||
@USE_ESD_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_ESD_TRUE@/sbin/ldconfig
|
||||
|
||||
%post -n gstreamer-esd
|
||||
%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
### MAD ###
|
||||
@USE_MAD_TRUE@%package -n gstreamer-mad
|
||||
@USE_MAD_TRUE@Summary: Plugin using MAD for mp3 decoding
|
||||
@USE_MAD_TRUE@Group: Libraries/Multimedia
|
||||
@USE_MAD_TRUE@Requires: %{name} = %{ver}
|
||||
@USE_MAD_TRUE@Requires: mad >= 0.13.0
|
||||
@USE_MAD_TRUE@
|
||||
@USE_MAD_TRUE@%description -n gstreamer-mad
|
||||
@USE_MAD_TRUE@Plugin for playback of mp3 songs using the very good MAD library
|
||||
@USE_MAD_TRUE@
|
||||
@USE_MAD_TRUE@%files -n gstreamer-mad
|
||||
@USE_MAD_TRUE@%defattr(-, root, root)
|
||||
@USE_MAD_TRUE@%{prefix}/lib/gst/libgstmad*
|
||||
@USE_MAD_TRUE@
|
||||
@USE_MAD_TRUE@%post -n gstreamer-mad
|
||||
@USE_MAD_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_MAD_TRUE@
|
||||
@USE_MAD_TRUE@%postun -n gstreamer-mad
|
||||
@USE_MAD_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_MAD_TRUE@/sbin/ldconfig
|
||||
|
||||
%postun -n gstreamer-esd
|
||||
%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
/sbin/ldconfig
|
||||
### OSS ###
|
||||
@USE_OSS_TRUE@%package -n gstreamer-oss
|
||||
@USE_OSS_TRUE@Summary: Gstreamer plugins for input and output using OSS
|
||||
@USE_OSS_TRUE@Group: Libraries/Multimedia
|
||||
@USE_OSS_TRUE@Requires: %{name} = %{ver}
|
||||
@USE_OSS_TRUE@
|
||||
@USE_OSS_TRUE@%description -n gstreamer-oss
|
||||
@USE_OSS_TRUE@Plugins for output and input to the OpenSoundSytem audio
|
||||
@USE_OSS_TRUE@drivers found in the Linux kernels or commercially available
|
||||
@USE_OSS_TRUE@from OpenSound.
|
||||
@USE_OSS_TRUE@
|
||||
@USE_OSS_TRUE@%files -n gstreamer-oss
|
||||
@USE_OSS_TRUE@%defattr(-, root, root)
|
||||
@USE_OSS_TRUE@%{prefix}/lib/gst/libgstoss*
|
||||
@USE_OSS_TRUE@
|
||||
@USE_OSS_TRUE@%post -n gstreamer-oss
|
||||
@USE_OSS_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_OSS_TRUE@
|
||||
@USE_OSS_TRUE@%postun -n gstreamer-oss
|
||||
@USE_OSS_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_OSS_TRUE@/sbin/ldconfig
|
||||
|
||||
### Vorbis ###
|
||||
@USE_VORBIS_TRUE@%package -n gstreamer-vorbis
|
||||
@USE_VORBIS_TRUE@Summary: Gstreamer plugin for encoding and decoding Ogg Vorbis audio files
|
||||
@USE_VORBIS_TRUE@Group: Libraries/Multimedia
|
||||
@USE_VORBIS_TRUE@Requires: libogg >= 1.0beta4
|
||||
@USE_VORBIS_TRUE@Requires: libvorbis >= 1.0beta4
|
||||
@USE_VORBIS_TRUE@Requires: %{name} = %{ver}
|
||||
@USE_VORBIS_TRUE@
|
||||
@USE_VORBIS_TRUE@%description -n gstreamer-vorbis
|
||||
@USE_VORBIS_TRUE@Plugins for creating and playing Ogg Vorbis audio files.
|
||||
@USE_VORBIS_TRUE@
|
||||
@USE_VORBIS_TRUE@%files -n gstreamer-vorbis
|
||||
@USE_VORBIS_TRUE@%defattr(-, root, root)
|
||||
@USE_VORBIS_TRUE@%{prefix}/lib/gst/libgstvorbis*
|
||||
@USE_VORBIS_TRUE@
|
||||
@USE_VORBIS_TRUE@%post -n gstreamer-vorbis
|
||||
@USE_VORBIS_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_VORBIS_TRUE@
|
||||
@USE_VORBIS_TRUE@%postun -n gstreamer-vorbis
|
||||
@USE_VORBIS_TRUE@%{prefix}/bin/gstreamer-register --gst-mask=0
|
||||
@USE_VORBIS_TRUE@/sbin/ldconfig
|
||||
|
|
Loading…
Reference in a new issue