Add Doxygen main page

This commit is contained in:
Aaro Altonen 2021-02-23 13:47:13 +02:00
parent 8271bfb34d
commit 36d76a3ca5
4 changed files with 54 additions and 5 deletions

View File

@ -864,7 +864,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = include/lib.hh include/session.hh include/media_stream.hh include/util.hh include/rtcp.hh include/clock.hh
INPUT = include/lib.hh include/session.hh include/media_stream.hh include/util.hh include/rtcp.hh include/clock.hh docs/html/INDEX.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@ -1061,7 +1061,7 @@ FILTER_SOURCE_PATTERNS =
# (index.html). This can be useful if you have a project on for instance GitHub
# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
USE_MDFILE_AS_MAINPAGE = docs/html/INDEX.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing

36
docs/examples/rawvideo.cc Normal file
View File

@ -0,0 +1,36 @@
#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;
}

13
docs/html/INDEX.md Normal file
View File

@ -0,0 +1,13 @@
# uvgRTP public API documentation
To use uvgRTP, you must first create a uvgrtp::context object
Then you need to allocate a uvgrtp::session object from the context object by calling uvgrtp::context::create_session()
Finally, you need to allocate a uvgrtp::media_stream object from the allocated session object
by calling uvgrtp::session::create_stream()
This object is used for both sending and receiving, see documentation for
uvgrtp::media_stream::push_frame(),
uvgrtp::media_stream::pull_frame() and
uvgrtp::media_stream::install_receive_hook() for more details.

View File

@ -65,9 +65,9 @@ $(function() {
<div class="title">uvgRTP public API documentation </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md_docs_html_INDEX"></a> To use uvgRTP, you must first create <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.</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.</p>
<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">uvgrtp::media_stream::install_receive_hook()</a> for more details. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->