summaryrefslogtreecommitdiff
path: root/gst/rtmp2
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2020-05-20 10:54:21 +0200
committerEdward Hervey <bilboed@bilboed.com>2020-05-20 10:55:55 +0200
commitf3d6026ad23502f943677e1ae11583613aa3c53f (patch)
tree208b1927e6891c38e2f93d5e46cbaf34397baad5 /gst/rtmp2
parent21602395480eddf12025553bbe3685d999bada94 (diff)
downloadgstreamer-plugins-bad-f3d6026ad23502f943677e1ae11583613aa3c53f.tar.gz
rtmp2src: Answer scheduling query
Just like for rtmpsrc, we must inform downstream that we are a sequential (i.e. don't do random access efficiently) and bandwith-limited (i.e. might need buffering downstream) element Fixes buffering issues with playbin3 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1282>
Diffstat (limited to 'gst/rtmp2')
-rw-r--r--gst/rtmp2/gstrtmp2src.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gst/rtmp2/gstrtmp2src.c b/gst/rtmp2/gstrtmp2src.c
index 150b42f5f..c3603aebb 100644
--- a/gst/rtmp2/gstrtmp2src.c
+++ b/gst/rtmp2/gstrtmp2src.c
@@ -106,6 +106,7 @@ static gboolean gst_rtmp2_src_unlock (GstBaseSrc * src);
static gboolean gst_rtmp2_src_unlock_stop (GstBaseSrc * src);
static GstFlowReturn gst_rtmp2_src_create (GstBaseSrc * src, guint64 offset,
guint size, GstBuffer ** outbuf);
+static gboolean gst_rtmp2_src_query (GstBaseSrc * src, GstQuery * query);
/* Internal API */
static void gst_rtmp2_src_task_func (gpointer user_data);
@@ -178,6 +179,7 @@ gst_rtmp2_src_class_init (GstRtmp2SrcClass * klass)
base_src_class->unlock = GST_DEBUG_FUNCPTR (gst_rtmp2_src_unlock);
base_src_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_rtmp2_src_unlock_stop);
base_src_class->create = GST_DEBUG_FUNCPTR (gst_rtmp2_src_create);
+ base_src_class->query = GST_DEBUG_FUNCPTR (gst_rtmp2_src_query);
g_object_class_override_property (gobject_class, PROP_LOCATION, "location");
g_object_class_override_property (gobject_class, PROP_SCHEME, "scheme");
@@ -694,6 +696,33 @@ out:
}
static gboolean
+gst_rtmp2_src_query (GstBaseSrc * basesrc, GstQuery * query)
+{
+ gboolean ret = FALSE;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_SCHEDULING:{
+ gst_query_set_scheduling (query,
+ GST_SCHEDULING_FLAG_SEQUENTIAL |
+ GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED, 1, -1, 0);
+ gst_query_add_scheduling_mode (query, GST_PAD_MODE_PUSH);
+
+ ret = TRUE;
+ break;
+ }
+ default:
+ ret = FALSE;
+ break;
+ }
+
+ if (!ret)
+ ret =
+ GST_BASE_SRC_CLASS (gst_rtmp2_src_parent_class)->query (basesrc, query);
+
+ return ret;
+}
+
+static gboolean
main_loop_running_cb (GstRtmp2Src * self)
{
GST_TRACE_OBJECT (self, "Main loop running now");