summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2018-02-05 16:57:52 +1100
committerMatthew Waters <matthew@centricular.com>2018-02-05 17:44:33 +1100
commiteaef193d082e0e6c87736359c9284ba6640683c9 (patch)
treed5fe929a82153fd98363fa1f3f496355ade67319 /ext
parentdc452aa799d80d5f28720e051ac4160a9cf58140 (diff)
dtls: drop upstream segment and stream-start events
Fixes tests with GstHarness We will push our own from the srcpad task.
Diffstat (limited to 'ext')
-rw-r--r--ext/dtls/gstdtlsenc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/dtls/gstdtlsenc.c b/ext/dtls/gstdtlsenc.c
index d6c6402f7..5b3bb26af 100644
--- a/ext/dtls/gstdtlsenc.c
+++ b/ext/dtls/gstdtlsenc.c
@@ -96,6 +96,7 @@ static gboolean src_activate_mode (GstPad *, GstObject *, GstPadMode,
static void src_task_loop (GstPad *);
static GstFlowReturn sink_chain (GstPad *, GstObject *, GstBuffer *);
+static gboolean sink_event (GstPad * pad, GstObject * parent, GstEvent * event);
static void on_key_received (GstDtlsConnection *, gpointer key, guint cipher,
guint auth, GstDtlsEnc *);
@@ -355,6 +356,7 @@ gst_dtls_enc_request_new_pad (GstElement * element,
}
gst_pad_set_chain_function (sink, GST_DEBUG_FUNCPTR (sink_chain));
+ gst_pad_set_event_function (sink, GST_DEBUG_FUNCPTR (sink_event));
ret = gst_pad_set_active (sink, TRUE);
g_warn_if_fail (ret);
@@ -493,6 +495,29 @@ sink_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
return GST_FLOW_OK;
}
+
+static gboolean
+sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
+{
+ gboolean ret = FALSE;
+
+ switch (GST_EVENT_TYPE (event)) {
+ /* Drop segment, stream-start as we will push our own from the src pad
+ * task.
+ * FIXME: do we need any information from upstream for pushing our own? */
+ case GST_EVENT_SEGMENT:
+ case GST_EVENT_STREAM_START:
+ gst_event_unref (event);
+ ret = TRUE;
+ break;
+ default:
+ ret = gst_pad_event_default (pad, parent, event);
+ break;
+ }
+
+ return ret;
+}
+
static void
on_key_received (GstDtlsConnection * connection, gpointer key, guint cipher,
guint auth, GstDtlsEnc * self)