Yocto 2.4

Move OpenBMC to Yocto 2.4(rocko)

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-Disable-visualizations.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-Disable-visualizations.patch
deleted file mode 100644
index ea88120..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/0001-gtk-play-Disable-visualizations.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 6cf42c468e93b0aaa171961e059bc3e2fb915889 Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Fri, 28 Apr 2017 14:35:19 +0300
-Subject: [PATCH] gtk-play: Disable visualizations
-
-This is a workaround for [YOCTO #11410] (audio playback is broken in
-mediaplayer if vaapi is used). It disables visualizations and makes
-sure we clear the window (otherwise nothing does that and result is
-very ugly).
-
-This patch should be removed when 11410 is fixed.
-
-Upstream-Status: Inappropriate [bug workaround]
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- gtk/gtk-play.c | 13 ++++++++++++-
- 1 file changed, 12 insertions(+), 1 deletion(-)
-
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index 8ae0fea..63b9bb0 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -1401,6 +1401,15 @@ get_child_position (GtkOverlay * overlay, GtkWidget * widget,
-   return TRUE;
- }
- 
-+/* Hack to make sure something gets drawn if visualizations are disabled */
-+static gboolean
-+draw_cb (GtkWidget *widget, cairo_t *cr, gpointer data)
-+{
-+  cairo_set_source_rgb (cr, 0, 0, 0);
-+  cairo_paint (cr);
-+  return FALSE;
-+}
-+
- static void
- create_ui (GtkPlay * play)
- {
-@@ -1431,6 +1440,8 @@ create_ui (GtkPlay * play)
-     play->video_area = gtk_drawing_area_new ();
-     g_signal_connect (play->video_area, "realize",
-         G_CALLBACK (video_area_realize_cb), play);
-+    g_signal_connect (play->video_area, "draw",
-+        G_CALLBACK (draw_cb), NULL);
-   }
-   gtk_widget_set_events (play->video_area, GDK_EXPOSURE_MASK
-       | GDK_LEAVE_NOTIFY_MASK
-@@ -1753,7 +1764,7 @@ gtk_play_constructor (GType type, guint n_construct_params,
- 
-   /* enable visualization (by default playbin uses goom) */
-   /* if visualization is enabled then use the first element */
--  gst_player_set_visualization_enabled (self->player, TRUE);
-+  gst_player_set_visualization_enabled (self->player, FALSE);
- 
-   g_signal_connect (G_OBJECT (self), "show", G_CALLBACK (show_cb), NULL);
- 
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch
deleted file mode 100644
index 712d46d..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch
+++ /dev/null
@@ -1,252 +0,0 @@
-From d64c7edb66f4a64ff49c4306cf77fd269b7079ab Mon Sep 17 00:00:00 2001
-From: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Date: Mon, 16 Mar 2015 13:45:30 +0200
-Subject: [PATCH] Add error signal emission for missing plugins
-
-Add a missing plugins error signal to gst-player. Note that this error
-does not necessarily mean the playback has completely failed, but in
-practice the user experience will be bad (think, e.g. of a mp4 file
-where H.264 codec is missing: AAC playback still works...).
-
-Use the signal in gtk-play to show a infobar if plugins are missing.
-
-Submitted upstream at https://github.com/sdroege/gst-player/pull/11
-
-Upstream-Status: Submitted
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
----
- configure.ac               |  2 +-
- gtk/gtk-play.c             | 54 +++++++++++++++++++++++++++++++++++++++++++++-
- lib/gst/player/gstplayer.c | 22 +++++++++++++++++++
- lib/gst/player/gstplayer.h |  3 ++-
- 4 files changed, 78 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 90ab74c..6cdb4eb 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -53,7 +53,7 @@ AC_SUBST(LT_AGE)
- PKG_PROG_PKG_CONFIG
- 
- PKG_CHECK_MODULES(GLIB, [glib-2.0 gobject-2.0])
--PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4])
-+PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4 gstreamer-pbutils-1.0])
- 
- GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
- AC_SUBST(GLIB_PREFIX)
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index b92773b..e2b605a 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -30,6 +30,8 @@ typedef struct
-   GtkWidget *prev_button, *next_button;
-   GtkWidget *seekbar;
-   GtkWidget *video_area;
-+  GtkWidget *info_label;
-+  GtkWidget *info_bar;
-   GtkWidget *volume_button;
-   gulong seekbar_value_changed_signal_id;
-   gboolean playing;
-@@ -141,6 +143,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
- }
- 
- static void
-+clear_missing_plugins (GtkPlay * play)
-+{
-+  gtk_label_set_text (GTK_LABEL (play->info_label), "");
-+  gtk_widget_hide (play->info_bar);
-+}
-+
-+static void
- skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
- {
-   GList *prev;
-@@ -155,6 +164,7 @@ skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
- 
-   gtk_widget_set_sensitive (play->next_button, TRUE);
-   gst_player_set_uri (play->player, prev->data);
-+  clear_missing_plugins (play);
-   gst_player_play (play->player);
-   set_title (play, prev->data);
-   gtk_widget_set_sensitive (play->prev_button, g_list_previous (prev) != NULL);
-@@ -175,6 +185,7 @@ skip_next_clicked_cb (GtkButton * button, GtkPlay * play)
- 
-   gtk_widget_set_sensitive (play->prev_button, TRUE);
-   gst_player_set_uri (play->player, next->data);
-+  clear_missing_plugins (play);
-   gst_player_play (play->player);
-   set_title (play, next->data);
-   gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
-@@ -193,10 +204,16 @@ volume_changed_cb (GtkScaleButton * button, gdouble value, GtkPlay * play)
-   gst_player_set_volume (play->player, value);
- }
- 
-+void
-+info_bar_response_cb (GtkInfoBar * bar, gint response, GtkPlay * play)
-+{
-+  gtk_widget_hide (GTK_WIDGET (bar));
-+}
-+
- static void
- create_ui (GtkPlay * play)
- {
--  GtkWidget *controls, *main_hbox, *main_vbox;
-+  GtkWidget *controls, *main_hbox, *main_vbox, *info_bar, *content_area;
- 
-   play->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-   g_signal_connect (G_OBJECT (play->window), "delete-event",
-@@ -208,6 +225,20 @@ create_ui (GtkPlay * play)
-   g_signal_connect (play->video_area, "realize",
-       G_CALLBACK (video_area_realize_cb), play);
- 
-+  play->info_bar = gtk_info_bar_new ();
-+  gtk_info_bar_set_message_type (GTK_INFO_BAR (play->info_bar),
-+      GTK_MESSAGE_WARNING);
-+  //gtk_info_bar_set_show_close_button (GTK_INFO_BAR (play->info_bar),
-+  //    TRUE);
-+  gtk_widget_set_no_show_all (play->info_bar, TRUE);
-+  g_signal_connect (play->info_bar, "response",
-+      G_CALLBACK (info_bar_response_cb), play);
-+
-+  content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (play->info_bar));
-+  play->info_label = gtk_label_new ("");
-+  gtk_container_add (GTK_CONTAINER (content_area), play->info_label);
-+  gtk_widget_show (play->info_label);
-+
-   /* Unified play/pause button */
-   play->play_pause_button =
-       gtk_button_new_from_icon_name ("media-playback-pause",
-@@ -258,6 +289,7 @@ create_ui (GtkPlay * play)
- 
-   main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
-   gtk_box_pack_start (GTK_BOX (main_vbox), main_hbox, TRUE, TRUE, 0);
-+  gtk_box_pack_start (GTK_BOX (main_vbox), play->info_bar, FALSE, FALSE, 0);
-   gtk_box_pack_start (GTK_BOX (main_vbox), controls, FALSE, FALSE, 0);
-   gtk_container_add (GTK_CONTAINER (play->window), main_vbox);
- 
-@@ -322,6 +354,7 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
-       gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
- 
-       gst_player_set_uri (play->player, next->data);
-+      clear_missing_plugins (play);
-       gst_player_play (play->player);
-       set_title (play, next->data);
-     } else {
-@@ -330,6 +363,24 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
-   }
- }
- 
-+static void
-+error_cb (GstPlayer * player, GError * err, GtkPlay * play)
-+{
-+  char *message;
-+
-+  if (g_error_matches (err, gst_player_error_quark (),
-+      GST_PLAYER_ERROR_MISSING_PLUGIN)) {
-+    // add message to end of any existing message: there may be
-+    // multiple missing plugins.
-+    message = g_strdup_printf ("%s%s. ",
-+        gtk_label_get_text (GTK_LABEL (play->info_label)), err->message);
-+    gtk_label_set_text (GTK_LABEL (play->info_label), message);
-+    g_free (message);
-+
-+    gtk_widget_show (play->info_bar);
-+  }
-+}
-+
- int
- main (gint argc, gchar ** argv)
- {
-@@ -422,6 +473,7 @@ main (gint argc, gchar ** argv)
-   g_signal_connect (play.player, "video-dimensions-changed",
-       G_CALLBACK (video_dimensions_changed_cb), &play);
-   g_signal_connect (play.player, "end-of-stream", G_CALLBACK (eos_cb), &play);
-+  g_signal_connect (play.player, "error", G_CALLBACK (error_cb), &play);
- 
-   /* We have file(s) that need playing. */
-   set_title (&play, g_list_first (play.uris)->data);
-diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
-index bd682d9..78e7ba1 100644
---- a/lib/gst/player/gstplayer.c
-+++ b/lib/gst/player/gstplayer.c
-@@ -47,6 +47,7 @@
- 
- #include <gst/gst.h>
- #include <gst/video/video.h>
-+#include <gst/pbutils/missing-plugins.h>
- 
- GST_DEBUG_CATEGORY_STATIC (gst_player_debug);
- #define GST_CAT_DEFAULT gst_player_debug
-@@ -238,6 +239,7 @@ gst_player_class_init (GstPlayerClass * klass)
-       g_signal_new ("video-dimensions-changed", G_TYPE_FROM_CLASS (klass),
-       G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL,
-       NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-+
- }
- 
- static void
-@@ -619,6 +621,21 @@ error_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
-   g_mutex_unlock (&self->priv->lock);
- }
- 
-+static void
-+element_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
-+{
-+  GstPlayer *self = GST_PLAYER (user_data);
-+
-+  if (gst_is_missing_plugin_message (msg)) {
-+    gchar *desc;
-+
-+    desc = gst_missing_plugin_message_get_description (msg);
-+    emit_error (self, g_error_new (GST_PLAYER_ERROR,
-+        GST_PLAYER_ERROR_MISSING_PLUGIN, "Missing plugin '%s'", desc));
-+    g_free (desc);
-+  }
-+}
-+
- static gboolean
- eos_dispatch (gpointer user_data)
- {
-@@ -1059,6 +1076,8 @@ gst_player_main (gpointer data)
-       NULL, NULL);
-   g_source_attach (bus_source, self->priv->context);
- 
-+  g_signal_connect (G_OBJECT (bus), "message::element",
-+      G_CALLBACK (element_cb), self);
-   g_signal_connect (G_OBJECT (bus), "message::error", G_CALLBACK (error_cb),
-       self);
-   g_signal_connect (G_OBJECT (bus), "message::eos", G_CALLBACK (eos_cb), self);
-@@ -1560,6 +1579,7 @@ gst_player_error_get_type (void)
-   static gsize id = 0;
-   static const GEnumValue values[] = {
-     {C_ENUM (GST_PLAYER_ERROR_FAILED), "GST_PLAYER_ERROR_FAILED", "failed"},
-+    {C_ENUM (GST_PLAYER_ERROR_MISSING_PLUGIN), "GST_PLAYER_ERROR_MISSING_PLUGIN", "missing-plugin"},
-     {0, NULL, NULL}
-   };
- 
-@@ -1577,6 +1597,8 @@ gst_player_error_get_name (GstPlayerError error)
-   switch (error) {
-     case GST_PLAYER_ERROR_FAILED:
-       return "failed";
-+    case GST_PLAYER_ERROR_MISSING_PLUGIN:
-+      return "missing-plugin";
-   }
- 
-   g_assert_not_reached ();
-diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
-index c438513..35fb5bb 100644
---- a/lib/gst/player/gstplayer.h
-+++ b/lib/gst/player/gstplayer.h
-@@ -44,7 +44,8 @@ GType        gst_player_error_get_type                (void);
- #define      GST_TYPE_PLAYER_ERROR                    (gst_player_error_get_type ())
- 
- typedef enum {
--  GST_PLAYER_ERROR_FAILED = 0
-+  GST_PLAYER_ERROR_FAILED = 0,
-+  GST_PLAYER_ERROR_MISSING_PLUGIN
- } GstPlayerError;
- 
- const gchar *gst_player_error_get_name                (GstPlayerError error);
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch
deleted file mode 100644
index 783c42a..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-Fix pause/play
-
-The current player state is now notified via the state-changed signal,
-and in the GTK UI it was only used to keep track of the desired state.
-
-This is a backport of upstream commit 738479c7a0.
-
-Upstream-Status: Backport
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-
----
- gtk/gtk-play.c             |  8 ++++++--
- lib/gst/player/gstplayer.c | 12 ------------
- lib/gst/player/gstplayer.h |  2 --
- 3 files changed, 6 insertions(+), 16 deletions(-)
-
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index 6e7a098..e2b605a 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -34,6 +34,7 @@ typedef struct
-   GtkWidget *info_bar;
-   GtkWidget *volume_button;
-   gulong seekbar_value_changed_signal_id;
-+  gboolean playing;
- } GtkPlay;
- 
- /* Compat stubs */
-@@ -118,12 +119,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
- {
-   GtkWidget *image;
- 
--  if (gst_player_is_playing (play->player)) {
-+  if (play->playing) {
-     gst_player_pause (play->player);
-     image =
-         gtk_image_new_from_icon_name ("media-playback-start",
-         GTK_ICON_SIZE_BUTTON);
-     gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
-+    play->playing = FALSE;
-   } else {
-     gchar *title;
- 
-@@ -136,6 +138,7 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
-     title = gst_player_get_uri (play->player);
-     set_title (play, title);
-     g_free (title);
-+    play->playing = TRUE;
-   }
- }
- 
-@@ -335,7 +338,7 @@ video_dimensions_changed_cb (GstPlayer * unused, gint width, gint height,
- static void
- eos_cb (GstPlayer * unused, GtkPlay * play)
- {
--  if (gst_player_is_playing (play->player)) {
-+  if (play->playing) {
-     GList *next = NULL;
-     gchar *uri;
- 
-@@ -452,6 +455,7 @@ main (gint argc, gchar ** argv)
-   }
- 
-   play.player = gst_player_new ();
-+  play.playing = TRUE;
- 
-   g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL);
- 
-diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
-index 069b284..78e7ba1 100644
---- a/lib/gst/player/gstplayer.c
-+++ b/lib/gst/player/gstplayer.c
-@@ -1422,18 +1422,6 @@ gst_player_set_uri (GstPlayer * self, const gchar * val)
-   g_object_set (self, "uri", val, NULL);
- }
- 
--gboolean
--gst_player_is_playing (GstPlayer * self)
--{
--  gboolean val;
--
--  g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
--
--  g_object_get (self, "is-playing", &val, NULL);
--
--  return val;
--}
--
- GstClockTime
- gst_player_get_position (GstPlayer * self)
- {
-diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
-index 6933dd7..35fb5bb 100644
---- a/lib/gst/player/gstplayer.h
-+++ b/lib/gst/player/gstplayer.h
-@@ -93,8 +93,6 @@ gchar *      gst_player_get_uri                       (GstPlayer    * player);
- void         gst_player_set_uri                       (GstPlayer    * player,
-                                                        const gchar  * uri);
- 
--gboolean     gst_player_is_playing                    (GstPlayer    * player);
--
- GstClockTime gst_player_get_position                  (GstPlayer    * player);
- GstClockTime gst_player_get_duration                  (GstPlayer    * player);
- 
--- 
-2.1.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch
deleted file mode 100644
index 7bf1b03..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-Upstream-Status: Submitted
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From 43d4b19ab611d844156e26c4840cc54ddb73ae03 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Thu, 26 Feb 2015 17:17:05 +0000
-Subject: [PATCH] gtk-play: show a file chooser if no URIs were passed
-
----
- gtk/gtk-play.c |   28 ++++++++++++++++++++++++++--
- 1 file changed, 26 insertions(+), 2 deletions(-)
-
-diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
-index f015077..9766a72 100644
---- a/gtk/gtk-play.c
-+++ b/gtk/gtk-play.c
-@@ -319,8 +319,32 @@ main (gint argc, gchar ** argv)
-   // FIXME: Add support for playlists and stuff
-   /* Parse the list of the file names we have to play. */
-   if (!file_names) {
--    g_print ("Usage: %s FILE(s)|URI(s)\n", APP_NAME);
--    return 1;
-+    GtkWidget *chooser;
-+    int res;
-+
-+    chooser = gtk_file_chooser_dialog_new ("Select files to play", NULL,
-+                                          GTK_FILE_CHOOSER_ACTION_OPEN,
-+                                          "_Cancel", GTK_RESPONSE_CANCEL,
-+                                          "_Open", GTK_RESPONSE_ACCEPT,
-+                                          NULL);
-+    g_object_set (chooser,
-+                  "local-only", FALSE,
-+                  "select-multiple", TRUE,
-+                  NULL);
-+
-+    res = gtk_dialog_run (GTK_DIALOG (chooser));
-+    if (res == GTK_RESPONSE_ACCEPT) {
-+      GSList *l;
-+
-+      l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
-+      while (l) {
-+        play.uris = g_list_append (play.uris, l->data);
-+        l = g_slist_delete_link (l, l);
-+      }
-+    } else {
-+      return 0;
-+    }
-+    gtk_widget_destroy (chooser);
-   } else {
-     guint i;
- 
--- 
-1.7.10.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
index cb12a46..4fe8fde 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
@@ -5,14 +5,11 @@
 DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gtk+3 glib-2.0-native"
 
 SRC_URI = "git://github.com/sdroege/gst-player.git \
-           file://filechooser.patch;apply=0 \
-           file://Fix-pause-play.patch;apply=0 \
-           file://Add-error-signal-emission-for-missing-plugins.patch;apply=0 \
-           file://0001-gtk-play-Disable-visualizations.patch \
            file://gst-player.desktop"
 
 SRCREV = "ee3c226c82767a089743e4e06058743e67f73cdb"
 PV = "0.0.1+git${SRCPV}"
+UPSTREAM_VERSION_UNKNOWN = "1"
 
 S = "${WORKDIR}/git"
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch
deleted file mode 100644
index f666adc..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
-Upstream-Status: Backport [commit 59a731be6b in '1.10' branch]
-
-
-From 02a6002c3a80b3a5301c0943b1a1518bbdf439fc Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?=
- <vjaquez@igalia.com>
-Date: Fri, 21 Apr 2017 19:07:18 +0200
-Subject: [PATCH] vaapivideobufferpool: create allocator if needed
-
-Backport to branch 1.10
-
-Sometimes a video decoder could set different buffer pool
-configurations, because their frame size changes. In this case we
-did not reconfigure the allocator.
-
-This patch enables this use case, creating a new allocator inside
-the VAAPI buffer pool if the caps changed, if it is not dmabuf-based.
-If so, it is just reconfigured, since it doesn't have a surface pool.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=781577
----
- gst/vaapi/gstvaapivideobufferpool.c | 21 +++++++++++++++++++++
- 1 file changed, 21 insertions(+)
-
-diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c
-index a3b9223f..9a50614b 100644
---- a/gst/vaapi/gstvaapivideobufferpool.c
-+++ b/gst/vaapi/gstvaapivideobufferpool.c
-@@ -159,6 +159,27 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
-     gst_object_replace ((GstObject **) & priv->allocator, NULL);
-   priv->video_info = new_vip;
- 
-+  {
-+    guint surface_alloc_flags;
-+    gboolean vinfo_changed = FALSE;
-+
-+    if (allocator) {
-+      const GstVideoInfo *alloc_vinfo =
-+          gst_allocator_get_vaapi_video_info (allocator, &surface_alloc_flags);
-+      vinfo_changed = gst_video_info_changed (alloc_vinfo, &new_vip);
-+    }
-+
-+    if (vinfo_changed && allocator && priv->use_dmabuf_memory) {
-+      gst_allocator_set_vaapi_video_info (allocator, &new_vip,
-+          surface_alloc_flags);
-+    } else if (!priv->use_dmabuf_memory && (vinfo_changed || !allocator)) {
-+      /* let's destroy the other allocator and create a new one */
-+      allocator = gst_vaapi_video_allocator_new (priv->display, &new_vip,
-+          surface_alloc_flags);
-+      gst_buffer_pool_config_set_allocator (config, allocator, NULL);
-+    }
-+  }
-+
-   if (!gst_buffer_pool_config_has_option (config,
-           GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META))
-     goto error_no_vaapi_video_meta_option;
--- 
-2.11.0
-
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch
new file mode 100644
index 0000000..b80d073
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch
@@ -0,0 +1,35 @@
+From aac5902d3c9cb35c771e760d0e487622aa2e116a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Apr 2017 10:38:18 -0700
+Subject: [PATCH] configure: check for armv7ve variant
+
+OE passes -mcpu and -march via cmdline and if
+package tries to detect one of it own then it
+should be compatible otherwise, newer gcc7+ will
+error out
+
+Check for relevant preprocessor macro to determine
+armv7ve architecture
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gst-libs/ext/libav/configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gst-libs/ext/libav/configure b/gst-libs/ext/libav/configure
+index 4a5e477..727818e 100755
+--- a/gst-libs/ext/libav/configure
++++ b/gst-libs/ext/libav/configure
+@@ -4295,6 +4295,7 @@ elif enabled arm; then
+         elif check_arm_arch 6Z;       then echo armv6z
+         elif check_arm_arch 6ZK;      then echo armv6zk
+         elif check_arm_arch 6T2;      then echo armv6t2
++        elif check_arm_arch EXT_IDIV; then echo armv7ve
+         elif check_arm_arch 7;        then echo armv7
+         elif check_arm_arch 7A  7_A;  then echo armv7-a
+         elif check_arm_arch 7S;       then echo armv7-a
+-- 
+2.12.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch
new file mode 100644
index 0000000..afbfc84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch
@@ -0,0 +1,33 @@
+From b5226c096a0b7049874858e94a59d43e10ba3fd2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Sep 2017 10:22:56 -0700
+Subject: [PATCH] hevcpred_msa.c: Fix build by Including libavcodec/hevcdec.h
+
+src/libavcodec/mips/hevcpred_msa.c:1913:32: error: unknown type name 'HEVCContext'; did you mean 'HEVCPredContext'?
+ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
+                                ^~~~~~~~~~~
+                                HEVCPredContext
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c b/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c
+index 6a3b281..963c64c 100644
+--- a/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c
++++ b/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c
+@@ -18,7 +18,7 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ 
+-#include "libavcodec/hevc.h"
++#include "libavcodec/hevcdec.h"
+ #include "libavutil/mips/generic_macros_msa.h"
+ #include "hevcpred_mips.h"
+ 
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.4.bb
deleted file mode 100644
index 59d81db..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.10.4.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-require gstreamer1.0-libav.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
-                    file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
-                    file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
-    file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
-    file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
-    file://mips64_cpu_detection.patch \
-"
-SRC_URI[md5sum] = "e2bdd9fde6ca3ff7efffb93df121f4fd"
-SRC_URI[sha256sum] = "6ca0feca75e3d48315e07f20ec37cf6260ed1e9dde58df355febd5016246268b"
-
-S = "${WORKDIR}/gst-libav-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.2.bb
new file mode 100644
index 0000000..3b5bbd1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.2.bb
@@ -0,0 +1,21 @@
+require gstreamer1.0-libav.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
+                    file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
+           file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
+           file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
+           file://mips64_cpu_detection.patch \
+           file://0001-configure-check-for-armv7ve-variant.patch \
+           file://0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch \
+           "
+SRC_URI[md5sum] = "8788aecc032a287227b4bd239d1b998a"
+SRC_URI[sha256sum] = "5bb735b9bb218b652ae4071ea6f6be8eaae55e9d3233aec2f36b882a27542db3"
+
+S = "${WORKDIR}/gst-libav-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
index c542b13..016e176 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
@@ -37,7 +37,7 @@
     gstreamer1.0-plugins-base-videoscale \
     gstreamer1.0-plugins-base-videoconvert \
     gstreamer1.0-plugins-good-autodetect \
-    gstreamer1.0-plugins-good-souphttpsrc"
+    gstreamer1.0-plugins-good-soup"
 
 RRECOMMENDS_gstreamer1.0-meta-x11-base = "\
     gstreamer1.0-plugins-base-ximagesink \
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
index 05562b1..5d92351 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
@@ -29,10 +29,17 @@
         d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH"))
 }
 
+delete_pkg_m4_file() {
+    # Delete m4 files which we provide patched versions of but will be ignored
+    # if these exist
+	rm -f "${S}/common/m4/pkg.m4"
+	rm -f "${S}/common/m4/gtk-doc.m4"
+}
+do_configure[prefuncs] += "delete_pkg_m4_file"
+
 set_omx_core_name() {
 	sed -i -e "s;^core-name=.*;core-name=${GSTREAMER_1_0_OMX_CORE_NAME};" "${D}${sysconfdir}/xdg/gstomx.conf"
 }
-
 do_install[postfuncs] += " set_omx_core_name "
 
 FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.2.bb
similarity index 69%
rename from import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10.4.bb
rename to import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.2.bb
index dfeefa5..a1d4576 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.10.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.2.bb
@@ -5,7 +5,7 @@
 
 SRC_URI = "http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz"
 
-SRC_URI[md5sum] = "cedb230f1c47d0cf4b575d70dff66ff2"
-SRC_URI[sha256sum] = "45072925cf262f0fd528fab78f0de52734e46a5a88aa802fae51c67c09c81aa2"
+SRC_URI[md5sum] = "4a1404a20b72e4ab6e826500218ec308"
+SRC_URI[sha256sum] = "1b22398f45a027e977d2b5309625ec91cdcaf0da8751cbc7f596d639a45ba298"
 
 S = "${WORKDIR}/gst-omx-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
index 0ccfc89..7be15d9 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
@@ -20,7 +20,7 @@
     ${GSTREAMER_ORC} \
     ${PACKAGECONFIG_GL} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \
     bz2 curl dash dtls hls neon rsvg sbc smoothstreaming sndfile uvch264 webp \
 "
@@ -40,9 +40,7 @@
 PACKAGECONFIG[fluidsynth]      = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
 PACKAGECONFIG[gles2]           = "--enable-gles2,--disable-gles2,virtual/libgles2"
 PACKAGECONFIG[gtk]             = "--enable-gtk3,--disable-gtk3,gtk+3"
-# ensure OpenSSL is used for HLS AES description instead of nettle
-# (OpenSSL is a shared dependency with dtls)
-PACKAGECONFIG[hls]             = "--enable-hls --with-hls-crypto=openssl,--disable-hls,openssl"
+PACKAGECONFIG[hls]             = "--enable-hls --with-hls-crypto=nettle,--disable-hls,nettle"
 PACKAGECONFIG[kms]             = "--enable-kms,--disable-kms,libdrm"
 PACKAGECONFIG[libmms]          = "--enable-libmms,--disable-libmms,libmms"
 PACKAGECONFIG[libssh2]         = "--enable-libssh2,--disable-libssh2,libssh2"
@@ -66,19 +64,15 @@
 PACKAGECONFIG[uvch264]         = "--enable-uvch264,--disable-uvch264,libusb1 libgudev"
 PACKAGECONFIG[voaacenc]        = "--enable-voaacenc,--disable-voaacenc,vo-aacenc"
 PACKAGECONFIG[voamrwbenc]      = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc"
-PACKAGECONFIG[wayland]         = "--enable-wayland,--disable-wayland,wayland-native wayland wayland-protocols"
+PACKAGECONFIG[vulkan]          = "--enable-vulkan,--disable-vulkan,vulkan"
+PACKAGECONFIG[wayland]         = "--enable-wayland,--disable-wayland,wayland-native wayland wayland-protocols libdrm"
 PACKAGECONFIG[webp]            = "--enable-webp,--disable-webp,libwebp"
 
-# these plugins have not been ported to 1.0 (yet):
-#   apexsink linsys nas timidity sdl xvid wininet
-#   sndio cdxaparse dccp faceoverlay hdvparse tta mve nuvdemux
-#   patchdetect sdi videomeasure
-
 # these plugins have no corresponding library in OE-core or meta-openembedded:
-#   openni2 winks direct3d directsound winscreencap acm apple_media
+#   openni2 winks direct3d directsound winscreencap acm apple_media iqa
 #   android_media avc bs2b chromaprint daala dts fdkaac gme gsm kate ladspa libde265
-#   lv2 mimic mpeg2enc mplex musepack nvenc ofa openh264 opensles pvr soundtouch spandsp
-#   spc teletextdec tinyalsa vdpau vulkan wasapi x265 zbar
+#   lv2 mpeg2enc mplex msdk musepack nvenc ofa openh264 opensles soundtouch spandsp
+#   spc teletextdec tinyalsa vdpau wasapi x265 zbar webrtcdsp
 
 # qt5 support is disabled, because it is not present in OE core, and requires more work than
 # just adding a packageconfig (it requires access to moc, uic, rcc, and qmake paths).
@@ -94,7 +88,6 @@
     --enable-vcd \
     --disable-acm \
     --disable-android_media \
-    --disable-apexsink \
     --disable-apple_media \
     --disable-avc \
     --disable-bs2b \
@@ -107,43 +100,34 @@
     --disable-fdk_aac \
     --disable-gme \
     --disable-gsm \
+    --disable-iqa \
     --disable-kate \
     --disable-ladspa \
     --disable-libde265 \
-    --disable-libvisual \
-    --disable-linsys \
     --disable-lv2 \
-    --disable-mimic \
     --disable-mpeg2enc \
     --disable-mplex \
+    --disable-msdk \
     --disable-musepack \
-    --disable-nas \
     --disable-nvenc \
     --disable-ofa \
     --disable-openexr \
     --disable-openh264 \
     --disable-openni2 \
     --disable-opensles \
-    --disable-pvr \
     --disable-qt \
-    --disable-sdl \
-    --disable-sdltest \
-    --disable-sndio \
     --disable-soundtouch \
     --disable-spandsp \
     --disable-spc \
     --disable-teletextdec \
-    --disable-timidity \
     --disable-tinyalsa \
     --disable-vdpau \
-    --disable-vulkan \
     --disable-wasapi \
+    --disable-webrtcdsp \
     --disable-wildmidi \
-    --disable-wininet \
     --disable-winks \
     --disable-winscreencap \
     --disable-x265 \
-    --disable-xvid \
     --disable-zbar \
     ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--disable-yadif", "", d)} \
 "
@@ -157,3 +141,7 @@
 FILES_${PN}-freeverb += "${datadir}/gstreamer-${LIBV}/presets/GstFreeverb.prs"
 FILES_${PN}-opencv += "${datadir}/gst-plugins-bad/${LIBV}/opencv*"
 FILES_${PN}-voamrwbenc += "${datadir}/gstreamer-${LIBV}/presets/GstVoAmrwbEnc.prs"
+
+do_compile_prepend() {
+    export GIR_EXTRA_LIBS_PATH="${B}/gst-libs/gst/allocators/.libs"
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
index 43f1ee0..8d99dc6 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
@@ -1,4 +1,4 @@
-From cff6fbf555a072408c21da1e818209c9d3814dd3 Mon Sep 17 00:00:00 2001
+From 7592e793b3906355d76ca9a59f8fea2749ea2a4e Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Tue, 27 Oct 2015 14:36:58 +0200
 Subject: [PATCH] Makefile.am: don't hardcode libtool name when running
@@ -7,17 +7,34 @@
 Upstream-Status: Pending [review on oe-core list]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
 
----
- gst-libs/gst/gl/Makefile.am        | 2 +-
- gst-libs/gst/insertbin/Makefile.am | 2 +-
- gst-libs/gst/mpegts/Makefile.am    | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
+%% original patch: 0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
 
-Index: gst-plugins-bad-1.10.1/gst-libs/gst/gl/Makefile.am
-===================================================================
---- gst-plugins-bad-1.10.1.orig/gst-libs/gst/gl/Makefile.am
-+++ gst-plugins-bad-1.10.1/gst-libs/gst/gl/Makefile.am
-@@ -171,7 +171,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPEC
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ gst-libs/gst/allocators/Makefile.am | 2 +-
+ gst-libs/gst/gl/Makefile.am         | 2 +-
+ gst-libs/gst/insertbin/Makefile.am  | 2 +-
+ gst-libs/gst/mpegts/Makefile.am     | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
+index e50d077..623f092 100644
+--- a/gst-libs/gst/allocators/Makefile.am
++++ b/gst-libs/gst/allocators/Makefile.am
+@@ -37,7 +37,7 @@ GstBadAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstbadalloca
+ 		--add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ 		--library=libgstbadallocators-@GST_API_VERSION@.la \
+ 		--include=Gst-@GST_API_VERSION@ \
+-		--libtool="$(top_builddir)/libtool" \
++		--libtool="$(LIBTOOL)" \
+ 		--pkg gstreamer-@GST_API_VERSION@ \
+ 		--pkg-export gstreamer-badallocators-@GST_API_VERSION@ \
+ 		--output $@ \
+diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
+index 2ae4773..dfa7a7d 100644
+--- a/gst-libs/gst/gl/Makefile.am
++++ b/gst-libs/gst/gl/Makefile.am
+@@ -178,7 +178,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstgl-@GST_API_VERSION@
  		--include=Gst-@GST_API_VERSION@ \
  		--include=GstBase-@GST_API_VERSION@ \
  		--include=GstVideo-@GST_API_VERSION@ \
@@ -26,11 +43,11 @@
  		--pkg gstreamer-@GST_API_VERSION@ \
  		--pkg gstreamer-base-@GST_API_VERSION@ \
  		--pkg gstreamer-video-@GST_API_VERSION@ \
-Index: gst-plugins-bad-1.10.1/gst-libs/gst/insertbin/Makefile.am
-===================================================================
---- gst-plugins-bad-1.10.1.orig/gst-libs/gst/insertbin/Makefile.am
-+++ gst-plugins-bad-1.10.1/gst-libs/gst/insertbin/Makefile.am
-@@ -45,7 +45,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(IN
+diff --git a/gst-libs/gst/insertbin/Makefile.am b/gst-libs/gst/insertbin/Makefile.am
+index 1f8ea30..4b98ef6 100644
+--- a/gst-libs/gst/insertbin/Makefile.am
++++ b/gst-libs/gst/insertbin/Makefile.am
+@@ -45,7 +45,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstinsertbin-@GS
  		--library=libgstinsertbin-@GST_API_VERSION@.la \
  		--include=Gst-@GST_API_VERSION@ \
  		--include=GstBase-@GST_API_VERSION@ \
@@ -39,11 +56,11 @@
  		--pkg gstreamer-@GST_API_VERSION@ \
  		--pkg gstreamer-base-@GST_API_VERSION@ \
  		--pkg-export gstreamer-insertbin-@GST_API_VERSION@ \
-Index: gst-plugins-bad-1.10.1/gst-libs/gst/mpegts/Makefile.am
-===================================================================
---- gst-plugins-bad-1.10.1.orig/gst-libs/gst/mpegts/Makefile.am
-+++ gst-plugins-bad-1.10.1/gst-libs/gst/mpegts/Makefile.am
-@@ -79,7 +79,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTRO
+diff --git a/gst-libs/gst/mpegts/Makefile.am b/gst-libs/gst/mpegts/Makefile.am
+index aeea32e..929d9cc 100644
+--- a/gst-libs/gst/mpegts/Makefile.am
++++ b/gst-libs/gst/mpegts/Makefile.am
+@@ -79,7 +79,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstmpegts-@GST_API_
  		--add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-video-@GST_API_VERSION@` \
  		--library=libgstmpegts-@GST_API_VERSION@.la \
  		--include=Gst-@GST_API_VERSION@ \
@@ -52,3 +69,6 @@
  		--pkg gstreamer-@GST_API_VERSION@ \
  		--pkg gstreamer-video-@GST_API_VERSION@ \
  		--pkg-export gstreamer-mpegts-@GST_API_VERSION@ \
+-- 
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch
index 86a4495..48d93ab 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch
@@ -1,34 +1,38 @@
-From c271503d7e233428ac0323c51d6517113e26bef7 Mon Sep 17 00:00:00 2001
+From 7c8f68c5428380b930579dc9ef27c853264448fd Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 1 Dec 2016 00:27:13 -0800
+Date: Mon, 15 May 2017 15:06:11 +0300
 Subject: [PATCH] Prepend PKG_CONFIG_SYSROOT_DIR to pkg-config output
 
 In cross environment we have to prepend the sysroot to the path found by
 pkgconfig since the path returned from pkgconfig does not have sysroot prefixed
 it ends up using the files from host system. If build host has wayland installed
-the build will succeed but if you dont have wayland-protocols installed on build host then
-it wont find the files on build host
+the build will succeed but if you dont have wayland-protocols installed on build
+host then it wont find the files on build host
 
-This should work ok with non sysrooted builds too since in those cases PKG_CONFIG_SYSROOT_DIR
-will be empty
+This should work ok with non sysrooted builds too since
+in those cases PKG_CONFIG_SYSROOT_DIR will be empty
 
 Upstream-Status: Pending
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
 ---
  configure.ac | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-Index: gst-plugins-bad-1.10.1/configure.ac
-===================================================================
---- gst-plugins-bad-1.10.1.orig/configure.ac
-+++ gst-plugins-bad-1.10.1/configure.ac
-@@ -2233,7 +2233,7 @@ AG_GST_CHECK_FEATURE(WAYLAND, [wayland s
-     PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, wayland-protocols >= 1.4, [
-       if test "x$wayland_scanner" != "x"; then
-         HAVE_WAYLAND="yes"
--        AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
-+        AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, ${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
-       else
-         AC_MSG_RESULT([wayland-scanner is required to build the wayland plugin])
-         HAVE_WAYLAND="no"
+diff --git a/configure.ac b/configure.ac
+index e307be6..83cdeb0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2272,7 +2272,7 @@ AG_GST_CHECK_FEATURE(WAYLAND, [wayland sink], wayland , [
+   PKG_CHECK_MODULES(WAYLAND, wayland-client >= 1.4.0 libdrm >= 2.4.55 wayland-protocols >= 1.4, [
+     if test "x$wayland_scanner" != "x"; then
+       HAVE_WAYLAND="yes"
+-      AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
++      AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, ${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
+     else
+       AC_MSG_RESULT([wayland-scanner is required to build the wayland plugin])
+       HAVE_WAYLAND="no"
+-- 
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
index 9fc91d8..2235a57 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
@@ -1,24 +1,29 @@
-From a93ca63d01e7cd1e40b5be576992f77fac364bd5 Mon Sep 17 00:00:00 2001
+From 5622ca3b61603dc316a0f1fbede3f9aa353a5e48 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 21 Mar 2016 18:21:17 +0200
+Date: Fri, 12 May 2017 16:47:12 +0300
 Subject: [PATCH] gstreamer-gl.pc.in: don't append GL_CFLAGS to CFLAGS
 
 Dependencies' include directories should not be added in this way;
 it causes problems when cross-compiling in sysroot environments.
 
 Upstream-Status: Pending
+
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
 ---
  pkgconfig/gstreamer-gl.pc.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-Index: gst-plugins-bad-1.10.1/pkgconfig/gstreamer-gl.pc.in
-===================================================================
---- gst-plugins-bad-1.10.1.orig/pkgconfig/gstreamer-gl.pc.in
-+++ gst-plugins-bad-1.10.1/pkgconfig/gstreamer-gl.pc.in
-@@ -10,4 +10,4 @@ Version: @VERSION@
+diff --git a/pkgconfig/gstreamer-gl.pc.in b/pkgconfig/gstreamer-gl.pc.in
+index 8e7a303..d167be1 100644
+--- a/pkgconfig/gstreamer-gl.pc.in
++++ b/pkgconfig/gstreamer-gl.pc.in
+@@ -13,4 +13,4 @@ Version: @VERSION@
  Requires: gstreamer-base-@GST_API_VERSION@ gstreamer-@GST_API_VERSION@
  
- Libs: -L${libdir} -lgstgl-@GST_API_VERSION@ @GL_LIBS@
+ Libs: -L${libdir} -lgstgl-@GST_API_VERSION@
 -Cflags: -I${includedir} -I${libdir}/gstreamer-@GST_API_VERSION@/include @GL_CFLAGS@
 +Cflags: -I${includedir} -I${libdir}/gstreamer-@GST_API_VERSION@/include
+-- 
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mssdemux-improved-live-playback-support.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mssdemux-improved-live-playback-support.patch
deleted file mode 100644
index 4832c18..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mssdemux-improved-live-playback-support.patch
+++ /dev/null
@@ -1,929 +0,0 @@
-From 73721ad4e9e2d32e1c8b6a3b4aaa98401530e58a Mon Sep 17 00:00:00 2001
-From: Philippe Normand <philn@igalia.com>
-Date: Tue, 29 Nov 2016 14:43:41 +0100
-Subject: [PATCH] mssdemux: improved live playback support
-
-When a MSS server hosts a live stream the fragments listed in the
-manifest usually don't have accurate timestamps and duration, except
-for the first fragment, which additionally stores timing information
-for the few upcoming fragments. In this scenario it is useless to
-periodically fetch and update the manifest and the fragments list can
-be incrementally built by parsing the first/current fragment.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=755036
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- ext/smoothstreaming/Makefile.am               |   2 +
- ext/smoothstreaming/gstmssdemux.c             |  60 ++++++
- ext/smoothstreaming/gstmssfragmentparser.c    | 266 ++++++++++++++++++++++++++
- ext/smoothstreaming/gstmssfragmentparser.h    |  84 ++++++++
- ext/smoothstreaming/gstmssmanifest.c          | 158 ++++++++++++++-
- ext/smoothstreaming/gstmssmanifest.h          |   7 +
- gst-libs/gst/adaptivedemux/gstadaptivedemux.c |  27 ++-
- gst-libs/gst/adaptivedemux/gstadaptivedemux.h |  14 ++
- 8 files changed, 606 insertions(+), 12 deletions(-)
- create mode 100644 ext/smoothstreaming/gstmssfragmentparser.c
- create mode 100644 ext/smoothstreaming/gstmssfragmentparser.h
-
-diff --git a/ext/smoothstreaming/Makefile.am b/ext/smoothstreaming/Makefile.am
-index 4faf9df9f..a5e1ad6ae 100644
---- a/ext/smoothstreaming/Makefile.am
-+++ b/ext/smoothstreaming/Makefile.am
-@@ -13,8 +13,10 @@ libgstsmoothstreaming_la_LIBADD = \
- libgstsmoothstreaming_la_LDFLAGS = ${GST_PLUGIN_LDFLAGS}
- libgstsmoothstreaming_la_SOURCES = gstsmoothstreaming-plugin.c \
- 	gstmssdemux.c \
-+	gstmssfragmentparser.c \
- 	gstmssmanifest.c
- libgstsmoothstreaming_la_LIBTOOLFLAGS = --tag=disable-static
- 
- noinst_HEADERS = gstmssdemux.h \
-+	gstmssfragmentparser.h \
- 	gstmssmanifest.h
-diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c
-index 12fb40497..120d9c22b 100644
---- a/ext/smoothstreaming/gstmssdemux.c
-+++ b/ext/smoothstreaming/gstmssdemux.c
-@@ -135,11 +135,18 @@ gst_mss_demux_stream_update_fragment_info (GstAdaptiveDemuxStream * stream);
- static gboolean gst_mss_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek);
- static gint64
- gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux);
-+static gint64
-+gst_mss_demux_stream_get_fragment_waiting_time (GstAdaptiveDemuxStream *
-+    stream);
- static GstFlowReturn
- gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
-     GstBuffer * buffer);
- static gboolean gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux,
-     gint64 * start, gint64 * stop);
-+static GstFlowReturn gst_mss_demux_data_received (GstAdaptiveDemux * demux,
-+    GstAdaptiveDemuxStream * stream, GstBuffer * buffer);
-+static gboolean
-+gst_mss_demux_requires_periodical_playlist_update (GstAdaptiveDemux * demux);
- 
- static void
- gst_mss_demux_class_init (GstMssDemuxClass * klass)
-@@ -192,10 +199,15 @@ gst_mss_demux_class_init (GstMssDemuxClass * klass)
-       gst_mss_demux_stream_select_bitrate;
-   gstadaptivedemux_class->stream_update_fragment_info =
-       gst_mss_demux_stream_update_fragment_info;
-+  gstadaptivedemux_class->stream_get_fragment_waiting_time =
-+      gst_mss_demux_stream_get_fragment_waiting_time;
-   gstadaptivedemux_class->update_manifest_data =
-       gst_mss_demux_update_manifest_data;
-   gstadaptivedemux_class->get_live_seek_range =
-       gst_mss_demux_get_live_seek_range;
-+  gstadaptivedemux_class->data_received = gst_mss_demux_data_received;
-+  gstadaptivedemux_class->requires_periodical_playlist_update =
-+      gst_mss_demux_requires_periodical_playlist_update;
- 
-   GST_DEBUG_CATEGORY_INIT (mssdemux_debug, "mssdemux", 0, "mssdemux plugin");
- }
-@@ -650,6 +662,13 @@ gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux)
-   return interval;
- }
- 
-+static gint64
-+gst_mss_demux_stream_get_fragment_waiting_time (GstAdaptiveDemuxStream * stream)
-+{
-+  /* Wait a second for live streams so we don't try premature fragments downloading */
-+  return GST_SECOND;
-+}
-+
- static GstFlowReturn
- gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
-     GstBuffer * buffer)
-@@ -670,3 +689,44 @@ gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux, gint64 * start,
- 
-   return gst_mss_manifest_get_live_seek_range (mssdemux->manifest, start, stop);
- }
-+
-+static GstFlowReturn
-+gst_mss_demux_data_received (GstAdaptiveDemux * demux,
-+    GstAdaptiveDemuxStream * stream, GstBuffer * buffer)
-+{
-+  GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
-+  GstMssDemuxStream *mssstream = (GstMssDemuxStream *) stream;
-+  gsize available;
-+
-+  if (!gst_mss_manifest_is_live (mssdemux->manifest)) {
-+    return GST_ADAPTIVE_DEMUX_CLASS (parent_class)->data_received (demux,
-+        stream, buffer);
-+  }
-+
-+  if (gst_mss_stream_fragment_parsing_needed (mssstream->manifest_stream)) {
-+    gst_mss_manifest_live_adapter_push (mssstream->manifest_stream, buffer);
-+    available =
-+        gst_mss_manifest_live_adapter_available (mssstream->manifest_stream);
-+    // FIXME: try to reduce this minimal size.
-+    if (available < 4096) {
-+      return GST_FLOW_OK;
-+    } else {
-+      GST_LOG_OBJECT (stream->pad, "enough data, parsing fragment.");
-+      buffer =
-+          gst_mss_manifest_live_adapter_take_buffer (mssstream->manifest_stream,
-+          available);
-+      gst_mss_stream_parse_fragment (mssstream->manifest_stream, buffer);
-+    }
-+  }
-+
-+  return GST_ADAPTIVE_DEMUX_CLASS (parent_class)->data_received (demux, stream,
-+      buffer);
-+}
-+
-+static gboolean
-+gst_mss_demux_requires_periodical_playlist_update (GstAdaptiveDemux * demux)
-+{
-+  GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
-+
-+  return (!gst_mss_manifest_is_live (mssdemux->manifest));
-+}
-diff --git a/ext/smoothstreaming/gstmssfragmentparser.c b/ext/smoothstreaming/gstmssfragmentparser.c
-new file mode 100644
-index 000000000..b554d4f31
---- /dev/null
-+++ b/ext/smoothstreaming/gstmssfragmentparser.c
-@@ -0,0 +1,266 @@
-+/*
-+ * Microsoft Smooth-Streaming fragment parsing library
-+ *
-+ * gstmssfragmentparser.h
-+ *
-+ * Copyright (C) 2016 Igalia S.L
-+ * Copyright (C) 2016 Metrological
-+ *   Author: Philippe Normand <philn@igalia.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library (COPYING); if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+#include "gstmssfragmentparser.h"
-+#include <gst/base/gstbytereader.h>
-+#include <string.h>
-+
-+GST_DEBUG_CATEGORY_EXTERN (mssdemux_debug);
-+#define GST_CAT_DEFAULT mssdemux_debug
-+
-+void
-+gst_mss_fragment_parser_init (GstMssFragmentParser * parser)
-+{
-+  parser->status = GST_MSS_FRAGMENT_HEADER_PARSER_INIT;
-+  parser->tfrf.entries_count = 0;
-+}
-+
-+void
-+gst_mss_fragment_parser_clear (GstMssFragmentParser * parser)
-+{
-+  parser->tfrf.entries_count = 0;
-+  if (parser->tfrf.entries) {
-+    g_free (parser->tfrf.entries);
-+    parser->tfrf.entries = 0;
-+  }
-+}
-+
-+static gboolean
-+_parse_tfrf_box (GstMssFragmentParser * parser, GstByteReader * reader)
-+{
-+  guint8 version;
-+  guint32 flags = 0;
-+  guint8 fragment_count = 0;
-+  guint8 index = 0;
-+
-+  if (!gst_byte_reader_get_uint8 (reader, &version)) {
-+    GST_ERROR ("Error getting box's version field");
-+    return FALSE;
-+  }
-+
-+  if (!gst_byte_reader_get_uint24_be (reader, &flags)) {
-+    GST_ERROR ("Error getting box's flags field");
-+    return FALSE;
-+  }
-+
-+  gst_byte_reader_get_uint8 (reader, &fragment_count);
-+  parser->tfrf.entries_count = fragment_count;
-+  parser->tfrf.entries =
-+      g_malloc (sizeof (GstTfrfBoxEntry) * parser->tfrf.entries_count);
-+  for (index = 0; index < fragment_count; index++) {
-+    guint64 absolute_time = 0;
-+    guint64 absolute_duration = 0;
-+    if (version & 0x01) {
-+      gst_byte_reader_get_uint64_be (reader, &absolute_time);
-+      gst_byte_reader_get_uint64_be (reader, &absolute_duration);
-+    } else {
-+      guint32 time = 0;
-+      guint32 duration = 0;
-+      gst_byte_reader_get_uint32_be (reader, &time);
-+      gst_byte_reader_get_uint32_be (reader, &duration);
-+      time = ~time;
-+      duration = ~duration;
-+      absolute_time = ~time;
-+      absolute_duration = ~duration;
-+    }
-+    parser->tfrf.entries[index].time = absolute_time;
-+    parser->tfrf.entries[index].duration = absolute_duration;
-+  }
-+
-+  GST_LOG ("tfrf box parsed");
-+  return TRUE;
-+}
-+
-+static gboolean
-+_parse_tfxd_box (GstMssFragmentParser * parser, GstByteReader * reader)
-+{
-+  guint8 version;
-+  guint32 flags = 0;
-+  guint64 absolute_time = 0;
-+  guint64 absolute_duration = 0;
-+
-+  if (!gst_byte_reader_get_uint8 (reader, &version)) {
-+    GST_ERROR ("Error getting box's version field");
-+    return FALSE;
-+  }
-+
-+  if (!gst_byte_reader_get_uint24_be (reader, &flags)) {
-+    GST_ERROR ("Error getting box's flags field");
-+    return FALSE;
-+  }
-+
-+  if (version & 0x01) {
-+    gst_byte_reader_get_uint64_be (reader, &absolute_time);
-+    gst_byte_reader_get_uint64_be (reader, &absolute_duration);
-+  } else {
-+    guint32 time = 0;
-+    guint32 duration = 0;
-+    gst_byte_reader_get_uint32_be (reader, &time);
-+    gst_byte_reader_get_uint32_be (reader, &duration);
-+    time = ~time;
-+    duration = ~duration;
-+    absolute_time = ~time;
-+    absolute_duration = ~duration;
-+  }
-+
-+  parser->tfxd.time = absolute_time;
-+  parser->tfxd.duration = absolute_duration;
-+  GST_LOG ("tfxd box parsed");
-+  return TRUE;
-+}
-+
-+gboolean
-+gst_mss_fragment_parser_add_buffer (GstMssFragmentParser * parser,
-+    GstBuffer * buffer)
-+{
-+  GstByteReader reader;
-+  GstMapInfo info;
-+  guint32 size;
-+  guint32 fourcc;
-+  const guint8 *uuid;
-+  gboolean error = FALSE;
-+  gboolean mdat_box_found = FALSE;
-+
-+  static const guint8 tfrf_uuid[] = {
-+    0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
-+    0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f
-+  };
-+
-+  static const guint8 tfxd_uuid[] = {
-+    0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6,
-+    0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2
-+  };
-+
-+  static const guint8 piff_uuid[] = {
-+    0xa2, 0x39, 0x4f, 0x52, 0x5a, 0x9b, 0x4f, 0x14,
-+    0xa2, 0x44, 0x6c, 0x42, 0x7c, 0x64, 0x8d, 0xf4
-+  };
-+
-+  if (!gst_buffer_map (buffer, &info, GST_MAP_READ)) {
-+    return FALSE;
-+  }
-+
-+  gst_byte_reader_init (&reader, info.data, info.size);
-+  GST_TRACE ("Total buffer size: %u", gst_byte_reader_get_size (&reader));
-+
-+  size = gst_byte_reader_get_uint32_be_unchecked (&reader);
-+  fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
-+  if (fourcc == GST_MSS_FRAGMENT_FOURCC_MOOF) {
-+    GST_TRACE ("moof box found");
-+    size = gst_byte_reader_get_uint32_be_unchecked (&reader);
-+    fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
-+    if (fourcc == GST_MSS_FRAGMENT_FOURCC_MFHD) {
-+      gst_byte_reader_skip_unchecked (&reader, size - 8);
-+
-+      size = gst_byte_reader_get_uint32_be_unchecked (&reader);
-+      fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
-+      if (fourcc == GST_MSS_FRAGMENT_FOURCC_TRAF) {
-+        size = gst_byte_reader_get_uint32_be_unchecked (&reader);
-+        fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
-+        if (fourcc == GST_MSS_FRAGMENT_FOURCC_TFHD) {
-+          gst_byte_reader_skip_unchecked (&reader, size - 8);
-+
-+          size = gst_byte_reader_get_uint32_be_unchecked (&reader);
-+          fourcc = gst_byte_reader_get_uint32_le_unchecked (&reader);
-+          if (fourcc == GST_MSS_FRAGMENT_FOURCC_TRUN) {
-+            GST_TRACE ("trun box found, size: %" G_GUINT32_FORMAT, size);
-+            if (!gst_byte_reader_skip (&reader, size - 8)) {
-+              GST_WARNING ("Failed to skip trun box, enough data?");
-+              error = TRUE;
-+              goto beach;
-+            }
-+          }
-+        }
-+      }
-+    }
-+  }
-+
-+  while (!mdat_box_found) {
-+    GST_TRACE ("remaining data: %u", gst_byte_reader_get_remaining (&reader));
-+    if (!gst_byte_reader_get_uint32_be (&reader, &size)) {
-+      GST_WARNING ("Failed to get box size, enough data?");
-+      error = TRUE;
-+      break;
-+    }
-+
-+    GST_TRACE ("box size: %" G_GUINT32_FORMAT, size);
-+    if (!gst_byte_reader_get_uint32_le (&reader, &fourcc)) {
-+      GST_WARNING ("Failed to get fourcc, enough data?");
-+      error = TRUE;
-+      break;
-+    }
-+
-+    if (fourcc == GST_MSS_FRAGMENT_FOURCC_MDAT) {
-+      GST_LOG ("mdat box found");
-+      mdat_box_found = TRUE;
-+      break;
-+    }
-+
-+    if (fourcc != GST_MSS_FRAGMENT_FOURCC_UUID) {
-+      GST_ERROR ("invalid UUID fourcc: %" GST_FOURCC_FORMAT,
-+          GST_FOURCC_ARGS (fourcc));
-+      error = TRUE;
-+      break;
-+    }
-+
-+    if (!gst_byte_reader_peek_data (&reader, 16, &uuid)) {
-+      GST_ERROR ("not enough data in UUID box");
-+      error = TRUE;
-+      break;
-+    }
-+
-+    if (memcmp (uuid, piff_uuid, 16) == 0) {
-+      gst_byte_reader_skip_unchecked (&reader, size - 8);
-+      GST_LOG ("piff box detected");
-+    }
-+
-+    if (memcmp (uuid, tfrf_uuid, 16) == 0) {
-+      gst_byte_reader_get_data (&reader, 16, &uuid);
-+      if (!_parse_tfrf_box (parser, &reader)) {
-+        GST_ERROR ("txrf box parsing error");
-+        error = TRUE;
-+        break;
-+      }
-+    }
-+
-+    if (memcmp (uuid, tfxd_uuid, 16) == 0) {
-+      gst_byte_reader_get_data (&reader, 16, &uuid);
-+      if (!_parse_tfxd_box (parser, &reader)) {
-+        GST_ERROR ("tfrf box parsing error");
-+        error = TRUE;
-+        break;
-+      }
-+    }
-+  }
-+
-+beach:
-+
-+  if (!error)
-+    parser->status = GST_MSS_FRAGMENT_HEADER_PARSER_FINISHED;
-+
-+  GST_LOG ("Fragment parsing successful: %s", error ? "no" : "yes");
-+  gst_buffer_unmap (buffer, &info);
-+  return !error;
-+}
-diff --git a/ext/smoothstreaming/gstmssfragmentparser.h b/ext/smoothstreaming/gstmssfragmentparser.h
-new file mode 100644
-index 000000000..cf4711865
---- /dev/null
-+++ b/ext/smoothstreaming/gstmssfragmentparser.h
-@@ -0,0 +1,84 @@
-+/*
-+ * Microsoft Smooth-Streaming fragment parsing library
-+ *
-+ * gstmssfragmentparser.h
-+ *
-+ * Copyright (C) 2016 Igalia S.L
-+ * Copyright (C) 2016 Metrological
-+ *   Author: Philippe Normand <philn@igalia.com>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library (COPYING); if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+#ifndef __GST_MSS_FRAGMENT_PARSER_H__
-+#define __GST_MSS_FRAGMENT_PARSER_H__
-+
-+#include <gst/gst.h>
-+
-+G_BEGIN_DECLS
-+
-+#define GST_MSS_FRAGMENT_FOURCC_MOOF GST_MAKE_FOURCC('m','o','o','f')
-+#define GST_MSS_FRAGMENT_FOURCC_MFHD GST_MAKE_FOURCC('m','f','h','d')
-+#define GST_MSS_FRAGMENT_FOURCC_TRAF GST_MAKE_FOURCC('t','r','a','f')
-+#define GST_MSS_FRAGMENT_FOURCC_TFHD GST_MAKE_FOURCC('t','f','h','d')
-+#define GST_MSS_FRAGMENT_FOURCC_TRUN GST_MAKE_FOURCC('t','r','u','n')
-+#define GST_MSS_FRAGMENT_FOURCC_UUID GST_MAKE_FOURCC('u','u','i','d')
-+#define GST_MSS_FRAGMENT_FOURCC_MDAT GST_MAKE_FOURCC('m','d','a','t')
-+
-+typedef struct _GstTfxdBox
-+{
-+  guint8 version;
-+  guint32 flags;
-+
-+  guint64 time;
-+  guint64 duration;
-+} GstTfxdBox;
-+
-+typedef struct _GstTfrfBoxEntry
-+{
-+  guint64 time;
-+  guint64 duration;
-+} GstTfrfBoxEntry;
-+
-+typedef struct _GstTfrfBox
-+{
-+  guint8 version;
-+  guint32 flags;
-+
-+  gint entries_count;
-+  GstTfrfBoxEntry *entries;
-+} GstTfrfBox;
-+
-+typedef enum _GstFragmentHeaderParserStatus
-+{
-+  GST_MSS_FRAGMENT_HEADER_PARSER_INIT,
-+  GST_MSS_FRAGMENT_HEADER_PARSER_FINISHED
-+} GstFragmentHeaderParserStatus;
-+
-+typedef struct _GstMssFragmentParser
-+{
-+  GstFragmentHeaderParserStatus status;
-+  GstTfxdBox tfxd;
-+  GstTfrfBox tfrf;
-+} GstMssFragmentParser;
-+
-+void gst_mss_fragment_parser_init (GstMssFragmentParser * parser);
-+void gst_mss_fragment_parser_clear (GstMssFragmentParser * parser);
-+gboolean gst_mss_fragment_parser_add_buffer (GstMssFragmentParser * parser, GstBuffer * buf);
-+
-+G_END_DECLS
-+
-+#endif /* __GST_MSS_FRAGMENT_PARSER_H__ */
-diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
-index 144bbb42d..e1031ba55 100644
---- a/ext/smoothstreaming/gstmssmanifest.c
-+++ b/ext/smoothstreaming/gstmssmanifest.c
-@@ -1,5 +1,7 @@
- /* GStreamer
-  * Copyright (C) 2012 Smart TV Alliance
-+ * Copyright (C) 2016 Igalia S.L
-+ * Copyright (C) 2016 Metrological
-  *  Author: Thiago Sousa Santos <thiago.sousa.santos@collabora.com>, Collabora Ltd.
-  *
-  * gstmssmanifest.c:
-@@ -31,6 +33,7 @@
- #include <gst/codecparsers/gsth264parser.h>
- 
- #include "gstmssmanifest.h"
-+#include "gstmssfragmentparser.h"
- 
- GST_DEBUG_CATEGORY_EXTERN (mssdemux_debug);
- #define GST_CAT_DEFAULT mssdemux_debug
-@@ -74,12 +77,17 @@ struct _GstMssStream
-   gboolean active;              /* if the stream is currently being used */
-   gint selectedQualityIndex;
- 
-+  gboolean has_live_fragments;
-+  GstAdapter *live_adapter;
-+
-   GList *fragments;
-   GList *qualities;
- 
-   gchar *url;
-   gchar *lang;
- 
-+  GstMssFragmentParser fragment_parser;
-+
-   guint fragment_repetition_index;
-   GList *current_fragment;
-   GList *current_quality;
-@@ -96,6 +104,7 @@ struct _GstMssManifest
- 
-   gboolean is_live;
-   gint64 dvr_window;
-+  guint64 look_ahead_fragment_count;
- 
-   GString *protection_system_id;
-   gchar *protection_data;
-@@ -235,7 +244,8 @@ compare_bitrate (GstMssStreamQuality * a, GstMssStreamQuality * b)
- }
- 
- static void
--_gst_mss_stream_init (GstMssStream * stream, xmlNodePtr node)
-+_gst_mss_stream_init (GstMssManifest * manifest, GstMssStream * stream,
-+    xmlNodePtr node)
- {
-   xmlNodePtr iter;
-   GstMssFragmentListBuilder builder;
-@@ -248,9 +258,21 @@ _gst_mss_stream_init (GstMssStream * stream, xmlNodePtr node)
-   stream->url = (gchar *) xmlGetProp (node, (xmlChar *) MSS_PROP_URL);
-   stream->lang = (gchar *) xmlGetProp (node, (xmlChar *) MSS_PROP_LANGUAGE);
- 
-+  /* for live playback each fragment usually has timing
-+   * information for the few next look-ahead fragments so the
-+   * playlist can be built incrementally from the first fragment
-+   * of the manifest.
-+   */
-+
-+  GST_DEBUG ("Live stream: %s, look-ahead fragments: %" G_GUINT64_FORMAT,
-+      manifest->is_live ? "yes" : "no", manifest->look_ahead_fragment_count);
-+  stream->has_live_fragments = manifest->is_live
-+      && manifest->look_ahead_fragment_count;
-+
-   for (iter = node->children; iter; iter = iter->next) {
-     if (node_has_type (iter, MSS_NODE_STREAM_FRAGMENT)) {
--      gst_mss_fragment_list_builder_add (&builder, iter);
-+      if (!stream->has_live_fragments || !builder.fragments)
-+        gst_mss_fragment_list_builder_add (&builder, iter);
-     } else if (node_has_type (iter, MSS_NODE_STREAM_QUALITY)) {
-       GstMssStreamQuality *quality = gst_mss_stream_quality_new (iter);
-       stream->qualities = g_list_prepend (stream->qualities, quality);
-@@ -259,17 +281,24 @@ _gst_mss_stream_init (GstMssStream * stream, xmlNodePtr node)
-     }
-   }
- 
--  stream->fragments = g_list_reverse (builder.fragments);
-+  if (stream->has_live_fragments) {
-+    stream->live_adapter = gst_adapter_new ();
-+  }
-+
-+  if (builder.fragments) {
-+    stream->fragments = g_list_reverse (builder.fragments);
-+    stream->current_fragment = stream->fragments;
-+  }
- 
-   /* order them from smaller to bigger based on bitrates */
-   stream->qualities =
-       g_list_sort (stream->qualities, (GCompareFunc) compare_bitrate);
--
--  stream->current_fragment = stream->fragments;
-   stream->current_quality = stream->qualities;
- 
-   stream->regex_bitrate = g_regex_new ("\\{[Bb]itrate\\}", 0, 0, NULL);
-   stream->regex_position = g_regex_new ("\\{start[ _]time\\}", 0, 0, NULL);
-+
-+  gst_mss_fragment_parser_init (&stream->fragment_parser);
- }
- 
- 
-@@ -315,6 +344,7 @@ gst_mss_manifest_new (GstBuffer * data)
-   xmlNodePtr nodeiter;
-   gchar *live_str;
-   GstMapInfo mapinfo;
-+  gchar *look_ahead_fragment_count_str;
- 
-   if (!gst_buffer_map (data, &mapinfo, GST_MAP_READ)) {
-     return NULL;
-@@ -335,6 +365,7 @@ gst_mss_manifest_new (GstBuffer * data)
-   /* the entire file is always available for non-live streams */
-   if (!manifest->is_live) {
-     manifest->dvr_window = 0;
-+    manifest->look_ahead_fragment_count = 0;
-   } else {
-     /* if 0, or non-existent, the length is infinite */
-     gchar *dvr_window_str = (gchar *) xmlGetProp (root,
-@@ -346,6 +377,17 @@ gst_mss_manifest_new (GstBuffer * data)
-         manifest->dvr_window = 0;
-       }
-     }
-+
-+    look_ahead_fragment_count_str =
-+        (gchar *) xmlGetProp (root, (xmlChar *) "LookAheadFragmentCount");
-+    if (look_ahead_fragment_count_str) {
-+      manifest->look_ahead_fragment_count =
-+          g_ascii_strtoull (look_ahead_fragment_count_str, NULL, 10);
-+      xmlFree (look_ahead_fragment_count_str);
-+      if (manifest->look_ahead_fragment_count <= 0) {
-+        manifest->look_ahead_fragment_count = 0;
-+      }
-+    }
-   }
- 
-   for (nodeiter = root->children; nodeiter; nodeiter = nodeiter->next) {
-@@ -354,7 +396,7 @@ gst_mss_manifest_new (GstBuffer * data)
-       GstMssStream *stream = g_new0 (GstMssStream, 1);
- 
-       manifest->streams = g_slist_append (manifest->streams, stream);
--      _gst_mss_stream_init (stream, nodeiter);
-+      _gst_mss_stream_init (manifest, stream, nodeiter);
-     }
- 
-     if (nodeiter->type == XML_ELEMENT_NODE
-@@ -371,6 +413,11 @@ gst_mss_manifest_new (GstBuffer * data)
- static void
- gst_mss_stream_free (GstMssStream * stream)
- {
-+  if (stream->live_adapter) {
-+    gst_adapter_clear (stream->live_adapter);
-+    g_object_unref (stream->live_adapter);
-+  }
-+
-   g_list_free_full (stream->fragments, g_free);
-   g_list_free_full (stream->qualities,
-       (GDestroyNotify) gst_mss_stream_quality_free);
-@@ -379,6 +426,7 @@ gst_mss_stream_free (GstMssStream * stream)
-   g_regex_unref (stream->regex_position);
-   g_regex_unref (stream->regex_bitrate);
-   g_free (stream);
-+  gst_mss_fragment_parser_clear (&stream->fragment_parser);
- }
- 
- void
-@@ -1079,6 +1127,9 @@ GstFlowReturn
- gst_mss_stream_advance_fragment (GstMssStream * stream)
- {
-   GstMssStreamFragment *fragment;
-+  const gchar *stream_type_name =
-+      gst_mss_stream_type_name (gst_mss_stream_get_type (stream));
-+
-   g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
- 
-   if (stream->current_fragment == NULL)
-@@ -1086,14 +1137,20 @@ gst_mss_stream_advance_fragment (GstMssStream * stream)
- 
-   fragment = stream->current_fragment->data;
-   stream->fragment_repetition_index++;
--  if (stream->fragment_repetition_index < fragment->repetitions) {
--    return GST_FLOW_OK;
--  }
-+  if (stream->fragment_repetition_index < fragment->repetitions)
-+    goto beach;
- 
-   stream->fragment_repetition_index = 0;
-   stream->current_fragment = g_list_next (stream->current_fragment);
-+
-+  GST_DEBUG ("Advanced to fragment #%d on %s stream", fragment->number,
-+      stream_type_name);
-   if (stream->current_fragment == NULL)
-     return GST_FLOW_EOS;
-+
-+beach:
-+  gst_mss_fragment_parser_clear (&stream->fragment_parser);
-+  gst_mss_fragment_parser_init (&stream->fragment_parser);
-   return GST_FLOW_OK;
- }
- 
-@@ -1173,6 +1230,11 @@ gst_mss_stream_seek (GstMssStream * stream, gboolean forward,
-   GST_DEBUG ("Stream %s seeking to %" G_GUINT64_FORMAT, stream->url, time);
-   for (iter = stream->fragments; iter; iter = g_list_next (iter)) {
-     fragment = iter->data;
-+    if (stream->has_live_fragments) {
-+      if (fragment->time + fragment->repetitions * fragment->duration > time)
-+        stream->current_fragment = iter;
-+      break;
-+    }
-     if (fragment->time + fragment->repetitions * fragment->duration > time) {
-       stream->current_fragment = iter;
-       stream->fragment_repetition_index =
-@@ -1256,9 +1318,14 @@ static void
- gst_mss_stream_reload_fragments (GstMssStream * stream, xmlNodePtr streamIndex)
- {
-   xmlNodePtr iter;
--  guint64 current_gst_time = gst_mss_stream_get_fragment_gst_timestamp (stream);
-+  guint64 current_gst_time;
-   GstMssFragmentListBuilder builder;
- 
-+  if (stream->has_live_fragments)
-+    return;
-+
-+  current_gst_time = gst_mss_stream_get_fragment_gst_timestamp (stream);
-+
-   gst_mss_fragment_list_builder_init (&builder);
- 
-   GST_DEBUG ("Current position: %" GST_TIME_FORMAT,
-@@ -1514,3 +1581,74 @@ gst_mss_manifest_get_live_seek_range (GstMssManifest * manifest, gint64 * start,
- 
-   return ret;
- }
-+
-+void
-+gst_mss_manifest_live_adapter_push (GstMssStream * stream, GstBuffer * buffer)
-+{
-+  gst_adapter_push (stream->live_adapter, buffer);
-+}
-+
-+gsize
-+gst_mss_manifest_live_adapter_available (GstMssStream * stream)
-+{
-+  return gst_adapter_available (stream->live_adapter);
-+}
-+
-+GstBuffer *
-+gst_mss_manifest_live_adapter_take_buffer (GstMssStream * stream, gsize nbytes)
-+{
-+  return gst_adapter_take_buffer (stream->live_adapter, nbytes);
-+}
-+
-+gboolean
-+gst_mss_stream_fragment_parsing_needed (GstMssStream * stream)
-+{
-+  return stream->fragment_parser.status == GST_MSS_FRAGMENT_HEADER_PARSER_INIT;
-+}
-+
-+void
-+gst_mss_stream_parse_fragment (GstMssStream * stream, GstBuffer * buffer)
-+{
-+  GstMssStreamFragment *current_fragment = NULL;
-+  const gchar *stream_type_name;
-+  guint8 index;
-+
-+  if (!stream->has_live_fragments)
-+    return;
-+
-+  if (!gst_mss_fragment_parser_add_buffer (&stream->fragment_parser, buffer))
-+    return;
-+
-+  current_fragment = stream->current_fragment->data;
-+  current_fragment->time = stream->fragment_parser.tfxd.time;
-+  current_fragment->duration = stream->fragment_parser.tfxd.duration;
-+
-+  stream_type_name =
-+      gst_mss_stream_type_name (gst_mss_stream_get_type (stream));
-+
-+  for (index = 0; index < stream->fragment_parser.tfrf.entries_count; index++) {
-+    GList *l = g_list_last (stream->fragments);
-+    GstMssStreamFragment *last;
-+    GstMssStreamFragment *fragment;
-+
-+    if (l == NULL)
-+      break;
-+
-+    last = (GstMssStreamFragment *) l->data;
-+
-+    if (last->time == stream->fragment_parser.tfrf.entries[index].time)
-+      continue;
-+
-+    fragment = g_new (GstMssStreamFragment, 1);
-+    fragment->number = last->number + 1;
-+    fragment->repetitions = 1;
-+    fragment->time = stream->fragment_parser.tfrf.entries[index].time;
-+    fragment->duration = stream->fragment_parser.tfrf.entries[index].duration;
-+
-+    stream->fragments = g_list_append (stream->fragments, fragment);
-+    GST_LOG ("Adding fragment number: %u to %s stream, time: %" G_GUINT64_FORMAT
-+        ", duration: %" G_GUINT64_FORMAT ", repetitions: %u",
-+        fragment->number, stream_type_name,
-+        fragment->time, fragment->duration, fragment->repetitions);
-+  }
-+}
-diff --git a/ext/smoothstreaming/gstmssmanifest.h b/ext/smoothstreaming/gstmssmanifest.h
-index 6b7b1f971..03b066ae5 100644
---- a/ext/smoothstreaming/gstmssmanifest.h
-+++ b/ext/smoothstreaming/gstmssmanifest.h
-@@ -26,6 +26,7 @@
- #include <glib.h>
- #include <gio/gio.h>
- #include <gst/gst.h>
-+#include <gst/base/gstadapter.h>
- 
- G_BEGIN_DECLS
- 
-@@ -73,5 +74,11 @@ const gchar * gst_mss_stream_get_lang (GstMssStream * stream);
- 
- const gchar * gst_mss_stream_type_name (GstMssStreamType streamtype);
- 
-+void gst_mss_manifest_live_adapter_push(GstMssStream * stream, GstBuffer * buffer);
-+gsize gst_mss_manifest_live_adapter_available(GstMssStream * stream);
-+GstBuffer * gst_mss_manifest_live_adapter_take_buffer(GstMssStream * stream, gsize nbytes);
-+gboolean gst_mss_stream_fragment_parsing_needed(GstMssStream * stream);
-+void gst_mss_stream_parse_fragment(GstMssStream * stream, GstBuffer * buffer);
-+
- G_END_DECLS
- #endif /* __GST_MSS_MANIFEST_H__ */
-diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
-index 634e4f388..ddca726b6 100644
---- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
-+++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
-@@ -291,6 +291,9 @@ gst_adaptive_demux_wait_until (GstClock * clock, GCond * cond, GMutex * mutex,
-     GstClockTime end_time);
- static gboolean gst_adaptive_demux_clock_callback (GstClock * clock,
-     GstClockTime time, GstClockID id, gpointer user_data);
-+static gboolean
-+gst_adaptive_demux_requires_periodical_playlist_update_default (GstAdaptiveDemux
-+    * demux);
- 
- /* we can't use G_DEFINE_ABSTRACT_TYPE because we need the klass in the _init
-  * method to get to the padtemplates */
-@@ -412,6 +415,9 @@ gst_adaptive_demux_class_init (GstAdaptiveDemuxClass * klass)
-   klass->data_received = gst_adaptive_demux_stream_data_received_default;
-   klass->finish_fragment = gst_adaptive_demux_stream_finish_fragment_default;
-   klass->update_manifest = gst_adaptive_demux_update_manifest_default;
-+  klass->requires_periodical_playlist_update =
-+      gst_adaptive_demux_requires_periodical_playlist_update_default;
-+
- }
- 
- static void
-@@ -686,7 +692,9 @@ gst_adaptive_demux_sink_event (GstPad * pad, GstObject * parent,
-             demux->priv->stop_updates_task = FALSE;
-             g_mutex_unlock (&demux->priv->updates_timed_lock);
-             /* Task to periodically update the manifest */
--            gst_task_start (demux->priv->updates_task);
-+            if (demux_class->requires_periodical_playlist_update (demux)) {
-+              gst_task_start (demux->priv->updates_task);
-+            }
-           }
-         } else {
-           /* no streams */
-@@ -2125,6 +2133,13 @@ gst_adaptive_demux_stream_data_received_default (GstAdaptiveDemux * demux,
-   return gst_adaptive_demux_stream_push_buffer (stream, buffer);
- }
- 
-+static gboolean
-+gst_adaptive_demux_requires_periodical_playlist_update_default (GstAdaptiveDemux
-+    * demux)
-+{
-+  return TRUE;
-+}
-+
- static GstFlowReturn
- _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
- {
-@@ -3338,7 +3353,15 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
-       GST_DEBUG_OBJECT (stream->pad, "EOS, checking to stop download loop");
-       /* we push the EOS after releasing the object lock */
-       if (gst_adaptive_demux_is_live (demux)) {
--        if (gst_adaptive_demux_stream_wait_manifest_update (demux, stream)) {
-+        GstAdaptiveDemuxClass *demux_class =
-+            GST_ADAPTIVE_DEMUX_GET_CLASS (demux);
-+
-+        /* this might be a fragment download error, refresh the manifest, just in case */
-+        if (!demux_class->requires_periodical_playlist_update (demux)) {
-+          ret = gst_adaptive_demux_update_manifest (demux);
-+          break;
-+        } else if (gst_adaptive_demux_stream_wait_manifest_update (demux,
-+                stream)) {
-           goto end;
-         }
-         gst_task_stop (stream->download_task);
-diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h
-index 780f4d93f..9a1a1b7d1 100644
---- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h
-+++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h
-@@ -459,6 +459,20 @@ struct _GstAdaptiveDemuxClass
-    * selected period.
-    */
-   GstClockTime (*get_period_start_time) (GstAdaptiveDemux *demux);
-+
-+  /**
-+   * requires_periodical_playlist_update:
-+   * @demux: #GstAdaptiveDemux
-+   *
-+   * Some adaptive streaming protocols allow the client to download
-+   * the playlist once and build up the fragment list based on the
-+   * current fragment metadata. For those protocols the demuxer
-+   * doesn't need to periodically refresh the playlist. This vfunc
-+   * is relevant only for live playback scenarios.
-+   *
-+   * Return: %TRUE if the playlist needs to be refreshed periodically by the demuxer.
-+   */
-+  gboolean (*requires_periodical_playlist_update) (GstAdaptiveDemux * demux);
- };
- 
- GType    gst_adaptive_demux_get_type (void);
--- 
-2.11.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch
deleted file mode 100644
index 76d29e1..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-From e9178fa082116d4bf733b184a8b6951112c17900 Mon Sep 17 00:00:00 2001
-From: Matthew Waters <matthew@centricular.com>
-Date: Thu, 10 Nov 2016 17:18:36 +1100
-Subject: [PATCH] smoothstreaming: implement adaptivedemux's
- get_live_seek_range()
-
-Allows seeking through the available fragments that are still available
-on the server as specified by the DVRWindowLength attribute in the
-manifest.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=774178
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- ext/smoothstreaming/gstmssdemux.c    | 13 ++++++
- ext/smoothstreaming/gstmssmanifest.c | 84 ++++++++++++++++++++++++++++++++++++
- ext/smoothstreaming/gstmssmanifest.h |  1 +
- 3 files changed, 98 insertions(+)
-
-diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c
-index 9d0aece2b..b66e19514 100644
---- a/ext/smoothstreaming/gstmssdemux.c
-+++ b/ext/smoothstreaming/gstmssdemux.c
-@@ -138,6 +138,8 @@ gst_mss_demux_get_manifest_update_interval (GstAdaptiveDemux * demux);
- static GstFlowReturn
- gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
-     GstBuffer * buffer);
-+static gboolean gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux,
-+    gint64 * start, gint64 * stop);
- 
- static void
- gst_mss_demux_class_init (GstMssDemuxClass * klass)
-@@ -192,6 +194,8 @@ gst_mss_demux_class_init (GstMssDemuxClass * klass)
-       gst_mss_demux_stream_update_fragment_info;
-   gstadaptivedemux_class->update_manifest_data =
-       gst_mss_demux_update_manifest_data;
-+  gstadaptivedemux_class->get_live_seek_range =
-+      gst_mss_demux_get_live_seek_range;
- 
-   GST_DEBUG_CATEGORY_INIT (mssdemux_debug, "mssdemux", 0, "mssdemux plugin");
- }
-@@ -659,3 +663,12 @@ gst_mss_demux_update_manifest_data (GstAdaptiveDemux * demux,
-   gst_mss_manifest_reload_fragments (mssdemux->manifest, buffer);
-   return GST_FLOW_OK;
- }
-+
-+static gboolean
-+gst_mss_demux_get_live_seek_range (GstAdaptiveDemux * demux, gint64 * start,
-+    gint64 * stop)
-+{
-+  GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
-+
-+  return gst_mss_manifest_get_live_seek_range (mssdemux->manifest, start, stop);
-+}
-diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
-index 1b72e8de1..317b3cef9 100644
---- a/ext/smoothstreaming/gstmssmanifest.c
-+++ b/ext/smoothstreaming/gstmssmanifest.c
-@@ -42,6 +42,7 @@ GST_DEBUG_CATEGORY_EXTERN (mssdemux_debug);
- 
- #define MSS_PROP_BITRATE              "Bitrate"
- #define MSS_PROP_DURATION             "d"
-+#define MSS_PROP_DVR_WINDOW_LENGTH    "DVRWindowLength"
- #define MSS_PROP_LANGUAGE             "Language"
- #define MSS_PROP_NUMBER               "n"
- #define MSS_PROP_REPETITIONS          "r"
-@@ -94,6 +95,7 @@ struct _GstMssManifest
-   xmlNodePtr xmlrootnode;
- 
-   gboolean is_live;
-+  gint64 dvr_window;
- 
-   GString *protection_system_id;
-   gchar *protection_data;
-@@ -330,6 +332,22 @@ gst_mss_manifest_new (GstBuffer * data)
-     xmlFree (live_str);
-   }
- 
-+  /* the entire file is always available for non-live streams */
-+  if (!manifest->is_live) {
-+    manifest->dvr_window = 0;
-+  } else {
-+    /* if 0, or non-existent, the length is infinite */
-+    gchar *dvr_window_str = (gchar *) xmlGetProp (root,
-+        (xmlChar *) MSS_PROP_DVR_WINDOW_LENGTH);
-+    if (dvr_window_str) {
-+      manifest->dvr_window = g_ascii_strtoull (dvr_window_str, NULL, 10);
-+      xmlFree (dvr_window_str);
-+      if (manifest->dvr_window <= 0) {
-+        manifest->dvr_window = 0;
-+      }
-+    }
-+  }
-+
-   for (nodeiter = root->children; nodeiter; nodeiter = nodeiter->next) {
-     if (nodeiter->type == XML_ELEMENT_NODE
-         && (strcmp ((const char *) nodeiter->name, "StreamIndex") == 0)) {
-@@ -1406,3 +1424,69 @@ gst_mss_stream_get_lang (GstMssStream * stream)
- {
-   return stream->lang;
- }
-+
-+static GstClockTime
-+gst_mss_manifest_get_dvr_window_length_clock_time (GstMssManifest * manifest)
-+{
-+  gint64 timescale;
-+
-+  /* the entire file is always available for non-live streams */
-+  if (manifest->dvr_window == 0)
-+    return GST_CLOCK_TIME_NONE;
-+
-+  timescale = gst_mss_manifest_get_timescale (manifest);
-+  return (GstClockTime) gst_util_uint64_scale_round (manifest->dvr_window,
-+      GST_SECOND, timescale);
-+}
-+
-+static gboolean
-+gst_mss_stream_get_live_seek_range (GstMssStream * stream, gint64 * start,
-+    gint64 * stop)
-+{
-+  GList *l;
-+  GstMssStreamFragment *fragment;
-+  guint64 timescale = gst_mss_stream_get_timescale (stream);
-+
-+  g_return_val_if_fail (stream->active, FALSE);
-+
-+  /* XXX: assumes all the data in the stream is still available */
-+  l = g_list_first (stream->fragments);
-+  fragment = (GstMssStreamFragment *) l->data;
-+  *start = gst_util_uint64_scale_round (fragment->time, GST_SECOND, timescale);
-+
-+  l = g_list_last (stream->fragments);
-+  fragment = (GstMssStreamFragment *) l->data;
-+  *stop = gst_util_uint64_scale_round (fragment->time + fragment->duration *
-+      fragment->repetitions, GST_SECOND, timescale);
-+
-+  return TRUE;
-+}
-+
-+gboolean
-+gst_mss_manifest_get_live_seek_range (GstMssManifest * manifest, gint64 * start,
-+    gint64 * stop)
-+{
-+  GSList *iter;
-+  gboolean ret = FALSE;
-+
-+  for (iter = manifest->streams; iter; iter = g_slist_next (iter)) {
-+    GstMssStream *stream = iter->data;
-+
-+    if (stream->active) {
-+      /* FIXME: bound this correctly for multiple streams */
-+      if (!(ret = gst_mss_stream_get_live_seek_range (stream, start, stop)))
-+        break;
-+    }
-+  }
-+
-+  if (ret && gst_mss_manifest_is_live (manifest)) {
-+    GstClockTime dvr_window =
-+        gst_mss_manifest_get_dvr_window_length_clock_time (manifest);
-+
-+    if (GST_CLOCK_TIME_IS_VALID (dvr_window) && *stop - *start > dvr_window) {
-+      *start = *stop - dvr_window;
-+    }
-+  }
-+
-+  return ret;
-+}
-diff --git a/ext/smoothstreaming/gstmssmanifest.h b/ext/smoothstreaming/gstmssmanifest.h
-index af7419c23..6b7b1f971 100644
---- a/ext/smoothstreaming/gstmssmanifest.h
-+++ b/ext/smoothstreaming/gstmssmanifest.h
-@@ -54,6 +54,7 @@ void gst_mss_manifest_reload_fragments (GstMssManifest * manifest, GstBuffer * d
- GstClockTime gst_mss_manifest_get_min_fragment_duration (GstMssManifest * manifest);
- const gchar * gst_mss_manifest_get_protection_system_id (GstMssManifest * manifest);
- const gchar * gst_mss_manifest_get_protection_data (GstMssManifest * manifest);
-+gboolean gst_mss_manifest_get_live_seek_range (GstMssManifest * manifest, gint64 * start, gint64 * stop);
- 
- GstMssStreamType gst_mss_stream_get_type (GstMssStream *stream);
- GstCaps * gst_mss_stream_get_caps (GstMssStream * stream);
--- 
-2.11.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch
deleted file mode 100644
index 4e51040..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 0fbee8f37427b88339194b22ba9aa210772a8613 Mon Sep 17 00:00:00 2001
-From: Matthew Waters <matthew@centricular.com>
-Date: Thu, 10 Nov 2016 17:20:27 +1100
-Subject: [PATCH] smoothstreaming: use the duration from the list of fragments
- if not present in the manifest
-
-Provides a more accurate duration for live streams that may be minutes
-or hours in front of the earliest fragment.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=774178
----
-Upstream-Status: Backport
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
- ext/smoothstreaming/gstmssmanifest.c | 24 ++++++++++++++++++++++++
- 1 file changed, 24 insertions(+)
-
-diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
-index 317b3cef9..144bbb42d 100644
---- a/ext/smoothstreaming/gstmssmanifest.c
-+++ b/ext/smoothstreaming/gstmssmanifest.c
-@@ -888,6 +888,7 @@ gst_mss_manifest_get_duration (GstMssManifest * manifest)
-   gchar *duration;
-   guint64 dur = -1;
- 
-+  /* try the property */
-   duration =
-       (gchar *) xmlGetProp (manifest->xmlrootnode,
-       (xmlChar *) MSS_PROP_STREAM_DURATION);
-@@ -895,6 +896,29 @@ gst_mss_manifest_get_duration (GstMssManifest * manifest)
-     dur = g_ascii_strtoull (duration, NULL, 10);
-     xmlFree (duration);
-   }
-+  /* else use the fragment list */
-+  if (dur <= 0) {
-+    guint64 max_dur = 0;
-+    GSList *iter;
-+
-+    for (iter = manifest->streams; iter; iter = g_slist_next (iter)) {
-+      GstMssStream *stream = iter->data;
-+
-+      if (stream->active) {
-+        if (stream->fragments) {
-+          GList *l = g_list_last (stream->fragments);
-+          GstMssStreamFragment *fragment = (GstMssStreamFragment *) l->data;
-+          guint64 frag_dur =
-+              fragment->time + fragment->duration * fragment->repetitions;
-+          max_dur = MAX (frag_dur, max_dur);
-+        }
-+      }
-+    }
-+
-+    if (max_dur != 0)
-+      dur = max_dur;
-+  }
-+
-   return dur;
- }
- 
--- 
-2.11.0
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch
new file mode 100644
index 0000000..caaa62d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch
@@ -0,0 +1,37 @@
+From 1523ab462c1bf19055960ced255f4872b6cf9f5c Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 5 Jul 2017 11:00:42 +0300
+Subject: [PATCH 1/2] vkdisplay: Use ifdef for platform specific defines
+
+VK_KHR_*_SURFACE_EXTENSION_NAME are only available when corresponding
+WSI is enabled.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=784539]
+---
+ ext/vulkan/vkdisplay.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ext/vulkan/vkdisplay.c b/ext/vulkan/vkdisplay.c
+index 550134cd8..ade5d4583 100644
+--- a/ext/vulkan/vkdisplay.c
++++ b/ext/vulkan/vkdisplay.c
+@@ -448,11 +448,15 @@ gst_vulkan_display_type_to_extension_string (GstVulkanDisplayType type)
+   if (type == GST_VULKAN_DISPLAY_TYPE_NONE)
+     return NULL;
+ 
++#if GST_VULKAN_HAVE_WINDOW_XCB
+   if (type & GST_VULKAN_DISPLAY_TYPE_XCB)
+     return VK_KHR_XCB_SURFACE_EXTENSION_NAME;
++#endif
+ 
++#if GST_VULKAN_HAVE_WINDOW_WAYLAND
+   if (type & GST_VULKAN_DISPLAY_TYPE_WAYLAND)
+     return VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
++#endif
+ 
+   return NULL;
+ }
+-- 
+2.13.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch
new file mode 100644
index 0000000..0df145d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch
@@ -0,0 +1,64 @@
+From c23e1dc22deb495561cffb877edb2746b740a1fa Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 5 Jul 2017 11:07:05 +0300
+Subject: [PATCH 2/2] vulkan: Use the generated version of vkconfig.h
+
+Build fails in ext/vulkan/xcb and ext/vulkan/wayland when:
+* building from tarball
+* building out-of-tree
+* Only one WSI integration (xcb or wayland) is enabled by configure.ac
+This is because vkconfig.h from source directory gets used instead
+of the generated one.
+
+Add the correct build directory to "-I". Use angle bracket
+include in vkapi.h so that it actually looks in the include search
+path instead of defaulting to the same (source tree) directory.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=784539]
+---
+ ext/vulkan/vkapi.h             | 2 +-
+ ext/vulkan/wayland/Makefile.am | 1 +
+ ext/vulkan/xcb/Makefile.am     | 1 +
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/ext/vulkan/vkapi.h b/ext/vulkan/vkapi.h
+index e9c23aa92..a37c29d0f 100644
+--- a/ext/vulkan/vkapi.h
++++ b/ext/vulkan/vkapi.h
+@@ -23,7 +23,7 @@
+ 
+ #define VK_PROTOTYPES
+ 
+-#include "vkconfig.h"
++#include <vkconfig.h>
+ #include "vk_fwd.h"
+ #include "vkmacros.h"
+ 
+diff --git a/ext/vulkan/wayland/Makefile.am b/ext/vulkan/wayland/Makefile.am
+index f92d85e2c..10cfb70e6 100644
+--- a/ext/vulkan/wayland/Makefile.am
++++ b/ext/vulkan/wayland/Makefile.am
+@@ -14,6 +14,7 @@ noinst_HEADERS = \
+ 
+ libgstvulkan_wayland_la_CFLAGS = \
+ 	-I$(top_srcdir)/gst-libs \
++	-I$(top_builddir)/ext/vulkan \
+ 	-I$(top_srcdir)/ext/vulkan \
+ 	-I$(top_builddir)/gst-libs \
+ 	$(GST_PLUGINS_BASE_CFLAGS) \
+diff --git a/ext/vulkan/xcb/Makefile.am b/ext/vulkan/xcb/Makefile.am
+index 7debcff9e..b5103551b 100644
+--- a/ext/vulkan/xcb/Makefile.am
++++ b/ext/vulkan/xcb/Makefile.am
+@@ -14,6 +14,7 @@ noinst_HEADERS = \
+ 
+ libgstvulkan_xcb_la_CFLAGS = \
+ 	-I$(top_srcdir)/gst-libs \
++	-I$(top_builddir)/ext/vulkan \
+ 	-I$(top_srcdir)/ext/vulkan \
+ 	-I$(top_builddir)/gst-libs \
+ 	$(GST_PLUGINS_BASE_CFLAGS) \
+-- 
+2.13.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/link-with-libvchostif.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/link-with-libvchostif.patch
new file mode 100644
index 0000000..c382b17
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/link-with-libvchostif.patch
@@ -0,0 +1,35 @@
+Add -lvchostif to link when using -lEGL on rpi
+
+This is required because libEGL from userland uses sybols
+from this library.
+
+lib/libEGL.so.1.0.0                                                                                                                                                                                                                              121: 00000000     0 FUNC    GLOBAL DEFAULT  UND vc_dispmanx_element_add
+  1552: 00000000     0 FUNC    GLOBAL DEFAULT  UND vc_dispmanx_element_add
+
+These symbols are provided by libvchostif as seen below
+
+lib/libvchostif.so
+   252: 0000b161   192 FUNC    GLOBAL DEFAULT    9 vc_dispmanx_element_add
+   809: 0000b161   192 FUNC    GLOBAL DEFAULT    9 vc_dispmanx_element_add
+
+With this explicit link, plugins fail during runtime
+
+(gst-plugin-scanner:571): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-1.0/libgstomx.so': Error relocating /usr/lib/libgstgl-1.0.so.0: vc_dispmanx_element_add: symbol not found
+(gst-plugin-scanner:571): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-1.0/libgstopengl.so': Error relocating /usr/lib/libgstgl-1.0.so.0: vc_dispmanx_element_add: symbol not found
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: gst-plugins-bad-1.10.4/configure.ac
+===================================================================
+--- gst-plugins-bad-1.10.4.orig/configure.ac
++++ gst-plugins-bad-1.10.4/configure.ac
+@@ -785,7 +785,7 @@ case $host in
+                             HAVE_EGL=yes
+                             HAVE_GLES2=yes
+                             HAVE_EGL_RPI=yes
+-                            EGL_LIBS="-lbcm_host -lvcos -lvchiq_arm"
++                            EGL_LIBS="-lbcm_host -lvchostif -lvcos -lvchiq_arm"
+                             EGL_CFLAGS=""
+                             AC_DEFINE(USE_EGL_RPI, [1], [Use RPi platform])
+                           ])
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.2.bb
similarity index 61%
rename from import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb
rename to import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.2.bb
index 0bb4053..8321da0 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.2.bb
@@ -1,9 +1,7 @@
 require gstreamer1.0-plugins-bad.inc
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
-                    file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
-                    file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50 \
-                    file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a"
+                    file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 "
 
 SRC_URI = " \
     http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \
@@ -15,12 +13,12 @@
     file://0009-glimagesink-Downrank-to-marginal.patch \
     file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
     file://0001-Prepend-PKG_CONFIG_SYSROOT_DIR-to-pkg-config-output.patch \
-    file://0001-smoothstreaming-implement-adaptivedemux-s-get_live_s.patch \
-    file://0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch \
-    file://0001-mssdemux-improved-live-playback-support.patch \
+    file://link-with-libvchostif.patch \
+    file://0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch \
+    file://0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch \
 "
-SRC_URI[md5sum] = "2757103e57a096a1a05b3ab85b8381af"
-SRC_URI[sha256sum] = "23ddae506b3a223b94869a0d3eea3e9a12e847f94d2d0e0b97102ce13ecd6966"
+SRC_URI[md5sum] = "5683f0ea91f9e1e0613b0f6f729980a7"
+SRC_URI[sha256sum] = "9c2c7edde4f59d74eb414e0701c55131f562e5c605a3ce9b091754f106c09e37"
 
 S = "${WORKDIR}/gst-plugins-bad-${PV}"
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
deleted file mode 100644
index 5341e3c..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 540e02c92c75e08b90326863dc787fa5cadf9da6 Mon Sep 17 00:00:00 2001
-From: Song Bing <b06498@freescale.com>
-Date: Fri, 13 Mar 2015 18:04:31 +0800
-Subject: [PATCH] encodebin: Need more buffers in output queue for better
- performance
-
-Need more buffers in output queue for better performance
-
-Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=744191]
-
-Signed-off-by: Song Bing <b06498@freescale.com>
----
- gst/encoding/gstencodebin.c |    3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c
-index 6728e58..32daae4 100644
---- a/gst/encoding/gstencodebin.c
-+++ b/gst/encoding/gstencodebin.c
-@@ -1228,8 +1228,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
-    * We only use a 1buffer long queue here, the actual queueing will be done
-    * 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,
-+  g_object_set (sgroup->outqueue, "max-size-time", (guint64) 0,
-       "silent", TRUE, NULL);
- 
-   gst_bin_add (GST_BIN (ebin), sgroup->outqueue);
--- 
-1.7.9.5
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.2.bb
similarity index 78%
rename from import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.4.bb
rename to import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.2.bb
index 7c81670..5de0b8b 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.10.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.2.bb
@@ -9,11 +9,10 @@
     file://get-caps-from-src-pad-when-query-caps.patch \
     file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \
     file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \
-    file://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \
     file://make-gio_unix_2_0-dependency-configurable.patch \
     file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
 "
-SRC_URI[md5sum] = "f6b46f8fac01eb773d556e3efc369e86"
-SRC_URI[sha256sum] = "f6d245b6b3d4cb733f81ebb021074c525ece83db0c10e932794b339b8d935eb7"
+SRC_URI[md5sum] = "77f5379c4ca677616b415e3b3ff95578"
+SRC_URI[sha256sum] = "5067dce3afe197a9536fea0107c77213fab536dff4a213b07fc60378d5510675"
 
 S = "${WORKDIR}/gst-plugins-base-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2-Fix-4K-colorimetry.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2-Fix-4K-colorimetry.patch
new file mode 100644
index 0000000..f78818a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2-Fix-4K-colorimetry.patch
@@ -0,0 +1,48 @@
+From 545646cccba243236e10362fe7325f89be57da1f Mon Sep 17 00:00:00 2001
+From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+Date: Tue, 18 Jul 2017 11:28:37 -0400
+Subject: [PATCH] v4l2: Fix 4K colorimetry
+
+Since 1.6, the transfer function for BT2020 has been changed from BT709
+to BT2020_12. It's the same function, but with more precision. As a side
+effect, the V4L2 colorpsace didn't match GStreamer colorspace. When
+GStreamer ended up making a guess, it would not match anything supported
+by V4L2 anymore. This this by using BT2020_12 for BT2020 colorspace and
+BT2020 transfer function in replacement of BT709 whenever a 4K
+resolution is detected.
+
+Upstream-Status: Backport
+Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
+
+---
+ sys/v4l2/gstv4l2object.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
+index 61244455f..aae2c55e7 100644
+--- a/sys/v4l2/gstv4l2object.c
++++ b/sys/v4l2/gstv4l2object.c
+@@ -1960,7 +1960,7 @@ gst_v4l2_object_get_colorspace (struct v4l2_format *fmt,
+     case V4L2_COLORSPACE_BT2020:
+       cinfo->range = GST_VIDEO_COLOR_RANGE_16_235;
+       cinfo->matrix = GST_VIDEO_COLOR_MATRIX_BT2020;
+-      cinfo->transfer = GST_VIDEO_TRANSFER_BT709;
++      cinfo->transfer = GST_VIDEO_TRANSFER_BT2020_12;
+       cinfo->primaries = GST_VIDEO_COLOR_PRIMARIES_BT2020;
+       break;
+     case V4L2_COLORSPACE_SMPTE240M:
+@@ -2062,7 +2062,10 @@ gst_v4l2_object_get_colorspace (struct v4l2_format *fmt,
+ 
+   switch (transfer) {
+     case V4L2_XFER_FUNC_709:
+-      cinfo->transfer = GST_VIDEO_TRANSFER_BT709;
++      if (fmt->fmt.pix.height > 2160)
++        cinfo->transfer = GST_VIDEO_TRANSFER_BT2020_12;
++      else
++        cinfo->transfer = GST_VIDEO_TRANSFER_BT709;
+       break;
+     case V4L2_XFER_FUNC_SRGB:
+       cinfo->transfer = GST_VIDEO_TRANSFER_SRGB;
+-- 
+2.14.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch
deleted file mode 100644
index 2a9a23e..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 22be02612adc757f6a43cefc6ee65ecaef68f0d9 Mon Sep 17 00:00:00 2001
-From: Carlos Rafael Giani <dv@pseudoterminal.org>
-Date: Thu, 23 Mar 2017 22:13:05 +0100
-Subject: [PATCH] v4l2object: Also add videometa if there is padding to the
- right and bottom
-
-https://bugzilla.gnome.org/show_bug.cgi?id=780478
-
-Upstream-Status: Backport [1.10.5]
-
-Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
----
- sys/v4l2/gstv4l2object.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
-index 91c8ff0..ed4654e 100644
---- a/sys/v4l2/gstv4l2object.c
-+++ b/sys/v4l2/gstv4l2object.c
-@@ -3070,9 +3070,10 @@ store_info:
-   GST_DEBUG_OBJECT (v4l2object->element, "Got sizeimage %" G_GSIZE_FORMAT,
-       info->size);
- 
--  /* to avoid copies we need video meta if top or left padding */
-+  /* to avoid copies we need video meta if there is padding */
-   v4l2object->need_video_meta =
--      ((align->padding_top + align->padding_left) != 0);
-+      ((align->padding_top + align->padding_left + align->padding_right +
-+          align->padding_bottom) != 0);
- 
-   /* ... or if stride is non "standard" */
-   if (!standard_stride)
--- 
-2.7.4
-
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.2.bb
similarity index 73%
rename from import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.4.bb
rename to import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.2.bb
index 57447bf..f9593c9 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.10.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.2.bb
@@ -10,9 +10,12 @@
     file://avoid-including-sys-poll.h-directly.patch \
     file://ensure-valid-sentinel-for-gst_structure_get.patch \
     file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
-    file://0001-v4l2object-Also-add-videometa-if-there-is-padding-to.patch \
+    file://0001-v4l2-Fix-4K-colorimetry.patch \
 "
-SRC_URI[md5sum] = "cc0cc13cdb07d4237600b6886b81f31d"
-SRC_URI[sha256sum] = "8a86c61434a8c44665365bd0b3557a040937d1f44bf69caee4e9ea816ce74d7e"
+SRC_URI[md5sum] = "20254217d9805484532e08ff1c3aa296"
+SRC_URI[sha256sum] = "5591ee7208ab30289a30658a82b76bf87169c927572d9b794f3a41ed48e1ee96"
 
 S = "${WORKDIR}/gst-plugins-good-${PV}"
+
+RPROVIDES_${PN}-pulseaudio += "${PN}-pulse"
+RPROVIDES_${PN}-soup += "${PN}-souphttpsrc"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
index 708ad7a..60aa968 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
@@ -18,7 +18,6 @@
 PACKAGECONFIG[cdio]     = "--enable-cdio,--disable-cdio,libcdio"
 PACKAGECONFIG[dvdread]  = "--enable-dvdread,--disable-dvdread,libdvdread"
 PACKAGECONFIG[lame]     = "--enable-lame,--disable-lame,lame"
-PACKAGECONFIG[mad]      = "--enable-mad,--disable-mad,libmad"
 PACKAGECONFIG[mpeg2dec] = "--enable-mpeg2dec,--disable-mpeg2dec,mpeg2dec"
 PACKAGECONFIG[mpg123]   = "--enable-mpg123,--disable-mpg123,mpg123"
 PACKAGECONFIG[x264]     = "--enable-x264,--disable-x264,x264"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.12.2.bb
similarity index 76%
rename from import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.4.bb
rename to import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.12.2.bb
index 92a2caa..6956c85 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.10.4.bb
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.12.2.bb
@@ -7,7 +7,7 @@
     http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \
     file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
 "
-SRC_URI[md5sum] = "c68d0509c9980b0b70a4b836ff73fff1"
-SRC_URI[sha256sum] = "6386c77ca8459cba431ed0b63da780c7062c7cc48055d222024d8eaf198ffa59"
+SRC_URI[md5sum] = "eb639021905a32cf3013ca5bac1b694d"
+SRC_URI[sha256sum] = "1cc3942bbf3ea87da3e35437d4e014e991b103db22a6174f62a98c89c3f5f466"
 
 S = "${WORKDIR}/gst-plugins-ugly-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
index 3f6d4c3..c40d398 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
@@ -49,3 +49,6 @@
 do_configure[prefuncs] += " delete_pkg_m4_file patch_gtk_doc_makefiles"
 
 PACKAGES_DYNAMIC = "^${PN}-.*"
+
+# qemu-mips64: error while loading shared libraries: .../recipe-sysroot/usr/lib/libgthread-2.0.so.0: ELF file data encoding not little-endian
+EXTRA_OECONF_append_mips64 = " --disable-introspection "
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python.inc
new file mode 100644
index 0000000..961b930
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python.inc
@@ -0,0 +1,35 @@
+SUMMARY = "Python bindings for GStreamer 1.0"
+HOMEPAGE = "http://cgit.freedesktop.org/gstreamer/gst-python/"
+SECTION = "multimedia"
+LICENSE = "LGPLv2.1"
+
+DEPENDS = "gstreamer1.0 python3-pygobject"
+RDEPENDS_${PN} += "gstreamer1.0 python3-pygobject"
+
+PNREAL = "gst-python"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz"
+
+S = "${WORKDIR}/${PNREAL}-${PV}"
+
+inherit autotools pkgconfig distutils3-base upstream-version-is-even gobject-introspection
+
+do_install_append() {
+    # gstpythonplugin hardcodes the location of the libpython from the build
+    # workspace and then fails at runtime. We can override it using
+    # --with-libpython-dir=${libdir}, but it still fails because it looks for a
+    # symlinked library ending in .so instead of the actually library with
+    # LIBNAME.so.MAJOR.MINOR. Although we could patch the code to use the path
+    # we want, it will break again if the library version ever changes. We need
+    # to think about the best way of handling this and possibly consult
+    # upstream.
+    #
+    # Note that this particular find line is taken from the Debian packaging for
+    # gst-python1.0.
+    find "${D}" \
+        -name '*.pyc' -o \
+        -name '*.pyo' -o \
+        -name '*.la' -o \
+        -name 'libgstpythonplugin*' \
+        -delete
+}
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.12.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.12.2.bb
new file mode 100644
index 0000000..b2dc05b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.12.2.bb
@@ -0,0 +1,7 @@
+require gstreamer1.0-python.inc
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz"
+SRC_URI[md5sum] = "da5c9fa42290bc3006661c869e076ffe"
+SRC_URI[sha256sum] = "f4cc32ad46a653e1ae2f27ac2a16078b00075c9106b2784a1a8d1f31c5069e47"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c34deae4e395ca07e725ab0076a5f740"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
index 7191f98..68173ce 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
@@ -36,3 +36,5 @@
 
 do_configure[prefuncs] += " delete_pkg_m4_file patch_gtk_doc_makefiles"
 
+# Needs to be disable due to a dependency on gstreamer-plugins introspection files
+EXTRA_OECONF_append_mips64 = " --disable-introspection "
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.4.bb
deleted file mode 100644
index 6aa9a53..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.10.4.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require gstreamer1.0-rtsp-server.inc
-
-SRC_URI[md5sum] = "ef587fa6393e09bc26f884510596e305"
-SRC_URI[sha256sum] = "2f6e12fd4e3568ee190dc24e57e4c3a878971c3a3fb6904a9674404fac256de6"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.12.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.12.2.bb
new file mode 100644
index 0000000..2426cca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.12.2.bb
@@ -0,0 +1,6 @@
+require gstreamer1.0-rtsp-server.inc
+
+SRC_URI[md5sum] = "022757cab183f5b970086e9101c60a98"
+SRC_URI[sha256sum] = "d8ba9264e8ae6e440293328e759e40456f161aa66077b3143dd07581136190b3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc
index ef0734b..abfcc65 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc
@@ -22,12 +22,21 @@
 
 PACKAGES =+ "${PN}-tests"
 
+# OpenGL packageconfig factored out to make it easy for distros
+# and BSP layers to pick either glx, egl, or no GL. By default,
+# try detecting X11 first, and if found (with OpenGL), use GLX,
+# otherwise try to check if EGL can be used.
+PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'glx', \
+                        bb.utils.contains('DISTRO_FEATURES',     'opengl', 'egl', \
+                                                                       '', d), d)}"
+
 PACKAGECONFIG ??= "drm \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)} \
+                   ${PACKAGECONFIG_GL} \
                    ${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
 
 PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,udev libdrm"
-PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,virtual/mesa"
+PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
+PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,virtual/libgl"
 PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland"
 PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxrandr libxrender"
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb
deleted file mode 100644
index 44c66de..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require gstreamer1.0-vaapi.inc
-SRC_URI[md5sum] = "318af17f906637570b61dd7be9b5581d"
-SRC_URI[sha256sum] = "03e690621594d9f9495d86c7dac8b8590b3a150462770ed070dc76f66a70de75"
-
-SRC_URI += "file://vaapivideobufferpool-create-allocator-if-needed.patch"
-
-DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.12.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.12.2.bb
new file mode 100644
index 0000000..fbd9f86
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.12.2.bb
@@ -0,0 +1,5 @@
+require gstreamer1.0-vaapi.inc
+SRC_URI[md5sum] = "bea015f33696a15ad9575fb71af862ed"
+SRC_URI[sha256sum] = "23c714e0474b3c7ae6ff8884aebf8503a1bc3ded335fa2d2b2ac31788466163a"
+
+DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
index 72d7ce6..3291934 100644
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
@@ -25,10 +25,10 @@
 PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
 PACKAGECONFIG[gst-tracer-hooks] = "--enable-gst-tracer-hooks,--disable-gst-tracer-hooks,"
 PACKAGECONFIG[unwind] = "--with-unwind,--without-unwind,libunwind"
+PACKAGECONFIG[dw] = "--with-dw,--without-dw,elfutils"
 
 EXTRA_OECONF = " \
     --disable-dependency-tracking \
-    --disable-docbook \
     --disable-examples \
 "
 
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-configure-Add-switches-for-enabling-disabling-libdw-.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-configure-Add-switches-for-enabling-disabling-libdw-.patch
new file mode 100644
index 0000000..1132fd5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-configure-Add-switches-for-enabling-disabling-libdw-.patch
@@ -0,0 +1,70 @@
+From a0cb41ba72913eda06049d266ec43ea8f52b5bee Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Fri, 11 Aug 2017 21:21:36 +0200
+Subject: [PATCH] configure: Add switches for enabling/disabling libdw and
+ libunwind
+
+[Original patch modified to be applicable to 1.12.2]
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=778193]
+
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ configure.ac | 38 ++++++++++++++++++++++++++++++++------
+ 1 file changed, 32 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b6b2923..32dd827 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -821,15 +821,41 @@ fi
+ AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
+ 
+ dnl libunwind is optionally used by the leaks tracer
+-PKG_CHECK_MODULES(UNWIND, libunwind, HAVE_UNWIND=yes, HAVE_UNWIND=no)
+-if test "x$HAVE_UNWIND" = "xyes"; then
+-  AC_DEFINE(HAVE_UNWIND, 1, [libunwind available])
++AC_ARG_WITH([unwind],[AS_HELP_STRING([--with-unwind=yes|no|auto],[use libunwind])],
++            [], [with_unwind=auto])
++if [ test "x${with_unwind}" != "xno" ]; then
++  PKG_CHECK_MODULES(UNWIND, [libunwind],
++      [
++        HAVE_UNWIND=yes
++        AC_DEFINE(HAVE_UNWIND, 1, [libunwind available])
++      ],
++      [
++        HAVE_UNWIND=no
++        if [ test "x${with_unwind}" = "xyes" ]; then
++          AC_MSG_ERROR([could not find libunwind])
++        fi
++      ])
++else
++  HAVE_UNWIND=no
+ fi
+ 
+ dnl libdw is optionally used to add source lines and numbers to backtraces
+-PKG_CHECK_MODULES(DW, libdw, HAVE_DW=yes, HAVE_DW=no)
+-if test "x$HAVE_DW" = "xyes"; then
+-  AC_DEFINE(HAVE_DW, 1, [libdw available])
++AC_ARG_WITH([dw],[AS_HELP_STRING([--with-dw=yes|no|auto],[use libdw])],
++            [], [with_dw=auto])
++if [ test "x${with_dw}" != "xno" ]; then
++  PKG_CHECK_MODULES(DW, [libdw],
++      [
++        HAVE_DW=yes
++        AC_DEFINE(HAVE_DW, 1, [libdw available])
++      ],
++      [
++        HAVE_DW=no
++        if [ test "x${with_dw}" = "xyes" ]; then
++          AC_MSG_ERROR([could not find libdw])
++        fi
++      ])
++else
++  HAVE_DW=no
+ fi
+ 
+ dnl Check for backtrace() from libc
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/deterministic-unwind.patch b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/deterministic-unwind.patch
deleted file mode 100644
index e39e6ca..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0/deterministic-unwind.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Make the detection of libunwind deterministic.
-
-Upstream-Status: Pending
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-diff --git a/configure.ac b/configure.ac
-index ac88fb2..182c19a 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -829,3 +828,0 @@ AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
--dnl libunwind is optionally used by the leaks tracer
--PKG_CHECK_MODULES(UNWIND, libunwind, HAVE_UNWIND=yes, HAVE_UNWIND=no)
--
-@@ -839,3 +836,7 @@ AC_CHECK_FUNC(backtrace, [
--if test "x$HAVE_UNWIND" = "xyes"; then
--  AC_DEFINE(HAVE_UNWIND, 1, [libunwind available])
--fi
-+dnl libunwind is optionally used by the leaks tracer
-+AC_ARG_WITH([unwind],[AS_HELP_STRING([--with-unwind],[use libunwind])],
-+            [], [with_unwind=yes])
-+AS_IF([test "$with_unwind" = yes],
-+      [PKG_CHECK_MODULES(UNWIND, libunwind)
-+       AC_DEFINE(HAVE_UNWIND, 1, [libunwind available])]
-+)
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.4.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.4.bb
deleted file mode 100644
index 2a67993..0000000
--- a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.10.4.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-require gstreamer1.0.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
-                    file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
-
-SRC_URI = " \
-    http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \
-    file://deterministic-unwind.patch \
-"
-SRC_URI[md5sum] = "7c91a97e4a2dc81eafd59d0a2f8b0d6e"
-SRC_URI[sha256sum] = "50c2f5af50a6cc6c0a3f3ed43bdd8b5e2bff00bacfb766d4be139ec06d8b5218"
-
-S = "${WORKDIR}/gstreamer-${PV}"
diff --git a/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.12.2.bb b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.12.2.bb
new file mode 100644
index 0000000..8d41a59
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.12.2.bb
@@ -0,0 +1,13 @@
+require gstreamer1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \
+    file://0001-configure-Add-switches-for-enabling-disabling-libdw-.patch \
+"
+SRC_URI[md5sum] = "4748860621607ffd96244fb79c86c238"
+SRC_URI[sha256sum] = "9fde3f39a2ea984f9e07ce09250285ce91f6e3619d186889f75b5154ecf994ba"
+
+S = "${WORKDIR}/gstreamer-${PV}"