...
 
Commits (73)
This diff is collapsed.
This diff is collapsed.
Release notes for GStreamer Base Plugins 1.8.0
Release notes for GStreamer Base Plugins 1.8.3
The GStreamer team is pleased to announce the first release of the new stable
1.8 release series. The 1.8 release series is adding new features on top of
the 1.0, 1.2, 1.4 and 1.6 series and is part of the API and ABI-stable 1.x
release series of the GStreamer multimedia framework.
The GStreamer team is proud to announce the third bugfix release in the stable
1.8 release series of your favourite cross-platform multimedia framework!
Binaries for Android, iOS, Mac OS X and Windows will be provided shortly after
the source release by the GStreamer project during the stable 1.8 release
series.
This release only contains bugfixes and it is safe to update from 1.8.x. For a
full list of bugfixes see Bugzilla.
See /releases/1.8/ for the full release notes.
This module contains a set of reference plugins, base classes for other
......@@ -58,7 +58,13 @@ contains a set of codecs plugins based on libav (formerly gst-ffmpeg)
Bugs fixed in this release
* 763316 : install-plugins: update documentation
* 767689 : oggdemux: re-enable the seek on EOS when determining stream length
* 767712 : xvimage: Missing sanity checking for allocation sizes for various video formats
* 767859 : discoverer: Don't crash when trying to serialize non-OK discoverer infos to a GVariant
* 768178 : tagdemux: Drops data of too small files in PUSH mode
* 768249 : rtspsrc lockup on gst_rtspsrc_stop
* 768361 : videodecoder: Takes stream lock for non-serialized queries
* 768991 : oggdemux: fix unknown duration playing Ogg from HTTP
==== Download ====
......@@ -95,5 +101,9 @@ subscribe to the gstreamer-devel list.
Contributors to this release
* Víctor Manuel Jáquez Leal
* Duncan Palmer
* Sebastian Dröge
* Sergio Torres Soldado
* Tim-Philipp Müller
* Vincent Penquerc'h
 
\ No newline at end of file
......@@ -5,7 +5,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file
dnl initialize autoconf
dnl releases only do -Wall, git and prerelease does -Werror too
dnl use a three digit version number for releases, and four for git/prerelease
AC_INIT([GStreamer Base Plug-ins],[1.8.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-base])
AC_INIT([GStreamer Base Plug-ins],[1.8.3],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-base])
AG_GST_INIT
......@@ -56,7 +56,7 @@ dnl 1.2.5 => 205
dnl 1.10.9 (who knows) => 1009
dnl
dnl sets GST_LT_LDFLAGS
AS_LIBTOOL(GST, 800, 0, 800)
AS_LIBTOOL(GST, 803, 0, 803)
dnl *** required versions of GStreamer stuff ***
GST_REQ=1.8.0
......
......@@ -2748,3 +2748,43 @@
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstTheoraDec::visualize-bit-usage</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,255]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Visualize bitstream usage breakdown</NICK>
<BLURB>Sets the bitstream breakdown visualization mode. Values influence the width of the bit usage bars to show.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstTheoraDec::visualize-macroblock-modes</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,65535]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Visualize macroblock modes</NICK>
<BLURB>Show macroblock mode selection overlaid on image. Value gives a mask for macroblock (MB) modes to show.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstTheoraDec::visualize-motion-vectors</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,65535]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Visualize motion vectors</NICK>
<BLURB>Show motion vector selection overlaid on image. Value gives a mask for motion vector (MV) modes to show.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstTheoraDec::visualize-quantization-modes</NAME>
<TYPE>gint</TYPE>
<RANGE>[0,65535]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Visualize adaptive quantization modes</NICK>
<BLURB>Show adaptive quantization mode selection overlaid on image. Value gives a mask for quantization (QI) modes to show.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
......@@ -3,7 +3,7 @@
<description>Adds multiple streams</description>
<filename>../../gst/adder/.libs/libgstadder.so</filename>
<basename>libgstadder.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>ALSA plugin library</description>
<filename>../../ext/alsa/.libs/libgstalsa.so</filename>
<basename>libgstalsa.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Elements used to communicate with applications</description>
<filename>../../gst/app/.libs/libgstapp.so</filename>
<basename>libgstapp.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Convert audio to different formats</description>
<filename>../../gst/audioconvert/.libs/libgstaudioconvert.so</filename>
<basename>libgstaudioconvert.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Adjusts audio frames</description>
<filename>../../gst/audiorate/.libs/libgstaudiorate.so</filename>
<basename>libgstaudiorate.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Resamples audio</description>
<filename>../../gst/audioresample/.libs/libgstaudioresample.so</filename>
<basename>libgstaudioresample.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Creates audio test signals of given frequency and volume</description>
<filename>../../gst/audiotestsrc/.libs/libgstaudiotestsrc.so</filename>
<basename>libgstaudiotestsrc.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Read audio from CD in paranoid mode</description>
<filename>../../ext/cdparanoia/.libs/libgstcdparanoia.so</filename>
<basename>libgstcdparanoia.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>various encoding-related elements</description>
<filename>../../gst/encoding/.libs/libgstencodebin.so</filename>
<basename>libgstencodebin.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>GIO elements</description>
<filename>../../gst/gio/.libs/libgstgio.so</filename>
<basename>libgstgio.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>libvisual visualization plugins</description>
<filename>../../ext/libvisual/.libs/libgstlibvisual.so</filename>
<basename>libgstlibvisual.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>ogg stream manipulation (info about ogg: http://xiph.org)</description>
<filename>../../ext/ogg/.libs/libgstogg.so</filename>
<basename>libgstogg.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>OPUS plugin library</description>
<filename>../../ext/opus/.libs/libgstopus.so</filename>
<basename>libgstopus.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Pango-based text rendering and overlay</description>
<filename>../../ext/pango/.libs/libgstpango.so</filename>
<basename>libgstpango.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>various playback elements</description>
<filename>../../gst/playback/.libs/libgstplayback.so</filename>
<basename>libgstplayback.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Subtitle parsing</description>
<filename>../../gst/subparse/.libs/libgstsubparse.so</filename>
<basename>libgstsubparse.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>transfer data over the network via TCP</description>
<filename>../../gst/tcp/.libs/libgsttcp.so</filename>
<basename>libgsttcp.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Theora plugin library</description>
<filename>../../ext/theora/.libs/libgsttheora.so</filename>
<basename>libgsttheora.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>default typefind functions</description>
<filename>../../gst/typefind/.libs/libgsttypefindfunctions.so</filename>
<basename>libgsttypefindfunctions.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Colorspace conversion</description>
<filename>../../gst/videoconvert/.libs/libgstvideoconvert.so</filename>
<basename>libgstvideoconvert.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Adjusts video frames</description>
<filename>../../gst/videorate/.libs/libgstvideorate.so</filename>
<basename>libgstvideorate.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Resizes video</description>
<filename>../../gst/videoscale/.libs/libgstvideoscale.so</filename>
<basename>libgstvideoscale.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Creates a test video stream</description>
<filename>../../gst/videotestsrc/.libs/libgstvideotestsrc.so</filename>
<basename>libgstvideotestsrc.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>plugin for controlling audio volume</description>
<filename>../../gst/volume/.libs/libgstvolume.so</filename>
<basename>libgstvolume.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Vorbis plugin library</description>
<filename>../../ext/vorbis/.libs/libgstvorbis.so</filename>
<basename>libgstvorbis.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>X11 video output element based on standard Xlib calls</description>
<filename>../../sys/ximage/.libs/libgstximagesink.so</filename>
<basename>libgstximagesink.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>XFree86 video output plugin using Xv extension</description>
<filename>../../sys/xvimage/.libs/libgstxvimagesink.so</filename>
<basename>libgstxvimagesink.so</basename>
<version>1.8.0</version>
<version>1.8.3</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -50,9 +50,6 @@
/* we hope we get a granpos within this many bytes off the end */
#define DURATION_CHUNK_OFFSET (64*1024)
/* stop duration checks within this much of EOS */
#define EOS_AVOIDANCE_THRESHOLD 8192
/* An Ogg page can not be larger than 255 segments of 255 bytes, plus
26 bytes of header */
#define MAX_OGG_PAGE_SIZE (255 * 255 + 26)
......@@ -344,7 +341,9 @@ gst_ogg_pad_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
else
stop = MAX (idx_time, stop);
} else {
stop = -1; /* we've no clue, sadly, without seeking */
stop = ogg->push_time_length;
if (stop == -1)
stop = ogg->total_time;
}
}
}
......@@ -1652,8 +1651,7 @@ gst_ogg_pad_handle_push_mode_state (GstOggPad * pad, ogg_page * page)
event and there is a queue2 upstream (such as when using playbin),
it will pause the task *after* we come back from the EOS handler,
so we cannot prevent the pausing by issuing a seek. */
if (ogg->push_byte_offset + EOS_AVOIDANCE_THRESHOLD >=
ogg->push_byte_length) {
if (ogg->push_byte_offset >= ogg->push_byte_length) {
GstMessage *message;
GstFlowReturn res;
......@@ -2418,13 +2416,6 @@ gst_ogg_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
case GST_EVENT_EOS:
{
GST_DEBUG_OBJECT (ogg, "got an EOS event");
#if 0
/* This would be what is needed (recover from EOS by going on to
the next step (issue the delayed seek)), but it does not work
if there is a queue2 upstream - see more details comment in
gst_ogg_pad_submit_page.
If I could find a way to bypass queue2 behavior, this should
be enabled. */
GST_PUSH_LOCK (ogg);
if (ogg->push_state == PUSH_DURATION) {
GST_DEBUG_OBJECT (ogg, "Got EOS while determining length");
......@@ -2436,7 +2427,6 @@ gst_ogg_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
break;
}
GST_PUSH_UNLOCK (ogg);
#endif
res = gst_ogg_demux_send_event (ogg, event);
if (ogg->current_chain == NULL) {
GST_WARNING_OBJECT (ogg,
......@@ -3660,8 +3650,7 @@ gst_ogg_demux_get_duration_push (GstOggDemux * ogg, int flags)
/* A full Ogg page can be almost 64 KB. There's no guarantee that there'll be a
granpos there, but it's fairly likely */
position =
ogg->push_byte_length - DURATION_CHUNK_OFFSET - EOS_AVOIDANCE_THRESHOLD;
position = ogg->push_byte_length - DURATION_CHUNK_OFFSET;
if (position < 0)
position = 0;
......
......@@ -238,22 +238,6 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos)
GstCaps *constraint, *inter;
constraint = gst_caps_from_string ("audio/x-raw");
if (dec->sample_rate == 0 || dec->sample_rate == 48000) {
gst_caps_set_simple (constraint, "rate", G_TYPE_INT, 48000, NULL);
} else {
GValue v = { 0 }
, l = {
0};
g_value_init (&l, GST_TYPE_LIST);
g_value_init (&v, G_TYPE_INT);
g_value_set_int (&v, dec->sample_rate);
gst_value_list_append_value (&l, &v);
g_value_set_int (&v, 48000);
gst_value_list_append_value (&l, &v);
gst_caps_set_value (constraint, "rate", &l);
g_value_unset (&v);
g_value_unset (&l);
}
if (dec->n_channels <= 2) { /* including 0 */
gst_caps_set_simple (constraint, "channels", GST_TYPE_INT_RANGE, 1, 2,
NULL);
......@@ -268,6 +252,7 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos)
if (gst_caps_is_empty (inter)) {
GST_DEBUG_OBJECT (dec, "Empty intersection, failed to negotiate");
gst_caps_unref (inter);
gst_caps_unref (caps);
return FALSE;
}
......@@ -284,6 +269,7 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos)
dec->sample_rate = rate;
dec->n_channels = channels;
gst_caps_unref (caps);
}
if (dec->n_channels == 0) {
......@@ -569,9 +555,12 @@ opus_dec_chain_parse_data (GstOpusDec * dec, GstBuffer * buffer)
gst_buffer_unmap (buf, &map);
if (n < 0) {
GST_ELEMENT_ERROR (dec, STREAM, DECODE, ("Decoding error: %d", n), (NULL));
GstFlowReturn ret = GST_FLOW_ERROR;
gst_buffer_unref (outbuf);
return GST_FLOW_ERROR;
GST_AUDIO_DECODER_ERROR (dec, 1, STREAM, DECODE, ("Error decoding stream"),
("Decoding error (%d): %s", n, opus_strerror (n)), ret);
return ret;
}
GST_DEBUG_OBJECT (dec, "decoded %d samples", n);
gst_buffer_set_size (outbuf, n * 2 * dec->n_channels);
......@@ -862,17 +851,15 @@ gst_opus_dec_set_property (GObject * object, guint prop_id,
}
}
GstCaps *
gst_opus_dec_getcaps (GstAudioDecoder * dec, GstCaps * filter)
/* caps must be writable */
static void
gst_opus_dec_caps_extend_channels_options (GstCaps * caps)
{
GstCaps *caps;
unsigned n;
int channels;
if (filter) {
filter = gst_caps_copy (filter);
for (n = 0; n < gst_caps_get_size (filter); ++n) {
GstStructure *s = gst_caps_get_structure (filter, n);
for (n = 0; n < gst_caps_get_size (caps); ++n) {
GstStructure *s = gst_caps_get_structure (caps, n);
if (gst_structure_get_int (s, "channels", &channels)) {
if (channels == 1 || channels == 2) {
GValue v = { 0 };
......@@ -883,24 +870,64 @@ gst_opus_dec_getcaps (GstAudioDecoder * dec, GstCaps * filter)
}
}
}
}
caps = gst_audio_decoder_proxy_getcaps (dec, NULL, filter);
if (filter)
gst_caps_unref (filter);
if (caps) {
caps = gst_caps_make_writable (caps);
for (n = 0; n < gst_caps_get_size (caps); ++n) {
GstStructure *s = gst_caps_get_structure (caps, n);
if (gst_structure_get_int (s, "channels", &channels)) {
if (channels == 1 || channels == 2) {
}
static void
gst_opus_dec_value_list_append_int (GValue * list, gint i)
{
GValue v = { 0 };
g_value_init (&v, GST_TYPE_INT_RANGE);
gst_value_set_int_range (&v, 1, 2);
gst_structure_set_value (s, "channels", &v);
g_value_init (&v, G_TYPE_INT);
g_value_set_int (&v, i);
gst_value_list_append_value (list, &v);
g_value_unset (&v);
}
static void
gst_opus_dec_caps_extend_rate_options (GstCaps * caps)
{
unsigned n;
GValue v = { 0 };
g_value_init (&v, GST_TYPE_LIST);
gst_opus_dec_value_list_append_int (&v, 48000);
gst_opus_dec_value_list_append_int (&v, 24000);
gst_opus_dec_value_list_append_int (&v, 16000);
gst_opus_dec_value_list_append_int (&v, 12000);
gst_opus_dec_value_list_append_int (&v, 8000);
for (n = 0; n < gst_caps_get_size (caps); ++n) {
GstStructure *s = gst_caps_get_structure (caps, n);
gst_structure_set_value (s, "rate", &v);
}
g_value_unset (&v);
}
GstCaps *
gst_opus_dec_getcaps (GstAudioDecoder * dec, GstCaps * filter)
{
GstCaps *caps, *proxy_filter = NULL, *ret;
if (filter) {
proxy_filter = gst_caps_copy (filter);
gst_opus_dec_caps_extend_channels_options (proxy_filter);
gst_opus_dec_caps_extend_rate_options (proxy_filter);
}
caps = gst_audio_decoder_proxy_getcaps (dec, NULL, proxy_filter);
if (proxy_filter)
gst_caps_unref (proxy_filter);
if (caps) {
caps = gst_caps_make_writable (caps);
gst_opus_dec_caps_extend_channels_options (caps);
gst_opus_dec_caps_extend_rate_options (caps);
}
if (filter) {
ret = gst_caps_intersect (caps, filter);
gst_caps_unref (caps);
} else {
ret = caps;
}
return caps;
return ret;
}
......@@ -27,6 +27,7 @@ gir_cincludes=$(patsubst %,--c-include='gst/allocators/%',$(libgstallocators_@GS
GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@GST_API_VERSION@.la
$(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" GI_SCANNER_DISABLE_CACHE=yes\
GST_PLUGIN_SYSTEM_PATH="" GST_PLUGIN_PATH="" GST_REGISTRY_UPDATE=no \
CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" PKG_CONFIG="$(PKG_CONFIG)" DLLTOOL="$(DLLTOOL)" \
$(INTROSPECTION_SCANNER) -v --namespace GstAllocators \
--nsversion=@GST_API_VERSION@ \
--identifier-prefix=Gst \
......
......@@ -40,6 +40,7 @@ gir_sources+=$(patsubst %,$(builddir)/%, $(nodist_libgstapp_@GST_API_VERSION@_la
GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSION@.la
$(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" GI_SCANNER_DISABLE_CACHE=yes\
GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no \
CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" PKG_CONFIG="$(PKG_CONFIG)" DLLTOOL="$(DLLTOOL)" \
$(INTROSPECTION_SCANNER) -v --namespace GstApp \
--nsversion=@GST_API_VERSION@ \
--identifier-prefix=Gst \
......
......@@ -98,6 +98,7 @@ gir_sources+=$(patsubst %,$(builddir)/%, $(built_sources))
GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VERSION@.la
$(AM_V_GEN)PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" GI_SCANNER_DISABLE_CACHE=yes\
GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no \
CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" PKG_CONFIG="$(PKG_CONFIG)" DLLTOOL="$(DLLTOOL)" \
$(INTROSPECTION_SCANNER) -v --namespace GstAudio \
--nsversion=@GST_API_VERSION@ \
--warn-all \
......
......@@ -524,7 +524,7 @@ static const guint64 default_masks[] = {
* called as a last resort when the specific channel map is unknown.
*
* Returns: a fallback channel-mask for @channels or 0 when there is no
* mask.
* mask and mono.
*
* Since: 1.8
*/
......
......@@ -224,6 +224,7 @@ gst_audio_buffer_clip (GstBuffer * buffer, GstSegment * segment, gint rate,
gst_buffer_unref (buffer);
GST_DEBUG ("timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp));
if (ret) {
GST_BUFFER_TIMESTAMP (ret) = timestamp;
if (change_duration)
......@@ -232,6 +233,9 @@ gst_audio_buffer_clip (GstBuffer * buffer, GstSegment * segment, gint rate,
GST_BUFFER_OFFSET (ret) = offset;
if (change_offset_end)
GST_BUFFER_OFFSET_END (ret) = offset_end;
} else {
GST_ERROR ("copy_region failed");
}
}
return ret;
}
......@@ -496,8 +496,10 @@ gst_audio_decoder_reset (GstAudioDecoder * dec, gboolean full)
if (full) {
dec->priv->active = FALSE;
GST_OBJECT_LOCK (dec);
dec->priv->bytes_in = 0;
dec->priv->samples_out = 0;
GST_OBJECT_UNLOCK (dec);
dec->priv->agg = -1;
dec->priv->error_count = 0;
gst_audio_decoder_clear_queues (dec);
......@@ -524,11 +526,13 @@ gst_audio_decoder_reset (GstAudioDecoder * dec, gboolean full)
if (dec->priv->ctx.allocator)
gst_object_unref (dec->priv->ctx.allocator);
GST_OBJECT_LOCK (dec);
gst_caps_replace (&dec->priv->ctx.input_caps, NULL);
memset (&dec->priv->ctx, 0, sizeof (dec->priv->ctx));
gst_audio_info_init (&dec->priv->ctx.info);
GST_OBJECT_UNLOCK (dec);
dec->priv->ctx.max_errors = GST_AUDIO_DECODER_MAX_ERRORS;
dec->priv->ctx.had_output_data = FALSE;
dec->priv->ctx.had_input_data = FALSE;
......@@ -811,7 +815,9 @@ gst_audio_decoder_set_output_format (GstAudioDecoder * dec,
}
/* copy the GstAudioInfo */
GST_OBJECT_LOCK (dec);
dec->priv->ctx.info = *info;
GST_OBJECT_UNLOCK (dec);
dec->priv->ctx.output_format_changed = TRUE;
done:
......@@ -1382,8 +1388,10 @@ gst_audio_decoder_finish_frame (GstAudioDecoder * dec, GstBuffer * buf,
}
}
GST_OBJECT_LOCK (dec);
priv->samples += samples;
priv->samples_out += samples;
GST_OBJECT_UNLOCK (dec);
/* we got data, so note things are looking up */
if (G_UNLIKELY (dec->priv->error_count))
......@@ -1444,7 +1452,9 @@ gst_audio_decoder_handle_frame (GstAudioDecoder * dec,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
g_queue_push_tail (&dec->priv->frames, buffer);
dec->priv->ctx.delay = dec->priv->frames.length;
GST_OBJECT_LOCK (dec);
dec->priv->bytes_in += size;
GST_OBJECT_UNLOCK (dec);
} else {
GST_LOG_OBJECT (dec, "providing subclass with NULL frame");
}
......@@ -1942,8 +1952,14 @@ not_negotiated:
static inline gboolean
gst_audio_decoder_do_byte (GstAudioDecoder * dec)
{
return dec->priv->ctx.do_estimate_rate && dec->priv->ctx.info.bpf &&
gboolean ret;
GST_OBJECT_LOCK (dec);
ret = dec->priv->ctx.do_estimate_rate && dec->priv->ctx.info.bpf &&
dec->priv->ctx.info.rate <= dec->priv->samples_out;
GST_OBJECT_UNLOCK (dec);
return ret;
}
/* Must be called holding the GST_AUDIO_DECODER_STREAM_LOCK */
......@@ -1957,6 +1973,7 @@ gst_audio_decoder_negotiate_default_caps (GstAudioDecoder * dec)
guint64 channel_mask = 0;
gint caps_size;
GstStructure *structure;
GstAudioInfo info;
templcaps = gst_pad_get_pad_template_caps (dec->srcpad);
caps = gst_pad_peer_query_caps (dec->srcpad, templcaps);
......@@ -2003,10 +2020,18 @@ gst_audio_decoder_negotiate_default_caps (GstAudioDecoder * dec)
for (i = 0; i < caps_size; i++) {
structure = gst_caps_get_structure (caps, i);
if (gst_structure_has_field (structure, "channels"))
gst_structure_fixate_field_nearest_int (structure,
"channels", GST_AUDIO_DEF_CHANNELS);
else
gst_structure_set (structure, "channels", G_TYPE_INT,
GST_AUDIO_DEF_CHANNELS, NULL);
if (gst_structure_has_field (structure, "rate"))
gst_structure_fixate_field_nearest_int (structure,
"rate", GST_AUDIO_DEF_RATE);
else
gst_structure_set (structure, "rate", G_TYPE_INT, GST_AUDIO_DEF_RATE,
NULL);
}
caps = gst_caps_fixate (caps);
structure = gst_caps_get_structure (caps, 0);
......@@ -2024,9 +2049,13 @@ gst_audio_decoder_negotiate_default_caps (GstAudioDecoder * dec)
}
}
if (!caps || !gst_audio_info_from_caps (&dec->priv->ctx.info, caps))
if (!caps || !gst_audio_info_from_caps (&info, caps))
goto caps_error;
GST_OBJECT_LOCK (dec);
dec->priv->ctx.info = info;
GST_OBJECT_UNLOCK (dec);
GST_INFO_OBJECT (dec,
"Chose default caps %" GST_PTR_FORMAT " for initial gap", caps);
gst_caps_unref (caps);
......@@ -2518,77 +2547,6 @@ gst_audio_decoder_propose_allocation_default (GstAudioDecoder * dec,
return TRUE;
}
/*
* gst_audio_encoded_audio_convert:
* @fmt: audio format of the encoded audio
* @bytes: number of encoded bytes
* @samples: number of encoded samples
* @src_format: source format
* @src_value: source value
* @dest_format: destination format
* @dest_value: destination format
*
* Helper function to convert @src_value in @src_format to @dest_value in
* @dest_format for encoded audio data. Conversion is possible between
* BYTE and TIME format by using estimated bitrate based on
* @samples and @bytes (and @fmt).
*/
/* FIXME: make gst_audio_encoded_audio_convert() public? */
static gboolean
gst_audio_encoded_audio_convert (GstAudioInfo * fmt,
gint64 bytes, gint64 samples, GstFormat src_format,
gint64 src_value, GstFormat * dest_format, gint64 * dest_value)
{
gboolean res = FALSE;
g_return_val_if_fail (dest_format != NULL, FALSE);
g_return_val_if_fail (dest_value != NULL, FALSE);
if (G_UNLIKELY (src_format == *dest_format || src_value == 0 ||
src_value == -1)) {
if (dest_value)
*dest_value = src_value;
return TRUE;
}
if (samples == 0 || bytes == 0 || fmt->rate == 0) {
GST_DEBUG ("not enough metadata yet to convert");
goto exit;
}
bytes *= fmt->rate;
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
case GST_FORMAT_TIME:
*dest_value = gst_util_uint64_scale (src_value,
GST_SECOND * samples, bytes);
res = TRUE;
break;
default:
res = FALSE;
}
break;
case GST_FORMAT_TIME:
switch (*dest_format) {
case GST_FORMAT_BYTES:
*dest_value = gst_util_uint64_scale (src_value, bytes,
samples * GST_SECOND);
res = TRUE;
break;
default:
res = FALSE;
}
break;
default:
res = FALSE;
}
exit:
return res;
}
/**
* gst_audio_decoder_proxy_getcaps:
* @decoder: a #GstAudioDecoder
......@@ -2651,9 +2609,12 @@ gst_audio_decoder_sink_query_default (GstAudioDecoder * dec, GstQuery * query)
gint64 src_val, dest_val;
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
if (!(res = gst_audio_encoded_audio_convert (&dec->priv->ctx.info,
GST_OBJECT_LOCK (dec);
res = __gst_audio_encoded_audio_convert (&dec->priv->ctx.info,
dec->priv->bytes_in, dec->priv->samples_out,
src_fmt, src_val, &dest_fmt, &dest_val)))
src_fmt, src_val, &dest_fmt, &dest_val);
GST_OBJECT_UNLOCK (dec);
if (!res)
goto error;
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
break;
......@@ -2832,8 +2793,11 @@ gst_audio_decoder_src_query_default (GstAudioDecoder * dec, GstQuery * query)
gint64 src_val, dest_val;
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
if (!(res = gst_audio_info_convert (&dec->priv->ctx.info,
src_fmt, src_val, dest_fmt, &dest_val)))
GST_OBJECT_LOCK (dec);
res = gst_audio_info_convert (&dec->priv->ctx.info,
src_fmt, src_val, dest_fmt, &dest_val);
GST_OBJECT_UNLOCK (dec);
if (!res)
break;
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
break;
......
......@@ -478,8 +478,10 @@ gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full)
if (full) {
enc->priv->active = FALSE;
GST_OBJECT_LOCK (enc);
enc->priv->samples_in = 0;
enc->priv->bytes_out = 0;
GST_OBJECT_UNLOCK (enc);
g_list_foreach (enc->priv->ctx.headers, (GFunc) gst_buffer_unref, NULL);
g_list_free (enc->priv->ctx.headers);
......@@ -490,11 +492,13 @@ gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full)
gst_object_unref (enc->priv->ctx.allocator);
enc->priv->ctx.allocator = NULL;
GST_OBJECT_LOCK (enc);
gst_caps_replace (&enc->priv->ctx.input_caps, NULL);
gst_caps_replace (&enc->priv->ctx.caps, NULL);
memset (&enc->priv->ctx, 0, sizeof (enc->priv->ctx));
gst_audio_info_init (&enc->priv->ctx.info);
GST_OBJECT_UNLOCK (enc);
if (enc->priv->upstream_tags) {
gst_tag_list_unref (enc->priv->upstream_tags);
......@@ -783,6 +787,8 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
ret = GST_FLOW_FLUSHING;
else
ret = GST_FLOW_NOT_NEGOTIATED;
if (buf)
gst_buffer_unref (buf);
goto exit;
}
}
......@@ -909,7 +915,9 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
GST_BUFFER_OFFSET_END (tmpbuf) = priv->bytes_out + size;
}
GST_OBJECT_LOCK (enc);
priv->bytes_out += size;
GST_OBJECT_UNLOCK (enc);
gst_pad_push (enc->srcpad, tmpbuf);
}
......@@ -971,7 +979,9 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
}
}
GST_OBJECT_LOCK (enc);
priv->bytes_out += size;
GST_OBJECT_UNLOCK (enc);
if (G_UNLIKELY (priv->discont)) {
GST_LOG_OBJECT (enc, "marking discont");
......@@ -1116,7 +1126,9 @@ gst_audio_encoder_push_buffers (GstAudioEncoder * enc, gboolean force)
/* mark this already as consumed,
* which it should be when subclass gives us data in exchange for samples */
priv->offset += need;
GST_OBJECT_LOCK (enc);
priv->samples_in += need / ctx->info.bpf;
GST_OBJECT_UNLOCK (enc);
/* subclass might not want to be bothered with leftover data,
* so take care of that here if so, otherwise pass along */
......@@ -1428,8 +1440,10 @@ gst_audio_encoder_sink_setcaps (GstAudioEncoder * enc, GstCaps * caps)
res = klass->set_format (enc, &state);
if (res) {
GST_OBJECT_LOCK (enc);
ctx->info = state;
gst_caps_replace (&enc->priv->ctx.input_caps, caps);
GST_OBJECT_UNLOCK (enc);
} else {
/* invalidate state to ensure no casual carrying on */
GST_DEBUG_OBJECT (enc, "subclass did not accept format");
......@@ -1715,8 +1729,11 @@ gst_audio_encoder_sink_query_default (GstAudioEncoder * enc, GstQuery * query)
gint64 src_val, dest_val;
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
if (!(res = gst_audio_info_convert (&enc->priv->ctx.info,
src_fmt, src_val, dest_fmt, &dest_val)))
GST_OBJECT_LOCK (enc);
res = gst_audio_info_convert (&enc->priv->ctx.info,
src_fmt, src_val, dest_fmt, &dest_val);
GST_OBJECT_UNLOCK (enc);
if (!res)
goto error;
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
res = TRUE;
......@@ -1848,77 +1865,6 @@ gst_audio_encoder_propose_allocation_default (GstAudioEncoder * enc,
return TRUE;
}
/*
* gst_audio_encoded_audio_convert:
* @fmt: audio format of the encoded audio
* @bytes: number of encoded bytes
* @samples: number of encoded samples
* @src_format: source format
* @src_value: source value
* @dest_format: destination format
* @dest_value: destination format
*
* Helper function to convert @src_value in @src_format to @dest_value in
* @dest_format for encoded audio data. Conversion is possible between
* BYTE and TIME format by using estimated bitrate based on
* @samples and @bytes (and @fmt).
*/
/* FIXME: make gst_audio_encoded_audio_convert() public? */
static gboolean
gst_audio_encoded_audio_convert (GstAudioInfo * fmt,
gint64 bytes, gint64 samples, GstFormat src_format,
gint64 src_value, GstFormat * dest_format, gint64 * dest_value)
{
gboolean res = FALSE;
g_return_val_if_fail (dest_format != NULL, FALSE);
g_return_val_if_fail (dest_value != NULL, FALSE);
if (G_UNLIKELY (src_format == *dest_format || src_value == 0 ||
src_value == -1)) {
if (dest_value)
*dest_value = src_value;
return TRUE;
}
if (samples == 0 || bytes == 0 || fmt->rate == 0) {
GST_DEBUG ("not enough metadata yet to convert");
goto exit;
}
bytes *= fmt->rate;
switch (src_format) {
case GST_FORMAT_BYTES:
switch (*dest_format) {
case GST_FORMAT_TIME:
*dest_value = gst_util_uint64_scale (src_value,
GST_SECOND * samples, bytes);
res = TRUE;
break;
default:
res = FALSE;
}
break;
case GST_FORMAT_TIME:
switch (*dest_format) {
case GST_FORMAT_BYTES:
*dest_value = gst_util_uint64_scale (src_value, bytes,
samples * GST_SECOND);
res = TRUE;
break;
default:
res = FALSE;
}
break;
default:
res = FALSE;
}
exit:
return res;
}
/* FIXME ? are any of these queries (other than latency) an encoder's business
* also, the conversion stuff might seem to make sense, but seems to not mind
* segment stuff etc at all
......@@ -1988,9 +1934,12 @@ gst_audio_encoder_src_query_default (GstAudioEncoder * enc, GstQuery * query)
gint64 src_val, dest_val;
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
if (!(res = gst_audio_encoded_audio_convert (&enc->priv->ctx.info,
GST_OBJECT_LOCK (enc);
res = __gst_audio_encoded_audio_convert (&enc->priv->ctx.info,
enc->priv->bytes_out, enc->priv->samples_in, src_fmt, src_val,
&dest_fmt, &dest_val)))
&dest_fmt, &dest_val);
GST_OBJECT_UNLOCK (enc);
if (!res)
break;
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
break;
......
......@@ -1470,18 +1470,6 @@ default_commit (GstAudioRingBuffer * buf, guint64 * sample,
g_return_val_if_fail (buf->memory != NULL, -1);
g_return_val_if_fail (data != NULL, -1);
/* writing stuff now, ensure running clock */
if (G_UNLIKELY (g_atomic_int_get (&buf->state) !=
GST_AUDIO_RING_BUFFER_STATE_STARTED)) {
/* see if we are allowed to start it */
if (G_UNLIKELY (g_atomic_int_get (&buf->may_start) == FALSE)) {
GST_DEBUG_OBJECT (buf, "not allowed to start");
} else {
GST_DEBUG_OBJECT (buf, "start!");
gst_audio_ring_buffer_start (buf);
}
}
need_reorder = buf->need_reorder;
channels = buf->spec.info.channels;
......
......@@ -232,7 +232,7 @@ audioringbuffer_thread_func (GstAudioRingBuffer * buf)
message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
GST_STREAM_STATUS_TYPE_ENTER, GST_ELEMENT_CAST (sink));
g_value_init (&val, GST_TYPE_G_THREAD);
g_value_set_boxed (&val, sink->thread);
g_value_set_boxed (&val, g_thread_self ());
gst_message_set_stream_status_object (message, &val);
g_value_unset (&val);
GST_DEBUG_OBJECT (sink, "posting ENTER stream status");
......@@ -307,7 +307,7 @@ stop_running:
message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
GST_STREAM_STATUS_TYPE_LEAVE, GST_ELEMENT_CAST (sink));
g_value_init (&val, GST_TYPE_G_THREAD);
g_value_set_boxed (&val, sink->thread);
g_value_set_boxed (&val, g_thread_self ());
gst_message_set_stream_status_object (message, &val);
g_value_unset (&val);
GST_DEBUG_OBJECT (sink, "posting LEAVE stream status");
......
......@@ -218,7 +218,7 @@ audioringbuffer_thread_func (GstAudioRingBuffer * buf)
message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
GST_STREAM_STATUS_TYPE_ENTER, GST_ELEMENT_CAST (src));
g_value_init (&val, GST_TYPE_G_THREAD);
g_value_set_boxed (&val, src->thread);
g_value_set_boxed (&val, g_thread_self ());
gst_message_set_stream_status_object (message, &val);
g_value_unset (&val);
GST_DEBUG_OBJECT (src, "posting ENTER stream status");
......@@ -291,7 +291,7 @@ stop_running:
message = gst_message_new_stream_status (GST_OBJECT_CAST (buf),
GST_STREAM_STATUS_TYPE_LEAVE, GST_ELEMENT_CAST (src));
g_value_init (&val, GST_TYPE_G_THREAD);
g_value_set_boxed (&val, src->thread);
g_value_set_boxed (&val, g_thread_self ());
gst_message_set_stream_status_object (message, &val);
g_value_unset (&val);
GST_DEBUG_OBJECT (src, "posting LEAVE stream status");
......
......@@ -142,3 +142,73 @@ done:
return fcaps;
}
/**
* __gst_audio_encoded_audio_convert:
* @fmt: audio format of the encoded audio
* @bytes: number of encoded bytes
* @samples: number of encoded samples
* @src_format: source format
* @src_value: source value
* @dest_format: destination format
* @dest_value: destination format
*
* Helper function to convert @src_value in @src_format to @dest_value in
* @dest_format for encoded audio data. Conversion is possible between
* BYTE and TIME format by using estimated bitrate based on
* @samples and @bytes (and @fmt).
*/
gboolean
__gst_audio_encoded_audio_convert (GstAudioInfo * fmt,
gint64 bytes, gint64 samples, GstFormat src_format,
gint64 src_value, GstFormat * dest_format, gint64 * dest_value)
{
gboolean res = FALSE;
g_return_val_if_fail (dest_format != NULL, FALSE);
g_return_val_if_fail (dest_value != NULL, FALSE);
if (G_UNLIKELY (src_format == *dest_format || src_value == 0 ||
src_value == -1)) {
if (dest_value)
*dest_value = src_value;
return TRUE;
}
if (samples == 0 || bytes == 0 || fmt->rate == 0) {
GST_DEBUG ("not enough metadata yet to convert");
goto exit;
}
bytes *= fmt->rate;
switch (src_format) {