Panda3D
|
Allows you to open a webcam or other video capture device as a video stream. More...
#include "webcamVideo.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
int | get_fps () const |
Returns the camera's framerate. | |
int | get_size_x () const |
Returns the camera's size_x. | |
int | get_size_y () const |
Returns the camera's size_y. | |
virtual TypeHandle | get_type () const |
MAKE_SEQ (get_options, get_num_options, get_option) | |
void | output (ostream &out) const |
Outputs the WebcamVideo. | |
virtual | PT (MovieVideoCursor) open()=0 |
Static Public Member Functions | |
static void | find_all_webcams () |
Scans the hardware for webcams, and pushes them onto the global list of all webcams. | |
static TypeHandle | get_class_type () |
static int | get_num_options () |
Returns the number of webcam options. | |
static void | init_type () |
static | PT (WebcamVideo) get_option(int n) |
Protected Attributes | |
int | _fps |
int | _size_x |
int | _size_y |
Static Protected Attributes | |
static pvector< PT(WebcamVideo)> | _all_webcams |
Allows you to open a webcam or other video capture device as a video stream.
Definition at line 25 of file webcamVideo.h.
void WebcamVideo::find_all_webcams | ( | ) | [static] |
Scans the hardware for webcams, and pushes them onto the global list of all webcams.
There are several implementations of WebcamVideo, including one based on DirectShow, one based on Video4Linux, and so forth. These implementations are contained in one C++ file each, and they export nothing at all except a single "find_all" function. Otherwise, they can only be accessed through the virtual methods of the WebcamVideo objects they create.
Definition at line 48 of file webcamVideo.cxx.
Referenced by get_num_options().
int WebcamVideo::get_fps | ( | ) | const [inline] |
Returns the camera's framerate.
This is a maximum theoretical: the actual performance will depend on the speed of the hardware.
Definition at line 44 of file webcamVideo.I.
Referenced by output().
int WebcamVideo::get_num_options | ( | ) | [static] |
Returns the number of webcam options.
An "option" consists of a device plus a set of configuration parameters. For example, "Creative Webcam Live at 640x480, 30 fps" is an option.
Definition at line 78 of file webcamVideo.cxx.
References find_all_webcams().
int WebcamVideo::get_size_x | ( | ) | const [inline] |
int WebcamVideo::get_size_y | ( | ) | const [inline] |
void WebcamVideo::output | ( | ostream & | out | ) | const [inline] |
Outputs the WebcamVideo.
This function simply writes the name, size and FPS to the output stream.
Reimplemented from Namable.
Definition at line 55 of file webcamVideo.I.
References get_fps(), get_size_x(), and get_size_y().