Gnash
0.8.10
|
#include <VideoInputGst.h>
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) |
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.
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.
double gnash::media::gst::VideoInputGst::activityLevel | ( | ) | const [inline, virtual] |
Return the current activity level of the webcam.
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.
Referenced by setBandwidth().
double gnash::media::gst::VideoInputGst::currentFPS | ( | ) | const [inline, virtual] |
The current frame rate of the webcam.
Implements gnash::media::VideoInput.
double gnash::media::gst::VideoInputGst::fps | ( | ) | const [inline, virtual] |
The maximum FPS rate of the webcam.
Implements gnash::media::VideoInput.
Referenced by requestMode().
void gnash::media::gst::VideoInputGst::getNames | ( | std::vector< std::string > & | names | ) | [static] |
References gnash::key::i.
Referenced by gnash::media::gst::MediaHandlerGst::cameraNames().
size_t gnash::media::gst::VideoInputGst::height | ( | ) | const [inline, virtual] |
Return the height of the webcam's frame.
Implements gnash::media::VideoInput.
Referenced by requestMode().
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.
References __FUNCTION__, and _.
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] |
Implements gnash::media::VideoInput.
References gnash::key::m.
bool gnash::media::gst::VideoInputGst::muted | ( | ) | const [inline, virtual] |
Implements gnash::media::VideoInput.
const std::string& gnash::media::gst::VideoInputGst::name | ( | ) | const [inline, virtual] |
Return the name of this 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.
References assert, and 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.
width | The required width |
height | The required height |
fps | The required frame rate |
favorArea | How to match the requested mode. |
Implements gnash::media::VideoInput.
void gnash::media::gst::VideoInputGst::setBandwidth | ( | size_t | bandwidth | ) | [inline, virtual] |
Set the bandwidth for outgoing connections.
Implements gnash::media::VideoInput.
References bandwidth().
void gnash::media::gst::VideoInputGst::setMotionLevel | ( | int | m | ) | [inline, virtual] |
Set the amount of motion required before notifying the core.
Implements gnash::media::VideoInput.
References gnash::key::m.
void gnash::media::gst::VideoInputGst::setMotionTimeout | ( | int | m | ) | [inline, virtual] |
Set time without motion in milliseconds before core is notified.
Implements gnash::media::VideoInput.
References gnash::key::m.
void gnash::media::gst::VideoInputGst::setQuality | ( | int | q | ) | [inline, virtual] |
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.
dev_select | The index of the camera the user wants to select. |
References assert, name(), _, and __FUNCTION__.
Referenced by VideoInputGst().
bool gnash::media::gst::VideoInputGst::stop | ( | ) |
Function stops the pipeline designed earlier in code execution.
gboolean gnash::media::gst::VideoInputGst::webcamBreakVideoDisplayLink | ( | ) |
Function breaks the link between the _videoDisplayBin and the _videoDisplayQueue in the main bin.
webcam | A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate() |
References _, and __FUNCTION__.
gboolean gnash::media::gst::VideoInputGst::webcamBreakVideoSaveLink | ( | ) |
Function breaks link between the videoSaveBin and the videoSaveQueue in the main bin.
webcam | A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate() |
References _, and __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.
webcam | A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate() |
References _, and __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.
webcam | A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate() |
References _.
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. ==================================
webcam | A pointer to the GnashWebcamPrivate webcam structure created previously in a call to transferToPrivate() |
References _, and __FUNCTION__.
size_t gnash::media::gst::VideoInputGst::width | ( | ) | const [inline, virtual] |
Return the width of the webcam's frame.
Implements gnash::media::VideoInput.
Referenced by requestMode().