2003-03-26 19:57:29 +08:00
|
|
|
//
|
|
|
|
// ZoneMinder Local Camera Class Interface, $Date$, $Revision$
|
2006-01-17 18:56:30 +08:00
|
|
|
// Copyright (C) 2003, 2004, 2005, 2006 Philip Coombes
|
2003-03-26 19:57:29 +08:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ZM_LOCAL_CAMERA_H
|
|
|
|
#define ZM_LOCAL_CAMERA_H
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
|
|
|
#include "zm_camera.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// Class representing 'local' cameras, i.e. those which are
|
|
|
|
// directly connect to the host machine and which are accessed
|
|
|
|
// via a video interface.
|
|
|
|
//
|
|
|
|
class LocalCamera : public Camera
|
|
|
|
{
|
|
|
|
protected:
|
2006-01-22 01:58:46 +08:00
|
|
|
char device[PATH_MAX];
|
|
|
|
int channel;
|
|
|
|
int format;
|
2003-03-26 19:57:29 +08:00
|
|
|
|
2006-10-24 22:37:34 +08:00
|
|
|
int channel_index;
|
|
|
|
|
2003-03-26 19:57:29 +08:00
|
|
|
protected:
|
2006-10-24 22:37:34 +08:00
|
|
|
static int camera_count;
|
|
|
|
static int channel_count;
|
|
|
|
static int last_channel;
|
|
|
|
|
2006-01-22 01:58:46 +08:00
|
|
|
static int m_cap_frame;
|
|
|
|
static int m_cap_frame_active;
|
|
|
|
static int m_sync_frame;
|
|
|
|
static video_mbuf m_vmb;
|
|
|
|
static video_mmap *m_vmm;
|
|
|
|
static int m_videohandle;
|
|
|
|
static unsigned char *m_buffer;
|
|
|
|
static unsigned char *y_table;
|
|
|
|
static signed char *uv_table;
|
|
|
|
static short *r_v_table;
|
|
|
|
static short *g_v_table;
|
|
|
|
static short *g_u_table;
|
|
|
|
static short *b_u_table;
|
2003-03-26 19:57:29 +08:00
|
|
|
|
|
|
|
public:
|
2008-07-16 16:35:59 +08:00
|
|
|
LocalCamera( int p_id, const char *p_device, int p_channel, int p_format, int p_width, int p_height, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture=true );
|
2003-03-26 19:57:29 +08:00
|
|
|
~LocalCamera();
|
|
|
|
|
|
|
|
void Initialise();
|
|
|
|
void Terminate();
|
|
|
|
|
2005-10-17 18:58:25 +08:00
|
|
|
const char *Device() const { return( device ); }
|
2003-03-26 19:57:29 +08:00
|
|
|
unsigned int Channel() const { return( channel ); }
|
|
|
|
unsigned int Format() const { return( format ); }
|
|
|
|
|
2003-06-25 17:47:09 +08:00
|
|
|
int Brightness( int p_brightness=-1 );
|
|
|
|
int Hue( int p_hue=-1 );
|
|
|
|
int Colour( int p_colour=-1 );
|
|
|
|
int Contrast( int p_contrast=-1 );
|
|
|
|
|
2006-10-24 22:37:34 +08:00
|
|
|
int PrimeCapture();
|
2003-04-13 00:17:17 +08:00
|
|
|
int PreCapture();
|
|
|
|
int PostCapture( Image &image );
|
2003-03-26 19:57:29 +08:00
|
|
|
|
2005-10-17 18:58:25 +08:00
|
|
|
static bool GetCurrentSettings( const char *device, char *output, bool verbose );
|
2003-03-26 19:57:29 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ZM_LOCAL_CAMERA_H
|