Public Member Functions | Static Public Member Functions

gnash::media::gst::VideoInputGst Class Reference

#include <VideoInputGst.h>

Inheritance diagram for gnash::media::gst::VideoInputGst:
Inheritance graph
[legend]
Collaboration diagram for gnash::media::gst::VideoInputGst:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 VideoInputGst ()
 Constructor for the VideoInputGst class.
 ~VideoInputGst ()
 Destructor for the VideoInputGst class.
double activityLevel () const
 Return the current activity level of the webcam.
size_t bandwidth () const
 The maximum available bandwidth for outgoing connections.
void setBandwidth (size_t bandwidth)
 Set the bandwidth for outgoing connections.
double currentFPS () const
 The current frame rate of the webcam.
double fps () const
 The maximum FPS rate of the webcam.
size_t height () const
 Return the height of the webcam's frame.
size_t width () const
 Return the width of the webcam's frame.
size_t index () const
 The index of the camera.
void requestMode (size_t width, size_t height, double fps, bool favorArea)
 Request a native mode most closely matching the passed variables.
void setMotionLevel (int m)
 Set the amount of motion required before notifying the core.
int motionLevel () const
 Return the current motionLevel setting.
void setMotionTimeout (int m)
 Set time without motion in milliseconds before core is notified.
int motionTimeout () const
 Return the current motionTimeout setting.
void mute (bool m)
bool muted () const
const std::string & name () const
 Return the name of this webcam.
void setQuality (int q)
 Set the quality of the webcam.
int quality () const
 Return the current quality of the webcam.
bool play ()
 Function starts up the pipeline designed earlier in code execution. This puts everything into motion.
bool stop ()
 Function stops the pipeline designed earlier in code execution.
bool setWebcam (size_t index)
 Set this VideoInput's webcam to the device corresponding to an index.
bool init ()
 Call all functions necessary for initializing the camera.
int makeWebcamDeviceSelection ()
 This function is important in the flow of the code. It looks in the gnashrc file to see if you have a default camera defined and selects that one (if it's defined), otherwise a videotestsrc will be used for the remainder of the execution of the code. Currently this code also calls other functions to make bins and pipelines. It might be abstracted into separate functions later.
gboolean webcamMakeVideoSaveLink ()
 Function links the videoSaveBin to the videoSaveQueue in the main bin.
gboolean webcamBreakVideoSaveLink ()
 Function breaks link between the videoSaveBin and the videoSaveQueue in the main bin.
gboolean webcamCreateSaveBin ()
 Function creates the save bin. For more information on pipeline implementation and this function in general see the definition of the _webcam_save_bin variable in the GnashWebcamPrivate structure documentation.
gboolean webcamMakeVideoDisplayLink ()
 Function links the video_display_bin to the video_display_queue in the main bin.
gboolean webcamBreakVideoDisplayLink ()
 Function breaks the link between the _videoDisplayBin and the _videoDisplayQueue in the main bin.

Static Public Member Functions

static void getNames (std::vector< std::string > &names)

Detailed Description

This class is the main class that interacts with the other classes defined in this header file. However, most of the significant information is actually stored in a GnashWebcamPrivate class.


Constructor & Destructor Documentation

gnash::media::gst::VideoInputGst::VideoInputGst (  ) 

Constructor for the VideoInputGst class.

References makeWebcamDeviceSelection(), setWebcam(), and webcamCreateSaveBin().

gnash::media::gst::VideoInputGst::~VideoInputGst (  ) 

Destructor for the VideoInputGst class.


Member Function Documentation

double gnash::media::gst::VideoInputGst::activityLevel (  )  const [inline, virtual]

Return the current activity level of the webcam.

Returns:
A double specifying the amount of motion currently detected by the camera.

Implements gnash::media::VideoInput.

size_t gnash::media::gst::VideoInputGst::bandwidth (  )  const [inline, virtual]

The maximum available bandwidth for outgoing connections.

TODO: see if this should really be here.

Implements gnash::media::VideoInput.

double gnash::media::gst::VideoInputGst::currentFPS (  )  const [inline, virtual]

The current frame rate of the webcam.

Returns:
A double specifying the webcam's current FPS

Implements gnash::media::VideoInput.

double gnash::media::gst::VideoInputGst::fps (  )  const [inline, virtual]

The maximum FPS rate of the webcam.

Returns:
A double specifying the webcam's maximum FPS

Implements gnash::media::VideoInput.

void gnash::media::gst::VideoInputGst::getNames ( std::vector< std::string > &  names  )  [static]

References gnash::key::i.

size_t gnash::media::gst::VideoInputGst::height (  )  const [inline, virtual]

Return the height of the webcam's frame.

Implements gnash::media::VideoInput.

size_t gnash::media::gst::VideoInputGst::index (  )  const [inline, virtual]

The index of the camera.

Implements gnash::media::VideoInput.

bool gnash::media::gst::VideoInputGst::init (  ) 

Call all functions necessary for initializing the camera.

For gstreamer this includes setting up bins. Return false on failure of any initialization. TODO: better throw MediaException.

References webcamMakeVideoDisplayLink().

int gnash::media::gst::VideoInputGst::makeWebcamDeviceSelection (  ) 

This function is important in the flow of the code. It looks in the gnashrc file to see if you have a default camera defined and selects that one (if it's defined), otherwise a videotestsrc will be used for the remainder of the execution of the code. Currently this code also calls other functions to make bins and pipelines. It might be abstracted into separate functions later.

Returns:
The integer value respresenting the selected webcam from the gnashrc file.

References __FUNCTION__.

Referenced by VideoInputGst().

int gnash::media::gst::VideoInputGst::motionLevel (  )  const [inline, virtual]

Return the current motionLevel setting.

Implements gnash::media::VideoInput.

int gnash::media::gst::VideoInputGst::motionTimeout (  )  const [inline, virtual]

Return the current motionTimeout setting.

Implements gnash::media::VideoInput.

void gnash::media::gst::VideoInputGst::mute ( bool  m  )  [inline, virtual]
bool gnash::media::gst::VideoInputGst::muted (  )  const [inline, virtual]
const std::string& gnash::media::gst::VideoInputGst::name (  )  const [inline, virtual]

Return the name of this webcam.

Returns:
a string specifying the name of the webcam.

Implements gnash::media::VideoInput.

Referenced by setWebcam().

bool gnash::media::gst::VideoInputGst::play (  ) 

Function starts up the pipeline designed earlier in code execution. This puts everything into motion.

Returns:
True if the pipeline was started correctly, false otherwise.

References gnash::media::gst::bus_call().

int gnash::media::gst::VideoInputGst::quality (  )  const [inline, virtual]

Return the current quality of the webcam.

Implements gnash::media::VideoInput.

void gnash::media::gst::VideoInputGst::requestMode ( size_t  width,
size_t  height,
double  fps,
bool  favorArea 
) [virtual]

Request a native mode most closely matching the passed variables.

Parameters:
width The required width
height The required height
fps The required frame rate
favorArea How to match the requested mode.

Implements gnash::media::VideoInput.

References UNUSED.

void gnash::media::gst::VideoInputGst::setBandwidth ( size_t  bandwidth  )  [inline, virtual]

Set the bandwidth for outgoing connections.

Implements gnash::media::VideoInput.

void gnash::media::gst::VideoInputGst::setMotionLevel ( int  m  )  [inline, virtual]

Set the amount of motion required before notifying the core.

Implements gnash::media::VideoInput.

void gnash::media::gst::VideoInputGst::setMotionTimeout ( int  m  )  [inline, virtual]

Set time without motion in milliseconds before core is notified.

Implements gnash::media::VideoInput.

void gnash::media::gst::VideoInputGst::setQuality ( int  q  )  [inline, virtual]

Set the quality of the webcam.

Implements gnash::media::VideoInput.

bool gnash::media::gst::VideoInputGst::setWebcam ( size_t  index  ) 

Set this VideoInput's webcam to the device corresponding to an index.

Now transfer the important information from the GnashWebcam structure to the GnashWebcamPrivate structure which is larger because it has space to store Gstreamer pipeline, element and bin elements. See definition of GnashWebcamPrivate for more info.

Parameters:
dev_select The index of the camera the user wants to select.
Returns:
If the device index doesn't exist, return false

References __FUNCTION__, and name().

Referenced by VideoInputGst().

bool gnash::media::gst::VideoInputGst::stop (  ) 

Function stops the pipeline designed earlier in code execution.

Returns:
True if the pipeline was stopped correctly, false otherwise.
gboolean gnash::media::gst::VideoInputGst::webcamBreakVideoDisplayLink (  ) 

Function breaks the link between the _videoDisplayBin and the _videoDisplayQueue in the main bin.

Parameters:
webcam A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate()
Returns:
True if the link was successfully broken, false otherwise

References __FUNCTION__.

gboolean gnash::media::gst::VideoInputGst::webcamBreakVideoSaveLink (  ) 

Function breaks link between the videoSaveBin and the videoSaveQueue in the main bin.

Parameters:
webcam A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate()
Returns:
True if the link was succesfully broken, false otherwise

References __FUNCTION__.

gboolean gnash::media::gst::VideoInputGst::webcamCreateSaveBin (  ) 

Function creates the save bin. For more information on pipeline implementation and this function in general see the definition of the _webcam_save_bin variable in the GnashWebcamPrivate structure documentation.

Parameters:
webcam A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate()
Returns:
True if everything went correctly (making elements, dropping into bins and linking elements), false otherwis

References __FUNCTION__.

Referenced by VideoInputGst().

gboolean gnash::media::gst::VideoInputGst::webcamMakeVideoDisplayLink (  ) 

Function links the video_display_bin to the video_display_queue in the main bin.

Parameters:
webcam A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate()
Returns:
True if the link to the video_display_queue was successful, False otherwise.

Referenced by init().

gboolean gnash::media::gst::VideoInputGst::webcamMakeVideoSaveLink (  ) 

Function links the videoSaveBin to the videoSaveQueue in the main bin.

================================== Functions that shouldn't be public. ==================================

Parameters:
webcam A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate()
Returns:
True if the link to the videoSaveQueue was successfully, false otherwise.

References __FUNCTION__.

size_t gnash::media::gst::VideoInputGst::width (  )  const [inline, virtual]

Return the width of the webcam's frame.

Implements gnash::media::VideoInput.


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