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

[FR] Build options shall be available to application writers #2610

Open
jeandube opened this issue Jan 12, 2023 · 3 comments · May be fixed by #2806
Open

[FR] Build options shall be available to application writers #2610

jeandube opened this issue Jan 12, 2023 · 3 comments · May be fixed by #2806
Labels
[API] Area: Changes in SRT library API Type: Enhancement Indicates new feature requests
Milestone

Comments

@jeandube
Copy link
Collaborator

build options affecting the public headers shall be set in a headers for apps.
Options such as ENABLE_AEAD_API_PREVIEW requires the app to define it whenever srt.h is included and this define is not automatically update whenever libsrt is updated/reconfigured/rebuilt.

<snip>
   SRTO_RETRANSMITALGO = 61, // An option to select packet retransmission algorithm
#ifdef ENABLE_AEAD_API_PREVIEW
   SRTO_CRYPTOMODE = 62,     // Encryption cipher mode (AES-CTR, AES-GCM, ...).
#endif
<snip>

If they are provided in a separate file, ex: srt-config.h app can also adapt their code to the lib they are building with.

#include <srt-config.h>
#include <srt.h>
...

An include for Makefiles can also be useful, to link with the libsrt configured crypto lib (--use-enclib=) for example.

@jeandube jeandube added the Type: Enhancement Indicates new feature requests label Jan 12, 2023
@maxsharabayko maxsharabayko added the [API] Area: Changes in SRT library API label Mar 28, 2023
@maxsharabayko maxsharabayko added this to the v1.6.0 milestone Mar 28, 2023
@oviano
Copy link
Contributor

oviano commented Mar 31, 2023

I support this! I build SRT in a slightly unorthodox way by dropping the files directly into my already-existing cross-platform library projects.

Having a <srt-config.h> file would be helpful in centralising the definitions common to all the builds, rather than have to add them individually to my projects.

@ethouris
Copy link
Collaborator

ethouris commented Oct 2, 2023

We could also make a config header file, but this solution only partially fixes any potential problems on this ground. A more general solution is to allow adding any kind of compile flags required for this header file before including, as obtained through pkg-config.

@jlsantiago0
Copy link
Contributor

Yes. but then you would require pkg-config to access the data. It should always be available no matter how you access the library interface. and since the only way to ensure that you are interfacing with the information related to how the library was built, is to include it in generated .h files distributed with the library. Having to have magic #defines defined by the library user in their source or build environment when there is no sure way to know which ones are valid is not good.

@maxsharabayko maxsharabayko modified the milestones: v1.5.4, Major Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[API] Area: Changes in SRT library API Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants