30 #include <boost/assert.hpp>
39 MediaSampleExchange::MediaSampleExchange()
42 MediaSampleExchange::~MediaSampleExchange() {
50 "Should not be signalling that there is a null sample available!");
51 BOOST_ASSERT_MSG(sample_ ==
nullptr,
52 "Sample should be consumed before the next one produced!");
54 timestamp_ = timestamp;
55 impl_->produced.set();
63 return impl_->produced.wait(timeout.count());
66 void MediaSampleExchange::signalSampleConsumed() {
67 BOOST_ASSERT_MSG(sample_ !=
nullptr,
68 "Sample pointer should not be null when consumed!");
70 impl_->consumed.set();
74 std::chrono::milliseconds timeout) {
77 "Sample pointer should not be null when waiting for consumer!");
78 return impl_->consumed.wait(timeout.count());
void getNow(TimeValue &tv)
Set the given TimeValue to the current time.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...