<html dir="ltr"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body style="text-align:left; direction:ltr;"><div>Hi,</div><div><br></div><div>On Wed, 2020-04-08 at 18:52 +0530, sameer wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
    <p>Thank you for the quick reply!</p>
    <p>We have not unref the srtpdec object anywhere. Even made the
      srtpdec object global.</p>
    <div class="moz-cite-prefix">
      <p>Following is our implementation of callback:<br>
      </p>
      <p>g_signal_connect(G_OBJECT(srtpdec), "request-key", G_CALLBACK
        (request_key_callback), &masterKey);</p>
      <p>// masterKey is string</p>
      <p>// srtpdec is global GstElement<br>
      </p>
      <p>GstCaps request_key_callback (GstElement  gstsrtpdec, guint 
        ssrc, gpointer  udata) <br></p></div></blockquote><div>The return value should be a "GstCaps *"</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div class="moz-cite-prefix"><p>
      </p>
      <p>{   <br>
            string *key = (string*)udata;<br>
            GstCaps *caps = gst_caps_new_simple ("application/x-srtp",<br>
              "payload", G_TYPE_INT, 0,<br>
              "ssrc", G_TYPE_UINT, ssrc,<br>
              "srtp-key", G_TYPE_STRING, key->c_str(),<br>
              "srtp-auth", G_TYPE_STRING, "hmac-sha1-80",<br>
              "srtp-cipher", G_TYPE_STRING, "aes-128-icm",<br>
              "srtcp-auth", G_TYPE_STRING, "hmac-sha1-80",<br>
              "srtcp-cipher", G_TYPE_STRING, "aes-128-icm",<br>
              "roc", G_TYPE_UINT, 0,<br>
              NULL);<br>
            return *caps;<br>
        }</p></div></blockquote><div>And you should "return caps;"</div><div><br></div><div>Olivier</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div class="moz-cite-prefix">
      <p>Is it the correct way?</p>
      <p>Thanks</p>
    </div>
    <blockquote type="cite" cite="mid:VE1PR03MB590345D3C4252060B36476D4A3C00@VE1PR03MB5903.eurprd03.prod.outlook.com" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Προ-διαμορφωμένο HTML Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.-HTMLChar
        {mso-style-name:"Προ-διαμορφωμένο HTML Char";
        mso-style-priority:99;
        mso-style-link:"Προ-διαμορφωμένο HTML";
        font-family:Consolas;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span lang="EL">From:</span></b><span lang="EL"> Olivier Crête
                <a class="moz-txt-link-rfc2396E" href="mailto:olivier.crete@collabora.com"><olivier.crete@collabora.com></a>
                <br>
                <b>Sent:</b> Wednesday, April 8, 2020 3:52 PM<br>
                <b>To:</b> Discussion of the development of and with
                GStreamer <a class="moz-txt-link-rfc2396E" href="mailto:gstreamer-devel@lists.freedesktop.org"><gstreamer-devel@lists.freedesktop.org></a><br>
                <b>Cc:</b> Lefteris Diakakis
                <a class="moz-txt-link-rfc2396E" href="mailto:ldiakakis@rtelworld.com"><ldiakakis@rtelworld.com></a><br>
                <b>Subject:</b> Re: Need Help Regarding SRTPDEC
                request_key_callback<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal">Hi,<o:p></o:p></p>
        </div>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <div>
          <p class="MsoNormal">On Wed, 2020-04-08 at 14:37 +0530, sameer
            wrote:<o:p></o:p></p>
        </div>
        <blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
          <p>The ssrc is not received in sdp. I have implemented the
            callback function to return capstring as mentioned in the
            <a href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad/html/gst-plugins-bad-plugins-srtpdec.html" moz-do-not-send="true">
              documentation</a> :<o:p></o:p></p>
          <p><b>static GstCaps request_key_callback (GstElement 
              gstsrtpdec, guint  ssrc, gpointer  udata)
            </b><o:p></o:p></p>
          <p>The capstring returned is like:<o:p></o:p></p>
          <p><b>"
application/x-srtp,channels=(int)1,media=(string)audio,payload=(int)0,clock-rate=(int)8000,encoding-name=(string)PCMU,ssrc=(uint)1932929554,srtp-key=(buffer)4d73554e564e334354466141365042324168614444436c4a456a754a497673747a354e5961694d5a,srtp-cipher=(string)aes-128-icm,srtp-auth=(string)hmac-sha1-32,srtcp-cipher=(string)aes-128-icm,srtcp-auth=(string)hmac-sha1-32,roc=(uint)0
              "</b><o:p></o:p></p>
          <p>But after the callback invokes I am receiving following
            error:<o:p></o:p></p>
          <p><b>(recorder:32537): GLib-GObject-CRITICAL **:
              14:18:06.064: g_object_unref: assertion 'G_IS_OBJECT
              (object)' failed<br>
              <br>
              ** (recorder:32537): CRITICAL **: 14:18:06.064:
              update_session_stream_from_caps: assertion
              'GST_IS_SRTP_DEC (filter)' failed</b><o:p></o:p></p>
          <p>and the app crashes.<o:p></o:p></p>
          <p>Can anyone tell me what mistake I am making. I am not able
            to find much in the documentation or any examples.<o:p></o:p></p>
        </blockquote>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <div>
          <p class="MsoNormal">You probably unref the srtpdec object
            somewhere where you shouldn't.<o:p></o:p></p>
        </div>
        <div>
          <p class="MsoNormal"><o:p> </o:p></p>
        </div>
        <div>
          <pre>-- </pre><o:p></o:p>
          <pre>Olivier Crête</pre><o:p></o:p>
          <a href="mailto:olivier.crete@collabora.com" moz-do-not-send="true"><pre>olivier.crete@collabora.com</pre></a><o:p></o:p>
        </div>
      </div>
    </blockquote>
  

<pre>_______________________________________________</pre><pre>gstreamer-devel mailing list</pre><a href="mailto:gstreamer-devel@lists.freedesktop.org"><pre>gstreamer-devel@lists.freedesktop.org</pre></a><pre><br></pre><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"><pre>https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</pre></a><pre><br></pre></blockquote><div><span><pre><pre>-- <br></pre>Olivier Crête
olivier.crete@collabora.com
</pre></span></div></body></html>