25 #ifndef INCLUDED_MediaSampleExchange_h_GUID_6E82A284_0E96_4391_6408_D9602D2658D7 26 #define INCLUDED_MediaSampleExchange_h_GUID_6E82A284_0E96_4391_6408_D9602D2658D7 50 : sampleExchange_(other.sampleExchange_), sample_(other.sample_),
51 timestamp_(other.timestamp_), owning_(false) {
52 std::swap(owning_, other.owning_);
60 assert(owning_ &&
"Shouldn't try to get the contained sample from a " 61 "moved-from wrapper!");
66 assert(owning_ &&
"Shouldn't try to get the contained timestamp from a " 67 "moved-from wrapper!");
74 : sampleExchange_(exchange), sample_(sample), timestamp_(timestamp),
78 IMediaSample &sample_;
96 void signalSampleProduced(IMediaSample *sample,
98 void signalSampleProduced(IMediaSample *sample);
101 bool waitForSample(std::chrono::milliseconds timeout);
106 IMediaSample *pin{sample_};
107 return Sample{*
this, *pin, timestamp_};
111 bool waitForSampleConsumed(std::chrono::milliseconds timeout);
115 void signalSampleConsumed();
118 IMediaSample *sample_ =
nullptr;
120 std::unique_ptr<Impl> impl_;
123 using MediaSampleExchangePtr = std::shared_ptr<MediaSampleExchange>;
127 sampleExchange_.signalSampleConsumed();
131 #endif // INCLUDED_MediaSampleExchange_h_GUID_6E82A284_0E96_4391_6408_D9602D2658D7
Sample(Sample &&other)
Move constructor.
Definition: MediaSampleExchange.h:49
Header providing a C++ wrapper around TimeValueC.h.
~Sample()
Destructor - signals consumer finished.
Definition: MediaSampleExchange.h:125
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
An RAII class for retrieving the sample and signalling consumption complete.
Definition: MediaSampleExchange.h:44