<p>The <aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a> is an entity which represents one RTP stream.
<trclass="memdesc:a0950a91bd645cbf842d8218ae4171aed"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Add keying information for user-managed SRTP session. <br/></td></tr>
<trclass="memdesc:a157e9973d92b65e82914d4028690c770"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Send data to remote participant with a custom timestamp. <br/></td></tr>
<trclass="memdesc:a068a0963e06f789b4e4310a45cbe4409"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Send data to remote participant with a custom timestamp. <br/></td></tr>
<trclass="memdesc:ac0cb1cf34b639c9ba71b047b3ba26d22"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Send data to remote participant with a custom timestamp. <br/></td></tr>
<trclass="memdesc:a5577c57f1bdd5b888aa4e8c4f939eba7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Send data to remote participant with custom RTP and NTP timestamps. <br/></td></tr>
<trclass="memdesc:abe9099254c6bf16f255f5f50441ec9d2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Send data to remote participant with a custom timestamp. <br/></td></tr>
<trclass="memdesc:a56d2a209b2647d0f3ee7948e8cf45438"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Send data to remote participant with custom RTP and NTP timestamps. <br/></td></tr>
<trclass="memdesc:ab0c854a4c36572f91008a8e1e49e38bb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Poll a frame indefinitely from the media stream object. <br/></td></tr>
<trclass="memdesc:a466067ad9924a52530c62c53c1b397b4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Poll a frame for a specified time from the media stream object. <br/></td></tr>
<trclass="memdesc:a74a558b23866976e52c5903996544a27"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Asynchronous way of getting frames. <br/></td></tr>
<trclass="memdesc:a2cee4fe3bf423ec317b4a3eacc136238"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Configure the media stream, see <aclass="el"href="util_8hh.html#aa98d9238629e33567e73af0d239e587f"title="RTP context configuration flags.">RTP_CTX_CONFIGURATION_FLAGS</a> for more details. <br/></td></tr>
<trclass="memdesc:acee8dd45e8c6ebbb1af52bb54dd7c40d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get the values associated with configuration flags, see <aclass="el"href="util_8hh.html#aa98d9238629e33567e73af0d239e587f"title="RTP context configuration flags.">RTP_CTX_CONFIGURATION_FLAGS</a> for more details. <br/></td></tr>
<trclass="memdesc:ab339f15d5a852beacd901b7b78e887ea"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get pointer to the RTCP object of the media stream. <br/></td></tr>
<trclass="memdesc:a8796cb34e0e6c61af8cabd13dd6793b5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get SSRC identifier. You can use the SSRC value for example to find the report block belonging to this <aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a> in RTCP sender/receiver report. <br/></td></tr>
<divclass="textblock"><p>The <aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a> is an entity which represents one RTP stream. </p>
<p><aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a> is defined by the ports which are used for sending and/or receiving media. It is possible for <aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a> to be bi- or unidirectional. The unidirectionality is achieved by specifying RCE_SEND_ONLY or RCE_RECEIVE_ONLY flag when creating <aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a>.</p>
<p>If RCE_RTCP was given when creating <aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a>, you can get the <aclass="el"href="classuvgrtp_1_1rtcp.html"title="RTCP instance handles all incoming and outgoing RTCP traffic, including report generation.">uvgrtp::rtcp</a> object with <aclass="el"href="#ab339f15d5a852beacd901b7b78e887ea"title="Get pointer to the RTCP object of the media stream.">get_rtcp()</a>-function.</p>
<p><aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a> corresponds to one RTP session in <ahref="https://www.rfc-editor.org/rfc/rfc3550">RFC 3550</a>. </p>
<pclass="definition">Definition at line <aclass="el"href="media__stream_8hh_source.html#l00053">53</a> of file <aclass="el"href="media__stream_8hh_source.html">media_stream.hh</a>.</p>
<p>For user-managed SRTP session (flag RCE_SRTP_KMNGMNT_USER), the media stream is not started until SRTP key has been added and all calls to <aclass="el"href="#a157e9973d92b65e82914d4028690c770"title="Send data to remote participant with a custom timestamp.">push_frame()</a> will fail.</p>
<p>Configure the media stream, see <aclass="el"href="util_8hh.html#aa98d9238629e33567e73af0d239e587f"title="RTP context configuration flags.">RTP_CTX_CONFIGURATION_FLAGS</a> for more details. </p>
<p>Get the values associated with configuration flags, see <aclass="el"href="util_8hh.html#aa98d9238629e33567e73af0d239e587f"title="RTP context configuration flags.">RTP_CTX_CONFIGURATION_FLAGS</a> for more details. </p>
<dlclass="section return"><dt>Returns</dt><dd>Value of the configuration flag</dd></dl>
<dlclass="retval"><dt>Return values</dt><dd>
<tableclass="retval">
<tr><tdclass="paramname">int</td><td>value on success </td></tr>
<p>This object is used to control all RTCP-related functionality and RTCP documentation can be found from <aclass="el"href="classuvgrtp_1_1rtcp.html">uvgrtp::rtcp</a></p>
<tr><tdclass="paramname">uvgrtp::rtcp*</td><td>If RTCP has been enabled (RCE_RTCP has been given to <aclass="el"href="classuvgrtp_1_1session.html#a0b9fb48e95cbfdb76fd9f61e8cafe8e4"title="Create a uni- or bidirectional media stream.">uvgrtp::session::create_stream()</a>) </td></tr>
<p>Get SSRC identifier. You can use the SSRC value for example to find the report block belonging to this <aclass="el"href="classuvgrtp_1_1media__stream.html"title="The media_stream is an entity which represents one RTP stream.">media_stream</a> in RTCP sender/receiver report. </p>
<dlclass="section return"><dt>Returns</dt><dd>SSRC value </dd></dl>
<p>Receive hook is an alternative to polling frames using <aclass="el"href="#ab0c854a4c36572f91008a8e1e49e38bb"title="Poll a frame indefinitely from the media stream object.">uvgrtp::media_stream::pull_frame()</a>. Instead of application asking from uvgRTP if there are any new frames available, uvgRTP will notify the application when a frame has been received</p>
<p>The hook should not be used for media processing as it will block the receiver from reading more frames. Instead, it should only be used as an interface between uvgRTP and the calling application where the frame hand-off happens.</p>
<p>If so specified either by the selected media format and/or given <aclass="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 1492 bytes, or to any other size defined by the application using <aclass="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>
<tr><tdclass="paramname">rtp_flags</td><td>Optional flags, see <aclass="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>
<p>If so specified either by the selected media format and/or given <aclass="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 1492 bytes, or to any other size defined by the application using <aclass="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, <aclass="el"href="classuvgrtp_1_1rtcp.html#a5d0d06f9b4b7779d96d8d60938627316"title="Provide timestamping information for RTCP.">uvgrtp::rtcp::set_ts_info()</a> should have been called.</p>
<tr><tdclass="paramname">rtp_flags</td><td>Optional flags, see <aclass="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>
<p>Send data to remote participant with custom RTP and NTP timestamps. </p>
<p>If so specified either by the selected media format and/or given <aclass="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 1492 bytes, or to any other size defined by the application using <aclass="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, <aclass="el"href="classuvgrtp_1_1rtcp.html#a5d0d06f9b4b7779d96d8d60938627316"title="Provide timestamping information for RTCP.">uvgrtp::rtcp::set_ts_info()</a> should have been called.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">data</td><td>Smart pointer to data the that should be sent </td></tr>
<tr><tdclass="paramname">data_len</td><td>Length of data </td></tr>
<tr><tdclass="paramname">ts</td><td>32-bit RTP timestamp for the packet </td></tr>
<tr><tdclass="paramname">ntp_ts</td><td>64-bit NTP timestamp value of when the packets data was sampled. NTP timestamp is a 64-bit unsigned fixed-point number with the integer part (seconds) in the first 32 bits and the fractional part (fractional seconds) in the last 32 bits. Used for synchronizing multiple streams. </td></tr>
<tr><tdclass="paramname">rtp_flags</td><td>Optional flags, see <aclass="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>
<p>If so specified either by the selected media format and/or given <aclass="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 1492 bytes, or to any other size defined by the application using <aclass="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>
<tr><tdclass="paramname">rtp_flags</td><td>Optional flags, see <aclass="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>
<p>If so specified either by the selected media format and/or given <aclass="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 1492 bytes, or to any other size defined by the application using <aclass="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, <aclass="el"href="classuvgrtp_1_1rtcp.html#a5d0d06f9b4b7779d96d8d60938627316"title="Provide timestamping information for RTCP.">uvgrtp::rtcp::set_ts_info()</a> should have been called.</p>
<tr><tdclass="paramname">rtp_flags</td><td>Optional flags, see <aclass="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>
<p>Send data to remote participant with custom RTP and NTP timestamps. </p>
<p>If so specified either by the selected media format and/or given <aclass="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 1492 bytes, or to any other size defined by the application using <aclass="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, <aclass="el"href="classuvgrtp_1_1rtcp.html#a5d0d06f9b4b7779d96d8d60938627316"title="Provide timestamping information for RTCP.">uvgrtp::rtcp::set_ts_info()</a> should have been called.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">data</td><td>Pointer to data the that should be sent, uvgRTP does not take ownership of the memory </td></tr>
<tr><tdclass="paramname">data_len</td><td>Length of data </td></tr>
<tr><tdclass="paramname">ts</td><td>32-bit RTP timestamp for the packet </td></tr>
<tr><tdclass="paramname">ntp_ts</td><td>64-bit NTP timestamp value of when the packets data was sampled. NTP timestamp is a 64-bit unsigned fixed-point number with the integer part (seconds) in the first 32 bits and the fractional part (fractional seconds) in the last 32 bits. Used for synchronizing multiple streams. </td></tr>
<tr><tdclass="paramname">rtp_flags</td><td>Optional flags, see <aclass="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>
<li>Use flags RCE_SRTP + RCE_SRTP_KMNGMNT_ZRTP + (RCE_ZRTP_DIFFIE_HELLMAN_MODE/RCE_ZRTP_MULTISTREAM_MODE) to automatically start ZRTP negotiation when creating a media stream.</li>
<li>Use flags RCE_SRTP + (RCE_ZRTP_DIFFIE_HELLMAN_MODE/RCE_ZRTP_MULTISTREAM_MODE) and after creating the media stream, call <aclass="el"href="#a9e22ebbe9f903abe0fcae267f98cafeb"title="Start the ZRTP negotiation manually.">start_zrtp()</a> to manually start the ZRTP negotiation</li>