diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-01-25 11:50:54 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-01-25 11:50:54 +0100 |
commit | 68c0790817b4dedf8d4d028631e98d66171e73c0 (patch) | |
tree | 1063f6bb873d4ab3bee85e2310e06ad9f9232261 | |
parent | cd8742fdcb71e9bb3f987e5f98594c20b5c08134 (diff) | |
parent | bd900a6c856c536c783aa7a53e3c6b19f3cb8bf9 (diff) |
Merge branch 'master' into 0.11
Conflicts:
gst-libs/gst/interfaces/propertyprobe.c
sys/xvimage/xvimagesink.c
-rw-r--r-- | Android.mk | 2 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | ext/alsa/gstalsasink.c | 17 | ||||
-rw-r--r-- | ext/ogg/gstoggstream.c | 2 | ||||
-rw-r--r-- | ext/vorbis/gstvorbisdec.c | 8 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstaudiobasesink.c | 5 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstaudiodecoder.c | 3 | ||||
-rw-r--r-- | gst-libs/gst/tag/gstexiftag.c | 1 | ||||
-rw-r--r-- | gst/playback/gstdecodebin2.c | 103 | ||||
-rw-r--r-- | gst/playback/gstplaybin2.c | 2 | ||||
-rw-r--r-- | gst/playback/gstplaysink.c | 18 | ||||
-rw-r--r-- | gst/playback/gststreamsynchronizer.c | 3 | ||||
-rw-r--r-- | gst/playback/gstsubtitleoverlay.c | 9 | ||||
-rw-r--r-- | gst/videoscale/vs_fill_borders.c | 4 | ||||
-rw-r--r-- | sys/xvimage/xvimagepool.c | 2 | ||||
-rw-r--r-- | tools/gst-discoverer.c | 3 |
16 files changed, 153 insertions, 35 deletions
diff --git a/Android.mk b/Android.mk index b42e34b53..9fa657203 100644 --- a/Android.mk +++ b/Android.mk @@ -60,6 +60,7 @@ GST_PLUGINS_BASE_BUILT_SOURCES := \ ifneq ($(NDK_BUILD), true) GST_PLUGINS_BASE_BUILT_SOURCES += ext/vorbis/Android.mk +ZLIB_CFLAGS = -I $(abspath $(GST_PLUGINS_BASE_TOP)/../../zlib) endif GST_PLUGINS_BASE_BUILT_SOURCES := $(patsubst %, $(abspath $(GST_PLUGINS_BASE_TOP))/%, $(GST_PLUGINS_BASE_BUILT_SOURCES)) @@ -78,6 +79,7 @@ gst-plugins-base-configure: PKG_CONFIG_TOP_BUILD_DIR=/ \ IVORBIS_CFLAGS="-I$(TOP)/external/tremolo -DTREMOR" \ IVORBIS_LIBS="-lvorbisidec" \ + ZLIB_CFLAGS="$(ZLIB_CFLAGS)" \ $(abspath $(GST_PLUGINS_BASE_TOP))/$(CONFIGURE) --host=arm-linux-androideabi \ --prefix=/system --disable-orc --disable-gio --enable-ivorbis \ --disable-valgrind --disable-gtk-doc && \ diff --git a/configure.ac b/configure.ac index 65271abfc..5cb21e3ff 100644 --- a/configure.ac +++ b/configure.ac @@ -78,6 +78,8 @@ AG_GST_GETTEXT([gst-plugins-base-$GST_MAJORMINOR]) dnl *** check for arguments to configure *** +AG_GST_ARG_DISABLE_FATAL_WARNINGS + AG_GST_ARG_DEBUG AG_GST_ARG_PROFILING AG_GST_ARG_VALGRIND @@ -330,14 +332,14 @@ AG_GST_CHECK_GST_DEBUG_DISABLED([NO_WARNINGS="-Wno-unused"], [NO_WARNINGS=""]) dnl define an ERROR_CFLAGS Makefile variable dnl -Wformat-nonliteral - see ext/pango/gstclockoverlay.c and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39438 -AG_GST_SET_ERROR_CFLAGS($GST_GIT, [ +AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [ -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS]) dnl define an ERROR_CXXFLAGS Makefile variable -AG_GST_SET_ERROR_CXXFLAGS($GST_GIT, [ +AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [ -Wmissing-declarations -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index e4262e374..bec7e5c96 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -256,9 +256,11 @@ gst_alsasink_init (GstAlsaSink * alsasink) } #define CHECK(call, error) \ -G_STMT_START { \ -if ((err = call) < 0) \ - goto error; \ +G_STMT_START { \ + if ((err = call) < 0) { \ + GST_WARNING_OBJECT (alsa, "Error %d (%s) calling " #call, err, snd_strerror (err)); \ + goto error; \ + } \ } G_STMT_END; static GstCaps * @@ -355,8 +357,6 @@ retry: rrate = alsa->rate; CHECK (snd_pcm_hw_params_set_rate_near (alsa->handle, params, &rrate, NULL), no_rate); - if (rrate != alsa->rate) - goto rate_match; #ifndef GST_DISABLE_GST_DEBUG /* get and dump some limits */ @@ -486,13 +486,6 @@ no_rate: alsa->rate, snd_strerror (err))); return err; } -rate_match: - { - GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL), - ("Rate doesn't match (requested %iHz, get %iHz)", alsa->rate, err)); - snd_pcm_hw_params_free (params); - return -EINVAL; - } buffer_size: { GST_ELEMENT_ERROR (alsa, RESOURCE, SETTINGS, (NULL), diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c index 17c3ae70c..2811fc63a 100644 --- a/ext/ogg/gstoggstream.c +++ b/ext/ogg/gstoggstream.c @@ -1874,7 +1874,7 @@ packet_duration_opus (GstOggStream * pad, ogg_packet * packet) gint64 duration; gint64 frame_duration; - gint nframes; + gint nframes = 0; guint8 toc; if (packet->bytes < 1) diff --git a/ext/vorbis/gstvorbisdec.c b/ext/vorbis/gstvorbisdec.c index 033d2b350..cb4313d71 100644 --- a/ext/vorbis/gstvorbisdec.c +++ b/ext/vorbis/gstvorbisdec.c @@ -401,7 +401,7 @@ vorbis_handle_header_packet (GstVorbisDec * vd, ogg_packet * packet) /* Packetno = 0 if the first byte is exactly 0x01 */ packet->b_o_s = ((gst_ogg_packet_data (packet))[0] == 0x1) ? 1 : 0; -#ifdef USE_TREMELO +#ifdef USE_TREMOLO if ((ret = vorbis_dsp_headerin (&vd->vi, &vd->vc, packet))) #else if ((ret = vorbis_synthesis_headerin (&vd->vi, &vd->vc, packet))) @@ -510,7 +510,7 @@ static GstFlowReturn vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet, GstClockTime timestamp, GstClockTime duration) { -#ifdef USE_TREMELO +#ifdef USE_TREMOLO vorbis_sample_t *pcm; #else vorbis_sample_t **pcm; @@ -534,8 +534,8 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet, * throw away too much. For now we decode everything and clip right * before pushing data. */ -#ifdef USE_TREMELO - if (G_UNLIKELY (vorbis_dsp_synthesis (&vd->vb, packet, 1))) +#ifdef USE_TREMOLO + if (G_UNLIKELY (vorbis_dsp_synthesis (&vd->vd, packet, 1))) goto could_not_read; #else if (G_UNLIKELY (vorbis_synthesis (&vd->vb, packet))) diff --git a/gst-libs/gst/audio/gstaudiobasesink.c b/gst-libs/gst/audio/gstaudiobasesink.c index 693f86df1..60f463631 100644 --- a/gst-libs/gst/audio/gstaudiobasesink.c +++ b/gst-libs/gst/audio/gstaudiobasesink.c @@ -1642,7 +1642,7 @@ gst_audio_base_sink_render (GstBaseSink * bsink, GstBuffer * buf) " Using render_start=%" G_GUINT64_FORMAT, size, render_start); /* we don't have a start so we don't know stop either */ stop = -1; - goto no_sync; + goto no_align; } /* let's calc stop based on the number of samples in the buffer instead @@ -1717,7 +1717,7 @@ gst_audio_base_sink_render (GstBaseSink * bsink, GstBuffer * buf) render_stop = render_start + samples; GST_DEBUG_OBJECT (sink, "no sync needed. Using render_start=%" G_GUINT64_FORMAT, render_start); - goto no_sync; + goto no_align; } /* bring buffer start and stop times to running time */ @@ -1838,7 +1838,6 @@ no_align: /* number of target samples is difference between start and stop */ out_samples = render_stop - render_start; -no_sync: /* we render the first or last sample first, depending on the rate */ if (bsink->segment.rate >= 0.0) sample_offset = render_start; diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index a3dcf9bce..3b1de164b 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -344,7 +344,8 @@ gst_audio_decoder_class_init (GstAudioDecoderClass * klass) gobject_class->get_property = gst_audio_decoder_get_property; gobject_class->finalize = gst_audio_decoder_finalize; - element_class->change_state = gst_audio_decoder_change_state; + element_class->change_state = + GST_DEBUG_FUNCPTR (gst_audio_decoder_change_state); /* Properties */ g_object_class_install_property (gobject_class, PROP_LATENCY, diff --git a/gst-libs/gst/tag/gstexiftag.c b/gst-libs/gst/tag/gstexiftag.c index f82c6c8af..0393cc251 100644 --- a/gst-libs/gst/tag/gstexiftag.c +++ b/gst-libs/gst/tag/gstexiftag.c @@ -1681,6 +1681,7 @@ parse_exif_ifd (GstExifReader * exif_reader, gint buf_offset, case EXIF_TYPE_UNDEFINED: parse_exif_undefined_tag (exif_reader, &tag_map[map_index], tagdata.count, tagdata.offset, tagdata.offset_as_data); + break; case EXIF_TYPE_LONG: parse_exif_long_tag (exif_reader, &tag_map[map_index], tagdata.count, tagdata.offset, tagdata.offset_as_data); diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 4916fade8..9d2ad08de 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -435,6 +435,7 @@ static gboolean gst_decode_chain_is_complete (GstDecodeChain * chain); static gboolean gst_decode_chain_expose (GstDecodeChain * chain, GList ** endpads, gboolean * missing_plugin); static gboolean gst_decode_chain_is_drained (GstDecodeChain * chain); +static void gst_decode_chain_prune (GstDecodeChain * chain); static gboolean gst_decode_group_is_complete (GstDecodeGroup * group); static GstPad *gst_decode_group_control_demuxer_pad (GstDecodeGroup * group, GstPad * pad); @@ -2315,6 +2316,16 @@ pad_event_cb (GstPad * pad, GstPadProbeInfo * info, gpointer data) } static void +demuxer_pad_blocked_cb (GstPad * pad, gboolean blocked, GstDecodeChain * chain) +{ + GstDecodeBin *dbin; + + dbin = chain->dbin; + if (!blocked) + gst_decode_chain_prune (dbin->decode_chain); +} + +static void pad_added_cb (GstElement * element, GstPad * pad, GstDecodeChain * chain) { GstCaps *caps; @@ -2330,6 +2341,27 @@ pad_added_cb (GstElement * element, GstPad * pad, GstDecodeChain * chain) gst_caps_unref (caps); EXPOSE_LOCK (dbin); + CHAIN_MUTEX_LOCK (chain); + if (chain->demuxer && + ((GstDecodeElement *) chain->elements->data)->element == element) { + GList *l; + + for (l = chain->next_groups; l; l = l->next) { + GstDecodeGroup *group = l->data; + GList *l2; + + for (l2 = group->children; l2; l2 = l2->next) { + GstDecodeChain *child_chain = l2->data; + + if (!gst_pad_is_blocked (child_chain->pad)) { + GST_DEBUG_OBJECT (pad, "blocking next group's pad %p", pad); + gst_pad_set_blocked_async (child_chain->pad, TRUE, + (GstPadBlockCallback) demuxer_pad_blocked_cb, chain); + } + } + } + } + CHAIN_MUTEX_UNLOCK (chain); if (gst_decode_chain_is_complete (dbin->decode_chain)) { GST_LOG_OBJECT (dbin, "That was the last dynamic object, now attempting to expose the group"); @@ -2860,6 +2892,76 @@ gst_decode_group_hide (GstDecodeGroup * group) gst_decode_group_free_internal (group, TRUE); } +static void +gst_decode_group_prune (GstDecodeGroup * group) +{ + GList *l; + + GST_DEBUG_OBJECT (group->dbin, "Pruning group %p", group); + + for (l = group->children; l; l = l->next) { + GstDecodeChain *chain = (GstDecodeChain *) l->data; + + gst_decode_chain_prune (chain); + } + + GST_DEBUG_OBJECT (group->dbin, "Pruned group %p", group); +} + +static void +gst_decode_chain_prune (GstDecodeChain * chain) +{ + GList *l; + + CHAIN_MUTEX_LOCK (chain); + + GST_DEBUG_OBJECT (chain->dbin, "Pruning chain %p", chain); + + if (chain->active_group) + gst_decode_group_prune (chain->active_group); + + for (l = chain->next_groups; l; l = l->next) { + gst_decode_group_prune ((GstDecodeGroup *) l->data); + } + + for (l = chain->old_groups; l; l = l->next) { + GstDecodeGroup *group = l->data; + + /* This calls set_state(NULL) on the old elements and we're + * the streaming thread but this is one of the few cases + * when this is possible. It's guaranteed at this point + * that *this* streaming thread is not inside the elements + * currently, because it's *here* now or a different streaming + * thread is used for the elements. + */ + gst_decode_group_free (group); + } + g_list_free (chain->old_groups); + chain->old_groups = NULL; + + GST_DEBUG_OBJECT (chain->dbin, "Pruned chain %p", chain); + CHAIN_MUTEX_UNLOCK (chain); +} + +static void +unblock_demuxer_pads (GstDecodeChain * chain) +{ + GList *l; + + GST_DEBUG_OBJECT (chain->dbin, "Unblocking demuxer pad for chain %p", chain); + + if (gst_pad_is_blocked (chain->pad)) + gst_pad_set_blocked_async (chain->pad, FALSE, + (GstPadBlockCallback) demuxer_pad_blocked_cb, chain); + if (chain->active_group) { + for (l = chain->active_group->children; l; l = l->next) { + GstDecodeChain *child_chain = l->data; + + unblock_demuxer_pads (child_chain); + } + } +} + /* configure queue sizes, this depends on the buffering method and if we are * playing or prerolling. */ static void @@ -3235,6 +3337,7 @@ gst_decode_pad_handle_eos (GstDecodePad * pad) EXPOSE_LOCK (dbin); if (gst_decode_chain_is_complete (dbin->decode_chain)) gst_decode_bin_expose (dbin); + unblock_demuxer_pads (dbin->decode_chain); EXPOSE_UNLOCK (dbin); } diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index d79263b0d..33368bbc6 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -3851,7 +3851,7 @@ save_current_group (GstPlayBin * playbin) /* see if there is a current group */ GST_PLAY_BIN_LOCK (playbin); curr_group = playbin->curr_group; - if (curr_group && curr_group->valid) { + if (curr_group && curr_group->valid && curr_group->active) { /* unlink our pads with the sink */ deactivate_group (playbin, curr_group); } diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 836f6f5bd..05f45fc87 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1521,7 +1521,7 @@ gen_text_chain (GstPlaySink * playsink) chain->queue = NULL; } /* try to set sync to true but it's no biggie when we can't */ - if ((elem = + if (chain->sink && (elem = gst_play_sink_find_property_sinks (playsink, chain->sink, "sync", G_TYPE_BOOLEAN))) g_object_set (elem, "sync", TRUE, NULL); @@ -1594,10 +1594,18 @@ gen_text_chain (GstPlaySink * playsink) "max-size-bytes", 0, "max-size-time", (gint64) 0, "silent", TRUE, NULL); gst_bin_add (bin, element); - gst_element_link_pads_full (element, "src", chain->overlay, - "subtitle_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS); - textsinkpad = gst_element_get_static_pad (element, "sink"); - srcpad = gst_element_get_static_pad (chain->overlay, "src"); + if (gst_element_link_pads_full (element, "src", chain->overlay, + "subtitle_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) { + textsinkpad = gst_element_get_static_pad (element, "sink"); + srcpad = gst_element_get_static_pad (chain->overlay, "src"); + } else { + gst_bin_remove (bin, chain->sink); + gst_bin_remove (bin, chain->overlay); + chain->sink = NULL; + chain->overlay = NULL; + gst_object_unref (videosinkpad); + videosinkpad = NULL; + } } } } diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index 77bf80360..3e155d136 100644 --- a/gst/playback/gststreamsynchronizer.c +++ b/gst/playback/gststreamsynchronizer.c @@ -543,7 +543,8 @@ gst_stream_synchronizer_sink_chain (GstPad * pad, GstObject * parent, GST_STREAM_SYNCHRONIZER_LOCK (self); stream = gst_pad_get_element_private (pad); - stream->seen_data = TRUE; + if (stream) + stream->seen_data = TRUE; if (stream && stream->drop_discont) { buffer = gst_buffer_make_writable (buffer); GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT); diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c index f3d28a677..032164893 100644 --- a/gst/playback/gstsubtitleoverlay.c +++ b/gst/playback/gstsubtitleoverlay.c @@ -1398,6 +1398,15 @@ gst_subtitle_overlay_change_state (GstElement * element, break; case GST_STATE_CHANGE_PAUSED_TO_READY: GST_DEBUG_OBJECT (self, "State change PAUSED->READY"); + + /* Set the pads back to blocking state */ + GST_SUBTITLE_OVERLAY_LOCK (self); + gst_pad_set_blocked_async_full (self->video_block_pad, TRUE, + _pad_blocked_cb, self, NULL); + gst_pad_set_blocked_async_full (self->subtitle_block_pad, TRUE, + _pad_blocked_cb, self, NULL); + GST_SUBTITLE_OVERLAY_UNLOCK (self); + do_async_done (self); break; diff --git a/gst/videoscale/vs_fill_borders.c b/gst/videoscale/vs_fill_borders.c index 160e137de..ca6cfd51f 100644 --- a/gst/videoscale/vs_fill_borders.c +++ b/gst/videoscale/vs_fill_borders.c @@ -394,8 +394,8 @@ vs_fill_borders_AYUV64 (const VSImage * dest, const uint8_t * val) uint8_t *data; uint64_t v; - v = (val[0] << 8) | (val[1] << 24) | (((guint64) val[2]) << 40) | (((guint64) - val[3]) << 56); + v = (((guint32) val[0]) << 8) | (((guint32) val[1]) << 24) | + (((guint64) val[2]) << 40) | (((guint64) val[3]) << 56); data = dest->real_pixels; for (i = 0; i < top; i++) { diff --git a/sys/xvimage/xvimagepool.c b/sys/xvimage/xvimagepool.c index 86dab2870..9c5b52a17 100644 --- a/sys/xvimage/xvimagepool.c +++ b/sys/xvimage/xvimagepool.c @@ -333,6 +333,8 @@ gst_xvimage_meta_free (GstXvImageMeta * meta, GstBuffer * buffer) shmdt (meta->SHMInfo.shmaddr); } #endif + if (meta->xvimage) + XFree (meta->xvimage); goto beach; } diff --git a/tools/gst-discoverer.c b/tools/gst-discoverer.c index f17def52c..c28ee648f 100644 --- a/tools/gst-discoverer.c +++ b/tools/gst-discoverer.c @@ -413,7 +413,6 @@ process_file (GstDiscoverer * dc, const gchar * filename) GDir *dir; gchar *uri, *path; GstDiscovererInfo *info; - GstStructure *st = NULL; if (!gst_uri_is_valid (filename)) { /* Recurse into directories */ @@ -461,8 +460,6 @@ process_file (GstDiscoverer * dc, const gchar * filename) if (err) g_error_free (err); gst_discoverer_info_unref (info); - if (st) - gst_structure_free (st); } else { gst_discoverer_discover_uri_async (dc, uri); } |