NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Types | Public Member Functions | Protected Attributes | List of all members
video::SDIInput Class Reference
Collaboration diagram for video::SDIInput:
Collaboration graph
[legend]

Public Types

enum  InterlacedBehaviour { DO_NOTHING_SPECIAL, DROP_ONE_FIELD, STACK_FIELDS, SPLIT_LINE_INTERLEAVED_STEREO }
 

Public Member Functions

 SDIInput (SDIDevice *dev, InterlacedBehaviour interlaced=DO_NOTHING_SPECIAL, int ringbuffersize=0)
 Initialises SDI capture into texture memory. More...
 
 ~SDIInput ()
 
int get_current_ringbuffer_slot () const
 Returns the most up-to-date index into the ring buffer. More...
 
int get_texture_id (int streamno, int ringbufferslot=-1) const
 Returns the texture ID for a specific ring buffer slot, or for the current slot. The texture has always RGBA format, and dimensions reported by get_width()/get_height(). More...
 
FrameInfo capture ()
 Transfers one set of frames over all streams into texture objects. More...
 
bool has_frame () const
 
void set_log_filename (const std::string &fn)
 
void flush_log ()
 
Actual video dimensions.

These may be different from the reported capture format if we are dropping a field, for example.

int get_width () const
 Returns the width in pixels of the texture object that receives video data. More...
 
int get_height () const
 Returns the height in pixels of the texture object that receives video data. More...
 

Protected Attributes

SDIInputImplpimpl
 
bool preparetextures
 
std::string logfilename
 

Member Enumeration Documentation

Enumerator
DO_NOTHING_SPECIAL 
DROP_ONE_FIELD 
STACK_FIELDS 
SPLIT_LINE_INTERLEAVED_STEREO 

Constructor & Destructor Documentation

video::SDIInput::SDIInput ( SDIDevice dev,
InterlacedBehaviour  interlaced = DO_NOTHING_SPECIAL,
int  ringbuffersize = 0 
)

Initialises SDI capture into texture memory.

Parameters
devthe device on which to capture
interlacedwhat to do with interlaced video, ignored of format is progressive
ringbuffersizehow may slots to allocate in the texture ringbuffer
Exceptions
std::runtime_errorif anything goes wrong with setup
std::logic_errorif you passed in the wrong parameters
video::SDIInput::~SDIInput ( )

Member Function Documentation

FrameInfo video::SDIInput::capture ( )

Transfers one set of frames over all streams into texture objects.

Exceptions
std::runtime_errorif capture setup has become invalid
Postcondition
Texture binding on the currently active unit will have changed This method will actively try to prevent the system from entering any power-savings mode!
void video::SDIInput::flush_log ( )
int video::SDIInput::get_current_ringbuffer_slot ( ) const

Returns the most up-to-date index into the ring buffer.

int video::SDIInput::get_height ( ) const

Returns the height in pixels of the texture object that receives video data.

int video::SDIInput::get_texture_id ( int  streamno,
int  ringbufferslot = -1 
) const

Returns the texture ID for a specific ring buffer slot, or for the current slot. The texture has always RGBA format, and dimensions reported by get_width()/get_height().

Parameters
streamnothe index of the stream, counting from zero
ringbufferslota specific ringbuffer slot, otherwise the currently active slot
Exceptions
nothingshould not throw
Returns
The OpenGL object name (i.e. ID) of the requested texture map; or zero if there is none for the requested stream.
int video::SDIInput::get_width ( ) const

Returns the width in pixels of the texture object that receives video data.

bool video::SDIInput::has_frame ( ) const
Warning
Caveat: this will not throw if the capture state has become invalid, it will simply continue returning false! So if too much time has passed since last frame you may want to call capture() anyway to see whether there still is anything connected.
void video::SDIInput::set_log_filename ( const std::string fn)

Member Data Documentation

std::string video::SDIInput::logfilename
protected
SDIInputImpl* video::SDIInput::pimpl
protected
bool video::SDIInput::preparetextures
protected

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