From 7d577d955c5d0a6ec50cb571cf3bf3cf8f66a433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 27 Sep 2011 00:32:41 +0100 Subject: [PATCH 1/8] docs: minor docs fix --- docs/libs/gst-plugins-base-libs-sections.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 70c6868403..4e998e4844 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -101,8 +101,8 @@ GST_AUDIO_FORMAT_INFO_FLAGS GST_AUDIO_FORMAT_INFO_FORMAT GST_AUDIO_FORMAT_INFO_IS_FLOAT GST_AUDIO_FORMAT_INFO_IS_INTEGER -GST_AUDIO_FORMAT_INFO_IS_BE -GST_AUDIO_FORMAT_INFO_IS_LE +GST_AUDIO_FORMAT_INFO_IS_BIG_ENDIAN +GST_AUDIO_FORMAT_INFO_IS_LITTLE_ENDIAN GST_AUDIO_FORMAT_INFO_IS_SIGNED GST_AUDIO_FORMAT_INFO_NAME GST_AUDIO_FORMAT_INFO_WIDTH From 9a9541ff352d43f84184b4011d0f0f6ad5f37226 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 27 Sep 2011 15:31:20 +0200 Subject: [PATCH 2/8] audioencoder: clean up some documentation --- gst-libs/gst/audio/gstaudioencoder.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index c11843843b..f8ff8c5f0a 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -457,20 +457,13 @@ gst_audio_encoder_finalize (GObject * object) * @buffer: encoded data * @samples: number of samples (per channel) represented by encoded data * - * Collects encoded data and/or pushes encoded data downstream. - * Source pad caps must be set when this is called. Depending on the nature - * of the (framing of) the format, subclass can decide whether to push - * encoded data directly or to collect various "frames" in a single buffer. - * Note that the latter behaviour is recommended whenever the format is allowed, - * as it incurs no additional latency and avoids otherwise generating a - * a multitude of (small) output buffers. If not explicitly pushed, - * any available encoded data is pushed at the end of each processing cycle, - * i.e. which encodes as much data as available input data allows. + * Collects encoded data and pushes encoded data downstream. + * Source pad caps must be set when this is called. * * If @samples < 0, then best estimate is all samples provided to encoder * (subclass) so far. @buf may be NULL, in which case next number of @samples * are considered discarded, e.g. as a result of discontinuous transmission, - * and a discontinuity is marked (note that @buf == NULL => push == TRUE). + * and a discontinuity is marked. * * Returns: a #GstFlowReturn that should be escalated to caller (of caller) * From 89f672054515f8c7770a243aecdcc2d323e756e3 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 27 Sep 2011 16:16:29 +0200 Subject: [PATCH 3/8] audioencoder: protect pending_events with proper lock --- gst-libs/gst/audio/gstaudioencoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index f8ff8c5f0a..1580fc99e2 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -1282,10 +1282,10 @@ gst_audio_encoder_sink_eventfunc (GstAudioEncoder * enc, GstEvent * event) gst_tag_list_remove_tag (tags, GST_TAG_AUDIO_CODEC); event = gst_event_new_tag (tags); - GST_OBJECT_LOCK (enc); + GST_AUDIO_ENCODER_STREAM_LOCK (enc); enc->priv->pending_events = g_list_append (enc->priv->pending_events, event); - GST_OBJECT_UNLOCK (enc); + GST_AUDIO_ENCODER_STREAM_UNLOCK (enc); handled = TRUE; break; } From 803b65613b59e1a40f61368fae012c82701a222e Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 27 Sep 2011 16:16:54 +0200 Subject: [PATCH 4/8] audioencoder: send tag event after pending events ... which probably includes a pending newsegment event. --- gst-libs/gst/audio/gstaudioencoder.c | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 1580fc99e2..4b2df82925 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -490,21 +490,6 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf, GST_AUDIO_ENCODER_STREAM_LOCK (enc); - if (G_UNLIKELY (enc->priv->tags)) { - GstTagList *tags; - - /* add codec info to pending tags */ - tags = enc->priv->tags; - /* no more pending */ - enc->priv->tags = NULL; - gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_CODEC, - GST_PAD_CAPS (enc->srcpad)); - gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_AUDIO_CODEC, - GST_PAD_CAPS (enc->srcpad)); - GST_DEBUG_OBJECT (enc, "sending tags %" GST_PTR_FORMAT, tags); - gst_element_found_tags_for_pad (GST_ELEMENT (enc), enc->srcpad, tags); - } - GST_LOG_OBJECT (enc, "accepting %d bytes encoded data as %d samples", buf ? GST_BUFFER_SIZE (buf) : -1, samples); @@ -523,6 +508,22 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf, g_list_free (pending_events); } + /* send after pending events, which likely includes newsegment event */ + if (G_UNLIKELY (enc->priv->tags)) { + GstTagList *tags; + + /* add codec info to pending tags */ + tags = enc->priv->tags; + /* no more pending */ + enc->priv->tags = NULL; + gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_CODEC, + GST_PAD_CAPS (enc->srcpad)); + gst_pb_utils_add_codec_description_to_tag_list (tags, GST_TAG_AUDIO_CODEC, + GST_PAD_CAPS (enc->srcpad)); + GST_DEBUG_OBJECT (enc, "sending tags %" GST_PTR_FORMAT, tags); + gst_element_found_tags_for_pad (GST_ELEMENT (enc), enc->srcpad, tags); + } + /* remove corresponding samples from input */ if (samples < 0) samples = (enc->priv->offset / ctx->info.bpf); From 24d71cf7a68e3849881ea706835eb15457e4268e Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 27 Sep 2011 16:57:45 +0200 Subject: [PATCH 5/8] audioencoder: really push pending events --- gst-libs/gst/audio/gstaudioencoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 4b2df82925..7c4ab4aeb9 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -503,7 +503,7 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf, priv->pending_events = NULL; GST_DEBUG_OBJECT (enc, "Pushing pending events"); - for (l = priv->pending_events; l; l = l->next) + for (l = pending_events; l; l = l->next) gst_pad_push_event (enc->srcpad, l->data); g_list_free (pending_events); } From 01d27ee084ffd8deb3a45a682fd6a226d292aa55 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 27 Sep 2011 16:18:05 +0200 Subject: [PATCH 6/8] audioencoder: only got_data if we really got some ... which avoids going loopy with casual subclass. --- gst-libs/gst/audio/gstaudioencoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 7c4ab4aeb9..1a8887ea97 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -494,7 +494,8 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf, buf ? GST_BUFFER_SIZE (buf) : -1, samples); /* mark subclass still alive and providing */ - priv->got_data = TRUE; + if (G_LIKELY (buf)) + priv->got_data = TRUE; if (priv->pending_events) { GList *pending_events, *l; From c0956342b2a3f6c71a69344e0921034e321a47d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimo=20J=C3=A4rvi?= Date: Wed, 28 Sep 2011 01:11:30 +0300 Subject: [PATCH 7/8] playbin2: Fix compiler warnings on 64 bit mingw-w64 Fixes bug #660301. --- gst/playback/gstplaybin2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 41b3cd443d..62a8cfaf8b 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -2607,7 +2607,7 @@ pad_added_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group) G_CALLBACK (notify_tags_cb), ntdata, (GClosureNotify) g_free, (GConnectFlags) 0); g_object_set_data (G_OBJECT (sinkpad), "playbin2.notify_tags_handler", - (gpointer) notify_tags_handler); + (gpointer) (guintptr) notify_tags_handler); /* store the pad in the array */ GST_DEBUG_OBJECT (playbin, "pad %p added to array", sinkpad); @@ -2709,7 +2709,7 @@ pad_removed_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group) gulong notify_tags_handler; notify_tags_handler = - (gulong) g_object_get_data (G_OBJECT (peer), + (guintptr) g_object_get_data (G_OBJECT (peer), "playbin2.notify_tags_handler"); if (notify_tags_handler != 0) g_signal_handler_disconnect (G_OBJECT (peer), notify_tags_handler); From ceea972b42dadada2b105131f79866050faf7110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimo=20J=C3=A4rvi?= Date: Wed, 28 Sep 2011 01:56:42 +0300 Subject: [PATCH 8/8] videotestsrc: Fix compiler warning on 64 bit mingw-w64 Fixes bug #660304. --- gst/videotestsrc/videotestsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c index ecc83f88b4..8f7ddaff21 100644 --- a/gst/videotestsrc/videotestsrc.c +++ b/gst/videotestsrc/videotestsrc.c @@ -547,7 +547,7 @@ gst_video_test_src_get_size (GstVideoTestSrc * v, int w, int h) fourcc->paint_setup (p, NULL); - return (unsigned long) p->endptr; + return (guintptr) p->endptr; } #define SCALEBITS 10