-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add play_next() API to the player class (#762)
* Add play_next() API to the player class Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Make play_next() as blocking call. Add wait until next message will be published. Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Simplified logic in play_next(). Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Fix for issue with unplayed message in play_next() due to the topic filtration. Also partially solved issue with undefined behaviour when more than one message recorded with the same timestamp. Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Put skip_message_in_main_play_loop_ under the TSA guard and some renames Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Scoped shared_ptr for message to avoid memory corruption since underlying queue do reinterpret_cast to internal buffer when peeking element. Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Move publishers to protected section and add playing_messages_from_queue_ flag for unit tests Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add spin_and_wait_for_matched in SubscriptionManager Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add unit tests for play_next() Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add lower bound check for expected playback time after play_next() call Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add one more play_next() iteration for play_respect_messages_timing_after_play_next test Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Add constraint that play_next() will return false if player not in playback mode. i.e. Player::play() hasn't been started Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Move part of the code responsible for the publishing one message to the private publish_message(message) method Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Fix for undefined behaviour when resume() call happen during play_next() Signed-off-by: Michael Orlov <morlovmr@gmail.com> * Replace std::list with std::vector for publishers in spin_and_wait_for_matched Signed-off-by: Michael Orlov <morlovmr@gmail.com>
- Loading branch information
1 parent
dd50cbb
commit c488315
Showing
5 changed files
with
510 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.