Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

prepare for siprtp_module - #32

Merged
j1elo merged 4 commits into
Kurento:masterfrom
naevatec:siprtp_module
Mar 14, 2022
Merged

j1elo merged 4 commits into
Kurento:masterfrom
naevatec:siprtp_module

Conversation

@slabajo

@slabajo slabajo commented Feb 24, 2021

Copy link
Copy Markdown
Member

What is the current behavior you want to change?

Current rtpendpoint (GStreamer plugin) is not well suited for SIP RTP media integration, as it lacks several features. This Lacking features are implemented in an external module SipRtpEndpoint that regarding its interface it derives from RtpEndpoint (available in https://github.com/naevatec/kms-siprtpendpoint). However, current rtpendpoint plugin declares several data private that is needed on derived siprtpendpoint in that module. In fact current rtpendpoint plugin can be considered "final" in the sense that it is not intended for deriving any class. The alternative would have been to reimplement many features of rtpendpoint in siprtpendpoint, which is for sure a bad idea in terms of maintenance.
So, this PR is about reingenieering a little part of rtpendpoint plugin so that private data gets public and so can be reused by derived classes/plugins

What is the new behavior provided by this change?

No new behaviour nor modified any behaviiour. All will continue to work exactly as they do on current version. The only change is matter of interface of the rtpendpoint GStreamer plugin

How has this been tested?

Tests have been done integrated with kms-siprtpendpoint project and include:

  • unitary tests (on kms-siprtpendpoint /test folder) that test all RTP features needed for SIP integration
  • system test, a sample app that switches media sources (including ssrc and timestamp bases and also encryption/non-encryption has been deveoped and tested including all relevant RtpEndpoint APIs that are all the ones related to SDP negotiation (generateOffer, processOffer and processAnswer). Rest of APIs remain unchanged

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature / enhancement (non-breaking change which improves the project)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • My change requires a change to the documentation
  • My change requires a change in other repository

Checklist

  • I have read the Contribution Guidelines
  • I have added an explanation of what the changes do and why they should be included
  • I have written new tests for the changes, as applicable, and have successfully run them locally

@j1elo j1elo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filesystem listings shown in the screenshots were generated with a find command and then compared with meld. For portability between development machines, I've written the complete self-contained set of commands that build and install KMS so it's possible to repeat this analysis as desired:

docker run --rm -ti --network host -v /tmp:/host ubuntu:xenial

apt-get update && apt-get install --no-install-recommends --yes \
    build-essential \
    ca-certificates \
    cmake \
    git \
    gnupg \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83 \
&& source /etc/lsb-release \
&& echo "deb [arch=amd64] http://ubuntu.openvidu.io/dev $DISTRIB_CODENAME kms6" >/etc/apt/sources.list.d/kurento.list \
&& apt-get update && apt-get install --no-install-recommends --yes \
    kurento-media-server-dev

git clone https://github.com/Kurento/kms-omni-build.git \
&& cd kms-omni-build/ \
&& git submodule update --init --recursive \
&& git submodule update --remote \
&& git checkout master \
&& git submodule foreach "git checkout master"

pushd kms-elements/ \
&& git checkout -b naevatec-siprtp_module master \
&& git config --global user.email "dummy" \
&& git config --global user.name "dummy" \
&& git pull --no-edit https://github.com/naevatec/kms-elements.git siprtp_module \
&& popd

bin/kms-build-run.sh --build-only \
&& cd build-Debug-docker/ \
&& make install

find / -xdev ! -path '/kms-omni-build/*' | sort >/host/fs-after-install.txt

Running this with/without the git pull siprtp_module, provides two "fs-after-install.txt" files that can be compared. These contain a preview of where all files would be installed in user's machines when using apt-get.

add_glib_enumtypes(KMS_RTPENDPOINT_SOURCES KMS_RTPENDPOINT_HEADERS kms-rtp-enumtypes KMS ${ENUM_HEADERS})

add_library(rtpendpoint MODULE ${KMS_RTPENDPOINT_SOURCES} ${KMS_RTPENDPOINT_HEADERS})
add_library(rtpendpoint SHARED ${KMS_RTPENDPOINT_SOURCES} ${KMS_RTPENDPOINT_HEADERS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is good; the library is a GStreamer plugin, intended to be loaded with dlopen(), and it is not a general purpose shared library.

If there are functions that should be exported, probably the correct way would be to implement a separate, general-purpose shared library, similar to the kmswebrtcendpointlib that is done in the webrtc module.

TARGETS rtpendpoint
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_GST_PLUGINS_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

@j1elo j1elo May 10, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same: the target rtpendpoint is meant to produce a GStreamer plugin, which should be installed in the GStreamer plugin destination path. See the difference in installation, before & after this change:
image

This can cause "plugin not found" errors, depending on the platform.

In summary, all Kureno-specific plugins should end up in {installPrefix}/lib/gstreamer-1.5/. The fact that it happens to work when the plugin is in {installPrefix}/lib/ (together with all other system libraries) is coincidental and depends on the environment configuration and/or the specific system. It will probably break if using the GST_PLUGIN_PATH variable, or when we update to newer GStreamer versions.

Note for an extra example, how WebRtcEndpoint still contains a shared-library which is appropriately installed in /usr/(local)/lib/, named kmswebrtcendpointlib; the same should be done for RtpEndpoint, if possible:
image

@j1elo j1elo self-assigned this Mar 14, 2022
@j1elo j1elo mentioned this pull request Mar 14, 2022
3 of 8 tasks
@j1elo

j1elo commented Mar 14, 2022

Copy link
Copy Markdown
Member

Changes look good to me. Using same file listing procedure than in #32 (review), this is the definitive list of new files that get installed:

+ /usr/local/include/kurento/rtpendpoint
+ /usr/local/include/kurento/rtpendpoint/kms-rtp-enumtypes.h
+ /usr/local/include/kurento/rtpendpoint/kms-rtp-marshal.h
+ /usr/local/include/kurento/rtpendpoint/kmsrtpbaseconnection.h
+ /usr/local/include/kurento/rtpendpoint/kmsrtpconnection.h
+ /usr/local/include/kurento/rtpendpoint/kmsrtpendpoint.h
+ /usr/local/include/kurento/rtpendpoint/kmsrtpsdescryptosuite.h
+ /usr/local/include/kurento/rtpendpoint/kmsrtpsession.h
+ /usr/local/include/kurento/rtpendpoint/kmssocketutils.h
+ /usr/local/include/kurento/rtpendpoint/kmssrtpconnection.h
+ /usr/local/include/kurento/rtpendpoint/kmssrtpsession.h
+ /usr/local/lib/libkmsrtpendpointlib.so
+ /usr/local/lib/libkmsrtpendpointlib.so.6
+ /usr/local/lib/libkmsrtpendpointlib.so.6.16.1~22.g56f7139
+ /usr/local/share/cmake-3.5/Modules/FindKmsRtpEndpointLib.cmake

@j1elo
j1elo merged commit b38df49 into Kurento:master Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants