1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>srtpenc: GStreamer Bad Plugins 1.0 Plugins Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Bad Plugins 1.0 Plugins Reference Manual"> 8<link rel="up" href="ch01.html" title="gst-plugins-bad Elements"> 9<link rel="prev" href="gst-plugins-bad-plugins-srtpdec.html" title="srtpdec"> 10<link rel="next" href="gst-plugins-bad-plugins-stretch.html" title="stretch"> 11<meta name="generator" content="GTK-Doc V1.28 (XML mode)"> 12<link rel="stylesheet" href="style.css" type="text/css"> 13</head> 14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> 16<td width="100%" align="left" class="shortcuts"> 17<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 18 <a href="#gst-plugins-bad-plugins-srtpenc.description" class="shortcut">Description</a></span><span id="nav_properties"> <span class="dim">|</span> 19 <a href="#gst-plugins-bad-plugins-srtpenc.properties" class="shortcut">Properties</a></span><span id="nav_signals"> <span class="dim">|</span> 20 <a href="#gst-plugins-bad-plugins-srtpenc.signals" class="shortcut">Signals</a></span> 21</td> 22<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 23<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 24<td><a accesskey="p" href="gst-plugins-bad-plugins-srtpdec.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 25<td><a accesskey="n" href="gst-plugins-bad-plugins-stretch.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 26</tr></table> 27<div class="refentry"> 28<a name="gst-plugins-bad-plugins-srtpenc"></a><div class="titlepage"></div> 29<div class="refnamediv"><table width="100%"><tr> 30<td valign="top"> 31<h2><span class="refentrytitle"><a name="gst-plugins-bad-plugins-srtpenc.top_of_page"></a>srtpenc</span></h2> 32<p>srtpenc</p> 33</td> 34<td class="gallery_image" valign="top" align="right"></td> 35</tr></table></div> 36<div class="refsect1"> 37<a name="gst-plugins-bad-plugins-srtpenc.properties"></a><h2>Properties</h2> 38<div class="informaltable"><table class="informaltable" border="0"> 39<colgroup> 40<col width="150px" class="properties_type"> 41<col width="300px" class="properties_name"> 42<col width="200px" class="properties_flags"> 43</colgroup> 44<tbody> 45<tr> 46<td class="property_type"> 47<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> *</td> 48<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--key" title="The “key” property">key</a></td> 49<td class="property_flags">Read / Write</td> 50</tr> 51<tr> 52<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> 53<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--random-key" title="The “random-key” property">random-key</a></td> 54<td class="property_flags">Read / Write</td> 55</tr> 56<tr> 57<td class="property_type"><span class="type">GstSrtpAuthType</span></td> 58<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--rtcp-auth" title="The “rtcp-auth” property">rtcp-auth</a></td> 59<td class="property_flags">Read / Write</td> 60</tr> 61<tr> 62<td class="property_type"><span class="type">GstSrtpCipherType</span></td> 63<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--rtcp-cipher" title="The “rtcp-cipher” property">rtcp-cipher</a></td> 64<td class="property_flags">Read / Write</td> 65</tr> 66<tr> 67<td class="property_type"><span class="type">GstSrtpAuthType</span></td> 68<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--rtp-auth" title="The “rtp-auth” property">rtp-auth</a></td> 69<td class="property_flags">Read / Write</td> 70</tr> 71<tr> 72<td class="property_type"><span class="type">GstSrtpCipherType</span></td> 73<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--rtp-cipher" title="The “rtp-cipher” property">rtp-cipher</a></td> 74<td class="property_flags">Read / Write</td> 75</tr> 76<tr> 77<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td> 78<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--replay-window-size" title="The “replay-window-size” property">replay-window-size</a></td> 79<td class="property_flags">Read / Write</td> 80</tr> 81<tr> 82<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> 83<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--allow-repeat-tx" title="The “allow-repeat-tx” property">allow-repeat-tx</a></td> 84<td class="property_flags">Read / Write</td> 85</tr> 86<tr> 87<td class="property_type"> 88<a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstStructure.html#GstStructure-struct"><span class="type">GstStructure</span></a> *</td> 89<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--stats" title="The “stats” property">stats</a></td> 90<td class="property_flags">Read</td> 91</tr> 92</tbody> 93</table></div> 94</div> 95<div class="refsect1"> 96<a name="gst-plugins-bad-plugins-srtpenc.signals"></a><h2>Signals</h2> 97<div class="informaltable"><table class="informaltable" border="0"> 98<colgroup> 99<col width="150px" class="signals_return"> 100<col width="300px" class="signals_name"> 101<col width="200px" class="signals_flags"> 102</colgroup> 103<tbody> 104<tr> 105<td class="signal_type"><span class="returnvalue">void</span></td> 106<td class="signal_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc-soft-limit" title="The “soft-limit” signal">soft-limit</a></td> 107<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td> 108</tr> 109<tr> 110<td class="signal_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a></td> 111<td class="signal_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc-get-rollover-counter" title="The “get-rollover-counter” signal">get-rollover-counter</a></td> 112<td class="signal_flags"><a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></td> 113</tr> 114</tbody> 115</table></div> 116</div> 117<div class="refsect1"> 118<a name="gst-plugins-bad-plugins-srtpenc.other"></a><h2>Types and Values</h2> 119<div class="informaltable"><table class="informaltable" width="100%" border="0"> 120<colgroup> 121<col width="150px" class="name"> 122<col class="description"> 123</colgroup> 124<tbody><tr> 125<td class="datatype_keyword">struct</td> 126<td class="function_name"><a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc" title="struct GstSrtpEnc">GstSrtpEnc</a></td> 127</tr></tbody> 128</table></div> 129</div> 130<div class="refsect1"> 131<a name="gst-plugins-bad-plugins-srtpenc.description"></a><h2>Description</h2> 132<p>gstrtpenc acts as an encoder that adds security to RTP and RTCP 133packets in the form of encryption and authentication. It outs SRTP 134and SRTCP.</p> 135<p>An application can request multiple RTP and RTCP pads to protect, 136but every sink pad requested must receive packets from the same 137source (identical SSRC). If a packet received contains a different 138SSRC, a warning is emited and the valid SSRC is forced on the packet.</p> 139<p>This element uses libsrtp library. When receiving the first packet, 140the library is initialized with a new stream (based on the SSRC). It 141uses the default RTP and RTCP encryption and authentication mechanisms, 142unless the user has set the relevant properties first. It also uses 143a master key that MUST be set by property (key) at the beginning. The 144master key must be of a maximum length of 46 characters (14 characters 145for the salt plus the key). The encryption and authentication mechanisms 146available are :</p> 147<p>Encryption (properties rtp-cipher and rtcp-cipher)</p> 148<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 149<li class="listitem"><p>AES_ICM 256 bits (maximum security)</p></li> 150<li class="listitem"><p>AES_ICM 128 bits (default)</p></li> 151<li class="listitem"><p>NULL</p></li> 152</ul></div> 153<p>Authentication (properties rtp-auth and rtcp-auth)</p> 154<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 155<li class="listitem"><p>HMAC_SHA1 80 bits (default, maximum protection)</p></li> 156<li class="listitem"><p>HMAC_SHA1 32 bits</p></li> 157<li class="listitem"><p>NULL</p></li> 158</ul></div> 159<p>Note that for SRTP protection, authentication is mandatory (non-null) 160if encryption is used (non-null).</p> 161<p>When requested to create a sink pad, a linked source pad is created. 162Each packet received is first analysed (checked for valid SSRC) then 163its buffer is protected with libsrtp, then pushed on the source pad. 164If protection failed or the stream could not be created, the buffer 165is dropped and a warning is emitted. The packets pushed on the source 166pad are of type 'application/x-srtp' or 'application/x-srtcp'.</p> 167<p>When the maximum usage of the master key is reached, a soft-limit 168signal is sent to the user. The user must then set a new master key 169by property. If the hard limit is reached, a flag is set and every 170subsequent packet is dropped, until a new key is set and the stream 171has been updated.</p> 172<p>If a stream is to be shared between multiple clients it is also 173possible to request the internal SRTP rollover counter for a given 174SSRC. The rollover counter should be then transmitted and used by the 175clients to authenticate and decrypt the packets. Failing to do that 176the clients will start with a rollover counter of 0 which will 177probably be incorrect if the stream has been transmitted for a 178while to other clients.</p> 179<p>This element supports sending with a single Master Key, it is possible to set the 180Master Key Identifier (MKI) using the "mki" property. If this property is set, the MKI 181will be added to every buffer.</p> 182<div class="refsynopsisdiv"> 183<h2>Synopsis</h2> 184<div class="refsect2"> 185<a name="id-1.2.213.6.14.1"></a><h3>Element Information</h3> 186<div class="variablelist"><table border="0" class="variablelist"> 187<colgroup> 188<col align="left" valign="top"> 189<col> 190</colgroup> 191<tbody> 192<tr> 193<td><p><span class="term">plugin</span></p></td> 194<td> 195 <a class="link" href="gst-plugins-bad-plugins-plugin-srtp.html#plugin-srtp">srtp</a> 196 </td> 197</tr> 198<tr> 199<td><p><span class="term">author</span></p></td> 200<td>Gabriel Millaire <millaire.gabriel@collabora.com></td> 201</tr> 202<tr> 203<td><p><span class="term">class</span></p></td> 204<td>Filter/Network/SRTP</td> 205</tr> 206</tbody> 207</table></div> 208</div> 209<hr> 210<div class="refsect2"> 211<a name="id-1.2.213.6.14.2"></a><h3>Element Pads</h3> 212<div class="variablelist"><table border="0" class="variablelist"> 213<colgroup> 214<col align="left" valign="top"> 215<col> 216</colgroup> 217<tbody> 218<tr> 219<td><p><span class="term">name</span></p></td> 220<td>rtcp_sink_%u</td> 221</tr> 222<tr> 223<td><p><span class="term">direction</span></p></td> 224<td>sink</td> 225</tr> 226<tr> 227<td><p><span class="term">presence</span></p></td> 228<td>request</td> 229</tr> 230<tr> 231<td><p><span class="term">details</span></p></td> 232<td>application/x-rtcp</td> 233</tr> 234</tbody> 235</table></div> 236<div class="variablelist"><table border="0" class="variablelist"> 237<colgroup> 238<col align="left" valign="top"> 239<col> 240</colgroup> 241<tbody> 242<tr> 243<td><p><span class="term">name</span></p></td> 244<td>rtp_sink_%u</td> 245</tr> 246<tr> 247<td><p><span class="term">direction</span></p></td> 248<td>sink</td> 249</tr> 250<tr> 251<td><p><span class="term">presence</span></p></td> 252<td>request</td> 253</tr> 254<tr> 255<td><p><span class="term">details</span></p></td> 256<td>application/x-rtp</td> 257</tr> 258</tbody> 259</table></div> 260<div class="variablelist"><table border="0" class="variablelist"> 261<colgroup> 262<col align="left" valign="top"> 263<col> 264</colgroup> 265<tbody> 266<tr> 267<td><p><span class="term">name</span></p></td> 268<td>rtcp_src_%u</td> 269</tr> 270<tr> 271<td><p><span class="term">direction</span></p></td> 272<td>source</td> 273</tr> 274<tr> 275<td><p><span class="term">presence</span></p></td> 276<td>sometimes</td> 277</tr> 278<tr> 279<td><p><span class="term">details</span></p></td> 280<td>application/x-srtcp</td> 281</tr> 282</tbody> 283</table></div> 284<div class="variablelist"><table border="0" class="variablelist"> 285<colgroup> 286<col align="left" valign="top"> 287<col> 288</colgroup> 289<tbody> 290<tr> 291<td><p><span class="term">name</span></p></td> 292<td>rtp_src_%u</td> 293</tr> 294<tr> 295<td><p><span class="term">direction</span></p></td> 296<td>source</td> 297</tr> 298<tr> 299<td><p><span class="term">presence</span></p></td> 300<td>sometimes</td> 301</tr> 302<tr> 303<td><p><span class="term">details</span></p></td> 304<td>application/x-srtp</td> 305</tr> 306</tbody> 307</table></div> 308</div> 309</div> 310</div> 311<div class="refsect1"> 312<a name="gst-plugins-bad-plugins-srtpenc.functions_details"></a><h2>Functions</h2> 313<p></p> 314</div> 315<div class="refsect1"> 316<a name="gst-plugins-bad-plugins-srtpenc.other_details"></a><h2>Types and Values</h2> 317<div class="refsect2"> 318<a name="GstSrtpEnc"></a><h3>struct GstSrtpEnc</h3> 319<pre class="programlisting">struct GstSrtpEnc { 320 GstElement element; 321 322 gboolean random_key; 323 324 GstBuffer *key; 325 guint rtp_cipher; 326 guint rtp_auth; 327 guint rtcp_cipher; 328 guint rtcp_auth; 329 GstBuffer *mki; 330 331 srtp_t session; 332 gboolean first_session; 333 gboolean key_changed; 334 335 guint replay_window_size; 336 gboolean allow_repeat_tx; 337 338 GHashTable *ssrcs_set; 339}; 340</pre> 341</div> 342</div> 343<div class="refsect1"> 344<a name="gst-plugins-bad-plugins-srtpenc.property-details"></a><h2>Property Details</h2> 345<div class="refsect2"> 346<a name="GstSrtpEnc--key"></a><h3>The <code class="literal">“key”</code> property</h3> 347<pre class="programlisting"> “key” <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstBuffer.html#GstBuffer-struct"><span class="type">GstBuffer</span></a> *</pre> 348<p>Master key (minimum of 30 and maximum of 46 bytes).</p> 349<p>Flags: Read / Write</p> 350</div> 351<hr> 352<div class="refsect2"> 353<a name="GstSrtpEnc--random-key"></a><h3>The <code class="literal">“random-key”</code> property</h3> 354<pre class="programlisting"> “random-key” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> 355<p>Generate a random key if TRUE.</p> 356<p>Flags: Read / Write</p> 357<p>Default value: FALSE</p> 358</div> 359<hr> 360<div class="refsect2"> 361<a name="GstSrtpEnc--rtcp-auth"></a><h3>The <code class="literal">“rtcp-auth”</code> property</h3> 362<pre class="programlisting"> “rtcp-auth” <span class="type">GstSrtpAuthType</span></pre> 363<p>RTCP Authentication.</p> 364<p>Flags: Read / Write</p> 365<p>Default value: GST_SRTP_AUTH_HMAC_SHA1_80</p> 366</div> 367<hr> 368<div class="refsect2"> 369<a name="GstSrtpEnc--rtcp-cipher"></a><h3>The <code class="literal">“rtcp-cipher”</code> property</h3> 370<pre class="programlisting"> “rtcp-cipher” <span class="type">GstSrtpCipherType</span></pre> 371<p>RTCP Cipher.</p> 372<p>Flags: Read / Write</p> 373<p>Default value: GST_SRTP_CIPHER_AES_128_ICM</p> 374</div> 375<hr> 376<div class="refsect2"> 377<a name="GstSrtpEnc--rtp-auth"></a><h3>The <code class="literal">“rtp-auth”</code> property</h3> 378<pre class="programlisting"> “rtp-auth” <span class="type">GstSrtpAuthType</span></pre> 379<p>RTP Authentication.</p> 380<p>Flags: Read / Write</p> 381<p>Default value: GST_SRTP_AUTH_HMAC_SHA1_80</p> 382</div> 383<hr> 384<div class="refsect2"> 385<a name="GstSrtpEnc--rtp-cipher"></a><h3>The <code class="literal">“rtp-cipher”</code> property</h3> 386<pre class="programlisting"> “rtp-cipher” <span class="type">GstSrtpCipherType</span></pre> 387<p>RTP Cipher.</p> 388<p>Flags: Read / Write</p> 389<p>Default value: GST_SRTP_CIPHER_AES_128_ICM</p> 390</div> 391<hr> 392<div class="refsect2"> 393<a name="GstSrtpEnc--replay-window-size"></a><h3>The <code class="literal">“replay-window-size”</code> property</h3> 394<pre class="programlisting"> “replay-window-size” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></pre> 395<p>Size of the replay protection window.</p> 396<p>Flags: Read / Write</p> 397<p>Allowed values: [64,32768]</p> 398<p>Default value: 128</p> 399</div> 400<hr> 401<div class="refsect2"> 402<a name="GstSrtpEnc--allow-repeat-tx"></a><h3>The <code class="literal">“allow-repeat-tx”</code> property</h3> 403<pre class="programlisting"> “allow-repeat-tx” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> 404<p>Whether retransmissions of packets with the same sequence number are allowed(Note that such repeated transmissions must have the same RTP payload, or a severe security weakness is introduced!).</p> 405<p>Flags: Read / Write</p> 406<p>Default value: FALSE</p> 407</div> 408<hr> 409<div class="refsect2"> 410<a name="GstSrtpEnc--stats"></a><h3>The <code class="literal">“stats”</code> property</h3> 411<pre class="programlisting"> “stats” <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstStructure.html#GstStructure-struct"><span class="type">GstStructure</span></a> *</pre> 412<p>Various statistics.</p> 413<p>Flags: Read</p> 414</div> 415</div> 416<div class="refsect1"> 417<a name="gst-plugins-bad-plugins-srtpenc.signal-details"></a><h2>Signal Details</h2> 418<div class="refsect2"> 419<a name="GstSrtpEnc-soft-limit"></a><h3>The <code class="literal">“soft-limit”</code> signal</h3> 420<pre class="programlisting"><span class="returnvalue">void</span> 421user_function (<a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc" title="struct GstSrtpEnc"><span class="type">GstSrtpEnc</span></a> *gstsrtpenc, 422 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre> 423<p>Signal emited when the stream with <em class="parameter"><code>ssrc</code></em> 424 has reached the soft 425limit of utilisation of it's master encryption key. User should 426provide a new key by setting the <a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc--key" title="The “key” property"><span class="type">“key”</span></a> property.</p> 427<div class="refsect3"> 428<a name="GstSrtpEnc-soft-limit.parameters"></a><h4>Parameters</h4> 429<div class="informaltable"><table class="informaltable" width="100%" border="0"> 430<colgroup> 431<col width="150px" class="parameters_name"> 432<col class="parameters_description"> 433<col width="200px" class="parameters_annotations"> 434</colgroup> 435<tbody> 436<tr> 437<td class="parameter_name"><p>gstsrtpenc</p></td> 438<td class="parameter_description"><p>the element on which the signal is emitted</p></td> 439<td class="parameter_annotations"> </td> 440</tr> 441<tr> 442<td class="parameter_name"><p>user_data</p></td> 443<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td> 444<td class="parameter_annotations"> </td> 445</tr> 446</tbody> 447</table></div> 448</div> 449<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p> 450</div> 451<hr> 452<div class="refsect2"> 453<a name="GstSrtpEnc-get-rollover-counter"></a><h3>The <code class="literal">“get-rollover-counter”</code> signal</h3> 454<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> 455user_function (<a class="link" href="gst-plugins-bad-plugins-srtpenc.html#GstSrtpEnc" title="struct GstSrtpEnc"><span class="type">GstSrtpEnc</span></a> *gstsrtpenc, 456 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> arg1, 457 <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre> 458<p>Flags: <a href="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#G-SIGNAL-ACTION:CAPS">Action</a></p> 459</div> 460</div> 461<div class="refsect1"> 462<a name="gst-plugins-bad-plugins-srtpenc.see-also"></a><h2>See Also</h2> 463<p>srtpdec</p> 464</div> 465</div> 466<div class="footer"> 467<hr>Generated by GTK-Doc V1.28</div> 468</body> 469</html>