The goal of the SDP library is provide SDP Serializer and Deserializer functionalities.
Session Description Protocol (SDP), described in RFC8866, is a format for describing multimedia communication sessions for the purposes of announcement and invitation. An SDP description consists of a number of lines of text of the form:
<type>=<value>
where <type> is exactly one case-significant character and <value> is structured
text whose format depends on <type>. Here is an example of a SDP message:
v=0
o=jdoe 2890844526 2890842807 IN IP4 10.47.16.5
s=SDP Seminar
i=A Seminar on the session description protocol
u=http://www.example.com/seminars/sdp.pdf
e=j.doe@example.com (Jane Doe)
c=IN IP4 224.2.17.12/127
t=2873397496 2873404696
a=recvonly
m=audio 49170 RTP/AVP 0
m=video 51372 RTP/AVP 99
a=rtpmap:99 h263-1998/90000
- Call SdpSerializer_Init to start creating an SDP message.
- Keep appending info by calling corresponding APIs:
- To append string, call SdpSerializer_AddBuffer().
- To append originator, call SdpSerializer_AddOriginator().
- etc.
- Call SdpSerializer_Finalize() to get the result after serialization.
- Call SdpDeserializer_Init to start deserializing an SDP message.
- Keep calling SdpDeserializer_GetNext() to get next
<type>=<value>in the SDP message. - Call corresponding parse APIs to parse string into structure:
- If return type is SDP_TYPE_ORIGINATOR, call SdpDeserializer_ParseOriginator().
- If return type is SDP_TYPE_BANDWIDTH, call SdpDeserializer_ParseBandwidthInfo().
- etc.
- Loop to step 2 till you get SDP_RESULT_MESSAGE_END.
- For running unit tests:
- C99 compiler like gcc.
- CMake 3.13.0 or later.
- Ruby 2.0.0 or later (It is required for the CMock test framework that we use).
- For running the coverage target, gcov and lcov are required.
-
Go to the root directory of this repository.
-
Run the following command to generate Makefiles:
cmake -S test/unit-test -B build/ -G "Unix Makefiles" \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_CLONE_SUBMODULES=ON \ -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG'
-
Run the following command to build the library and unit tests:
make -C build all
-
Run the following command to execute all tests and view results:
cd build && ctest -E system --output-on-failure
-
Go to the root directory of this repository.
-
Run the following command to generate Makefiles:
cmake -S test/unit-test -B build/ -G "Unix Makefiles" \ -DBUILD_CLONE_SUBMODULES=ON \ -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG'
-
Generate coverage report in
build/coveragefolder:cd build && make coverage
cmake -S test/unit-test -B build/ -G "Unix Makefiles" -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
cd build && make coverage