...
 
Commits (371)
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -60,17 +60,5 @@ EXTRA_DIST = \
DISTCLEANFILES = _stdint.h
# check that no marshal or enumtypes files are included
# this in turn ensures that distcheck fails for missing .list files which is currently
# shadowed when the corresponding .c and .h files are included.
distcheck-hook:
@test "x" = "x`find $(distdir) -name \*-enumtypes.[ch]`" && \
test "x" = "x`find $(distdir) -name \*-marshal.[ch]`" || \
( $(ECHO) "*** Leftover enumtypes or marshal files in the tarball." && \
$(ECHO) "*** Make sure the following files are not disted:" && \
find $(distdir) -name \*-enumtypes.[ch] && \
find $(distdir) -name \*-marshal.[ch] && \
false )
include $(top_srcdir)/common/release.mak
include $(top_srcdir)/common/po.mak
This diff is collapsed.
GStreamer: Release notes for GStreamer Plugins 0.8.7 "Hyperspace"
GStreamer: Release notes for GStreamer Plugins 0.8.11 "... And Thanks For All The Fix"
The GStreamer team is happy to announce a new release
......@@ -23,87 +23,68 @@ want support for a lot of popular video formats, you need to install this
module along with the GStreamer Core and Plugins. An FFmpeg-based colorspace
element has been added to the Plugins however.
A special "thank you" to Ronald Bultje, who has done most of the work on 0.8
in the past year. We wish him luck on his new adventure in NYC. So long !
Features of this release
* Parallel installability with 0.6.x series
* Internationalization
* Translations: af az cs en_GB hu nb nl or sq sr sv uk
* multichannel audio support
* new element: apetag
* new element: ttadec, ttaparse
* new element: directfbvideosink
* vcd fixes
* playbin fixes
* dvdread fixes
* a52dec fixes
* sunaudiosrc fixes
* osssrc fixes
* avidemux fixes
* licensing updates
* Translations: af az ca cs en_GB fr hu it nb nl or sq sr sv uk vi
* new element: dvdsubdec
* new element: imagemixer
* new element: textrender
* new element: x264enc
* new element: oggparse
* important fixes for esound synchronisation
Bugs fixed in this release
* 147919 : [playbin] broken wav seeking
* 148559 : [monoscope] grinds to a halt
* 149102 : gstreamer license problems
* 149613 : [PATCH}Add proxy server support to the musicbrainz plugin
* 151624 : Multichannel support
* 152339 : [PATCH] [build] gst-plugins cross compiling
* 154773 : [playbin] crashes trying to play short wave files (1 or 2...
* 154775 : [qtdemux] Quicktime movie causing some weird debug spew
* 154814 : Selection of totem crashing videos
* 154815 : [PATCH] ffmpegcolorspace leaks caps
* 155348 : Various MP3 files cannot be detected or played
* 155879 : [libriff] Bug in lib-riff
* 156798 : " An error occured " " Could not write to resource " this sa...
* 157233 : [PATCH] playbin leak fixes
* 158258 : Patch for polypsink to make it work with both threaded an...
* 158382 : [PATCH] [build] debian speex detection patch
* 158650 : [PATCH] [videocrop] video crop is completely buggered
* 158704 : Fix/finish (S)VCD support
* 159215 : [PATCH] Memory leaks in audioscale
* 159296 : Playing benow.mp3 file cause totem to hang on EOS with de...
* 159297 : dark.441-16-s.flac hangs on eos in totem with debug spew
* 159301 : gstreamer.avi file plays, but have broken seeking in totem
* 159338 : alaw/mulaw decoders caps warning
* 159433 : [osssink] doesn't check for supported channels
* 159512 : Progress bar with m4a (aac) broken
* 159651 : [decodebin] totem crash
* 159759 : DVD LCPM asserts
* 159847 : [build] hardcoded path for musepack headers in configure
* 159864 : avidemux sends GST_EVENT_DISCONTINUOUS
* 159986 : [PATCH] Videorate doesn't handle seek and doesn't reset w...
* 160276 : [PATCH] mpegdemux and dvddemux don't reset themselves in ...
* 160439 : Can't compile gst-plugins without GCONF
* 160514 : [avidemux] seek after EOF for truncated avi files (to non...
* 160532 : [avidemux] avi[cvid+PCM] : no image, sound is noise
* 160808 : 'ERROR: pipeline doesn't want to play' when using xvimage...
* 160869 : [playbin] ogg file (theora/vorbis) causes segfault near end
* 161039 : [PATCH] [deinterlace] rowstrides need fixing
* 161538 : [playbin] AVI files with mp3 audio are out-of-sync in pla...
* 161624 : [alsasink] crash at end of playing this file
* 161980 : Volume control applet does not set value correctly.
* 162819 : [audioscale] cleanup
* 162913 : [mms] missing NULL terminator to g_object_set() in uri ha...
* 162924 : [playbin] totem assertion failures when playing cd / pote...
API changed in this release
- API additions:
* A new cdparanoia property, device, has been added.
* A new dvdnavsrc property, device, has been added.
* A new dvdreadsrc property, device, has been added.
* A new vcdsrc property, device, has been added.
- API depreciations:
* A cdparanoia property, location, has been marked for deprecation.
* A dvdnavsrc property, location, has been marked for deprecation.
* A dvdreadsrc property, location, has been marked for deprecation.
* A vcdsrc property, location, has been marked for deprecation.
* 166528 : [playbin] hang playing dvdnav:// location
* 166783 : [PATCH] New plugin: imagemixer
* 167122 : seeking DVD stops playback
* 171563 : Vorbis support for Matroska muxer
* 301312 : dvdsubdec element
* 305754 : [PATCH] Internal GStreamer error: pad problem.
* 306555 : chain-based text rendering element
* 307326 : esdsink makes video choppy totem
* 307361 : please expose shoutcast stream metadata through playbin
* 308040 : gstadder: using adder with float audio results in corrupt...
* 308484 : Totem gives error when seeking back to beginning of Ogg T...
* 308633 : Matroska muxer always fails
* 308638 : ffmpegcolorspace does not handle bgra32 correctly
* 308772 : mad timestamp inconsistency
* 308980 : gst-typefind incorrectly identifies m4a files encoded wit...
* 309087 : artsdsink registers conflicting property " name " which cau...
* 309150 : [xvimagesink/ximagesink] Incremenet framerate properties
* 309179 : videomixer does not love static images and eos
* 309218 : adder element does not supply duration values to data it ...
* 309325 : Matroska: incorrect element size
* 309354 : timestamp inconsitency in audioscale
* 309375 : cdparanoia can't extract last track
* 309503 : gst-plugins: xine wrapper compile problem with xine-lib-1...
* 309524 : no debug category for gnome-vfs elements
* 309532 : Matroska: Invalid free()
* 309834 : Totem crashes when trying to Play Disc 'cdrecorder'
* 310020 : Totem segfaults due to bad location
* 310335 : [decodebin] problems with audio streams in a mkv
* 310597 : gsttextrender cuts of pixels at the right and bottom of s...
* 311006 : [spectrum] handle mono streams
* 311070 : wavparse returns caps not in template
* 311162 : [flacdec] doesn't handle 24-bit files
* 311401 : alpha capsnego broken
* 311487 : configure doesn't check for libGLU?
* 311491 : ogg muxer can get pages out of order (patch)
* 311583 : Skips when playing CD
* 311600 : Add MPEG-2 support to mpeg1videoparse
* 311662 : " uninitialized value " warning causes build to fail
* 312121 : [modplug] crashes on query before song fully loaded
* 312272 : Musicbrainz tags not registered for FLAC encoder
* 313084 : Eats memory decoding mp3
* 313374 : Crashes in libgstcdparanoia when missing device permissions
* 313600 : recent change to esdsink in the 0.8.x branch breaks playback
Download
......@@ -138,26 +119,27 @@ as provided by gstreamer-gconf-0.8.pc, to access the default settings.
Contributors to this release
* Archana Shah
* Akos Maroy
* Andy Wingo
* Arwed v. Merkatz
* Balamurali Viswanathan
* Chris Ouch
* Benjamin Otte
* Christian Schaller
* Christophe Fergeau
* David Schleef
* Edward Hervey
* Iain Holmes
* James Bowes
* Julien Moutte
* Maciej Katafiasz
* Martin Soto
* Dominique Würtz
* Jan Schmidt
* Jonathan Matthew
* Josef Zlomek
* Luca Ognibene
* Madhan Raj M
* Michael Benes
* Michael Smith
* Paolo Borelli
* Ronald Bultje
* Sebastien Cote
* Stefan Kost
* Stephane Loeuillet
* Ross Burton
* Thomas Vander Stichele
* Thomas Zajic
* Stefan Kost
* Tim-Philipp Müller
* Toni Willberg
* Wim Taymans
* Wouter Paesen
* Zaheer Abbas Merali
 
\ No newline at end of file
......@@ -67,7 +67,7 @@ if test -x mkinstalldirs; then rm mkinstalldirs; fi
# first remove patch if necessary, then run autopoint, then reapply
if test -f po/Makefile.in.in;
then
patch -p0 -R < common/gettext.patch
patch -p0 -R --forward < common/gettext.patch
fi
tool_run "$autopoint --force"
patch -p0 < common/gettext.patch
......
common @ 54886902
Subproject commit b2638c100721f67b280c3b43b21f1ce1c9b5e316
Subproject commit 54886902497be267fe1f1a3f9c4dc0245bc46175
This diff is collapsed.
......@@ -9,7 +9,7 @@ static GList *seekable_elements = NULL;
static GstElement *pipeline;
static GtkAdjustment *adjustment;
static gboolean stats = FALSE;
static guint64 duration;
static gint64 duration;
static guint update_id;
......@@ -60,7 +60,7 @@ static seek_format seek_formats[] = {
G_GNUC_UNUSED static void
query_durations ()
query_durations (void)
{
GList *walk = seekable_elements;
......@@ -89,7 +89,7 @@ query_durations ()
}
G_GNUC_UNUSED static void
query_positions ()
query_positions (void)
{
GList *walk = seekable_elements;
......@@ -121,7 +121,7 @@ static gboolean
update_scale (gpointer data)
{
GstClock *clock;
guint64 position = 0;
gint64 position = 0;
GstFormat format = GST_FORMAT_TIME;
duration = 0;
......@@ -267,11 +267,11 @@ main (int argc, char **argv)
gtk_scale_set_digits (GTK_SCALE (hscale), 2);
gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_CONTINUOUS);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_press_event", G_CALLBACK (start_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_release_event", G_CALLBACK (stop_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"format_value", G_CALLBACK (format_value), pipeline);
/* do the packing stuff ... */
......
......@@ -6,7 +6,7 @@
static GstElement *playbin = NULL;
static GstElement *pipeline;
static guint64 duration;
static gint64 duration;
static GtkAdjustment *adjustment;
static GtkWidget *hscale;
static gboolean verbose = FALSE;
......@@ -45,7 +45,7 @@ static gboolean
update_scale (gpointer data)
{
GstClock *clock;
guint64 position;
gint64 position;
GstFormat format = GST_FORMAT_TIME;
gboolean res;
......@@ -225,11 +225,11 @@ main (int argc, char **argv)
gtk_scale_set_digits (GTK_SCALE (hscale), 2);
gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_CONTINUOUS);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_press_event", G_CALLBACK (start_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_release_event", G_CALLBACK (stop_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"format_value", G_CALLBACK (format_value), pipeline);
/* do the packing stuff ... */
......
......@@ -12,7 +12,7 @@ static GList *rate_pads = NULL;
static GList *seekable_elements = NULL;
static GstElement *pipeline;
static guint64 duration;
static gint64 duration;
static GtkAdjustment *adjustment;
static GtkWidget *hscale;
static gboolean stats = FALSE;
......@@ -663,7 +663,7 @@ query_rates (void)
}
G_GNUC_UNUSED static void
query_durations_elems ()
query_durations_elems (void)
{
GList *walk = seekable_elements;
......@@ -693,7 +693,7 @@ query_durations_elems ()
}
G_GNUC_UNUSED static void
query_durations_pads ()
query_durations_pads (void)
{
GList *walk = seekable_pads;
......@@ -723,7 +723,7 @@ query_durations_pads ()
}
G_GNUC_UNUSED static void
query_positions_elems ()
query_positions_elems (void)
{
GList *walk = seekable_elements;
......@@ -753,7 +753,7 @@ query_positions_elems ()
}
G_GNUC_UNUSED static void
query_positions_pads ()
query_positions_pads (void)
{
GList *walk = seekable_pads;
......@@ -786,7 +786,7 @@ static gboolean
update_scale (gpointer data)
{
GstClock *clock;
guint64 position;
gint64 position;
GstFormat format = GST_FORMAT_TIME;
gboolean res;
......@@ -1035,11 +1035,11 @@ main (int argc, char **argv)
gtk_scale_set_digits (GTK_SCALE (hscale), 2);
gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_CONTINUOUS);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_press_event", G_CALLBACK (start_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_release_event", G_CALLBACK (stop_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"format_value", G_CALLBACK (format_value), pipeline);
/* do the packing stuff ... */
......
......@@ -13,7 +13,7 @@ static GList *seekable_elements = NULL;
static GstElement *pipeline;
static GtkAdjustment *adjustment;
static gboolean stats = FALSE;
static guint64 duration;
static gint64 duration;
static guint update_id;
......@@ -136,7 +136,7 @@ query_rates (void)
}
G_GNUC_UNUSED static void
query_durations ()
query_durations (void)
{
GList *walk = seekable_elements;
......@@ -165,7 +165,7 @@ query_durations ()
}
G_GNUC_UNUSED static void
query_positions ()
query_positions (void)
{
GList *walk = seekable_elements;
......@@ -197,7 +197,7 @@ static gboolean
update_scale (gpointer data)
{
GstClock *clock;
guint64 position;
gint64 position;
GstFormat format = GST_FORMAT_TIME;
duration = 0;
......@@ -345,11 +345,11 @@ main (int argc, char **argv)
gtk_scale_set_digits (GTK_SCALE (hscale), 2);
gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_CONTINUOUS);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_press_event", G_CALLBACK (start_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"button_release_event", G_CALLBACK (stop_seek), pipeline);
gtk_signal_connect (GTK_OBJECT (hscale),
g_signal_connect (hscale,
"format_value", G_CALLBACK (format_value), pipeline);
/* do the packing stuff ... */
......
......@@ -58,6 +58,12 @@ else
CDAUDIO_DIR=
endif
if USE_CDIO
CDIO_DIR=cdio
else
CDIO_DIR=
endif
if USE_CDPARANOIA
CDPARANOIA_DIR=cdparanoia
else
......@@ -130,6 +136,12 @@ else
FLAC_DIR=
endif
if USE_GCONF
GCONF_DIR = gconf
else
GCONF_DIR =
endif
if USE_GDK_PIXBUF
GDK_PIXBUF_DIR=gdk_pixbuf
else
......@@ -382,12 +394,30 @@ else
SNAPSHOT_DIR=
endif
if USE_SPC
SPC_DIR=spc
else
SPC_DIR=
endif
if USE_SPEEX
SPEEX_DIR=speex
else
SPEEX_DIR=
endif
if USE_WAVPACK
WAVPACK_DIR=wavpack
else
WAVPACK_DIR=
endif
if USE_X264
X264_DIR=x264
else
X264_DIR=
endif
if USE_XINE
XINE_DIR=xine
else
......@@ -405,6 +435,7 @@ SUBDIRS=\
$(AUDIORESAMPLE_DIR) \
$(CAIRO_DIR) \
$(CDAUDIO_DIR) \
$(CDIO_DIR) \
$(CDPARANOIA_DIR) \
$(DIRAC_DIR) \
$(DIRECTFB_DIR) \
......@@ -418,6 +449,7 @@ SUBDIRS=\
$(FAAC_DIR) \
$(FAAD_DIR) \
$(FLAC_DIR) \
$(GCONF_DIR) \
$(GDK_PIXBUF_DIR) \
$(GNOMEVFS_DIR) \
$(GSM_DIR) \
......@@ -451,12 +483,15 @@ SUBDIRS=\
$(SMOOTHWAVE_DIR) \
$(SNAPSHOT_DIR) \
$(SNDFILE_DIR) \
$(SPC_DIR) \
$(SPEEX_DIR) \
$(SWFDEC_DIR) \
$(TARKIN_DIR) \
$(THEORA_DIR) \
$(IVORBIS_DIR) \
$(VORBIS_DIR) \
$(WAVPACK_DIR) \
$(X264_DIR) \
$(XINE_DIR) \
$(XVID_DIR)
......@@ -471,6 +506,7 @@ DIST_SUBDIRS=\
audioresample \
cairo \
cdaudio \
cdio \
cdparanoia \
dirac \
directfb \
......@@ -483,6 +519,7 @@ DIST_SUBDIRS=\
faac \
faad \
flac \
gconf \
gdk_pixbuf \
gnomevfs \
gsm \
......@@ -518,10 +555,13 @@ DIST_SUBDIRS=\
shout2 \
sidplay \
smoothwave \
spc \
speex \
swfdec \
tarkin \
theora \
vorbis \
wavpack \
x264 \
xine \
xvid
......@@ -60,8 +60,8 @@ static GstStaticPadTemplate sink_temp = GST_STATIC_PAD_TEMPLATE ("sink",
"width = (int) 16, "
"signed = (boolean) true, "
"channels = (int) 2, "
"rate = (int) 44100, " "endianness = (int) byte_order")
);
"rate = (int) 44100, " "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER)
));
static GstStaticPadTemplate src_temp = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
......@@ -71,8 +71,8 @@ static GstStaticPadTemplate src_temp = GST_STATIC_PAD_TEMPLATE ("src",
"width = (int) 16, "
"signed = (boolean) true, "
"channels = (int) 2, "
"rate = (int) 44100, " "endianness = (int) byte_order")
);
"rate = (int) 44100, " "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER)
));
enum
{
......
......@@ -122,7 +122,7 @@ gst_artsdsink_class_init (GstArtsdsinkClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MUTE, g_param_spec_boolean ("mute", "mute", "mute", TRUE, G_PARAM_READWRITE)); /* CHECKME */
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE)); /* CHECKME */
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("connection-name", "Connection name", "Name to use for the connection", NULL, G_PARAM_READWRITE)); /* CHECKME */
gobject_class->set_property = gst_artsdsink_set_property;
gobject_class->get_property = gst_artsdsink_get_property;
......
......@@ -74,6 +74,7 @@ static GstStaticPadTemplate afparse_sink_factory =
static void gst_afparse_base_init (gpointer g_class);
static void gst_afparse_class_init (GstAFParseClass * klass);
static void gst_afparse_init (GstAFParse * afparse);
static void gst_afparse_finalize (GObject * object);
static gboolean gst_afparse_open_file (GstAFParse * afparse);
static void gst_afparse_close_file (GstAFParse * afparse);
......@@ -93,6 +94,8 @@ static long gst_afparse_vf_seek (AFvirtualfile * vfile, long offset,
int is_relative);
static long gst_afparse_vf_tell (AFvirtualfile * vfile);
static GstElementClass *parent_class = NULL;
GType
gst_afparse_get_type (void)
{
......@@ -140,9 +143,11 @@ gst_afparse_class_init (GstAFParseClass * klass)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gobject_class->set_property = gst_afparse_set_property;
gobject_class->get_property = gst_afparse_get_property;
gobject_class->finalize = gst_afparse_finalize;
}
static void
......@@ -161,7 +166,7 @@ gst_afparse_init (GstAFParse * afparse)
gst_element_set_loop_function (GST_ELEMENT (afparse), gst_afparse_loop);
afparse->vfile = af_virtual_file_new ();
afparse->vfile = g_new (AFvirtualfile, 1);
afparse->vfile->closure = NULL;
afparse->vfile->read = gst_afparse_vf_read;
afparse->vfile->length = gst_afparse_vf_length;
......@@ -185,6 +190,16 @@ gst_afparse_init (GstAFParse * afparse)
afparse->timestamp = 0LL;
}
static void
gst_afparse_finalize (GObject * obj)
{
GstAFParse *afparse = GST_AFPARSE (obj);
g_free (afparse->file);
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
static void
gst_afparse_loop (GstElement * element)
{
......
......@@ -302,12 +302,15 @@ gst_afsink_open_file (GstAFSink * sink)
if (caps == NULL) {
g_critical ("gstafsink chain : Could not get caps of pad !\n");
} else {
gint rate = 0;
structure = gst_caps_get_structure (caps, 0);
gst_structure_get_int (structure, "channels", &sink->channels);
gst_structure_get_int (structure, "width", &sink->width);
gst_structure_get_int (structure, "rate", &sink->rate);
gst_structure_get_int (structure, "rate", &rate);
gst_structure_get_boolean (structure, "signed", &sink->is_signed);
gst_structure_get_int (structure, "endianness", &sink->endianness_data);
sink->rate = rate;
}
GST_DEBUG ("channels %d, width %d, rate %d, signed %s",
sink->channels, sink->width, sink->rate, sink->is_signed ? "yes" : "no");
......
......@@ -440,8 +440,6 @@ gst_cdaudio_get_query_types (GstElement * element)
static const GstQueryType query_types[] = {
GST_QUERY_TOTAL,
GST_QUERY_POSITION,
GST_QUERY_START,
GST_QUERY_SEGMENT_END,
0
};
......
......@@ -312,7 +312,7 @@ gst_directfbvideosink_sink_link (GstPad * pad, const GstCaps * caps)
}
} else if (g_ascii_strcasecmp (gst_structure_get_name (structure),
"video/x-raw-yuv") == 0) {
gint im_format = 0;
guint32 im_format = 0;
gst_structure_get_fourcc (structure, "format", &im_format);
GST_DEBUG_OBJECT (directfbvideosink,
......
......@@ -333,6 +333,7 @@ gst_dtsdec_handle_event (GstDtsDec * dts, GstEvent * event)
dts->cache = NULL;
}
break;
default:
break;
}
......
......@@ -21,6 +21,8 @@
#include "config.h"
#endif
#include <string.h>
#include "gstfaac.h"
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
......@@ -34,10 +36,28 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 6]; " "audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 32, " "depth = (int) 24, " "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]; " "audio/x-raw-float, " "endianness = (int) BYTE_ORDER, " "depth = (int) 32, " /* sizeof (gfloat) */
"rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]")
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) BYTE_ORDER, "
"signed = (boolean) TRUE, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 6]")
);
#define UNUSED \
"audio/x-raw-int, " \
"endianness = (int) BYTE_ORDER, " \
"signed = (boolean) TRUE, " \
"width = (int) 32, " \
"depth = (int) 24, " \
"rate = (int) [ 8000, 96000], " \
"channels = (int) [ 1, 6]; " \
"audio/x-raw-float, " \
"endianness = (int) BYTE_ORDER, " \
"depth = (int) 32, " /* sizeof (gfloat) */ \
"rate = (int) [ 8000, 96000], " \
"channels = (int) [ 1, 6]" \
enum
{
ARG_0,
......@@ -61,8 +81,7 @@ static void gst_faac_get_property (GObject * object,
static GstPadLinkReturn
gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps);
static GstPadLinkReturn
gst_faac_srcconnect (GstPad * pad, const GstCaps * caps);
static GstPadLinkReturn gst_faac_srcconnect (GstPad * pad);
static void gst_faac_chain (GstPad * pad, GstData * data);
static GstElementStateReturn gst_faac_change_state (GstElement * element);
......@@ -221,23 +240,22 @@ gst_faac_init (GstFaac * faac)
faac->samplerate = -1;
faac->channels = -1;
faac->cache = NULL;
faac->cache_time = GST_CLOCK_TIME_NONE;
faac->cache_duration = 0;
faac->out_time = 0;
GST_FLAG_SET (faac, GST_ELEMENT_EVENT_AWARE);
faac->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get (&sink_template),
"sink");
gst_element_add_pad (GST_ELEMENT (faac), faac->sinkpad);
gst_pad_set_chain_function (faac->sinkpad, gst_faac_chain);
gst_pad_set_link_function (faac->sinkpad, gst_faac_sinkconnect);
gst_element_add_pad (GST_ELEMENT (faac), faac->sinkpad);
faac->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get (&src_template),
"src");
gst_pad_use_explicit_caps (faac->srcpad);
gst_element_add_pad (GST_ELEMENT (faac), faac->srcpad);
gst_pad_set_link_function (faac->srcpad, gst_faac_srcconnect);
/* default properties */
faac->bitrate = 1024 * 128;
......@@ -307,39 +325,33 @@ gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps)
/* if the other side was already set-up, redo that */
if (GST_PAD_CAPS (faac->srcpad))
return gst_faac_srcconnect (faac->srcpad,
gst_pad_get_allowed_caps (faac->srcpad));
return gst_faac_srcconnect (faac->srcpad);
/* else, that'll be done later */
return GST_PAD_LINK_OK;
}
static GstPadLinkReturn
gst_faac_srcconnect (GstPad * pad, const GstCaps * caps)
gst_faac_srcconnect (GstPad * pad)
{
GstFaac *faac = GST_FAAC (gst_pad_get_parent (pad));
GstCaps *caps;
gint n;
if (!faac->handle || (faac->samplerate == -1 || faac->channels == -1)) {
return GST_PAD_LINK_DELAYED;
}
/* we do samplerate/channels ourselves */
for (n = 0; n < gst_caps_get_size (caps); n++) {
GstStructure *structure = gst_caps_get_structure (caps, n);
gst_structure_remove_field (structure, "rate");
gst_structure_remove_field (structure, "channels");
}
/* go through list */
caps = gst_caps_normalize (caps);
caps = gst_pad_get_allowed_caps (pad);
for (n = 0; n < gst_caps_get_size (caps); n++) {
GstStructure *structure = gst_caps_get_structure (caps, n);
faacEncConfiguration *conf;
gint mpegversion = 0;
gint mpegversion = 4;
GstCaps *newcaps;
GstPadLinkReturn ret;
guint8 *c_data;
gulong c_size;
gst_structure_get_int (structure, "mpegversion", &mpegversion);
......@@ -363,19 +375,26 @@ gst_faac_srcconnect (GstPad * pad, const GstCaps * caps)
"mpegversion", G_TYPE_INT, mpegversion,
"channels", G_TYPE_INT, faac->channels,
"rate", G_TYPE_INT, faac->samplerate, NULL);
ret = gst_pad_try_set_caps (faac->srcpad, newcaps);
switch (ret) {
case GST_PAD_LINK_OK:
case GST_PAD_LINK_DONE:
return GST_PAD_LINK_DONE;
case GST_PAD_LINK_DELAYED:
return GST_PAD_LINK_DELAYED;
default:
break;
if ((ret =
faacEncGetDecoderSpecificInfo (faac->handle, &c_data,
&c_size)) == 0) {
GstBuffer *data = gst_buffer_new_and_alloc (c_size);
memcpy (GST_BUFFER_DATA (data), c_data, c_size);
gst_caps_set_simple (newcaps, "codec_data", GST_TYPE_BUFFER, data, NULL);
gst_buffer_unref (data);
}
if (gst_pad_set_explicit_caps (faac->srcpad, newcaps)) {
gst_caps_free (caps);
gst_caps_free (newcaps);
return GST_PAD_LINK_OK;
}
gst_caps_free (newcaps);
}
gst_caps_free (caps);
return GST_PAD_LINK_REFUSED;
}
......@@ -404,8 +423,10 @@ gst_faac_chain (GstPad * pad, GstData * data)
if (ret_size > 0) {
GST_BUFFER_SIZE (outbuf) = ret_size;
GST_BUFFER_TIMESTAMP (outbuf) = 0;
GST_BUFFER_DURATION (outbuf) = 0;
GST_BUFFER_TIMESTAMP (outbuf) = faac->out_time;
GST_BUFFER_DURATION (outbuf) = GST_SECOND * faac->samples /
(faac->channels * faac->samplerate);
faac->out_time += GST_BUFFER_DURATION (outbuf);
gst_pad_push (faac->srcpad, GST_DATA (outbuf));
} else {
break;
......@@ -431,8 +452,7 @@ gst_faac_chain (GstPad * pad, GstData * data)
}
if (!GST_PAD_CAPS (faac->srcpad)) {
if (gst_faac_srcconnect (faac->srcpad,
gst_pad_get_allowed_caps (faac->srcpad)) <= 0) {
if (gst_faac_srcconnect (faac->srcpad) <= 0) {
GST_ELEMENT_ERROR (faac, CORE, NEGOTIATION, (NULL),
("failed to negotiate MPEG/AAC format with next element"));
gst_buffer_unref (inbuf);
......@@ -511,30 +531,11 @@ gst_faac_chain (GstPad * pad, GstData * data)
if (ret_size > 0) {
GST_BUFFER_SIZE (outbuf) = ret_size;
if (faac->cache_time != GST_CLOCK_TIME_NONE) {
GST_BUFFER_TIMESTAMP (outbuf) = faac->cache_time;
faac->cache_time = GST_CLOCK_TIME_NONE;
} else
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (subbuf);
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (subbuf);
if (faac->cache_duration) {
GST_BUFFER_DURATION (outbuf) += faac->cache_duration;
faac->cache_duration = 0;
}
GST_BUFFER_TIMESTAMP (outbuf) = faac->out_time;
GST_BUFFER_DURATION (outbuf) = GST_SECOND * faac->samples /
(faac->channels * faac->samplerate);
faac->out_time += GST_BUFFER_DURATION (outbuf);
gst_pad_push (faac->srcpad, GST_DATA (outbuf));
} else {
/* FIXME: what I'm doing here isn't fully correct, but there
* really isn't a better way yet.
* Problem is that libfaac caches buffers (for encoding
* purposes), so the timestamp of the outgoing buffer isn't
* the same as the timestamp of the data that I pushed in.
* However, I don't know the delay between those two so I
* cannot really say aything about it. This is a bad guess. */
gst_buffer_unref (outbuf);
if (faac->cache_time != GST_CLOCK_TIME_NONE)
faac->cache_time = GST_BUFFER_TIMESTAMP (subbuf);
faac->cache_duration += GST_BUFFER_DURATION (subbuf);
}
in_size -= frame_size;
......@@ -619,8 +620,7 @@ gst_faac_change_state (GstElement * element)
gst_buffer_unref (faac->cache);
faac->cache = NULL;
}
faac->cache_time = GST_CLOCK_TIME_NONE;
faac->cache_duration = 0;
faac->out_time = 0;
faac->samplerate = -1;
faac->channels = -1;
break;
......
......@@ -61,7 +61,7 @@ typedef struct _GstFaac {
/* cache of the input */
GstBuffer *cache;
guint64 cache_time, cache_duration;
guint64 out_time;
} GstFaac;
typedef struct _GstFaacClass {
......
This diff is collapsed.
......@@ -329,9 +329,9 @@ static void
gst_hermes_colorspace_structure_to_hermes_format (HermesFormat * format,
GstStructure * structure)
{
gst_structure_get_int (structure, "red_mask", &format->r);
gst_structure_get_int (structure, "green_mask", &format->g);
gst_structure_get_int (structure, "blue_mask", &format->b);
gst_structure_get_int (structure, "red_mask", (gint *) & format->r);
gst_structure_get_int (structure, "green_mask", (gint *) & format->g);
gst_structure_get_int (structure, "blue_mask", (gint *) & format->b);
format->a = 0;
gst_structure_get_int (structure, "bpp", &format->bits);
format->indexed = 0;
......
......@@ -33,7 +33,7 @@ plugin_init (GstPlugin * plugin)
if (!gst_library_load ("gstbytestream"))
return FALSE;
if (!gst_element_register (plugin, "tremor", GST_RANK_PRIMARY,
if (!gst_element_register (plugin, "tremor", GST_RANK_SECONDARY,
ivorbisfile_get_type ()))
return FALSE;
......
......@@ -500,7 +500,8 @@ gst_jack_loop (GstElement * element)
gst_buffer_unref (buffer);
} else {
buffer = gst_buffer_new ();
gst_buffer_set_data (buffer, pad->data, len);
buffer->data = pad->data;
buffer->size = len;
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_DONTFREE);
gst_pad_push (pad->pad, GST_DATA (buffer));
......
......@@ -113,6 +113,7 @@ gst_ladspa_base_init (GstLADSPAClass * klass)
klass->numsrcpads++;
}
g_free (name);
gst_element_class_add_pad_template (element_class, templ);
}
}
......@@ -416,6 +417,22 @@ gst_ladspa_init (GstLADSPA * ladspa)
ladspa->controls = g_new (gfloat, oclass->numcontrols);
ladspa->dpman = gst_dpman_new ("ladspa_dpman", GST_ELEMENT (ladspa));
if (oclass->numsinkpads > 0) {
ladspa->data_in = g_new0 (LADSPA_Data *, oclass->numsinkpads);
ladspa->buffers_in = g_new0 (GstBuffer *, oclass->numsinkpads);
} else {
ladspa->data_in = NULL;
ladspa->buffers_in = NULL;
}
if (oclass->numsrcpads > 0) {
ladspa->buffers_out = g_new0 (GstBuffer *, oclass->numsrcpads);
ladspa->data_out = g_new0 (LADSPA_Data *, oclass->numsrcpads);
} else {
ladspa->buffers_out = NULL;
ladspa->data_out = NULL;
}
/* set up pads */
sinkcount = 0;
srccount = 0;
......@@ -524,7 +541,8 @@ gst_ladspa_link (GstPad * pad, const GstCaps * caps)
/* if this fails in some other plugin, the graph is left in an inconsistent
state */
for (l = gst_element_get_pad_list (element); l; l = l->next)
if (pad != (GstPad *) l->data)
if ((pad != (GstPad *) l->data)
&& !GST_PAD_IS_NEGOTIATING ((GstPad *) l->data))
if (gst_pad_try_set_caps ((GstPad *) l->data, caps) <= 0)
return GST_PAD_LINK_REFUSED;
......@@ -740,12 +758,10 @@ gst_ladspa_loop (GstElement * element)
numsinkpads = oclass->numsinkpads;
numsrcpads = oclass->numsrcpads;
/* fixme: these mallocs need to die */
data_in = g_new0 (LADSPA_Data *, numsinkpads);
data_out = g_new0 (LADSPA_Data *, numsrcpads);
buffers_in = g_new0 (GstBuffer *, numsinkpads);
buffers_out = g_new0 (GstBuffer *, numsrcpads);
data_in = ladspa->data_in;
data_out = ladspa->data_out;
buffers_in = ladspa->buffers_in;
buffers_out = ladspa->buffers_out;
largest_buffer = -1;
......@@ -775,7 +791,8 @@ gst_ladspa_loop (GstElement * element)
MIN (GST_BUFFER_SIZE (buffers_in[i]) / sizeof (gfloat),
largest_buffer);
data_in[i] = (LADSPA_Data *) GST_BUFFER_DATA (buffers_in[i]);
GST_BUFFER_TIMESTAMP (buffers_in[i]) = ladspa->timestamp;
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffers_in[i])))
ladspa->timestamp = GST_BUFFER_TIMESTAMP (buffers_in[i]);
}
i = 0;
......@@ -837,18 +854,12 @@ gst_ladspa_loop (GstElement * element)
ladspa->timestamp += ladspa->buffer_frames * GST_SECOND / ladspa->samplerate;
/* FIXME: move these mallocs and frees to the state-change handler */
g_free (buffers_out);
g_free (buffers_in);
g_free (data_out);
g_free (data_in);
}
static void
gst_ladspa_chain (GstPad * pad, GstData * _data)
{
GstBuffer *buffer_in = GST_BUFFER (_data);
GstBuffer *buffer_in;
LADSPA_Descriptor *desc;
LADSPA_Data *data_in, **data_out = NULL;
GstBuffer **buffers_out = NULL;
......@@ -857,6 +868,10 @@ gst_ladspa_chain (GstPad * pad, GstData * _data)
GstLADSPA *ladspa;
GstLADSPAClass *oclass;
/* we shouldn't get events here... */
g_return_if_fail (GST_IS_BUFFER (_data));
buffer_in = GST_BUFFER (_data);
ladspa = (GstLADSPA *) GST_OBJECT_PARENT (pad);
oclass = (GstLADSPAClass *) (G_OBJECT_GET_CLASS (ladspa));
data_in = (LADSPA_Data *) GST_BUFFER_DATA (buffer_in);
......@@ -864,19 +879,15 @@ gst_ladspa_chain (GstPad * pad, GstData * _data)
numsrcpads = oclass->numsrcpads;
desc = ladspa->descriptor;
/* we shouldn't get events here... */
g_return_if_fail (GST_IS_BUFFER (buffer_in));
/* FIXME: this function shouldn't need to malloc() anything */
if (numsrcpads > 0) {
buffers_out = g_new (GstBuffer *, numsrcpads);
data_out = g_new (LADSPA_Data *, numsrcpads);
}
buffers_out = ladspa->buffers_out;
data_out = ladspa->data_out;
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer_in)))
ladspa->timestamp = GST_BUFFER_TIMESTAMP (buffer_in);
i = 0;
if (!ladspa->inplace_broken && numsrcpads) {
/* reuse the first (chained) buffer */
buffers_out[i] = buffer_in;
buffers_out[i] = gst_buffer_copy_on_write (buffer_in);
GST_DEBUG ("reuse: %d", GST_BUFFER_SIZE (buffer_in));
data_out[i] = data_in;
i++;
......@@ -888,8 +899,7 @@ gst_ladspa_chain (GstPad * pad, GstData * _data)
data_out[i] = (LADSPA_Data *) GST_BUFFER_DATA (buffers_out[i]);
}
GST_DPMAN_PREPROCESS (ladspa->dpman, num_samples,
GST_BUFFER_TIMESTAMP (buffer_in));
GST_DPMAN_PREPROCESS (ladspa->dpman, num_samples, ladspa->timestamp);
num_processed = 0;
/* split up processing of the buffer into chunks so that dparams can
......@@ -923,9 +933,6 @@ gst_ladspa_chain (GstPad * pad, GstData * _data)
GST_BUFFER_SIZE (buffers_out[i]), i);
gst_pad_push (ladspa->srcpads[i], GST_DATA (buffers_out[i]));
}
g_free (buffers_out);
g_free (data_out);
}
}
......@@ -945,8 +952,8 @@ gst_ladspa_get (GstPad * pad)
/* 4096 is arbitrary */
buf = gst_buffer_new_and_alloc (4096);
GST_BUFFER_TIMESTAMP (buf) = ladspa->timestamp;
data = (LADSPA_Data *) GST_BUFFER_DATA (buf);
GST_BUFFER_TIMESTAMP (buf) = ladspa->timestamp;
GST_DPMAN_PREPROCESS (ladspa->dpman, ladspa->buffer_frames,
ladspa->timestamp);
......
......@@ -59,10 +59,15 @@ struct _GstLADSPA {
GstPad **sinkpads,
**srcpads;
LADSPA_Data **data_in;
LADSPA_Data **data_out;
GstBuffer **buffers_in;
GstBuffer **buffers_out;
gboolean activated;
gint samplerate, buffer_frames;
gint64 timestamp;
GstClockTime timestamp;
gboolean inplace_broken;
};
......
......@@ -262,15 +262,16 @@ gst_fameenc_class_init (GstFameEncClass * klass)
if (array->len > 0) {
GType type;
GParamSpec *pspec;
gchar *str1, *str2;
type =
g_enum_register_static (g_strdup_printf ("GstFameEnc_%s",
current_type), (GEnumValue *) array->data);
str1 = g_strdup_printf ("GstFameEnc_%s", current_type);
type = g_enum_register_static (str1, (GEnumValue *) array->data);
g_free (str1);
pspec =
g_param_spec_enum (current_type, current_type,
g_strdup_printf ("The FAME \"%s\" object", current_type), type,
str2 = g_strdup_printf ("The FAME \"%s\" object", current_type);
pspec = g_param_spec_enum (current_type, current_type, str2, type,
default_index, G_PARAM_READWRITE);
g_free (str2);
g_param_spec_set_qdata (pspec, fame_object_name, (gpointer) current_type);
......
......@@ -265,7 +265,8 @@ gst_mms_get (GstPad * pad)
GST_BUFFER_SIZE (buf) = 0;
GST_DEBUG ("reading %d bytes", mmssrc->blocksize);
result = mms_read (NULL, mmssrc->connection, data, mmssrc->blocksize);
result =
mms_read (NULL, mmssrc->connection, (char *) data, mmssrc->blocksize);
GST_BUFFER_OFFSET (buf) = mms_get_current_pos (mmssrc->connection) - result;
GST_BUFFER_SIZE (buf) = result;
......
......@@ -400,6 +400,7 @@ gst_musepack_stream_init (GstMusepackDec * musepackdec)
"rate", G_TYPE_INT, i.sample_freq, NULL);
if (!gst_pad_set_explicit_caps (musepackdec->srcpad, caps)) {
GST_ELEMENT_ERROR (musepackdec, CORE, NEGOTIATION, (NULL), (NULL));
gst_caps_free (caps);
return FALSE;
}
......@@ -409,6 +410,7 @@ gst_musepack_stream_init (GstMusepackDec * musepackdec)
musepackdec->len = mpc_streaminfo_get_length_samples (&i);
musepackdec->init = TRUE;
gst_caps_free (caps);
return TRUE;
}
......
......@@ -22,7 +22,7 @@
#include <gst/gst.h>
#include <gst/bytestream/bytestream.h>
#include <musepack/musepack.h>
#include <mpcdec/mpcdec.h>
#include "gstmusepackreader.h"
G_BEGIN_DECLS
......
......@@ -89,7 +89,7 @@ gst_musepack_reader_read (void *this, void *ptr, mpc_int32_t size)
return read;
}
static BOOL
static mpc_bool_t
gst_musepack_reader_seek (void *this, mpc_int32_t offset)
{
GstByteStream *bs = this;
......@@ -126,7 +126,7 @@ gst_musepack_reader_get_size (void *this)
return gst_bytestream_length (bs);
}
static BOOL
static mpc_bool_t
gst_musepack_reader_canseek (void *this)
{
return TRUE;
......
......@@ -20,7 +20,7 @@
#ifndef __GST_MUSEPACK_READER_H__
#define __GST_MUSEPACK_READER_H__
#include <musepack/musepack.h>
#include <mpcdec/mpcdec.h>
#include <gst/bytestream/bytestream.h>
void gst_musepack_init_reader (mpc_reader * r, GstByteStream * bs);
......
......@@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgsttrm.la
noinst_HEADERS = gsttrm.h
libgsttrm_la_SOURCES = gsttrm.c
libgsttrm_la_SOURCES = gsttrm.c blank-file.cpp
libgsttrm_la_CFLAGS = $(GST_CFLAGS) $(MUSICBRAINZ_CFLAGS)
libgsttrm_la_LIBADD =
libgsttrm_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(MUSICBRAINZ_LIBS)
/* This file is intentionally left blank. It exists only
* to fool libtool into using g++ for the linking
* (see bug #303936) */
......@@ -176,7 +176,7 @@ gst_musicbrainz_sinkconnect (GstPad * pad, const GstCaps * caps)
GstMusicBrainz *musicbrainz;
GstStructure *structure;
const gchar *mimetype;
gint width;
gint width, depth, chans, rate;
musicbrainz = GST_MUSICBRAINZ (gst_pad_get_parent (pad));
......@@ -185,18 +185,18 @@ gst_musicbrainz_sinkconnect (GstPad * pad, const GstCaps * caps)
structure = gst_caps_get_structure (caps, 0);
mimetype = gst_structure_get_name (structure);
if (!gst_structure_get_int (structure, "depth", &musicbrainz->depth) ||
!gst_structure_get_int (structure, "width", &width))
if (!gst_structure_get_int (structure, "depth", &depth) ||
!gst_structure_get_int (structure, "width", &width) ||
!gst_structure_get_int (structure, "channels", &chans) ||
!gst_structure_get_int (structure, "rate", &rate))
return GST_PAD_LINK_REFUSED;
if (musicbrainz->depth != width)
if (depth != width)
return GST_PAD_LINK_REFUSED;
if (!gst_structure_get_int (structure, "channels", &musicbrainz->channels))
return GST_PAD_LINK_REFUSED;
if (!gst_structure_get_int (structure, "rate", &musicbrainz->rate))
return GST_PAD_LINK_REFUSED;
musicbrainz->rate = rate;
musicbrainz->depth = depth;
musicbrainz->channels = chans;
trm_SetPCMDataInfo (musicbrainz->trm, musicbrainz->rate,
musicbrainz->channels, musicbrainz->depth);
......@@ -272,8 +272,8 @@ gst_musicbrainz_chain (GstPad * pad, GstData * data)
}
if (!musicbrainz->signature_available
&& trm_GenerateSignature (musicbrainz->trm, GST_BUFFER_DATA (buf),
GST_BUFFER_SIZE (buf))) {
&& trm_GenerateSignature (musicbrainz->trm,
(gchar *) GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf))) {
GST_DEBUG ("Signature");
if (musicbrainz->proxy_address != NULL) {
......
......@@ -33,12 +33,6 @@
#define NAS_SOUND_PORT_DURATION (2)
GST_DEBUG_CATEGORY (NAS);
/* Signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
......@@ -76,6 +70,7 @@ static GstCaps *gst_nassink_getcaps (GstPad * pad);
static gboolean gst_nassink_sync_parms (GstNassink * nassink);
static GstPadLinkReturn gst_nassink_sinkconnect (GstPad * pad,
const GstCaps * caps);
static GstCaps *gst_nassink_fixate (GstPad * pad, const GstCaps * caps);
static void gst_nassink_chain (GstPad * pad, GstData * _data);
......@@ -173,6 +168,9 @@ gst_nassink_init (GstNassink * nassink)
GST_DEBUG_FUNCPTR (gst_nassink_chain));
gst_pad_set_link_function (nassink->sinkpad, gst_nassink_sinkconnect);
gst_pad_set_getcaps_function (nassink->sinkpad, gst_nassink_getcaps);
gst_pad_set_fixate_function (nassink->sinkpad, gst_nassink_fixate);
GST_FLAG_SET (nassink, GST_ELEMENT_EVENT_AWARE);
nassink->mute = FALSE;
nassink->depth = 16;
......@@ -205,17 +203,16 @@ gst_nassink_getcaps (GstPad * pad)
GstCaps *templatecaps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
GstCaps *caps;
int i;
AuServer *server;
server = AuOpenServer (nassink->host, 0, NULL, 0, NULL, NULL);
if (!server)
if (!nassink->audio)
return templatecaps;
for (i = 0; i < gst_caps_get_size (templatecaps); i++) {
GstStructure *structure = gst_caps_get_structure (templatecaps, i);
gst_structure_set (structure, "rate", GST_TYPE_INT_RANGE,
AuServerMinSampleRate (server), AuServerMaxSampleRate (server), NULL);
AuServerMinSampleRate (nassink->audio),
AuServerMaxSampleRate (nassink->audio), NULL);
}
caps = gst_caps_intersect (templatecaps, gst_pad_get_pad_template_caps (pad));
gst_caps_free (templatecaps);
......@@ -236,7 +233,9 @@ gst_nassink_sync_parms (GstNassink * nassink)
if (nassink->audio == NULL)
return TRUE;
GST_CAT_DEBUG (NAS, "depth=%i rate=%i", nassink->depth, nassink->rate);
GST_CAT_DEBUG (NAS, "depth=%i rate=%i channels=%i", nassink->depth,
nassink->rate, nassink->tracks);
if (nassink->flow != AuNone) {
GST_CAT_DEBUG (NAS, "flushing buffer");
while (nassink->pos && nassink->buf)
......@@ -260,6 +259,83 @@ gst_nassink_sync_parms (GstNassink * nassink)
return ret >= 0;
}
/* nicked from gstalsa.c */
static GstCaps *
gst_nassink_fixate_field_nearest_int (const GstCaps * caps,
const gchar * field_name, gint target)
{
guint i;
GstCaps *result;
GstCaps *smaller = gst_caps_new_empty ();
GstCaps *equal = gst_caps_new_empty ();
GstCaps *bigger = gst_caps_new_empty ();
/* works like this: we fixate every structure and put them into one of those
* caps depending on what we fixated to. We then return the best caps that is
* not empty in the following order: equal, bigger, smaller
* We also make sure the caps were really reduced.
*/
for (i = 0; i < gst_caps_get_size (caps); i++) {
gint fixated_to;
GstStructure *copy = gst_structure_copy (gst_caps_get_structure (caps, i));
gst_caps_structure_fixate_field_nearest_int (copy, field_name, target);
if (gst_structure_get_int (copy, field_name, &fixated_to)) {
if (fixated_to == target) {
gst_caps_append_structure (equal,