Add support for streaming media in both directions #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note:
This PR is working, but media stream only functions when frame period is > timer granularity. Attempting with a frame rate > timer frequency results in failures in the media stream validation code.
This pull request introduces significant refactoring and enhancements to the media streaming functionality, especially around the IO pattern architecture and test suite. The changes primarily rename and split the previous "MediaStream" IO pattern into more explicit "MediaStreamPull" and "MediaStreamPush" variants, update related test code, and add a standard hash specialization for
ctSockaddr. Below are the most important changes grouped by theme:IO Pattern Refactoring and Enhancements
IoPatternType::MediaStreamenum value is renamed and split intoMediaStreamPullandMediaStreamPush, providing clearer semantics for different streaming modes. All references inctsConfig.cpp,ctsConfig.h, andctsIOPattern.cppare updated accordingly. [1] [2] [3] [4] [5] [6] [7] [8]ctsIoPatternMediaStreamServeris replaced byctsIoPatternMediaStreamSenderandctsIoPatternMediaStreamReceiverto match the new pull/push semantics. Instantiation logic is updated to use the appropriate class based on the pattern and whether the socket is in listening mode. [1] [2]Unit Test Updates
ctsMediaStreamServerConnectedSocketUnitTest.cppis updated to usectsMediaStreamSenderinstead of the removedctsMediaStreamServerConnectedSocket, including constructor and callback type changes. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]ScheduleTasktoQueueTaskto reflect the new interface inctsMediaStreamSender. [1] [2] [3] [4] [5]ctsMediaStreamSender.cppinstead of the removedctsMediaStreamServerConnectedSocket.cpp.General Library Improvements
std::hashspecialization forctl::ctSockaddris added, allowing it to be used as a key in unordered containers without requiring custom hash functors. [1] [2]ctsConnectEx.cppis generalized fromctThreadIocptoctThreadIocp_basefor improved abstraction.These changes collectively modernize the media streaming architecture, clarify IO pattern usage, and improve test maintainability and code flexibility.