Document push_frame()

This commit is contained in:
Aaro Altonen 2021-02-23 14:19:32 +02:00
parent 59b4eb4b27
commit 53f8afbdb2
9 changed files with 431 additions and 171 deletions

View File

@ -1,36 +0,0 @@
#include <uvgrtp/lib.hh>
#include <uvgrtp/formats/rawvideo.hh>
void hook(void *arg, uvgrtp::frame::rtp_frame *frame)
{
LOG_INFO("Raw video scan line(s) received");
uvgrtp::frame::dealloc_frame(frame);
}
int main(void)
{
/* To use the library, one must create a global RTP context object */
uvgrtp::context ctx;
/* Each new IP address requires a separate RTP session */
uvgrtp::session *sess = ctx.create_session("127.0.0.1");
uvgrtp::media_stream *rwv = sess->create_stream(8888, 8888, RTP_FORMAT_RAW_VIDEO, RTP_NO_FLAGS);
/* install receive hook for asynchronous frame reception */
rwv->install_receive_hook(nullptr, hook);
/* specify pixel format of input/output data */
rwv->configure_ctx(RCC_FMT_SUBTYPE, uvgrtp::formats::RWV_FMT_YUV420);
for (;;) {
uint8_t data[36];
rwv->push_frame((uint8_t *)data, sizeof(data), RTP_NO_FLAGS);
/* TODO: what kind of data is given to push_frame()? */
}
/* Session must be destroyed manually */
ctx.destroy_session(sess);
return 0;
}

View File

@ -79,9 +79,9 @@ $(function() {
<tr class="even"><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f">pull_frame</a>()</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736">pull_frame</a>(size_t timeout)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(uint8_t *data, size_t data_len, int flags)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>push_frame</b>(uint8_t *data, size_t data_len, uint32_t ts, int flags) (defined in <a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a>)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>push_frame</b>(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, int flags) (defined in <a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a>)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>push_frame</b>(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, uint32_t ts, int flags) (defined in <a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a>)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">push_frame</a>(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, int flags)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc">push_frame</a>(uint8_t *data, size_t data_len, uint32_t ts, int flags)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b">push_frame</a>(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, uint32_t ts, int flags)</td><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View File

@ -79,15 +79,16 @@ Public Member Functions</h2></td></tr>
rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><b>add_srtp_ctx</b> (uint8_t *key, uint8_t *salt)</td></tr>
<tr class="separator:a0950a91bd645cbf842d8218ae4171aed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2b7507d5b2c76bef74c9bceec07ba18"><td class="memItemLeft" align="right" valign="top">rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a> (uint8_t *data, size_t data_len, int flags)</td></tr>
<tr class="memdesc:ab2b7507d5b2c76bef74c9bceec07ba18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to remote participant with a custom timestamp. <a href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">More...</a><br /></td></tr>
<tr class="separator:ab2b7507d5b2c76bef74c9bceec07ba18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18975c5463df0664f1fd8ab495248dcc"><td class="memItemLeft" align="right" valign="top"><a id="a18975c5463df0664f1fd8ab495248dcc"></a>
rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><b>push_frame</b> (uint8_t *data, size_t data_len, uint32_t ts, int flags)</td></tr>
<tr class="separator:a18975c5463df0664f1fd8ab495248dcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2e79cf2f90f81a90ae9c22e0c1fb01e"><td class="memItemLeft" align="right" valign="top"><a id="ab2e79cf2f90f81a90ae9c22e0c1fb01e"></a>
rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><b>push_frame</b> (std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, int flags)</td></tr>
<tr class="memitem:ab2e79cf2f90f81a90ae9c22e0c1fb01e"><td class="memItemLeft" align="right" valign="top">rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">push_frame</a> (std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, int flags)</td></tr>
<tr class="memdesc:ab2e79cf2f90f81a90ae9c22e0c1fb01e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to remote participant with a custom timestamp. <a href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">More...</a><br /></td></tr>
<tr class="separator:ab2e79cf2f90f81a90ae9c22e0c1fb01e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85fed1e02b97326d3b794551f0677e2b"><td class="memItemLeft" align="right" valign="top"><a id="a85fed1e02b97326d3b794551f0677e2b"></a>
rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><b>push_frame</b> (std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, uint32_t ts, int flags)</td></tr>
<tr class="memitem:a18975c5463df0664f1fd8ab495248dcc"><td class="memItemLeft" align="right" valign="top">rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc">push_frame</a> (uint8_t *data, size_t data_len, uint32_t ts, int flags)</td></tr>
<tr class="memdesc:a18975c5463df0664f1fd8ab495248dcc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to remote participant with a custom timestamp. <a href="classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc">More...</a><br /></td></tr>
<tr class="separator:a18975c5463df0664f1fd8ab495248dcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85fed1e02b97326d3b794551f0677e2b"><td class="memItemLeft" align="right" valign="top">rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b">push_frame</a> (std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, uint32_t ts, int flags)</td></tr>
<tr class="memdesc:a85fed1e02b97326d3b794551f0677e2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to remote participant with a custom timestamp. <a href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b">More...</a><br /></td></tr>
<tr class="separator:a85fed1e02b97326d3b794551f0677e2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2fe9e8d9b67e25f103a78a25417149f"><td class="memItemLeft" align="right" valign="top">uvgrtp::frame::rtp_frame *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f">pull_frame</a> ()</td></tr>
<tr class="memdesc:ae2fe9e8d9b67e25f103a78a25417149f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Poll a frame indefinetily from the media stream object. <a href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f">More...</a><br /></td></tr>
@ -266,10 +267,133 @@ rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><b>push_frame</b>
<p>You can specify for how long should <a class="el" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f" title="Poll a frame indefinetily from the media stream object.">pull_frame()</a> block by giving "timeout" parameter that denotes how long <a class="el" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f" title="Poll a frame indefinetily from the media stream object.">pull_frame()</a> will wait for an incoming frame in milliseconds</p>
<p>Return pointer to RTP frame on success </p>
</div>
</div>
<a id="ab2e79cf2f90f81a90ae9c22e0c1fb01e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab2e79cf2f90f81a90ae9c22e0c1fb01e">&#9670;&nbsp;</a></span>push_frame() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">rtp_error_t uvgrtp::media_stream::push_frame </td>
<td>(</td>
<td class="paramtype">std::unique_ptr&lt; uint8_t[]&gt;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>data_len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>flags</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send data to remote participant with a custom timestamp. </p>
<p>If so specified either by the selected media format and/or given <a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2af" title="RTP context enable flags.">RTP_CTX_ENABLE_FLAGS</a>, uvgRTP fragments the input data into RTP packets of 1500 bytes, or to any other size defined by the application using <a class="el" href="util_8hh.html#aa98d9238629e33567e73af0d239e587fa7667fb72b42a2c11991b4879619f9f83">RCC_MTU_SIZE</a></p>
<p>The frame is automatically reconstructed by the receiver if all fragments have been received successfully.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Smart pointer to data the that should be sent </td></tr>
<tr><td class="paramname">data_len</td><td>Length of data </td></tr>
<tr><td class="paramname">ts</td><td>32-bit timestamp value for the data </td></tr>
<tr><td class="paramname">flags</td><td>Optional flags, see <a class="el" href="util_8hh.html#af03a75996471fc531742cd640c7caf2d" title="These flags are given to uvgrtp::media_stream::push_frame() and they can be OR&#39;ed together.">RTP_FLAGS</a> for more details</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP error code</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">RTP_OK</td><td>On success </td></tr>
<tr><td class="paramname">RTP_INVALID_VALUE</td><td>If one of the parameters are invalid </td></tr>
<tr><td class="paramname">RTP_MEMORY_ERROR</td><td>If the data chunk is too large to be processed </td></tr>
<tr><td class="paramname">RTP_SEND_ERROR</td><td>If uvgRTP failed to send the data to remote </td></tr>
<tr><td class="paramname">RTP_GENERIC_ERROR</td><td>If an unspecified error occurred </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a85fed1e02b97326d3b794551f0677e2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85fed1e02b97326d3b794551f0677e2b">&#9670;&nbsp;</a></span>push_frame() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">rtp_error_t uvgrtp::media_stream::push_frame </td>
<td>(</td>
<td class="paramtype">std::unique_ptr&lt; uint8_t[]&gt;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>data_len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>ts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>flags</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send data to remote participant with a custom timestamp. </p>
<p>If so specified either by the selected media format and/or given <a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2af" title="RTP context enable flags.">RTP_CTX_ENABLE_FLAGS</a>, uvgRTP fragments the input data into RTP packets of 1500 bytes, or to any other size defined by the application using <a class="el" href="util_8hh.html#aa98d9238629e33567e73af0d239e587fa7667fb72b42a2c11991b4879619f9f83">RCC_MTU_SIZE</a></p>
<p>The frame is automatically reconstructed by the receiver if all fragments have been received successfully.</p>
<p>If application so wishes, it may override uvgRTP's own timestamp calculations and provide timestamping information for the stream itself. This requires that the application provides a sensible value for the ts parameter. If RTCP has been enabled, uvgrtp::rtcp::set_ts_info() should have been called.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Smart pointer to data the that should be sent </td></tr>
<tr><td class="paramname">data_len</td><td>Length of data </td></tr>
<tr><td class="paramname">ts</td><td>32-bit timestamp value for the data </td></tr>
<tr><td class="paramname">flags</td><td>Optional flags, see <a class="el" href="util_8hh.html#af03a75996471fc531742cd640c7caf2d" title="These flags are given to uvgrtp::media_stream::push_frame() and they can be OR&#39;ed together.">RTP_FLAGS</a> for more details</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP error code</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">RTP_OK</td><td>On success </td></tr>
<tr><td class="paramname">RTP_INVALID_VALUE</td><td>If one of the parameters are invalid </td></tr>
<tr><td class="paramname">RTP_MEMORY_ERROR</td><td>If the data chunk is too large to be processed </td></tr>
<tr><td class="paramname">RTP_SEND_ERROR</td><td>If uvgRTP failed to send the data to remote </td></tr>
<tr><td class="paramname">RTP_GENERIC_ERROR</td><td>If an unspecified error occurred </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ab2b7507d5b2c76bef74c9bceec07ba18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab2b7507d5b2c76bef74c9bceec07ba18">&#9670;&nbsp;</a></span>push_frame()</h2>
<h2 class="memtitle"><span class="permalink"><a href="#ab2b7507d5b2c76bef74c9bceec07ba18">&#9670;&nbsp;</a></span>push_frame() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
@ -299,12 +423,95 @@ rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><b>push_frame</b>
</tr>
</table>
</div><div class="memdoc">
<p>Split "data" into 1500 byte chunks and send them to remote</p>
<p>NOTE: If SCD has been enabled, calling this version of <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame()</a> requires either that the caller has given a deallocation callback to SCD OR that "flags" contains flags "RTP_COPY"</p>
<p>NOTE: Each <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame()</a> sends one discrete frame of data. If the input frame is fragmented, calling application should call <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame()</a> with RTP_MORE and RTP_SLICE flags to prevent uvgRTP from flushing the frame queue after <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame()</a>.</p>
<p>push_frame(..., RTP_MORE | RTP_SLICE); // more data coming in, do not flush queue push_frame(..., RTP_MORE | RTP_SLICE); // more data coming in, do not flush queue push_frame(..., RTP_SLICE); // no more data coming in, flush queue</p>
<p>If user wishes to manage RTP timestamps himself, he may pass "ts" to <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame()</a> which forces uvgRTP to use that timestamp for all RTP packets of "data".</p>
<p>Return RTP_OK success Return RTP_INVALID_VALUE if one of the parameters are invalid Return RTP_MEMORY_ERROR if the data chunk is too large to be processed Return RTP_SEND_ERROR if uvgRTP failed to send the data to remote Return RTP_GENERIC_ERROR for any other error condition </p>
<p>Send data to remote participant with a custom timestamp. </p>
<p>If so specified either by the selected media format and/or given <a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2af" title="RTP context enable flags.">RTP_CTX_ENABLE_FLAGS</a>, uvgRTP fragments the input data into RTP packets of 1500 bytes, or to any other size defined by the application using <a class="el" href="util_8hh.html#aa98d9238629e33567e73af0d239e587fa7667fb72b42a2c11991b4879619f9f83">RCC_MTU_SIZE</a></p>
<p>The frame is automatically reconstructed by the receiver if all fragments have been received successfully.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Pointer to data the that should be sent </td></tr>
<tr><td class="paramname">data_len</td><td>Length of data </td></tr>
<tr><td class="paramname">ts</td><td>32-bit timestamp value for the data </td></tr>
<tr><td class="paramname">flags</td><td>Optional flags, see <a class="el" href="util_8hh.html#af03a75996471fc531742cd640c7caf2d" title="These flags are given to uvgrtp::media_stream::push_frame() and they can be OR&#39;ed together.">RTP_FLAGS</a> for more details</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP error code</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">RTP_OK</td><td>On success </td></tr>
<tr><td class="paramname">RTP_INVALID_VALUE</td><td>If one of the parameters are invalid </td></tr>
<tr><td class="paramname">RTP_MEMORY_ERROR</td><td>If the data chunk is too large to be processed </td></tr>
<tr><td class="paramname">RTP_SEND_ERROR</td><td>If uvgRTP failed to send the data to remote </td></tr>
<tr><td class="paramname">RTP_GENERIC_ERROR</td><td>If an unspecified error occurred </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a18975c5463df0664f1fd8ab495248dcc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a18975c5463df0664f1fd8ab495248dcc">&#9670;&nbsp;</a></span>push_frame() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">rtp_error_t uvgrtp::media_stream::push_frame </td>
<td>(</td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>data_len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>ts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>flags</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Send data to remote participant with a custom timestamp. </p>
<p>If so specified either by the selected media format and/or given <a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2af" title="RTP context enable flags.">RTP_CTX_ENABLE_FLAGS</a>, uvgRTP fragments the input data into RTP packets of 1500 bytes, or to any other size defined by the application using <a class="el" href="util_8hh.html#aa98d9238629e33567e73af0d239e587fa7667fb72b42a2c11991b4879619f9f83">RCC_MTU_SIZE</a></p>
<p>The frame is automatically reconstructed by the receiver if all fragments have been received successfully.</p>
<p>If application so wishes, it may override uvgRTP's own timestamp calculations and provide timestamping information for the stream itself. This requires that the application provides a sensible value for the ts parameter. If RTCP has been enabled, uvgrtp::rtcp::set_ts_info() should have been called.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Pointer to data the that should be sent </td></tr>
<tr><td class="paramname">data_len</td><td>Length of data </td></tr>
<tr><td class="paramname">ts</td><td>32-bit timestamp value for the data </td></tr>
<tr><td class="paramname">flags</td><td>Optional flags, see <a class="el" href="util_8hh.html#af03a75996471fc531742cd640c7caf2d" title="These flags are given to uvgrtp::media_stream::push_frame() and they can be OR&#39;ed together.">RTP_FLAGS</a> for more details</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP error code</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">RTP_OK</td><td>On success </td></tr>
<tr><td class="paramname">RTP_INVALID_VALUE</td><td>If one of the parameters are invalid </td></tr>
<tr><td class="paramname">RTP_MEMORY_ERROR</td><td>If the data chunk is too large to be processed </td></tr>
<tr><td class="paramname">RTP_SEND_ERROR</td><td>If uvgRTP failed to send the data to remote </td></tr>
<tr><td class="paramname">RTP_GENERIC_ERROR</td><td>If an unspecified error occurred </td></tr>
</table>
</dd>
</dl>
</div>
</div>

View File

@ -68,7 +68,7 @@ $(function() {
<div class="textblock"><p><a class="anchor" id="md_docs_html_INDEX"></a> To use uvgRTP, you must first create a <a class="el" href="classuvgrtp_1_1context.html">uvgrtp::context</a> object</p>
<p>Then you need to allocate a <a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a> object from the context object by calling <a class="el" href="classuvgrtp_1_1context.html#aa109aa2a419933359d225d19bcf3b2f9" title="Create a new RTP session.">uvgrtp::context::create_session()</a></p>
<p>Finally, you need to allocate a <a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a> object from the allocated session object by calling <a class="el" href="classuvgrtp_1_1session.html#a71aad1226214b1b0b1ba60a46c048ab2" title="Create a bidirectional media stream for an RTP session.">uvgrtp::session::create_stream()</a></p>
<p>This object is used for both sending and receiving, see documentation for <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">uvgrtp::media_stream::push_frame()</a>, <a class="el" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f" title="Poll a frame indefinetily from the media stream object.">uvgrtp::media_stream::pull_frame()</a> and <a class="el" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27" title="Asynchronous way of getting frames.">uvgrtp::media_stream::install_receive_hook()</a> for more details. </p>
<p>This object is used for both sending and receiving, see documentation for <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18" title="Send data to remote participant with a custom timestamp.">uvgrtp::media_stream::push_frame()</a>, <a class="el" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f" title="Poll a frame indefinetily from the media stream object.">uvgrtp::media_stream::pull_frame()</a> and <a class="el" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27" title="Asynchronous way of getting frames.">uvgrtp::media_stream::install_receive_hook()</a> for more details. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
<!-- start footer part -->

View File

@ -127,105 +127,111 @@ $(function() {
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment"> * Return RTP_NOT_SUPPORTED if user-managed SRTP was not specified in create_stream() */</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; rtp_error_t add_srtp_ctx(uint8_t *key, uint8_t *salt);</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18"> 84</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(uint8_t *data, <span class="keywordtype">size_t</span> data_len, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(uint8_t *data, <span class="keywordtype">size_t</span> data_len, uint32_t ts, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(std::unique_ptr&lt;uint8_t[]&gt; data, <span class="keywordtype">size_t</span> data_len, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(std::unique_ptr&lt;uint8_t[]&gt; data, <span class="keywordtype">size_t</span> data_len, uint32_t ts, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f"> 103</a></span>&#160; uvgrtp::frame::rtp_frame *<a class="code" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f">pull_frame</a>();</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736"> 119</a></span>&#160; uvgrtp::frame::rtp_frame *<a class="code" href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736">pull_frame</a>(<span class="keywordtype">size_t</span> timeout);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27"> 139</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27">install_receive_hook</a>(<span class="keywordtype">void</span> *arg, <span class="keywordtype">void</span> (*hook)(<span class="keywordtype">void</span> *, uvgrtp::frame::rtp_frame *));</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">/* If system call dispatcher is enabled and calling application has special requirements</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="comment"> * for the deallocation of a frame, it may install a deallocation hook which is called</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="comment"> * when SCD has processed the frame</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="comment"> * Return RTP_OK on success</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="comment"> * Return RTP_INVALID_VALUE if &quot;hook&quot; is nullptr */</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; rtp_error_t install_deallocation_hook(<span class="keywordtype">void</span> (*hook)(<span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="comment">/* If needed, a notification hook can be installed to uvgRTP that can be used as</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="comment"> * an information side channel to the internal state of the library.</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="comment"> * When uvgRTP encouters a situation it doesn&#39;t know how to react to,</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;<span class="comment"> * it calls the notify hook with certain notify reason number (src/util.hh).</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="comment"> * Upon receiving a notification, application may ignore it or act on it somehow</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;<span class="comment"> * Currently only one notification type is supported and only receiver uses notifications</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="comment"> * &quot;arg&quot; is optional argument that is passed to hook when it is called. It may be nullptr</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="comment"> * Return RTP_OK on success</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="comment"> * Return RTP_INVALID_VALUE if &quot;hook&quot; is nullptr */</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; rtp_error_t install_notify_hook(<span class="keywordtype">void</span> *arg, <span class="keywordtype">void</span> (*hook)(<span class="keywordtype">void</span> *, <span class="keywordtype">int</span>));</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; </div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#addf1cde9cb8c4e4af3160ce24c4288a5"> 176</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#addf1cde9cb8c4e4af3160ce24c4288a5">configure_ctx</a>(<span class="keywordtype">int</span> flag, ssize_t value);</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">/* Setter and getter for media-specific config that can be used f.ex with Opus */</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">void</span> set_media_config(<span class="keywordtype">void</span> *config);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> *get_media_config();</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; </div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="comment">/* Get unique key of the media stream</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="comment"> * Used by session to index media streams */</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; uint32_t get_key();</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a1134ff0271ad54bf1e07feed422118c2"> 200</a></span>&#160; <a class="code" href="classuvgrtp_1_1rtcp.html">uvgrtp::rtcp</a> *<a class="code" href="classuvgrtp_1_1media__stream.html#a1134ff0271ad54bf1e07feed422118c2">get_rtcp</a>();</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="comment">/* Initialize the connection by initializing the socket</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="comment"> * and binding ourselves to specified interface and creating</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="comment"> * an outgoing address */</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; rtp_error_t init_connection();</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; uint32_t key_;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; </div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; uvgrtp::srtp *srtp_;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; uvgrtp::srtcp *srtcp_;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; uvgrtp::socket *socket_;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; uvgrtp::rtp *rtp_;</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="classuvgrtp_1_1rtcp.html">uvgrtp::rtcp</a> *rtcp_;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; </div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; sockaddr_in addr_out_;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; std::string addr_;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; std::string laddr_;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordtype">int</span> src_port_;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordtype">int</span> dst_port_;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; rtp_format_t fmt_;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordtype">int</span> flags_;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="comment">/* Media context config (SCD etc.) */</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; rtp_ctx_conf_t ctx_config_;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="comment">/* Media config f.ex. for Opus */</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordtype">void</span> *media_config_;</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18"> 83</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(uint8_t *data, <span class="keywordtype">size_t</span> data_len, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; </div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e"> 107</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">push_frame</a>(std::unique_ptr&lt;uint8_t[]&gt; data, <span class="keywordtype">size_t</span> data_len, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc"> 137</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc">push_frame</a>(uint8_t *data, <span class="keywordtype">size_t</span> data_len, uint32_t ts, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; </div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b"> 167</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b">push_frame</a>(std::unique_ptr&lt;uint8_t[]&gt; data, <span class="keywordtype">size_t</span> data_len, uint32_t ts, <span class="keywordtype">int</span> flags);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; </div>
<div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f"> 183</a></span>&#160; uvgrtp::frame::rtp_frame *<a class="code" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f">pull_frame</a>();</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736"> 199</a></span>&#160; uvgrtp::frame::rtp_frame *<a class="code" href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736">pull_frame</a>(<span class="keywordtype">size_t</span> timeout);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; </div>
<div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27"> 219</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27">install_receive_hook</a>(<span class="keywordtype">void</span> *arg, <span class="keywordtype">void</span> (*hook)(<span class="keywordtype">void</span> *, uvgrtp::frame::rtp_frame *));</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; </div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">/* If system call dispatcher is enabled and calling application has special requirements</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;<span class="comment"> * for the deallocation of a frame, it may install a deallocation hook which is called</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="comment"> * when SCD has processed the frame</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;<span class="comment"> * Return RTP_OK on success</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="comment"> * Return RTP_INVALID_VALUE if &quot;hook&quot; is nullptr */</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; rtp_error_t install_deallocation_hook(<span class="keywordtype">void</span> (*hook)(<span class="keywordtype">void</span> *));</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">/* Has the media stream been initialized */</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordtype">bool</span> initialized_;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <span class="comment">/* Primary handler keys for the RTP packet dispatcher */</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uint32_t rtp_handler_key_;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; uint32_t zrtp_handler_key_;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="comment">/* RTP packet dispatcher for the receiver */</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; uvgrtp::pkt_dispatcher *pkt_dispatcher_;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; std::thread *dispatcher_thread_;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">/* Media object associated with this media stream. */</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; uvgrtp::formats::media *media_;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="comment">/* Thread that keeps the holepunched connection open for unidirectional streams */</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; uvgrtp::holepuncher *holepuncher_;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; };</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;};</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="keyword">namespace </span>uvg_rtp = uvgrtp;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">/* If needed, a notification hook can be installed to uvgRTP that can be used as</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="comment"> * an information side channel to the internal state of the library.</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="comment"> * When uvgRTP encouters a situation it doesn&#39;t know how to react to,</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;<span class="comment"> * it calls the notify hook with certain notify reason number (src/util.hh).</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="comment"> * Upon receiving a notification, application may ignore it or act on it somehow</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="comment"> * Currently only one notification type is supported and only receiver uses notifications</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="comment"> * &quot;arg&quot; is optional argument that is passed to hook when it is called. It may be nullptr</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="comment"> * Return RTP_OK on success</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;<span class="comment"> * Return RTP_INVALID_VALUE if &quot;hook&quot; is nullptr */</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; rtp_error_t install_notify_hook(<span class="keywordtype">void</span> *arg, <span class="keywordtype">void</span> (*hook)(<span class="keywordtype">void</span> *, <span class="keywordtype">int</span>));</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; </div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#addf1cde9cb8c4e4af3160ce24c4288a5"> 256</a></span>&#160; rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#addf1cde9cb8c4e4af3160ce24c4288a5">configure_ctx</a>(<span class="keywordtype">int</span> flag, ssize_t value);</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; </div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <span class="comment">/* Setter and getter for media-specific config that can be used f.ex with Opus */</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <span class="keywordtype">void</span> set_media_config(<span class="keywordtype">void</span> *config);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="keywordtype">void</span> *get_media_config();</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; </div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="comment">/* Get unique key of the media stream</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="comment"> * Used by session to index media streams */</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; uint32_t get_key();</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; </div>
<div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a1134ff0271ad54bf1e07feed422118c2"> 280</a></span>&#160; <a class="code" href="classuvgrtp_1_1rtcp.html">uvgrtp::rtcp</a> *<a class="code" href="classuvgrtp_1_1media__stream.html#a1134ff0271ad54bf1e07feed422118c2">get_rtcp</a>();</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="comment">/* Initialize the connection by initializing the socket</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;<span class="comment"> * and binding ourselves to specified interface and creating</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;<span class="comment"> * an outgoing address */</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; rtp_error_t init_connection();</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; </div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; uint32_t key_;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; </div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; uvgrtp::srtp *srtp_;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; uvgrtp::srtcp *srtcp_;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; uvgrtp::socket *socket_;</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; uvgrtp::rtp *rtp_;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <a class="code" href="classuvgrtp_1_1rtcp.html">uvgrtp::rtcp</a> *rtcp_;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; </div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; sockaddr_in addr_out_;</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; std::string addr_;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; std::string laddr_;</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="keywordtype">int</span> src_port_;</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordtype">int</span> dst_port_;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; rtp_format_t fmt_;</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keywordtype">int</span> flags_;</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; </div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="comment">/* Media context config (SCD etc.) */</span></div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; rtp_ctx_conf_t ctx_config_;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; </div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="comment">/* Media config f.ex. for Opus */</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="keywordtype">void</span> *media_config_;</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; </div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <span class="comment">/* Has the media stream been initialized */</span></div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="keywordtype">bool</span> initialized_;</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; </div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="comment">/* Primary handler keys for the RTP packet dispatcher */</span></div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; uint32_t rtp_handler_key_;</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; uint32_t zrtp_handler_key_;</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; </div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; <span class="comment">/* RTP packet dispatcher for the receiver */</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; uvgrtp::pkt_dispatcher *pkt_dispatcher_;</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; std::thread *dispatcher_thread_;</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; </div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="comment">/* Media object associated with this media stream. */</span></div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; uvgrtp::formats::media *media_;</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; </div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="comment">/* Thread that keeps the holepunched connection open for unidirectional streams */</span></div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; uvgrtp::holepuncher *holepuncher_;</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; };</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;};</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; </div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160;<span class="keyword">namespace </span>uvg_rtp = uvgrtp;</div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a></div><div class="ttdef"><b>Definition:</b> media_stream.hh:18</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_a1134ff0271ad54bf1e07feed422118c2"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#a1134ff0271ad54bf1e07feed422118c2">uvgrtp::media_stream::get_rtcp</a></div><div class="ttdeci">uvgrtp::rtcp * get_rtcp()</div><div class="ttdoc">Get pointer to the RTCP object of the media stream.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_a18975c5463df0664f1fd8ab495248dcc"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc">uvgrtp::media_stream::push_frame</a></div><div class="ttdeci">rtp_error_t push_frame(uint8_t *data, size_t data_len, uint32_t ts, int flags)</div><div class="ttdoc">Send data to remote participant with a custom timestamp.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_a441263e19be4383223884fde8838f736"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736">uvgrtp::media_stream::pull_frame</a></div><div class="ttdeci">uvgrtp::frame::rtp_frame * pull_frame(size_t timeout)</div><div class="ttdoc">Poll a frame for a specified time from the media stream object.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_a74a558b23866976e52c5903996544a27"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27">uvgrtp::media_stream::install_receive_hook</a></div><div class="ttdeci">rtp_error_t install_receive_hook(void *arg, void(*hook)(void *, uvgrtp::frame::rtp_frame *))</div><div class="ttdoc">Asynchronous way of getting frames.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_ab2b7507d5b2c76bef74c9bceec07ba18"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">uvgrtp::media_stream::push_frame</a></div><div class="ttdeci">rtp_error_t push_frame(uint8_t *data, size_t data_len, int flags)</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_a85fed1e02b97326d3b794551f0677e2b"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b">uvgrtp::media_stream::push_frame</a></div><div class="ttdeci">rtp_error_t push_frame(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, uint32_t ts, int flags)</div><div class="ttdoc">Send data to remote participant with a custom timestamp.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_ab2b7507d5b2c76bef74c9bceec07ba18"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">uvgrtp::media_stream::push_frame</a></div><div class="ttdeci">rtp_error_t push_frame(uint8_t *data, size_t data_len, int flags)</div><div class="ttdoc">Send data to remote participant with a custom timestamp.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_ab2e79cf2f90f81a90ae9c22e0c1fb01e"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">uvgrtp::media_stream::push_frame</a></div><div class="ttdeci">rtp_error_t push_frame(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, int flags)</div><div class="ttdoc">Send data to remote participant with a custom timestamp.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_addf1cde9cb8c4e4af3160ce24c4288a5"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#addf1cde9cb8c4e4af3160ce24c4288a5">uvgrtp::media_stream::configure_ctx</a></div><div class="ttdeci">rtp_error_t configure_ctx(int flag, ssize_t value)</div><div class="ttdoc">Configure the media stream, see RTP_CTX_CONFIGURATION_FLAGS for more details.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1media__stream_html_ae2fe9e8d9b67e25f103a78a25417149f"><div class="ttname"><a href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f">uvgrtp::media_stream::pull_frame</a></div><div class="ttdeci">uvgrtp::frame::rtp_frame * pull_frame()</div><div class="ttdoc">Poll a frame indefinetily from the media stream object.</div></div>
<div class="ttc" id="aclassuvgrtp_1_1rtcp_html"><div class="ttname"><a href="classuvgrtp_1_1rtcp.html">uvgrtp::rtcp</a></div><div class="ttdef"><b>Definition:</b> rtcp.hh:74</div></div>

View File

@ -1,5 +1,5 @@
var searchData=
[
['pull_5fframe_9',['pull_frame',['../classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f',1,'uvgrtp::media_stream::pull_frame()'],['../classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736',1,'uvgrtp::media_stream::pull_frame(size_t timeout)']]],
['push_5fframe_10',['push_frame',['../classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18',1,'uvgrtp::media_stream']]]
['push_5fframe_10',['push_frame',['../classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18',1,'uvgrtp::media_stream::push_frame(uint8_t *data, size_t data_len, int flags)'],['../classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e',1,'uvgrtp::media_stream::push_frame(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, int flags)'],['../classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc',1,'uvgrtp::media_stream::push_frame(uint8_t *data, size_t data_len, uint32_t ts, int flags)'],['../classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b',1,'uvgrtp::media_stream::push_frame(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, uint32_t ts, int flags)']]]
];

View File

@ -1,5 +1,5 @@
var searchData=
[
['pull_5fframe_75',['pull_frame',['../classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f',1,'uvgrtp::media_stream::pull_frame()'],['../classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736',1,'uvgrtp::media_stream::pull_frame(size_t timeout)']]],
['push_5fframe_76',['push_frame',['../classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18',1,'uvgrtp::media_stream']]]
['push_5fframe_76',['push_frame',['../classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18',1,'uvgrtp::media_stream::push_frame(uint8_t *data, size_t data_len, int flags)'],['../classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e',1,'uvgrtp::media_stream::push_frame(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, int flags)'],['../classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc',1,'uvgrtp::media_stream::push_frame(uint8_t *data, size_t data_len, uint32_t ts, int flags)'],['../classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b',1,'uvgrtp::media_stream::push_frame(std::unique_ptr&lt; uint8_t[]&gt; data, size_t data_len, uint32_t ts, int flags)']]]
];

View File

@ -157,7 +157,7 @@ Enumerations</h2></td></tr>
&#160;&#160;<a class="el" href="util_8hh.html#af03a75996471fc531742cd640c7caf2dab1d5797a23c37a33168046a2ae6aef6a">RTP_COPY</a> = 1 &lt;&lt; 1
<br />
}</td></tr>
<tr class="memdesc:af03a75996471fc531742cd640c7caf2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">These flags are given to <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">uvgrtp::media_stream::push_frame()</a> and they can be OR'ed together. <a href="util_8hh.html#af03a75996471fc531742cd640c7caf2d">More...</a><br /></td></tr>
<tr class="memdesc:af03a75996471fc531742cd640c7caf2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">These flags are given to <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18" title="Send data to remote participant with a custom timestamp.">uvgrtp::media_stream::push_frame()</a> and they can be OR'ed together. <a href="util_8hh.html#af03a75996471fc531742cd640c7caf2d">More...</a><br /></td></tr>
<tr class="separator:af03a75996471fc531742cd640c7caf2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15b2d6364db6065a482c99827f4bd2af"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2af">RTP_CTX_ENABLE_FLAGS</a> { <br />
&#160;&#160;<b>RCE_NO_FLAGS</b> = 0 &lt;&lt; 0
@ -372,7 +372,7 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>These flags are given to <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">uvgrtp::media_stream::push_frame()</a> and they can be OR'ed together. </p>
<p>These flags are given to <a class="el" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18" title="Send data to remote participant with a custom timestamp.">uvgrtp::media_stream::push_frame()</a> and they can be OR'ed together. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="af03a75996471fc531742cd640c7caf2da084c095dae54bbbc6d9509568c58f9a6"></a>RTP_NO_FLAGS&#160;</td><td class="fielddoc"><p>No flags </p>
</td></tr>

View File

@ -58,32 +58,115 @@ namespace uvgrtp {
* Return RTP_NOT_SUPPORTED if user-managed SRTP was not specified in create_stream() */
rtp_error_t add_srtp_ctx(uint8_t *key, uint8_t *salt);
/** Split "data" into 1500 byte chunks and send them to remote
/**
* \brief Send data to remote participant with a custom timestamp
*
* NOTE: If SCD has been enabled, calling this version of push_frame()
* requires either that the caller has given a deallocation callback to
* SCD OR that "flags" contains flags "RTP_COPY"
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* NOTE: Each push_frame() sends one discrete frame of data. If the input frame
* is fragmented, calling application should call push_frame() with RTP_MORE
* and RTP_SLICE flags to prevent uvgRTP from flushing the frame queue after
* push_frame().
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* push_frame(..., RTP_MORE | RTP_SLICE); // more data coming in, do not flush queue
* push_frame(..., RTP_MORE | RTP_SLICE); // more data coming in, do not flush queue
* push_frame(..., RTP_SLICE); // no more data coming in, flush queue
* \param data Pointer to data the that should be sent
* \param data_len Length of data
* \param ts 32-bit timestamp value for the data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* If user wishes to manage RTP timestamps himself, he may pass "ts" to push_frame()
* which forces uvgRTP to use that timestamp for all RTP packets of "data".
* \return RTP error code
*
* Return RTP_OK success
* Return RTP_INVALID_VALUE if one of the parameters are invalid
* Return RTP_MEMORY_ERROR if the data chunk is too large to be processed
* Return RTP_SEND_ERROR if uvgRTP failed to send the data to remote
* Return RTP_GENERIC_ERROR for any other error condition */
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_frame(uint8_t *data, size_t data_len, int flags);
rtp_error_t push_frame(uint8_t *data, size_t data_len, uint32_t ts, int flags);
/**
* \brief Send data to remote participant with a custom timestamp
*
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* \param data Smart pointer to data the that should be sent
* \param data_len Length of data
* \param ts 32-bit timestamp value for the data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_frame(std::unique_ptr<uint8_t[]> data, size_t data_len, int flags);
/**
* \brief Send data to remote participant with a custom timestamp
*
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* If application so wishes, it may override uvgRTP's own timestamp
* calculations and provide timestamping information for the stream itself.
* This requires that the application provides a sensible value for the ts
* parameter. If RTCP has been enabled, uvgrtp::rtcp::set_ts_info() should have
* been called.
*
* \param data Pointer to data the that should be sent
* \param data_len Length of data
* \param ts 32-bit timestamp value for the data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_frame(uint8_t *data, size_t data_len, uint32_t ts, int flags);
/**
* \brief Send data to remote participant with a custom timestamp
*
* \details If so specified either by the selected media format and/or given
* ::RTP_CTX_ENABLE_FLAGS, uvgRTP fragments the input data into RTP packets of 1500 bytes,
* or to any other size defined by the application using ::RCC_MTU_SIZE
*
* The frame is automatically reconstructed by the receiver if all fragments have been
* received successfully.
*
* If application so wishes, it may override uvgRTP's own timestamp
* calculations and provide timestamping information for the stream itself.
* This requires that the application provides a sensible value for the ts
* parameter. If RTCP has been enabled, uvgrtp::rtcp::set_ts_info() should have
* been called.
*
* \param data Smart pointer to data the that should be sent
* \param data_len Length of data
* \param ts 32-bit timestamp value for the data
* \param flags Optional flags, see ::RTP_FLAGS for more details
*
* \return RTP error code
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If one of the parameters are invalid
* \retval RTP_MEMORY_ERROR If the data chunk is too large to be processed
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred */
rtp_error_t push_frame(std::unique_ptr<uint8_t[]> data, size_t data_len, uint32_t ts, int flags);
/**