Need Help Regarding SRTPDEC request_key_callback

Olivier Crête olivier.crete at collabora.com
Wed Apr 8 13:47:00 UTC 2020


Hi,
On Wed, 2020-04-08 at 18:52 +0530, sameer wrote:
>     Thank you for the quick reply!
> 
>     We have not unref the srtpdec object anywhere. Even made the
>       srtpdec object global.
> 
>     
>       Following is our implementation of callback:
> 
>       
> 
>       g_signal_connect(G_OBJECT(srtpdec), "request-key", G_CALLBACK
>         (request_key_callback), &masterKey);
> 
>       // masterKey is string
> 
>       // srtpdec is global GstElement
> 
>       
> 
>       GstCaps request_key_callback (GstElement  gstsrtpdec, guint 
>         ssrc, gpointer  udata) 
The return value should be a "GstCaps *"
>       
> 
>       {   
> 
>             string *key = (string*)udata;
> 
>             GstCaps *caps = gst_caps_new_simple ("application/x-srtp",
> 
>               "payload", G_TYPE_INT, 0,
> 
>               "ssrc", G_TYPE_UINT, ssrc,
> 
>               "srtp-key", G_TYPE_STRING, key->c_str(),
> 
>               "srtp-auth", G_TYPE_STRING, "hmac-sha1-80",
> 
>               "srtp-cipher", G_TYPE_STRING, "aes-128-icm",
> 
>               "srtcp-auth", G_TYPE_STRING, "hmac-sha1-80",
> 
>               "srtcp-cipher", G_TYPE_STRING, "aes-128-icm",
> 
>               "roc", G_TYPE_UINT, 0,
> 
>               NULL);
> 
>             return *caps;
> 
>         }
And you should "return caps;"
Olivier
>       Is it the correct way?
>       Thanks
>     
> 
>     
> >       
> >       
> >       <!--
> > /* 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;}
> > -->
> >       
> >          
> >          
> >         
> >           
> >             From: Olivier Crête
> >                 <olivier.crete at collabora.com>
> >                 
> > 
> >                 Sent: Wednesday, April 8, 2020 3:52 PM
> > 
> >                 To: Discussion of the development of and with
> >                 GStreamer <gstreamer-devel at lists.freedesktop.org>
> > 
> >                 Cc: Lefteris Diakakis
> >                 <ldiakakis at rtelworld.com>
> > 
> >                 Subject: Re: Need Help Regarding SRTPDEC
> >                 request_key_callback
> >           
> >         
> >          
> >         
> >           Hi,
> >         
> >         
> >            
> >         
> >         
> >           On Wed, 2020-04-08 at 14:37 +0530, sameer
> >             wrote:
> >         
> >         
> > >           The ssrc is not received in sdp. I have implemented the
> > >             callback function to return capstring as mentioned in the
> > >             
> > >               documentation :
> > >           static GstCaps request_key_callback (GstElement 
> > >               gstsrtpdec, guint  ssrc, gpointer  udata)
> > >             
> > >           The capstring returned is like:
> > >           "
> > > 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
> > >               "
> > >           But after the callback invokes I am receiving following
> > >             error:
> > >           (recorder:32537): GLib-GObject-CRITICAL **:
> > >               14:18:06.064: g_object_unref: assertion 'G_IS_OBJECT
> > >               (object)' failed
> > > 
> > >               
> > > 
> > >               ** (recorder:32537): CRITICAL **: 14:18:06.064:
> > >               update_session_stream_from_caps: assertion
> > >               'GST_IS_SRTP_DEC (filter)' failed
> > >           and the app crashes.
> > >           Can anyone tell me what mistake I am making. I am not able
> > >             to find much in the documentation or any examples.
> > >         
> > 
> >         
> >            
> >         
> >         
> >           You probably unref the srtpdec object
> >             somewhere where you shouldn't.
> >         
> >         
> >            
> >         
> >         
> >           -- 
> >           Olivier Crête
> >           olivier.crete at collabora.com
> >         
> >       
> >     
> 
>   
> 
> _______________________________________________gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-- 
Olivier Crête
olivier.crete at collabora.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200408/3812d196/attachment-0001.htm>


More information about the gstreamer-devel mailing list