1
// VideoInput.h: Video input base class.
3
// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 3 of the License, or
8
// (at your option) any later version.
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program; if not, write to the Free Software
17
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
#ifndef GNASH_VIDEOINPUT_H
20
#define GNASH_VIDEOINPUT_H
22
#include <boost/cstdint.hpp> // for C99 int types
29
#include "dsodefs.h" //DSOEXPORT
34
/// This is the interface for video input devices.
36
/// Each VideoInput should represent exactly one webcam (or similar device).
38
/// The interface for querying the camera is provisionally done, but needs
39
/// more testing of how it actually works. Most of the values are faked.
41
/// TODO: separate the process of finding cameras from this class.
42
/// It could be implemented as a static method. The available cameras
43
/// and all created VideoInput objects should be stored in a
44
/// MediaHandler, mapped by an index for retrieval by ActionScript.
46
/// TODO: design a useful interface for starting, stopping and attaching
47
/// the video data. VideoInputGst has some functionality here, but it
48
/// is not generic enough, relying on too many gst-specific
49
/// implementation details.
54
DSOEXPORT VideoInput() {}
56
// virtual classes need a virtual destructor !
57
virtual ~VideoInput() {}
59
/// Return the current activity level of the webcam
61
/// @return A double specifying the amount of motion currently
62
/// detected by the camera.
63
virtual double activityLevel() const = 0;
65
/// The maximum available bandwidth for outgoing connections
67
/// TODO: see if this should really be here.
68
virtual size_t bandwidth() const = 0;
70
/// Set the bandwidth for outgoing connections.
71
virtual void setBandwidth(size_t bandwidth) = 0;
73
/// The current frame rate of the webcam
75
/// @return A double specifying the webcam's current FPS
76
virtual double currentFPS() const = 0;
78
/// The maximum FPS rate of the webcam
80
/// @return A double specifying the webcam's maximum FPS
81
virtual double fps() const = 0;
83
/// Return the height of the webcam's frame
84
virtual size_t height() const = 0;
86
/// Return the width of the webcam's frame
87
virtual size_t width() const = 0;
89
/// The index of the camera
90
virtual size_t index() const = 0;
92
/// Request a native mode most closely matching the passed variables.
94
/// @param width The required width
95
/// @param height The required height
96
/// @param fps The required frame rate
97
/// @param favorArea How to match the requested mode.
98
virtual void requestMode(size_t width, size_t height, double fps,
101
/// Set the amount of motion required before notifying the core
102
virtual void setMotionLevel(int m) = 0;
104
/// Return the current motionLevel setting
105
virtual int motionLevel() const = 0;
107
/// Set time without motion in milliseconds before core is notified
108
virtual void setMotionTimeout(int m) = 0;
110
/// Return the current motionTimeout setting.
111
virtual int motionTimeout() const = 0;
113
virtual void mute(bool m) = 0;
114
virtual bool muted() const = 0;
116
/// Return the name of this webcam
118
/// @return a string specifying the name of the webcam.
119
virtual const std::string& name() const = 0;
121
/// Set the quality of the webcam
122
virtual void setQuality(int q) = 0;
124
/// Return the current quality of the webcam
125
virtual int quality() const = 0;