7#include <catch2/catch_test_macros.hpp>
15 constexpr auto VIDEO_FLOW_ID =
"5fbec3b1-1b0f-417d-9059-8b94a47197ed";
16 constexpr auto DATA_FLOW_ID =
"db3bd465-2772-484f-8fac-830b0471258b";
20 constexpr auto GRAIN_RATE =
mxlRational{30000, 1001};
26 std::this_thread::sleep_for(delay);
29 std::uint8_t*
buffer =
nullptr;
49 auto const opts =
"{}";
80 auto videoThread = std::thread{[&]
82 videoStatus = commitGrainAfter(videoWriter, firstIndex, std::chrono::milliseconds{50});
84 auto dataThread = std::thread{[&]
86 dataStatus = commitGrainAfter(dataWriter, firstIndex, std::chrono::milliseconds{250});
102 auto const start = std::chrono::steady_clock::now();
104 auto const elapsed = std::chrono::steady_clock::now() - start;
107 CHECK(elapsed >= std::chrono::milliseconds{150});
Public flow reader, writer, payload and synchronization APIs.
MXL_EXPORT mxlStatus mxlFlowWriterOpenGrain(mxlFlowWriter writer, uint64_t index, mxlGrainInfo *mxlGrainInfo, uint8_t **payload)
MXL_EXPORT mxlStatus mxlReleaseFlowReader(mxlInstance instance, mxlFlowReader reader)
struct mxlFlowReader_t * mxlFlowReader
struct mxlGrainInfo_t mxlGrainInfo
MXL_EXPORT mxlStatus mxlFlowSynchronizationGroupWaitForDataAt(mxlFlowSynchronizationGroup group, uint64_t timestamp, uint64_t timeoutNs)
MXL_EXPORT mxlStatus mxlCreateFlowSynchronizationGroup(mxlInstance instance, mxlFlowSynchronizationGroup *group)
MXL_EXPORT mxlStatus mxlReleaseFlowSynchronizationGroup(mxlInstance instance, mxlFlowSynchronizationGroup group)
MXL_EXPORT mxlStatus mxlFlowSynchronizationGroupAddReader(mxlFlowSynchronizationGroup group, mxlFlowReader reader)
struct mxlFlowWriter_t * mxlFlowWriter
struct mxlFlowSynchronizationGroup_t * mxlFlowSynchronizationGroup
MXL_EXPORT mxlStatus mxlReleaseFlowWriter(mxlInstance instance, mxlFlowWriter writer)
MXL_EXPORT mxlStatus mxlCreateFlowWriter(mxlInstance instance, char const *flowDef, char const *options, mxlFlowWriter *writer, mxlFlowConfigInfo *configInfo, bool *created)
MXL_EXPORT mxlStatus mxlCreateFlowReader(mxlInstance instance, char const *flowId, char const *options, mxlFlowReader *reader)
MXL_EXPORT mxlStatus mxlFlowWriterCommitGrain(mxlFlowWriter writer, mxlGrainInfo const *grain)
struct mxlFlowConfigInfo_t mxlFlowConfigInfo
MXL_EXPORT mxlStatus mxlDestroyInstance(mxlInstance in_instance)
mxlStatus
MXL SDK Status codes.
MXL_EXPORT mxlInstance mxlCreateInstance(char const *in_mxlDomain, char const *in_options)
std::string readFile(std::filesystem::path const &filepath)
struct mxlRational_t mxlRational
TEST_CASE_PERSISTENT_FIXTURE(mxl::tests::mxlDomainFixture, "Synchronization group : Repeated waits", "[mxl sync groups]")
uint8_t * buffer
Set a mark at the beginning and the end of the grain payload.
mxlFlowConfigInfo configInfo
REQUIRE(timeDelta< 33 '366 '667LL)
MXL_EXPORT uint64_t mxlIndexToTimestamp(mxlRational const *editRate, uint64_t index)
MXL_EXPORT uint64_t mxlTimestampToIndex(mxlRational const *editRate, uint64_t timestamp)
MXL_EXPORT uint64_t mxlGetTime(void)