summaryrefslogtreecommitdiff
path: root/meta-openvuplus/recipes-multimedia
diff options
context:
space:
mode:
authorhschang <chang@dev3>2013-07-18 08:41:37 (GMT)
committerhschang <chang@dev3>2013-07-19 02:20:20 (GMT)
commitc9ea876f9437939944e8ccc6a45dba5b89478646 (patch)
treed96ca15a39cfb0bf04bd7dbba52fb54cc36316a1 /meta-openvuplus/recipes-multimedia
parent1b0ae08c0e43678c8a368faaed3d85ea7b27de84 (diff)
gst-plugins-bad : update SRCREV & patchs.
Diffstat (limited to 'meta-openvuplus/recipes-multimedia')
-rw-r--r--meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0005-hlsdemux-locking-fixes.patch110
-rw-r--r--meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0006-hlsdemux-backport.patch199
-rw-r--r--meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0007-revert-rtmp-change.patch53
-rw-r--r--meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad_0.10.23.1.bb7
4 files changed, 367 insertions, 2 deletions
diff --git a/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0005-hlsdemux-locking-fixes.patch b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0005-hlsdemux-locking-fixes.patch
new file mode 100644
index 0000000..38ec90c
--- /dev/null
+++ b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0005-hlsdemux-locking-fixes.patch
@@ -0,0 +1,110 @@
+--- a/gst/hls/gsthlsdemux.c
++++ b/gst/hls/gsthlsdemux.c
+@@ -1116,6 +1116,8 @@ gst_hls_demux_change_playlist (GstHLSDemux * demux, guint max_bitrate)
+ GList *previous_variant, *current_variant;
+ gint old_bandwidth, new_bandwidth;
+
++ GST_M3U8_CLIENT_LOCK (demux->client);
++
+ /* If user specifies a connection speed never use a playlist with a bandwidth
+ * superior than it */
+ if (demux->connection_speed != 0 && max_bitrate > demux->connection_speed)
+@@ -1131,11 +1133,11 @@ retry_failover_protection:
+
+ /* Don't do anything else if the playlist is the same */
+ if (new_bandwidth == old_bandwidth) {
++ GST_M3U8_CLIENT_UNLOCK (demux->client);
+ return TRUE;
+ }
+
+ demux->client->main->current_variant = current_variant;
+- GST_M3U8_CLIENT_UNLOCK (demux->client);
+
+ gst_m3u8_client_set_current (demux->client, current_variant->data);
+
+@@ -1152,9 +1154,9 @@ retry_failover_protection:
+ gst_message_new_element (GST_OBJECT_CAST (demux), s));
+ } else {
+ GList *failover = NULL;
++ gboolean ret;
+
+ GST_INFO_OBJECT (demux, "Unable to update playlist. Switching back");
+- GST_M3U8_CLIENT_LOCK (demux->client);
+
+ failover = g_list_previous (current_variant);
+ if (failover && new_bandwidth == GST_M3U8 (failover->data)->bandwidth) {
+@@ -1163,19 +1165,26 @@ retry_failover_protection:
+ }
+
+ demux->client->main->current_variant = previous_variant;
+- GST_M3U8_CLIENT_UNLOCK (demux->client);
++
+ gst_m3u8_client_set_current (demux->client, previous_variant->data);
+ /* Try a lower bitrate (or stop if we just tried the lowest) */
+ if (new_bandwidth ==
+ GST_M3U8 (g_list_first (demux->client->main->lists)->data)->bandwidth)
+- return FALSE;
++
++ ret = FALSE;
+ else
+- return gst_hls_demux_change_playlist (demux, new_bandwidth - 1);
++ ret = gst_hls_demux_change_playlist (demux, new_bandwidth - 1);
++
++ GST_M3U8_CLIENT_UNLOCK (demux->client);
++
++ return ret;
+ }
+
+ /* Force typefinding since we might have changed media type */
+ demux->do_typefind = TRUE;
+
++ GST_M3U8_CLIENT_UNLOCK (demux->client);
++
+ return TRUE;
+ }
+
+--- a/gst/hls/m3u8.c
++++ b/gst/hls/m3u8.c
+@@ -423,7 +423,8 @@ gst_m3u8_client_new (const gchar * uri)
+ client->current = NULL;
+ client->sequence = -1;
+ client->update_failed_count = 0;
+- client->lock = g_mutex_new ();
++ client->lock = g_new0 (GStaticRecMutex, 1);
++ g_static_rec_mutex_init(client->lock);
+ gst_m3u8_set_uri (client->main, g_strdup (uri));
+
+ return client;
+@@ -435,7 +436,9 @@ gst_m3u8_client_free (GstM3U8Client * self)
+ g_return_if_fail (self != NULL);
+
+ gst_m3u8_free (self->main);
+- g_mutex_free (self->lock);
++ g_static_rec_mutex_free (self->lock);
++ g_free (self->lock);
++
+ g_free (self);
+ }
+
+--- a/gst/hls/m3u8.h
++++ b/gst/hls/m3u8.h
+@@ -32,8 +32,8 @@ typedef struct _GstM3U8Client GstM3U8Client;
+ #define GST_M3U8(m) ((GstM3U8*)m)
+ #define GST_M3U8_MEDIA_FILE(f) ((GstM3U8MediaFile*)f)
+
+-#define GST_M3U8_CLIENT_LOCK(c) g_mutex_lock (c->lock);
+-#define GST_M3U8_CLIENT_UNLOCK(c) g_mutex_unlock (c->lock);
++#define GST_M3U8_CLIENT_LOCK(c) g_static_rec_mutex_lock (c->lock);
++#define GST_M3U8_CLIENT_UNLOCK(c) g_static_rec_mutex_unlock (c->lock);
+
+ struct _GstM3U8
+ {
+@@ -73,7 +73,7 @@ struct _GstM3U8Client
+ GstM3U8 *current;
+ guint update_failed_count;
+ gint sequence; /* the next sequence for this client */
+- GMutex *lock;
++ GStaticRecMutex *lock;
+ };
+
+
diff --git a/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0006-hlsdemux-backport.patch b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0006-hlsdemux-backport.patch
new file mode 100644
index 0000000..450ac03
--- /dev/null
+++ b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0006-hlsdemux-backport.patch
@@ -0,0 +1,199 @@
+diff --git a/gst/hls/gsthlsdemux.c b/gst/hls/gsthlsdemux.c
+index 3308a29..09acee1 100644
+--- a/gst/hls/gsthlsdemux.c
++++ b/gst/hls/gsthlsdemux.c
+@@ -315,14 +315,6 @@ gst_hls_demux_change_state (GstElement * element, GstStateChange transition)
+ case GST_STATE_CHANGE_READY_TO_PAUSED:
+ gst_hls_demux_reset (demux, FALSE);
+ break;
+- case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+- /* Start the streaming loop in paused only if we already received
+- the main playlist. It might have been stopped if we were in PAUSED
+- state and we filled our queue with enough cached fragments
+- */
+- if (gst_m3u8_client_get_uri (demux->client)[0] != '\0')
+- gst_task_start (demux->updates_task);
+- break;
+ default:
+ break;
+ }
+@@ -330,17 +322,6 @@ gst_hls_demux_change_state (GstElement * element, GstStateChange transition)
+ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+ switch (transition) {
+- case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
+- demux->cancelled = TRUE;
+- gst_uri_downloader_cancel (demux->downloader);
+- gst_task_stop (demux->updates_task);
+- g_mutex_lock (demux->updates_timed_lock);
+- GST_TASK_SIGNAL (demux->updates_task);
+- g_mutex_unlock (demux->updates_timed_lock);
+- g_static_rec_mutex_lock (&demux->updates_lock);
+- g_static_rec_mutex_unlock (&demux->updates_lock);
+- demux->cancelled = FALSE;
+- break;
+ case GST_STATE_CHANGE_PAUSED_TO_READY:
+ demux->cancelled = TRUE;
+ gst_hls_demux_stop (demux);
+@@ -718,14 +699,14 @@ gst_hls_demux_stream_loop (GstHLSDemux * demux)
+ * cache the first fragments and then it waits until it has more data in the
+ * queue. This task is woken up when we push a new fragment to the queue or
+ * when we reached the end of the playlist */
++ GST_DEBUG_OBJECT (demux, "Enter task");
+
+ if (G_UNLIKELY (demux->need_cache)) {
+ if (!gst_hls_demux_cache_fragments (demux))
+ goto cache_error;
+
+ /* we can start now the updates thread (only if on playing) */
+- if (GST_STATE (demux) == GST_STATE_PLAYING)
+- gst_task_start (demux->updates_task);
++ gst_task_start (demux->updates_task);
+ GST_INFO_OBJECT (demux, "First fragments cached successfully");
+ }
+
+@@ -765,10 +746,14 @@ gst_hls_demux_stream_loop (GstHLSDemux * demux)
+ demux->position_shift = 0;
+ }
+
++ GST_DEBUG_OBJECT (demux, "Pushing buffer %p", buf);
++
+ ret = gst_pad_push_list (demux->srcpad, buffer_list);
+ if (ret != GST_FLOW_OK)
+ goto error_pushing;
+
++ GST_DEBUG_OBJECT (demux, "Pushed buffer");
++
+ return;
+
+ end_of_playlist:
+@@ -806,6 +791,7 @@ error_pushing:
+
+ pause_task:
+ {
++ GST_DEBUG_OBJECT (demux, "Pause task");
+ gst_task_pause (demux->stream_task);
+ return;
+ }
+@@ -877,10 +863,13 @@ gst_hls_demux_updates_loop (GstHLSDemux * demux)
+ gst_hls_demux_schedule (demux);
+
+ /* block until the next scheduled update or the signal to quit this thread */
++ GST_DEBUG_OBJECT (demux, "Waiting");
+ if (g_cond_timed_wait (GST_TASK_GET_COND (demux->updates_task),
+ demux->updates_timed_lock, &demux->next_update)) {
++ GST_DEBUG_OBJECT (demux, "Unlocked");
+ goto quit;
+ }
++ GST_DEBUG_OBJECT (demux, "Continue");
+
+ if (demux->cancelled)
+ goto quit;
+@@ -918,6 +907,7 @@ gst_hls_demux_updates_loop (GstHLSDemux * demux)
+
+ /* fetch the next fragment */
+ if (g_queue_is_empty (demux->queue)) {
++ GST_DEBUG_OBJECT (demux, "queue empty, get next fragment");
+ if (!gst_hls_demux_get_next_fragment (demux, FALSE)) {
+ if (demux->cancelled) {
+ goto quit;
+@@ -1289,6 +1279,7 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux, gboolean caching)
+ GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
+ }
+
++ GST_DEBUG_OBJECT (demux, "Pushing fragment in queue");
+ g_queue_push_tail (demux->queue, download);
+ gst_buffer_list_unref (buffer_list);
+ if (!caching) {
+diff --git a/gst/hls/m3u8.c b/gst/hls/m3u8.c
+index 65afa8b..b6c04a8 100644
+--- a/gst/hls/m3u8.c
++++ b/gst/hls/m3u8.c
+@@ -37,6 +37,7 @@ static gboolean gst_m3u8_update (GstM3U8 * m3u8, gchar * data,
+ static GstM3U8MediaFile *gst_m3u8_media_file_new (gchar * uri,
+ gchar * title, GstClockTime duration, guint sequence);
+ static void gst_m3u8_media_file_free (GstM3U8MediaFile * self);
++gchar *uri_join (const gchar * uri, const gchar * path);
+
+ static GstM3U8 *
+ gst_m3u8_new (void)
+@@ -270,24 +271,9 @@ gst_m3u8_update (GstM3U8 * self, gchar * data, gboolean * updated)
+ goto next_line;
+ }
+
+- if (!gst_uri_is_valid (data)) {
+- gchar *slash;
+- if (!self->uri) {
+- GST_WARNING ("uri not set, can't build a valid uri");
+- goto next_line;
+- }
+- slash = g_utf8_strrchr (self->uri, -1, '/');
+- if (!slash) {
+- GST_WARNING ("Can't build a valid uri");
+- goto next_line;
+- }
+-
+- *slash = '\0';
+- data = g_strdup_printf ("%s/%s", self->uri, data);
+- *slash = '/';
+- } else {
+- data = g_strdup (data);
+- }
++ data = uri_join (self->uri, data);
++ if (data == NULL)
++ goto next_line;
+
+ r = g_utf8_strchr (data, -1, '\r');
+ if (r)
+@@ -674,3 +660,51 @@ gst_m3u8_client_get_playlist_for_bitrate (GstM3U8Client * client, guint bitrate)
+
+ return current_variant;
+ }
++
++gchar *
++uri_join (const gchar * uri1, const gchar * uri2)
++{
++ gchar *uri_copy, *tmp, *ret = NULL;
++
++ if (gst_uri_is_valid (uri2))
++ return g_strdup (uri2);
++
++ uri_copy = g_strdup (uri1);
++ if (uri2[0] != '/') {
++ /* uri2 is a relative uri2 */
++ tmp = g_utf8_strrchr (uri_copy, -1, '/');
++ if (!tmp) {
++ GST_WARNING ("Can't build a valid uri_copy");
++ goto out;
++ }
++
++ *tmp = '\0';
++ ret = g_strdup_printf ("%s/%s", uri_copy, uri2);
++ } else {
++ /* uri2 is an absolute uri2 */
++ char *scheme, *hostname;
++
++ scheme = uri_copy;
++ /* find the : in <scheme>:// */
++ tmp = g_utf8_strchr (uri_copy, -1, ':');
++ if (!tmp) {
++ GST_WARNING ("Can't build a valid uri_copy");
++ goto out;
++ }
++
++ *tmp = '\0';
++
++ /* skip :// */
++ hostname = tmp + 3;
++
++ tmp = g_utf8_strchr (hostname, -1, '/');
++ if (tmp)
++ *tmp = '\0';
++
++ ret = g_strdup_printf ("%s://%s%s", scheme, hostname, uri2);
++ }
++
++out:
++ g_free (uri_copy);
++ return ret;
++}
diff --git a/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0007-revert-rtmp-change.patch b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0007-revert-rtmp-change.patch
new file mode 100644
index 0000000..0cc2299
--- /dev/null
+++ b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad-0.10.23/0007-revert-rtmp-change.patch
@@ -0,0 +1,53 @@
+diff -Naur org/ext/rtmp/gstrtmpsrc.c git/ext/rtmp/gstrtmpsrc.c
+--- org/ext/rtmp/gstrtmpsrc.c 2013-07-16 17:17:38.000000000 +0200
++++ git/ext/rtmp/gstrtmpsrc.c 2013-07-16 17:20:56.154789765 +0200
+@@ -57,8 +57,6 @@
+ #include <winsock2.h>
+ #endif
+
+-#include <sys/socket.h>
+-
+ GST_DEBUG_CATEGORY_STATIC (rtmpsrc_debug);
+ #define GST_CAT_DEFAULT rtmpsrc_debug
+
+@@ -84,7 +82,6 @@
+ GValue * value, GParamSpec * pspec);
+ static void gst_rtmp_src_finalize (GObject * object);
+
+-static gboolean gst_rtmp_src_unlock (GstBaseSrc * src);
+ static gboolean gst_rtmp_src_stop (GstBaseSrc * src);
+ static gboolean gst_rtmp_src_start (GstBaseSrc * src);
+ static gboolean gst_rtmp_src_is_seekable (GstBaseSrc * src);
+@@ -148,7 +145,6 @@
+
+ gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_rtmp_src_start);
+ gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_rtmp_src_stop);
+- gstbasesrc_class->unlock = GST_DEBUG_FUNCPTR (gst_rtmp_src_unlock);
+ gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_rtmp_src_is_seekable);
+ gstbasesrc_class->prepare_seek_segment =
+ GST_DEBUG_FUNCPTR (gst_rtmp_src_prepare_seek_segment);
+@@ -584,24 +580,6 @@
+ #undef STR2AVAL
+
+ static gboolean
+-gst_rtmp_src_unlock (GstBaseSrc * basesrc)
+-{
+- GstRTMPSrc *rtmpsrc = GST_RTMP_SRC (basesrc);
+-
+- GST_DEBUG_OBJECT (rtmpsrc, "unlock");
+-
+- /* This cancels the recv() underlying RTMP_Read, but will cause a
+- * SIGPIPE. Hopefully the app is ignoring it, or you've patched
+- * librtmp. */
+- if (rtmpsrc->rtmp && rtmpsrc->rtmp->m_sb.sb_socket > 0) {
+- shutdown (rtmpsrc->rtmp->m_sb.sb_socket, SHUT_RDWR);
+- }
+-
+- return TRUE;
+-}
+-
+-
+-static gboolean
+ gst_rtmp_src_stop (GstBaseSrc * basesrc)
+ {
+ GstRTMPSrc *src;
diff --git a/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad_0.10.23.1.bb b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad_0.10.23.1.bb
index 68ef05f..9e70977 100644
--- a/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad_0.10.23.1.bb
+++ b/meta-openvuplus/recipes-multimedia/gstreamer/gst-plugins-bad_0.10.23.1.bb
@@ -10,10 +10,10 @@ DEPENDS += "libmusicbrainz tremor curl libmms librtmp"
DEPENDS += "gst-plugins-base"
CONFLICTS = "librsvg"
-PR = "r2"
+PR = "r3"
GIT_PV = ""
-SRCREV = "fb0d8700e71c4a6569ba023d16201087aec119fd"
+SRCREV = "cef47d85294a0dca38631f938b81a3f0dd6891bd"
EXTRA_OECONF += "--disable-examples --disable-experimental --disable-sdl --disable-cdaudio --disable-directfb \
--disable-vdpau --disable-apexsink --enable-orc --disable-mpeg2enc --disable-mplex --disable-rsvg --disable-uvch264"
@@ -25,6 +25,9 @@ SRC_URI = "git://anongit.freedesktop.org/gstreamer/${PN}"
SRC_URI += " \
file://0003-mpegpsdemux_speedup.diff.patch \
file://0004-mpegdemux-compile-fixes.patch \
+ file://0005-hlsdemux-locking-fixes.patch \
+ file://0006-hlsdemux-backport.patch \
+ file://0007-revert-rtmp-change.patch \
file://orc.m4-fix-location-of-orcc-when-cross-compiling.patch \
"