Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Created internal config storage for a socket #1776

Merged

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Jan 29, 2021

What's changed:

  1. All variables representing multiplexer-related options are moved to a separate class
  2. All other options are moved to CSrtConfig class that derives from the one above
  3. Multiplexer-related options are now in use when creating the multiplexer. Multiplexer contains this object instead of single fields for required options and it is used in the procedure of finding the existing multiplexer.
  4. Options have setters assigned to an option as template parameter and they are dispatched by finding in the option array. The solution was generally done in order to be able to forward the call to the option directly in case when the option name is already known, which was not necessary, but the already crafted solution still reduced the complexity (array index and call a function by pointer replaced binary search for enum).
  5. The restrictions are defined by flags and checked inside the socket setter function before accessing the option. Among the flags there are also options that require specific post-action in case when the option was set on the socket.
  6. The new socket option setting function consists now of precondition check, option forwarding, and post-action.
  7. The options of string type are represented by a hard-limited character array coming with a handy wrapper named StringStorage.

srtcore/api.cpp Outdated Show resolved Hide resolved
srtcore/channel.h Outdated Show resolved Hide resolved
srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.h Outdated Show resolved Hide resolved
srtcore/core.h Outdated Show resolved Hide resolved
srtcore/core.h Outdated Show resolved Hide resolved
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Feb 1, 2021
@maxsharabayko maxsharabayko added [core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code labels Feb 1, 2021
srtcore/core.h Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/api.cpp Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/channel.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

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

Might be worth applying clang-format on socketconfig.h and cpp

srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
srtcore/socketconfig.h Outdated Show resolved Hide resolved
@ethouris ethouris marked this pull request as ready for review February 8, 2021 16:27
srtcore/srt.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

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

CI build failure

@maxsharabayko
Copy link
Collaborator

maxsharabayko commented Mar 18, 2021

Follow up PRs/issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants