<div dir="ltr"><div><span style="background-color:rgb(147,196,125)"><span style=""></span></span>Hello,</div><div><br></div><div><br></div><div>I have a similar problem to <a href="https://lists.freedesktop.org/archives/gstreamer-devel/2020-April/074627.html">Need Help Regarding SRTPDEC request_key_callback</a>, which was eventually not resolved.</div><div><br></div><div>The following callback is used:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>

<pre style="margin:0px;text-indent:0px">GstCaps<span style="color:rgb(192,192,192)"> </span>StreamDecrypt::keyRequested([[maybe_unused]]<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GstElement</span><span style="color:rgb(192,192,192)"> </span>element,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">guint</span><span style="color:rgb(192,192,192)"> </span>ssrc,<span style="color:rgb(192,192,192)"> </span>gpointer<span style="color:rgb(192,192,192)"> </span>data)</pre>
<pre style="margin:0px;text-indent:0px">{</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,128)">GstCaps</span><span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span>caps<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(128,0,128)">GstCaps</span><span style="color:rgb(192,192,192)"> </span>*)data;</pre>
<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,0,128)">GValue</span><span style="color:rgb(192,192,192)"> </span>val_ssrc<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">G_VALUE_INIT</span>;</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">   </span>g_value_init(&val_ssrc,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">G_TYPE_UINT</span>);</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">   </span>g_value_set_uint(&val_ssrc,<span style="color:rgb(192,192,192)"> </span>ssrc);</pre>
<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">   </span>gst_caps_set_value(caps,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"ssrc"</span>,<span style="color:rgb(192,192,192)"> </span>&val_ssrc);</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">   </span>dump(caps); <span style="color:rgb(56,118,29)">// print GstCaps</span></pre>
<pre style="margin:0px;text-indent:0px"><br></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">   </span><span style="color:rgb(128,128,0)">return</span><span style="color:rgb(192,192,192)"> </span>*caps;</pre>
<pre style="margin:0px;text-indent:0px">}</pre></div></blockquote><div><br></div><div>This is how the request-key signal is connected:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>

<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)">g_signal_connect</span>(<span style="color:rgb(128,0,0)">decrypt</span>-><span style="color:rgb(61,133,198)">getGstElement()</span>,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"request-key"</span>,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">G_CALLBACK</span>(<span style="color:rgb(128,0,128)">StreamDecrypt</span>::<span style="color:rgb(128,0,0)">keyRequested</span>),<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">decrypt</span>-><span style="color:rgb(0,103,124)">getCapsSrtp</span>());</pre></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="color:rgb(56,118,29)">// decrypt->getGstElement() returns the GstElement* of the GstSrtpDec.<br></span></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="color:rgb(106,168,79)"><span style="color:rgb(56,118,29)">// decrypt->getCapsSrtp() returns the GstCaps*.</span> </span><br></div></blockquote><div><br></div><div><div>I confirmed that the GstCaps are set correctly, which are:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>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;</div></blockquote></div><div><br> </div><div>During runtime i get the following error:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>(AudioStream:9995): GLib-GObject-CRITICAL **: 02:12:00.065: g_object_unref: assertion 'G_IS_OBJECT (object)' failed<br><br>** (AudioStream:9995): CRITICAL **: 02:12:00.065: update_session_stream_from_caps: assertion 'GST_IS_SRTP_DEC (filter)' failed</div></blockquote><div><br></div><div>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<span style="color:rgb(0,0,128)"> results in the above mentioned </span>errors in GstSrtpDec::update_session_stream_from_caps. The app crash occurs in GstCaps::gst_caps_to_string.</div><div><br></div><div>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.<br></div><div><br></div><div><br></div><div>Thanks in advance and regards,</div><div>Jochen Jung<br></div><div> </div></div>