Signed-off-by: Yuqing Zhu <carol....@nxp.com> --- ...configuration-for-enabling-accurate-seeks.patch | 148 +++++++++++++++++++++ .../gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb | 1 + 2 files changed, 149 insertions(+) create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-player-Add-configuration-for-enabling-accurate-seeks.patch
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-player-Add-configuration-for-enabling-accurate-seeks.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-player-Add-configuration-for-enabling-accurate-seeks.patch new file mode 100755 index 0000000..46d602c --- /dev/null +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-player-Add-configuration-for-enabling-accurate-seeks.patch @@ -0,0 +1,148 @@ +From 698fbfbf955af2fb9b79f9e6e8091b8750c886c4 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <lyon.w...@nxp.com> +Date: Wed, 26 Oct 2016 16:28:10 +0800 +Subject: [PATCH 1/5] player: Add configuration for enabling accurate seeks + +Upstream-Status: Backport [1.11.1] +https://bugzilla.gnome.org/show_bug.cgi?id=773521 + +--- + docs/libs/gst-plugins-bad-libs-sections.txt | 3 ++ + gst-libs/gst/player/gstplayer.c | 60 +++++++++++++++++++++++++++++ + gst-libs/gst/player/gstplayer.h | 3 ++ + 3 files changed, 66 insertions(+) + +diff --git a/docs/libs/gst-plugins-bad-libs-sections.txt b/docs/libs/gst-plugins-bad-libs-sections.txt +index dbab6f7..77092f9 100644 +--- a/docs/libs/gst-plugins-bad-libs-sections.txt ++++ b/docs/libs/gst-plugins-bad-libs-sections.txt +@@ -1953,6 +1953,9 @@ gst_player_config_get_position_update_interval + gst_player_config_set_user_agent + gst_player_config_get_user_agent + ++gst_player_config_set_seek_accurate ++gst_player_config_get_seek_accurate ++ + <SUBSECTION Standard> + GST_IS_PLAYER + GST_IS_PLAYER_CLASS +diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c +index 313bca5..d9ff524 100644 +--- a/gst-libs/gst/player/gstplayer.c ++++ b/gst-libs/gst/player/gstplayer.c +@@ -85,6 +85,7 @@ typedef enum + { + CONFIG_QUARK_USER_AGENT = 0, + CONFIG_QUARK_POSITION_INTERVAL_UPDATE, ++ CONFIG_QUARK_ACCURATE_SEEK, + + CONFIG_QUARK_MAX + } ConfigQuarkId; +@@ -92,6 +93,7 @@ typedef enum + static const gchar *_config_quark_strings[] = { + "user-agent", + "position-interval-update", ++ "accurate-seek", + }; + + GQuark _config_quark_table[CONFIG_QUARK_MAX]; +@@ -266,6 +268,7 @@ gst_player_init (GstPlayer * self) + /* *INDENT-OFF* */ + self->config = gst_structure_new_id (QUARK_CONFIG, + CONFIG_QUARK (POSITION_INTERVAL_UPDATE), G_TYPE_UINT, DEFAULT_POSITION_UPDATE_INTERVAL_MS, ++ CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, FALSE, + NULL); + /* *INDENT-ON* */ + +@@ -2967,6 +2970,7 @@ gst_player_seek_internal_locked (GstPlayer * self) + GstStateChangeReturn state_ret; + GstEvent *s_event; + GstSeekFlags flags = 0; ++ gboolean accurate = FALSE; + + if (self->seek_source) { + g_source_destroy (self->seek_source); +@@ -3002,6 +3006,14 @@ gst_player_seek_internal_locked (GstPlayer * self) + + flags |= GST_SEEK_FLAG_FLUSH; + ++ accurate = gst_player_config_get_seek_accurate (self->config); ++ ++ if (accurate) { ++ flags |= GST_SEEK_FLAG_ACCURATE; ++ } else { ++ flags &= ~GST_SEEK_FLAG_ACCURATE; ++ } ++ + if (rate != 1.0) { + flags |= GST_SEEK_FLAG_TRICKMODE; + } +@@ -4199,3 +4211,51 @@ gst_player_config_get_position_update_interval (const GstStructure * config) + + return interval; + } ++ ++/** ++ * gst_player_config_set_seek_accurate: ++ * @player: #GstPlayer instance ++ * @accurate: accurate seek or not ++ * ++ * Enable or disable accurate seeking. When enabled, elements will try harder ++ * to seek as accurately as possible to the requested seek position. Generally ++ * it will be slower especially for formats that don't have any indexes or ++ * timestamp markers in the stream. ++ * ++ * If accurate seeking is disabled, elements will seek as close as the request ++ * position without slowing down seeking too much. ++ * ++ * Accurate seeking is disabled by default. ++ * ++ * Since: 1.12 ++ */ ++void ++gst_player_config_set_seek_accurate (GstPlayer * self, gboolean accurate) ++{ ++ GstStructure *config = self->config; ++ g_return_if_fail (config != NULL); ++ ++ gst_structure_id_set (config, ++ CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, accurate, NULL); ++} ++ ++/** ++ * gst_player_config_get_seek_accurate: ++ * @config: a #GstPlayer configuration ++ * ++ * Returns: %TRUE if accurate seeking is enabled ++ * ++ * Since 1.12 ++ */ ++gboolean ++gst_player_config_get_seek_accurate (const GstStructure * config) ++{ ++ gboolean accurate = FALSE; ++ ++ g_return_val_if_fail (config != NULL, FALSE); ++ ++ gst_structure_id_get (config, ++ CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, &accurate, NULL); ++ ++ return accurate; ++} +diff --git a/gst-libs/gst/player/gstplayer.h b/gst-libs/gst/player/gstplayer.h +index 0ac66be..8426be5 100644 +--- a/gst-libs/gst/player/gstplayer.h ++++ b/gst-libs/gst/player/gstplayer.h +@@ -202,6 +202,9 @@ void gst_player_config_set_position_update_interval (GstStructure * c + guint interval); + guint gst_player_config_get_position_update_interval (const GstStructure * config); + ++void gst_player_config_set_seek_accurate (GstPlayer * player, gboolean accurate); ++gboolean gst_player_config_get_seek_accurate (const GstStructure * config); ++ + G_END_DECLS + + #endif /* __GST_PLAYER_H__ */ +-- +1.9.1 + diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb index a5fc913..6655a86 100644 --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.4.bb @@ -19,6 +19,7 @@ SRC_URI = " \ file://0001-smoothstreaming-use-the-duration-from-the-list-of-fr.patch \ file://0001-mssdemux-improved-live-playback-support.patch \ file://0002-qmlglsrc-some-enhancements-for-qmlglsrc.patch \ + file://0003-player-Add-configuration-for-enabling-accurate-seeks.patch \ " SRC_URI[md5sum] = "2757103e57a096a1a05b3ab85b8381af" SRC_URI[sha256sum] = "23ddae506b3a223b94869a0d3eea3e9a12e847f94d2d0e0b97102ce13ecd6966" -- 1.9.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core