summaryrefslogtreecommitdiff
path: root/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0015-gstplayer-Add-gst_player_get_state-API.patch
blob: da6f8783d811c200663688d4ab21ccdfafb135e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 6e74c8bb4c93f07a83b6e79acfcef467e735abc5 Mon Sep 17 00:00:00 2001
From: Lyon Wang <lyon.wang@nxp.com>
Date: Fri, 17 Feb 2017 17:22:31 +0800
Subject: [PATCH 15/26] gstplayer: Add gst_player_get_state() API

- Add gst_player_get_state() API

https://bugzilla.gnome.org/show_bug.cgi?id=778379
Upstream-Status: Submitted

Signed-off-by: Lyon Wang <lyon.wang@nxp.com>

Conflicts:
	gst-libs/gst/player/gstplayer.c
---
 gst-libs/gst/player/gstplayer.c | 20 ++++++++++++++++++++
 gst-libs/gst/player/gstplayer.h |  2 ++
 2 files changed, 22 insertions(+)

diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c
index 92ad919..ebad94e 100644
--- a/gst-libs/gst/player/gstplayer.c
+++ b/gst-libs/gst/player/gstplayer.c
@@ -5042,3 +5042,23 @@ gst_player_get_text_sink (GstPlayer * self)
 
   return actual_sink;
 }
+
+/**
+ * gst_player_get_state:
+ * @player: #GstPlayer instance
+ *
+ * Gets internal GstPlayer state.
+ * It's not guaranteed that the state returned is the current state,
+ * it might've changed in the meantime.
+ *
+ * Returns: (transfer none): internal GstPlayerState
+ *
+ * Since 1.12
+ */
+GstPlayerState
+gst_player_get_state (GstPlayer * self)
+{
+  g_return_val_if_fail (GST_IS_PLAYER (self), GST_PLAYER_STATE_STOPPED);
+
+  return self->app_state;
+}
diff --git a/gst-libs/gst/player/gstplayer.h b/gst-libs/gst/player/gstplayer.h
index f444918..5ee3592 100644
--- a/gst-libs/gst/player/gstplayer.h
+++ b/gst-libs/gst/player/gstplayer.h
@@ -228,6 +228,8 @@ gboolean    gst_player_set_text_sink (GstPlayer * player, GstElement * text_sink
 GstElement * gst_player_get_audio_sink (GstPlayer * player);
 GstElement * gst_player_get_text_sink (GstPlayer * player);
 
+GstPlayerState  gst_player_get_state (GstPlayer * player);
+
 G_END_DECLS
 
 #endif /* __GST_PLAYER_H__ */
-- 
1.9.1