Commit a9b134d1 authored by Sebastian Dröge's avatar Sebastian Dröge

Merge branch 'master' into 0.11

Conflicts:
	docs/plugins/gst-plugins-base-plugins.hierarchy
	docs/plugins/gst-plugins-base-plugins.interfaces
	docs/plugins/gst-plugins-base-plugins.prerequisites
parents f1980aa0 9b8992cb
common @ 69b981f1
Subproject commit 9e5bbd508588961696e70c38e764492e0312ec4c
Subproject commit 69b981f10caa234ad0ff639179d0fda8505bd94b
......@@ -711,7 +711,7 @@
<ARG>
<NAME>GstMultiFdSink::buffers-max</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Buffers max</NICK>
<BLURB>max number of buffers to queue for a client (-1 = no limit).</BLURB>
......@@ -731,7 +731,7 @@
<ARG>
<NAME>GstMultiFdSink::buffers-soft-max</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Buffers soft max</NICK>
<BLURB>Recover client when going over this limit (-1 = no limit).</BLURB>
......@@ -821,7 +821,7 @@
<ARG>
<NAME>GstMultiFdSink::buffers-min</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Buffers min</NICK>
<BLURB>min number of buffers to queue (-1 = as few as possible).</BLURB>
......@@ -851,7 +851,7 @@
<ARG>
<NAME>GstMultiFdSink::bytes-min</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Bytes min</NICK>
<BLURB>min number of bytes to queue (-1 = as little as possible).</BLURB>
......@@ -861,7 +861,7 @@
<ARG>
<NAME>GstMultiFdSink::time-min</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Time min</NICK>
<BLURB>min number of time to queue (-1 = as little as possible).</BLURB>
......@@ -881,7 +881,7 @@
<ARG>
<NAME>GstMultiFdSink::units-max</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Units max</NICK>
<BLURB>max number of units to queue (-1 = no limit).</BLURB>
......@@ -891,7 +891,7 @@
<ARG>
<NAME>GstMultiFdSink::units-soft-max</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Units soft max</NICK>
<BLURB>Recover client when going over this limit (-1 = no limit).</BLURB>
......@@ -901,7 +901,7 @@
<ARG>
<NAME>GstMultiFdSink::qos-dscp</NAME>
<TYPE>gint</TYPE>
<RANGE>[G_MAXULONG,63]</RANGE>
<RANGE>[-1,63]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>QoS diff srv code point</NICK>
<BLURB>Quality of Service, differentiated services code point (-1 default).</BLURB>
......@@ -1081,7 +1081,7 @@
<ARG>
<NAME>GstVorbisEnc::bitrate</NAME>
<TYPE>gint</TYPE>
<RANGE>[G_MAXULONG,250001]</RANGE>
<RANGE>[-1,250001]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Target Bitrate</NICK>
<BLURB>Attempt to encode at a bitrate averaging this (in bps). This uses the bitrate management engine, and is not recommended for most users. Quality is a better alternative. (-1 == disabled).</BLURB>
......@@ -1111,7 +1111,7 @@
<ARG>
<NAME>GstVorbisEnc::max-bitrate</NAME>
<TYPE>gint</TYPE>
<RANGE>[G_MAXULONG,250001]</RANGE>
<RANGE>[-1,250001]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Maximum Bitrate</NICK>
<BLURB>Specify a maximum bitrate (in bps). Useful for streaming applications. (-1 == disabled).</BLURB>
......@@ -1121,7 +1121,7 @@
<ARG>
<NAME>GstVorbisEnc::min-bitrate</NAME>
<TYPE>gint</TYPE>
<RANGE>[G_MAXULONG,250001]</RANGE>
<RANGE>[-1,250001]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Minimum Bitrate</NICK>
<BLURB>Specify a minimum bitrate (in bps). Useful for encoding for a fixed-size channel. (-1 == disabled).</BLURB>
......@@ -1678,6 +1678,26 @@
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::average-period</NAME>
<TYPE>guint64</TYPE>
<RANGE><= G_MAXINT64</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Period over which to average</NICK>
<BLURB>Period over which to average the framerate (in ns) (0 = disabled).</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::drop-only</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>Only Drop</NICK>
<BLURB>Only drop frames, no duplicates are produced.</BLURB>
<DEFAULT>FALSE</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioRate::add</NAME>
<TYPE>guint64</TYPE>
......@@ -2201,7 +2221,7 @@
<ARG>
<NAME>GstCdParanoiaSrc::read-speed</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Read speed</NICK>
<BLURB>Read from device at specified speed.</BLURB>
......@@ -2211,7 +2231,7 @@
<ARG>
<NAME>GstCdParanoiaSrc::search-overlap</NAME>
<TYPE>gint</TYPE>
<RANGE>[G_MAXULONG,75]</RANGE>
<RANGE>[-1,75]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Search overlap</NICK>
<BLURB>Force minimum overlap search during verification to n sectors.</BLURB>
......@@ -2221,7 +2241,7 @@
<ARG>
<NAME>GstCdParanoiaSrc::cache-size</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Cache size</NICK>
<BLURB>Set CD cache size to n sectors (-1 = auto).</BLURB>
......@@ -2451,7 +2471,7 @@
<ARG>
<NAME>GstURIDecodeBin::buffer-duration</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Buffer duration (ns)</NICK>
<BLURB>Buffer duration when buffering streams (-1 default value).</BLURB>
......@@ -2461,7 +2481,7 @@
<ARG>
<NAME>GstURIDecodeBin::buffer-size</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Buffer size (bytes)</NICK>
<BLURB>Buffer size when buffering streams (-1 default value).</BLURB>
......@@ -2501,7 +2521,7 @@
<ARG>
<NAME>GstURIDecodeBin::ring-buffer-max-size</NAME>
<TYPE>guint64</TYPE>
<RANGE><= G_MAXUINT</RANGE>
<RANGE><= G_MAXULONG</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Max. ring buffer size (bytes)</NICK>
<BLURB>Max. amount of data in the ring buffer (bytes, 0 = ring buffer disabled).</BLURB>
......@@ -2671,7 +2691,7 @@
<ARG>
<NAME>GstPlayBin2::current-audio</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Current audio</NICK>
<BLURB>Currently playing audio stream (-1 = auto).</BLURB>
......@@ -2681,7 +2701,7 @@
<ARG>
<NAME>GstPlayBin2::current-text</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Current Text</NICK>
<BLURB>Currently playing text stream (-1 = auto).</BLURB>
......@@ -2691,7 +2711,7 @@
<ARG>
<NAME>GstPlayBin2::current-video</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Current Video</NICK>
<BLURB>Currently playing video stream (-1 = auto).</BLURB>
......@@ -2841,7 +2861,7 @@
<ARG>
<NAME>GstPlayBin2::buffer-duration</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Buffer duration (ns)</NICK>
<BLURB>Buffer duration when buffering network streams.</BLURB>
......@@ -2851,7 +2871,7 @@
<ARG>
<NAME>GstPlayBin2::buffer-size</NAME>
<TYPE>gint</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Buffer size (bytes)</NICK>
<BLURB>Buffer size when buffering network streams.</BLURB>
......@@ -2891,7 +2911,7 @@
<ARG>
<NAME>GstPlayBin2::ring-buffer-max-size</NAME>
<TYPE>guint64</TYPE>
<RANGE><= G_MAXUINT</RANGE>
<RANGE><= G_MAXULONG</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Max. ring buffer size (bytes)</NICK>
<BLURB>Max. amount of data in the ring buffer (bytes, 0 = ring buffer disabled).</BLURB>
......@@ -3231,7 +3251,7 @@
<ARG>
<NAME>GstAppSrc::max-latency</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Max Latency</NICK>
<BLURB>The maximum latency (-1 = unlimited).</BLURB>
......@@ -3241,7 +3261,7 @@
<ARG>
<NAME>GstAppSrc::min-latency</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Min Latency</NICK>
<BLURB>The minimum latency (-1 = default).</BLURB>
......@@ -3251,7 +3271,7 @@
<ARG>
<NAME>GstAppSrc::size</NAME>
<TYPE>gint64</TYPE>
<RANGE>>= G_MAXULONG</RANGE>
<RANGE>>= -1</RANGE>
<FLAGS>rw</FLAGS>
<NICK>Size</NICK>
<BLURB>The size of the data stream in bytes (-1 if unknown).</BLURB>
......
......@@ -411,7 +411,7 @@ gst_tag_get_language_code_iso_639_2X (const gchar * lang_code, guint8 flags)
} else if (i > 0 && (iso_639_codes[i - 1].flags & flags) == flags &&
iso_639_codes[i].name_offset == iso_639_codes[i - 1].name_offset) {
return iso_639_codes[i - 1].iso_639_2;
} else if (i < G_N_ELEMENTS (iso_639_codes) &&
} else if ((i + 1) < G_N_ELEMENTS (iso_639_codes) &&
(iso_639_codes[i + 1].flags & flags) == flags &&
iso_639_codes[i].name_offset == iso_639_codes[i + 1].name_offset) {
return iso_639_codes[i + 1].iso_639_2;
......
......@@ -223,7 +223,7 @@ GStreamer Plugins Base library development and header files.
%{_includedir}/gstreamer-%{majorminor}/gst/pbutils/gstdiscoverer.h
%{_includedir}/gstreamer-%{majorminor}/gst/pbutils/gstpluginsbaseversion.h
%{_includedir}/gstreamer-%{majorminor}/gst/tag/xmpwriter.h
%{_includedir}/gstreamer-%{majorminor}/gst/audio/gstaudioiec61937.h
%{_libdir}/libgstfft-%{majorminor}.so
%{_libdir}/libgstrtsp-%{majorminor}.so
......
......@@ -497,15 +497,15 @@ append_with_other_format (GstCaps * caps, GstStructure * s, gboolean isfloat)
if (isfloat) {
s2 = gst_structure_copy (s);
gst_structure_set_name (s2, "audio/x-raw-int");
s = make_lossless_changes (s2, FALSE);
make_lossless_changes (s2, FALSE);
/* If 64 bit float was allowed; remove width 64: we don't support it for
* integer*/
strip_width_64 (s);
strip_width_64 (s2);
gst_caps_append_structure (caps, s2);
} else {
s2 = gst_structure_copy (s);
gst_structure_set_name (s2, "audio/x-raw-float");
s = make_lossless_changes (s2, TRUE);
make_lossless_changes (s2, TRUE);
gst_caps_append_structure (caps, s2);
}
}
......
......@@ -110,7 +110,7 @@
* Handling mp3!xing!idv3 and theora!ogg tagsetting scenarios:
* Once we have chosen a muxer:
* When a new stream is requested:
* If muxer is 'Formatter' OR doesn't have a TagSetter interface:
* If muxer isn't 'Formatter' OR doesn't have a TagSetter interface:
* Find a Formatter for the given stream (preferably with TagSetter)
* Insert that before muxer
**/
......@@ -162,6 +162,7 @@ struct _GstEncodeBin
/* available muxers, encoders and parsers */
GList *muxers;
GList *formatters;
GList *encoders;
GList *parsers;
......@@ -205,6 +206,7 @@ struct _StreamGroup
GstElement *parser;
GstElement *smartencoder;
GstElement *outfilter; /* Output capsfilter (streamprofile.format) */
GstElement *formatter;
GstElement *outqueue; /* Queue just before the muxer */
};
......@@ -279,6 +281,9 @@ static void stream_group_remove (GstEncodeBin * ebin, StreamGroup * sgroup);
static GstPad *gst_encode_bin_request_pad_signal (GstEncodeBin * encodebin,
GstCaps * caps);
static inline GstElement *_get_formatter (GstEncodeBin * ebin,
GstEncodingProfile * sprof);
static void
gst_encode_bin_class_init (GstEncodeBinClass * klass)
{
......@@ -388,6 +393,9 @@ gst_encode_bin_dispose (GObject * object)
if (ebin->muxers)
gst_plugin_feature_list_free (ebin->muxers);
if (ebin->formatters)
gst_plugin_feature_list_free (ebin->formatters);
if (ebin->encoders)
gst_plugin_feature_list_free (ebin->encoders);
......@@ -410,15 +418,14 @@ static void
gst_encode_bin_init (GstEncodeBin * encode_bin)
{
GstPadTemplate *tmpl;
GList *formatters;
encode_bin->muxers =
gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_MUXER,
GST_RANK_MARGINAL);
formatters =
encode_bin->formatters =
gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_FORMATTER,
GST_RANK_SECONDARY);
encode_bin->muxers = g_list_concat (encode_bin->muxers, formatters);
encode_bin->encoders =
gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_ENCODER,
......@@ -911,6 +918,16 @@ no_template:
}
}
static gboolean
_has_class (GstElement * element, const gchar * classname)
{
GstElementClass *klass;
klass = GST_ELEMENT_GET_CLASS (element);
return strstr (klass->details.klass, classname) != NULL;
}
/* FIXME : Add handling of streams that don't need encoding */
/* FIXME : Add handling of streams that don't require conversion elements */
/*
......@@ -966,11 +983,12 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
muxerpad = get_compatible_muxer_sink_pad (ebin, NULL, format);
if (G_UNLIKELY (muxerpad == NULL))
goto no_muxer_pad;
}
/* Output Queue.
* We only use a 1buffer long queue here, the actual queueing will be done
* in the intput queue */
* in the input queue */
last = sgroup->outqueue = gst_element_factory_make ("queue", NULL);
g_object_set (sgroup->outqueue, "max-size-buffers", (guint32) 1,
"max-size-bytes", (guint32) 0, "max-size-time", (guint64) 0, NULL);
......@@ -988,6 +1006,26 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
}
gst_object_unref (srcpad);
/* Check if we need a formatter
* If we have no muxer or
* if the muxer isn't a formatter and doesn't implement the tagsetter interface
*/
if (!ebin->muxer
|| (!gst_element_implements_interface (ebin->muxer, GST_TYPE_TAG_SETTER)
|| !_has_class (ebin->muxer, "Formatter"))) {
sgroup->formatter = _get_formatter (ebin, sprof);
if (sgroup->formatter) {
GST_DEBUG ("Adding formatter for %" GST_PTR_FORMAT, format);
gst_bin_add (GST_BIN (ebin), sgroup->formatter);
tosync = g_list_append (tosync, sgroup->formatter);
if (G_UNLIKELY (!fast_element_link (sgroup->formatter, last)))
goto formatter_link_failure;
last = sgroup->formatter;
}
}
/* Output capsfilter
* This will receive the format caps from the streamprofile */
GST_DEBUG ("Adding output capsfilter for %" GST_PTR_FORMAT, format);
......@@ -1337,10 +1375,15 @@ muxer_link_failure:
GST_ERROR_OBJECT (ebin, "Couldn't link encoder to muxer");
goto cleanup;
outfilter_link_failure:
formatter_link_failure:
GST_ERROR_OBJECT (ebin, "Couldn't link output filter to output queue");
goto cleanup;
outfilter_link_failure:
GST_ERROR_OBJECT (ebin,
"Couldn't link output filter to output queue/formatter");
goto cleanup;
passthrough_link_failure:
GST_ERROR_OBJECT (ebin, "Failed linking splitter in passthrough mode");
goto cleanup;
......@@ -1404,10 +1447,49 @@ _factory_can_sink_caps (GstElementFactory * factory, const GstCaps * caps)
return FALSE;
}
static inline GstElement *
_get_formatter (GstEncodeBin * ebin, GstEncodingProfile * sprof)
{
GList *formatters, *tmpfmtr;
GstElement *formatter = NULL;
GstElementFactory *formatterfact = NULL;
const GstCaps *format;
const gchar *preset;
format = gst_encoding_profile_get_format (sprof);
preset = gst_encoding_profile_get_preset (sprof);
GST_DEBUG ("Getting list of formatters for format %" GST_PTR_FORMAT, format);
formatters =
gst_element_factory_list_filter (ebin->formatters, format, GST_PAD_SRC,
FALSE);
if (formatters == NULL)
goto beach;
/* FIXME : signal the user if he wants this */
for (tmpfmtr = formatters; tmpfmtr; tmpfmtr = tmpfmtr->next) {
formatterfact = (GstElementFactory *) tmpfmtr->data;
GST_DEBUG_OBJECT (ebin, "Trying formatter %s",
GST_PLUGIN_FEATURE_NAME (formatterfact));
if ((formatter =
_create_element_and_set_preset (formatterfact, preset, NULL)))
break;
}
gst_plugin_feature_list_free (formatters);
beach:
return formatter;
}
static inline GstElement *
_get_muxer (GstEncodeBin * ebin)
{
GList *muxers, *tmpmux;
GList *muxers, *formatters, *tmpmux;
GstElement *muxer = NULL;
GstElementFactory *muxerfact = NULL;
const GList *tmp;
......@@ -1422,6 +1504,12 @@ _get_muxer (GstEncodeBin * ebin)
muxers =
gst_element_factory_list_filter (ebin->muxers, format, GST_PAD_SRC, TRUE);
formatters =
gst_element_factory_list_filter (ebin->formatters, format, GST_PAD_SRC,
TRUE);
muxers = g_list_concat (muxers, formatters);
if (muxers == NULL)
goto beach;
......@@ -1604,9 +1692,17 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup)
if (sgroup->outqueue)
gst_element_set_state (sgroup->outqueue, GST_STATE_NULL);
/* Capsfilter - outqueue */
gst_element_set_state (sgroup->outfilter, GST_STATE_NULL);
gst_element_unlink (sgroup->outfilter, sgroup->outqueue);
if (sgroup->formatter) {
/* capsfilter - formatter - outqueue */
gst_element_set_state (sgroup->formatter, GST_STATE_NULL);
gst_element_set_state (sgroup->outfilter, GST_STATE_NULL);
gst_element_unlink (sgroup->formatter, sgroup->outqueue);
gst_element_unlink (sgroup->outfilter, sgroup->formatter);
} else {
/* Capsfilter - outqueue */
gst_element_set_state (sgroup->outfilter, GST_STATE_NULL);
gst_element_unlink (sgroup->outfilter, sgroup->outqueue);
}
gst_element_set_state (sgroup->outqueue, GST_STATE_NULL);
gst_bin_remove (GST_BIN (ebin), sgroup->outqueue);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment