From 36d76a3ca59720c84be62cb3b773e02031e6302c Mon Sep 17 00:00:00 2001 From: Aaro Altonen Date: Tue, 23 Feb 2021 13:47:13 +0200 Subject: [PATCH] Add Doxygen main page --- Doxyfile | 4 ++-- docs/examples/rawvideo.cc | 36 ++++++++++++++++++++++++++++++++++++ docs/html/INDEX.md | 13 +++++++++++++ docs/html/index.html | 6 +++--- 4 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 docs/examples/rawvideo.cc create mode 100644 docs/html/INDEX.md diff --git a/Doxyfile b/Doxyfile index 82da749..0a1e571 100644 --- a/Doxyfile +++ b/Doxyfile @@ -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 diff --git a/docs/examples/rawvideo.cc b/docs/examples/rawvideo.cc new file mode 100644 index 0000000..94f0219 --- /dev/null +++ b/docs/examples/rawvideo.cc @@ -0,0 +1,36 @@ +#include +#include + +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; +} diff --git a/docs/html/INDEX.md b/docs/html/INDEX.md new file mode 100644 index 0000000..355b0ab --- /dev/null +++ b/docs/html/INDEX.md @@ -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. diff --git a/docs/html/index.html b/docs/html/index.html index 28d153f..bb53316 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -65,9 +65,9 @@ $(function() {
uvgRTP public API documentation
-

To use uvgRTP, you must first create uvgrtp::context object

-

Then you need to allocate a uvgrtp::session object from the context object.

-

Finally, you need to allocate a uvgrtp::media_stream object from the allocated session object.

+

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.