Document push_frame()
This commit is contained in:
parent
59b4eb4b27
commit
53f8afbdb2
|
@ -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;
|
||||
}
|
|
@ -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< uint8_t[]> 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< 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><td class="entry"><a class="el" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">push_frame</a>(std::unique_ptr< 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 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< 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>
|
||||
</table></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
|
|
|
@ -79,15 +79,16 @@ Public Member Functions</h2></td></tr>
|
|||
rtp_error_t </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"> </td></tr>
|
||||
<tr class="memitem:ab2b7507d5b2c76bef74c9bceec07ba18"><td class="memItemLeft" align="right" valign="top">rtp_error_t </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"> </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"> </td></tr>
|
||||
<tr class="memitem:a18975c5463df0664f1fd8ab495248dcc"><td class="memItemLeft" align="right" valign="top"><a id="a18975c5463df0664f1fd8ab495248dcc"></a>
|
||||
rtp_error_t </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"> </td></tr>
|
||||
<tr class="memitem:ab2e79cf2f90f81a90ae9c22e0c1fb01e"><td class="memItemLeft" align="right" valign="top"><a id="ab2e79cf2f90f81a90ae9c22e0c1fb01e"></a>
|
||||
rtp_error_t </td><td class="memItemRight" valign="bottom"><b>push_frame</b> (std::unique_ptr< uint8_t[]> data, size_t data_len, int flags)</td></tr>
|
||||
<tr class="memitem:ab2e79cf2f90f81a90ae9c22e0c1fb01e"><td class="memItemLeft" align="right" valign="top">rtp_error_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">push_frame</a> (std::unique_ptr< uint8_t[]> data, size_t data_len, int flags)</td></tr>
|
||||
<tr class="memdesc:ab2e79cf2f90f81a90ae9c22e0c1fb01e"><td class="mdescLeft"> </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"> </td></tr>
|
||||
<tr class="memitem:a85fed1e02b97326d3b794551f0677e2b"><td class="memItemLeft" align="right" valign="top"><a id="a85fed1e02b97326d3b794551f0677e2b"></a>
|
||||
rtp_error_t </td><td class="memItemRight" valign="bottom"><b>push_frame</b> (std::unique_ptr< uint8_t[]> 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 </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"> </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"> </td></tr>
|
||||
<tr class="memitem:a85fed1e02b97326d3b794551f0677e2b"><td class="memItemLeft" align="right" valign="top">rtp_error_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b">push_frame</a> (std::unique_ptr< uint8_t[]> data, size_t data_len, uint32_t ts, int flags)</td></tr>
|
||||
<tr class="memdesc:a85fed1e02b97326d3b794551f0677e2b"><td class="mdescLeft"> </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"> </td></tr>
|
||||
<tr class="memitem:ae2fe9e8d9b67e25f103a78a25417149f"><td class="memItemLeft" align="right" valign="top">uvgrtp::frame::rtp_frame * </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"> </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 </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">◆ </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< uint8_t[]> </td>
|
||||
<td class="paramname"><em>data</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">size_t </td>
|
||||
<td class="paramname"><em>data_len</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </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'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">◆ </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< uint8_t[]> </td>
|
||||
<td class="paramname"><em>data</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">size_t </td>
|
||||
<td class="paramname"><em>data_len</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">uint32_t </td>
|
||||
<td class="paramname"><em>ts</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </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'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">◆ </a></span>push_frame()</h2>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ab2b7507d5b2c76bef74c9bceec07ba18">◆ </a></span>push_frame() <span class="overload">[3/4]</span></h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
|
@ -299,12 +423,95 @@ rtp_error_t </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'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">◆ </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 * </td>
|
||||
<td class="paramname"><em>data</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">size_t </td>
|
||||
<td class="paramname"><em>data_len</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">uint32_t </td>
|
||||
<td class="paramname"><em>ts</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </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'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>
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -127,105 +127,111 @@ $(function() {
|
|||
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <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>  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>  </div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18"> 84</a></span>  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>  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>  rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(std::unique_ptr<uint8_t[]> 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>  rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2b7507d5b2c76bef74c9bceec07ba18">push_frame</a>(std::unique_ptr<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="l00088"></a><span class="lineno"> 88</span>  </div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f"> 103</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736"> 119</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27"> 139</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <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> <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> <span class="comment"> * when SCD has processed the frame</span></div>
|
||||
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="comment"> * Return RTP_OK on success</span></div>
|
||||
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="comment"> * Return RTP_INVALID_VALUE if "hook" is nullptr */</span></div>
|
||||
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  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>  </div>
|
||||
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <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> <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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="comment"> * When uvgRTP encouters a situation it doesn't know how to react to,</span></div>
|
||||
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <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> <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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="comment"> * "arg" 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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="comment"> * Return RTP_OK on success</span></div>
|
||||
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="comment"> * Return RTP_INVALID_VALUE if "hook" is nullptr */</span></div>
|
||||
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  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>  </div>
|
||||
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#addf1cde9cb8c4e4af3160ce24c4288a5"> 176</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <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>  <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>  <span class="keywordtype">void</span> *get_media_config();</div>
|
||||
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  </div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="comment">/* Get unique key of the media stream</span></div>
|
||||
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> <span class="comment"> * Used by session to index media streams */</span></div>
|
||||
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  uint32_t get_key();</div>
|
||||
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  </div>
|
||||
<div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a1134ff0271ad54bf1e07feed422118c2"> 200</a></span>  <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>  </div>
|
||||
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="comment">/* Initialize the connection by initializing the socket</span></div>
|
||||
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span> <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> <span class="comment"> * an outgoing address */</span></div>
|
||||
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  rtp_error_t init_connection();</div>
|
||||
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  </div>
|
||||
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  uint32_t key_;</div>
|
||||
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  </div>
|
||||
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  uvgrtp::srtp *srtp_;</div>
|
||||
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  uvgrtp::srtcp *srtcp_;</div>
|
||||
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  uvgrtp::socket *socket_;</div>
|
||||
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  uvgrtp::rtp *rtp_;</div>
|
||||
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <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>  </div>
|
||||
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  sockaddr_in addr_out_;</div>
|
||||
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  std::string addr_;</div>
|
||||
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  std::string laddr_;</div>
|
||||
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordtype">int</span> src_port_;</div>
|
||||
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keywordtype">int</span> dst_port_;</div>
|
||||
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  rtp_format_t fmt_;</div>
|
||||
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordtype">int</span> flags_;</div>
|
||||
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  </div>
|
||||
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="comment">/* Media context config (SCD etc.) */</span></div>
|
||||
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  rtp_ctx_conf_t ctx_config_;</div>
|
||||
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  </div>
|
||||
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="comment">/* Media config f.ex. for Opus */</span></div>
|
||||
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <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>  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>  </div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e"> 107</a></span>  rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#ab2e79cf2f90f81a90ae9c22e0c1fb01e">push_frame</a>(std::unique_ptr<uint8_t[]> 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>  </div>
|
||||
<div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a18975c5463df0664f1fd8ab495248dcc"> 137</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b"> 167</a></span>  rtp_error_t <a class="code" href="classuvgrtp_1_1media__stream.html#a85fed1e02b97326d3b794551f0677e2b">push_frame</a>(std::unique_ptr<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="l00168"></a><span class="lineno"> 168</span>  </div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#ae2fe9e8d9b67e25f103a78a25417149f"> 183</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a441263e19be4383223884fde8838f736"> 199</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a74a558b23866976e52c5903996544a27"> 219</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <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> <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> <span class="comment"> * when SCD has processed the frame</span></div>
|
||||
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span> <span class="comment"> * Return RTP_OK on success</span></div>
|
||||
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span> <span class="comment"> * Return RTP_INVALID_VALUE if "hook" is nullptr */</span></div>
|
||||
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  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>  </div>
|
||||
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="comment">/* Has the media stream been initialized */</span></div>
|
||||
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="keywordtype">bool</span> initialized_;</div>
|
||||
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  </div>
|
||||
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <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>  uint32_t rtp_handler_key_;</div>
|
||||
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  uint32_t zrtp_handler_key_;</div>
|
||||
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  </div>
|
||||
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="comment">/* RTP packet dispatcher for the receiver */</span></div>
|
||||
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  uvgrtp::pkt_dispatcher *pkt_dispatcher_;</div>
|
||||
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  std::thread *dispatcher_thread_;</div>
|
||||
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  </div>
|
||||
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="comment">/* Media object associated with this media stream. */</span></div>
|
||||
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  uvgrtp::formats::media *media_;</div>
|
||||
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  </div>
|
||||
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <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>  uvgrtp::holepuncher *holepuncher_;</div>
|
||||
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  };</div>
|
||||
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span> };</div>
|
||||
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  </div>
|
||||
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span> <span class="keyword">namespace </span>uvg_rtp = uvgrtp;</div>
|
||||
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <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> <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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span> <span class="comment"> * When uvgRTP encouters a situation it doesn't know how to react to,</span></div>
|
||||
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span> <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> <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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span> <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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> <span class="comment"> * "arg" 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> <span class="comment"> *</span></div>
|
||||
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span> <span class="comment"> * Return RTP_OK on success</span></div>
|
||||
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span> <span class="comment"> * Return RTP_INVALID_VALUE if "hook" is nullptr */</span></div>
|
||||
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  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>  </div>
|
||||
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#addf1cde9cb8c4e4af3160ce24c4288a5"> 256</a></span>  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>  </div>
|
||||
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <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>  <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>  <span class="keywordtype">void</span> *get_media_config();</div>
|
||||
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  </div>
|
||||
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="comment">/* Get unique key of the media stream</span></div>
|
||||
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span> <span class="comment"> * Used by session to index media streams */</span></div>
|
||||
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  uint32_t get_key();</div>
|
||||
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  </div>
|
||||
<div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classuvgrtp_1_1media__stream.html#a1134ff0271ad54bf1e07feed422118c2"> 280</a></span>  <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>  </div>
|
||||
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="comment">/* Initialize the connection by initializing the socket</span></div>
|
||||
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span> <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> <span class="comment"> * an outgoing address */</span></div>
|
||||
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  rtp_error_t init_connection();</div>
|
||||
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  </div>
|
||||
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  uint32_t key_;</div>
|
||||
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  </div>
|
||||
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  uvgrtp::srtp *srtp_;</div>
|
||||
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  uvgrtp::srtcp *srtcp_;</div>
|
||||
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  uvgrtp::socket *socket_;</div>
|
||||
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  uvgrtp::rtp *rtp_;</div>
|
||||
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <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>  </div>
|
||||
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  sockaddr_in addr_out_;</div>
|
||||
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  std::string addr_;</div>
|
||||
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  std::string laddr_;</div>
|
||||
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordtype">int</span> src_port_;</div>
|
||||
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keywordtype">int</span> dst_port_;</div>
|
||||
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  rtp_format_t fmt_;</div>
|
||||
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keywordtype">int</span> flags_;</div>
|
||||
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  </div>
|
||||
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <span class="comment">/* Media context config (SCD etc.) */</span></div>
|
||||
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  rtp_ctx_conf_t ctx_config_;</div>
|
||||
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  </div>
|
||||
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="comment">/* Media config f.ex. for Opus */</span></div>
|
||||
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keywordtype">void</span> *media_config_;</div>
|
||||
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  </div>
|
||||
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="comment">/* Has the media stream been initialized */</span></div>
|
||||
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordtype">bool</span> initialized_;</div>
|
||||
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  </div>
|
||||
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <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>  uint32_t rtp_handler_key_;</div>
|
||||
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  uint32_t zrtp_handler_key_;</div>
|
||||
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  </div>
|
||||
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="comment">/* RTP packet dispatcher for the receiver */</span></div>
|
||||
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  uvgrtp::pkt_dispatcher *pkt_dispatcher_;</div>
|
||||
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  std::thread *dispatcher_thread_;</div>
|
||||
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  </div>
|
||||
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <span class="comment">/* Media object associated with this media stream. */</span></div>
|
||||
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  uvgrtp::formats::media *media_;</div>
|
||||
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  </div>
|
||||
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <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>  uvgrtp::holepuncher *holepuncher_;</div>
|
||||
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  };</div>
|
||||
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span> };</div>
|
||||
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  </div>
|
||||
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span> <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< 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_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< 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_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>
|
||||
|
|
|
@ -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< uint8_t[]> 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< uint8_t[]> data, size_t data_len, uint32_t ts, int flags)']]]
|
||||
];
|
||||
|
|
|
@ -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< uint8_t[]> 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< uint8_t[]> data, size_t data_len, uint32_t ts, int flags)']]]
|
||||
];
|
||||
|
|
|
@ -157,7 +157,7 @@ Enumerations</h2></td></tr>
|
|||
  <a class="el" href="util_8hh.html#af03a75996471fc531742cd640c7caf2dab1d5797a23c37a33168046a2ae6aef6a">RTP_COPY</a> = 1 << 1
|
||||
<br />
|
||||
}</td></tr>
|
||||
<tr class="memdesc:af03a75996471fc531742cd640c7caf2d"><td class="mdescLeft"> </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"> </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"> </td></tr>
|
||||
<tr class="memitem:a15b2d6364db6065a482c99827f4bd2af"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2af">RTP_CTX_ENABLE_FLAGS</a> { <br />
|
||||
  <b>RCE_NO_FLAGS</b> = 0 << 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 </td><td class="fielddoc"><p>No flags </p>
|
||||
</td></tr>
|
||||
|
|
|
@ -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);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue