OSVR-Core
Classes | Public Member Functions | Friends | List of all members
MediaSampleExchange Class Reference

A class to mediate between a consumer of directshow image samples and the ISampleGrabberCallback implementation, with signalling on the producer and consumer side. More...

#include <MediaSampleExchange.h>

Classes

struct  Impl
 

Public Member Functions

void signalSampleProduced (IMediaSample *sample, osvr::util::time::TimeValue const &timestamp)
 Signals that a sample (passed in) was produced. More...
 
void signalSampleProduced (IMediaSample *sample)
 
bool waitForSample (std::chrono::milliseconds timeout)
 
Sample get ()
 Retrieves the sample in an RAII wrapper, so that signalling of consumption is automatic when the sample object goes out of scope. More...
 
bool waitForSampleConsumed (std::chrono::milliseconds timeout)
 

Friends

class Sample
 

Detailed Description

A class to mediate between a consumer of directshow image samples and the ISampleGrabberCallback implementation, with signalling on the producer and consumer side.

Hides the newer Windows API used for the sync primitives from the ancient DirectShow-affiliated headers.

Member Function Documentation

§ get()

Sample MediaSampleExchange::get ( )
inline

Retrieves the sample in an RAII wrapper, so that signalling of consumption is automatic when the sample object goes out of scope.

§ signalSampleProduced()

void MediaSampleExchange::signalSampleProduced ( IMediaSample *  sample,
osvr::util::time::TimeValue const &  timestamp 
)

Signals that a sample (passed in) was produced.

The producer should not return from its callback (that is, not release that sample) until the sample has been consumed or some other event has taken place (shutdown).

§ waitForSample()

bool MediaSampleExchange::waitForSample ( std::chrono::milliseconds  timeout)
Returns
true if sample was made available, false if it timed out.

§ waitForSampleConsumed()

bool MediaSampleExchange::waitForSampleConsumed ( std::chrono::milliseconds  timeout)
Returns
true if sample was consumed, false if it timed out.

The documentation for this class was generated from the following files: