summaryrefslogtreecommitdiff
path: root/tests/check
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>2021-01-26 10:39:34 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>2021-01-27 09:48:49 +0100
commit912cf46b83d44905fd53ed11e142b9183e1fa887 (patch)
tree41814653161e5725ef744eeca57db5b09a320c59 /tests/check
parent5acde5568ee4faf12b3f58fe420cb98dae113fff (diff)
downloadgstreamer-plugins-base-912cf46b83d44905fd53ed11e142b9183e1fa887.tar.gz
rtpbasepayload: set attributes on newly requested extensions
Users were supposed to configure the extension themselves but it was impossible to do so as they didn't have access to the caps. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1021>
Diffstat (limited to 'tests/check')
-rw-r--r--tests/check/libs/rtpbasepayload.c5
-rw-r--r--tests/check/libs/rtpdummyhdrextimpl.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/check/libs/rtpbasepayload.c b/tests/check/libs/rtpbasepayload.c
index 73afca2ff..a94faa590 100644
--- a/tests/check/libs/rtpbasepayload.c
+++ b/tests/check/libs/rtpbasepayload.c
@@ -2150,16 +2150,20 @@ request_extension (GstRTPBasePayload * depayload, guint ext_id,
GST_START_TEST (rtp_base_payload_caps_request)
{
GstRTPHeaderExtension *ext;
+ GstRTPDummyHdrExt *dummy;
State *state;
state =
create_payloader ("application/x-rtp", &sinktmpl_with_extmap_str, NULL);
ext = rtp_dummy_hdr_ext_new ();
+ dummy = GST_RTP_DUMMY_HDR_EXT (ext);
gst_rtp_header_extension_set_id (ext, 4);
g_signal_connect (state->element, "request-extension",
G_CALLBACK (request_extension), ext);
+ fail_unless (dummy->set_attributes_count == 0);
+
set_state (state, GST_STATE_PLAYING);
push_buffer (state, "pts", 0 * GST_SECOND, NULL);
@@ -2175,6 +2179,7 @@ GST_START_TEST (rtp_base_payload_caps_request)
validate_normal_start_events (0);
fail_unless_equals_int (GST_RTP_DUMMY_HDR_EXT (ext)->write_count, 1);
+ fail_unless (dummy->set_attributes_count == 1);
gst_object_unref (ext);
destroy_payloader (state);
diff --git a/tests/check/libs/rtpdummyhdrextimpl.c b/tests/check/libs/rtpdummyhdrextimpl.c
index 180dbc80b..379bfe1d2 100644
--- a/tests/check/libs/rtpdummyhdrextimpl.c
+++ b/tests/check/libs/rtpdummyhdrextimpl.c
@@ -53,6 +53,7 @@ struct _GstRTPDummyHdrExt
GstRTPHeaderExtensionFlags supported_flags;
guint read_count;
guint write_count;
+ guint set_attributes_count;
gchar *direction;
gchar *attributes;
@@ -245,6 +246,8 @@ gst_rtp_dummy_hdr_ext_set_attributes_from_caps (GstRTPHeaderExtension * ext,
const gchar *ext_uri;
const GValue *arr;
+ dummy->set_attributes_count++;
+
if (!field_name)
return FALSE;