SrtpDec: request-key-callback results in app crash

Jochen Jung jochenmajjung at gmail.com
Mon Nov 23 01:37:42 UTC 2020


Hello,


I have a similar problem to Need Help Regarding SRTPDEC request_key_callback
<https://lists.freedesktop.org/archives/gstreamer-devel/2020-April/074627.html>,
which was eventually not resolved.

The following callback is used:

GstCaps StreamDecrypt::keyRequested([[maybe_unused]] GstElement
element, guint ssrc, gpointer data)
>
> {
>
> 	GstCaps * caps = (GstCaps *)data;
>
>
> 	GValue val_ssrc = G_VALUE_INIT;
>
> 	g_value_init(&val_ssrc, G_TYPE_UINT);
>
> 	g_value_set_uint(&val_ssrc, ssrc);
>
>
> 	gst_caps_set_value(caps, "ssrc", &val_ssrc);
>
> 	dump(caps); // print GstCaps
>
>
> 	return *caps;
>
> }
>
>
This is how the request-key signal is connected:

g_signal_connect(decrypt->getGstElement(), "request-key",
G_CALLBACK(StreamDecrypt::keyRequested), decrypt->getCapsSrtp());
>
> // decrypt->getGstElement() returns the GstElement* of the GstSrtpDec.
>
// decrypt->getCapsSrtp() returns the GstCaps*.
>

I confirmed that the GstCaps are set correctly, which are:

application/x-srtp,
> srtp-key=(buffer)c99a66320db73158a35a255d051758e95ed4abb2cdc69bb454110e827441,
> srtp-cipher=(string)aes-128-icm, srtp-auth=(string)hmac-sha1-80,
> srtcp-cipher=(string)aes-128-icm, srtcp-auth=(string)hmac-sha1-80,
> media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMU,
> payload=(int)0, ssrc=(uint)112235;
>

During runtime i get the following error:

(AudioStream:9995): GLib-GObject-CRITICAL **: 02:12:00.065: g_object_unref:
> assertion 'G_IS_OBJECT (object)' failed
>
> ** (AudioStream:9995): CRITICAL **: 02:12:00.065:
> update_session_stream_from_caps: assertion 'GST_IS_SRTP_DEC (filter)' failed
>

I traced this error back to a function in GstPad. The function
ACQUIRE_PARENT(pad, parent, label) returns an invliad GstSrtpDev object.
This invalid GstSrtpDec results in the above mentioned errors in
GstSrtpDec::update_session_stream_from_caps. The app crash occurs in
GstCaps::gst_caps_to_string.

Can anyone please tell me what i am doing wrong here? If everything is set
up correctly i have to assume this is a bug in the plugin.


Thanks in advance and regards,
Jochen Jung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201123/6047c675/attachment.htm>


More information about the gstreamer-devel mailing list