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] New API function srt_clock_type() #1887

Merged
merged 4 commits into from
Apr 27, 2021

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Mar 24, 2021

Adds int srt_clock_type(void) API function to determine in runtime the internal clock type used by SRT library.

Possible return values:

#define SRT_SYNC_CLOCK_STDCXX_STEADY      0 // C++11 std::chrono::steady_clock
#define SRT_SYNC_CLOCK_GETTIME_MONOTONIC  1 // clock_gettime with CLOCK_MONOTONIC
#define SRT_SYNC_CLOCK_WINQPC             2
#define SRT_SYNC_CLOCK_MACH_ABSTIME       3
#define SRT_SYNC_CLOCK_POSIX_GETTIMEOFDAY 4
#define SRT_SYNC_CLOCK_AMD64_RDTSC        5
#define SRT_SYNC_CLOCK_IA32_RDTSC         6
#define SRT_SYNC_CLOCK_IA64_ITC           7

Defines are used instead of enum to allow possible inclusion of SRT_INTERNAL_CLOCK_VERSION in version.h to determine the clock type at the compilation time.

Fixes #1702

TODO

  • docs: add function description to the API-functions.md.

@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Mar 24, 2021
@maxsharabayko maxsharabayko added [API] Area: Changes in SRT library API [core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests labels Mar 24, 2021
srtcore/srt.h Outdated Show resolved Hide resolved
@maxsharabayko maxsharabayko marked this pull request as ready for review April 16, 2021 09:15
srtcore/srt.h Outdated Show resolved Hide resolved
srtcore/srt.h Outdated Show resolved Hide resolved
@maxsharabayko maxsharabayko merged commit 291e010 into Haivision:master Apr 27, 2021
@maxsharabayko maxsharabayko deleted the develop/api-clocktype branch April 27, 2021 08:44
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 [core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests
Projects
None yet
5 participants