OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
MediaSampleExchange Class Reference

#include </home/jenkins/root/workspace/OSVR-Core-Docs/plugins/videobasedtracker/DirectShowCameraLib/MediaSampleExchange.h>

Classes

struct  Impl
 

Public Member Functions

void signalSampleProduced (IMediaSample *sample, osvr::util::time::TimeValue const &timestamp)
 
void signalSampleProduced (IMediaSample *sample)
 
bool waitForSample (std::chrono::milliseconds timeout)
 
Sample get ()
 
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.

Definition at line 89 of file MediaSampleExchange.h.

Member Function Documentation

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).

Definition at line 46 of file MediaSampleExchange.cpp.

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

Definition at line 62 of file MediaSampleExchange.cpp.

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.

Definition at line 105 of file MediaSampleExchange.h.

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

Definition at line 73 of file MediaSampleExchange.cpp.


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