reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofGstVideoGrabber Class Reference

#include <ofGstVideoGrabber.h>

Inheritance diagram for ofGstVideoGrabber:
ofBaseVideoGrabber ofBaseVideo ofBaseHasPixels_< unsigned char > ofBaseUpdates ofAbstractHasPixels

Public Member Functions

 ofGstVideoGrabber ()
 
 ~ofGstVideoGrabber ()
 
bool setPixelFormat (ofPixelFormat pixelFormat)
 needs to be called before initGrabber
 
ofPixelFormat getPixelFormat () const
 
void videoSettings ()
 Request a native GUI for video grabber settings.
 
std::vector< ofVideoDevicelistDevices () const
 Get a list of available video grabber devices.
 
void setDeviceID (int id)
 Set the video grabber's device ID.
 
void setDesiredFrameRate (int framerate)
 Set the video grabber's desired frame rate.
 
bool setup (int w, int h)
 Set up the grabber with the requested width and height.
 
void update ()
 Update the object's state.
 
bool isFrameNew () const
 
ofPixelsgetPixels ()
 Get a reference to the underlying ofPixels.
 
const ofPixelsgetPixels () const
 Get a const reference to the underlying ofPixels.
 
ofTexturegetTexturePtr ()
 Get the video grabber's internal ofTexture pointer if available.
 
float getHeight () const
 Get the video grabber's height.
 
float getWidth () const
 Get the video grabber's width.
 
void close ()
 Close the video source.
 
void setVerbose (bool bVerbose)
 Set the video grabber's hardware verbosity level.
 
bool isInitialized () const
 Determine if the video source is initialized.
 
ofGstVideoUtilsgetGstVideoUtils ()
 
- Public Member Functions inherited from ofBaseVideoGrabber
virtual ~ofBaseVideoGrabber ()
 Destroy the ofBaseVideoGrabber.
 
- Public Member Functions inherited from ofBaseVideo
virtual ~ofBaseVideo ()
 Destroy the ofBaseVideo.
 
- Public Member Functions inherited from ofBaseHasPixels_< unsigned char >
virtual ~ofBaseHasPixels_ ()
 Destroy the ofAbstractHasPixels.
 
- Public Member Functions inherited from ofAbstractHasPixels
virtual ~ofAbstractHasPixels ()
 Destroy the ofAbstractHasPixels.
 
- Public Member Functions inherited from ofBaseUpdates
virtual ~ofBaseUpdates ()
 Destroy the ofBaseUpdates.
 

Constructor & Destructor Documentation

◆ ofGstVideoGrabber()

ofGstVideoGrabber::ofGstVideoGrabber ( )

◆ ~ofGstVideoGrabber()

ofGstVideoGrabber::~ofGstVideoGrabber ( )

Member Function Documentation

◆ close()

void ofGstVideoGrabber::close ( )
virtual

Close the video source.

Implements ofBaseVideo.

◆ getGstVideoUtils()

ofGstVideoUtils * ofGstVideoGrabber::getGstVideoUtils ( )

◆ getHeight()

float ofGstVideoGrabber::getHeight ( ) const
virtual

Get the video grabber's height.

Returns
the video grabber's height.

Implements ofBaseVideoGrabber.

◆ getPixelFormat()

ofPixelFormat ofGstVideoGrabber::getPixelFormat ( ) const
virtual
Returns
the current ofPixelFormat.

Implements ofBaseVideo.

◆ getPixels() [1/2]

ofPixels & ofGstVideoGrabber::getPixels ( )
virtual

Get a reference to the underlying ofPixels.

Returns
a reference the underlying ofPixels.

Implements ofBaseHasPixels_< unsigned char >.

◆ getPixels() [2/2]

const ofPixels & ofGstVideoGrabber::getPixels ( ) const
virtual

Get a const reference to the underlying ofPixels.

Returns
a const reference the underlying ofPixels.

Implements ofBaseHasPixels_< unsigned char >.

◆ getTexturePtr()

ofTexture * ofGstVideoGrabber::getTexturePtr ( )
virtual

Get the video grabber's internal ofTexture pointer if available.

Note
Subclasses should implement this method only if internal API can upload video grabber pixels directly to an ofTexture.
Returns
the internal ofTexture pointer or nullptr if not available.

Reimplemented from ofBaseVideoGrabber.

◆ getWidth()

float ofGstVideoGrabber::getWidth ( ) const
virtual

Get the video grabber's width.

Returns
the video grabber's width.

Implements ofBaseVideoGrabber.

◆ isFrameNew()

bool ofGstVideoGrabber::isFrameNew ( ) const
virtual
Returns
true if the pixel data was updated since the last call to update().

Implements ofBaseVideo.

◆ isInitialized()

bool ofGstVideoGrabber::isInitialized ( ) const
virtual

Determine if the video source is initialized.

Video sources such as cameras are often initialized with a setup() method. Video sources such as movie players are often initialized with a load() method.

Returns
true if the video source is initialized.

Implements ofBaseVideo.

◆ listDevices()

vector< ofVideoDevice > ofGstVideoGrabber::listDevices ( ) const
virtual

Get a list of available video grabber devices.

Returns
a std::vector of ofVideoDevice objects.

Implements ofBaseVideoGrabber.

◆ setDesiredFrameRate()

void ofGstVideoGrabber::setDesiredFrameRate ( int  framerate)
virtual

Set the video grabber's desired frame rate.

Many video grabbers support user-specified frame rates. This frame rate should be considered a hint for the video grabber and is not guaranteed.

Parameters
frameratethe desired frame rate.

Reimplemented from ofBaseVideoGrabber.

◆ setDeviceID()

void ofGstVideoGrabber::setDeviceID ( int  deviceID)
virtual

Set the video grabber's device ID.

In most cases, a user can choose a specific grabber source by ID. This device ID information should be available to the user via the listDevices() method.

Parameters
deviceIDThe device ID provided by listDevices().

Reimplemented from ofBaseVideoGrabber.

◆ setPixelFormat()

bool ofGstVideoGrabber::setPixelFormat ( ofPixelFormat  pixelFormat)
virtual

needs to be called before initGrabber

Implements ofBaseVideo.

◆ setup()

bool ofGstVideoGrabber::setup ( int  w,
int  h 
)
virtual

Set up the grabber with the requested width and height.

Some video grabbers may take the requested width and height as a hint and choose the closest dimensions to those requested. Users can check the actual width and height by calling getWidth() and getHeight() respectively after a successful setup.

Parameters
wthe requested width.
hthe requested height.
Returns
true if the video grabber was set up successfully.

Implements ofBaseVideoGrabber.

◆ setVerbose()

void ofGstVideoGrabber::setVerbose ( bool  bTalkToMe)
virtual

Set the video grabber's hardware verbosity level.

Parameters
bTalkToMetrue if verbose grabber logging feedback is required.

Reimplemented from ofBaseVideoGrabber.

◆ update()

void ofGstVideoGrabber::update ( )
virtual

Update the object's state.

Implements ofBaseUpdates.

◆ videoSettings()

void ofGstVideoGrabber::videoSettings ( void  )
inlinevirtual

Request a native GUI for video grabber settings.

Note
This feature may not be implemented by all video grabbers.

Reimplemented from ofBaseVideoGrabber.


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