move v4l_multibuffer and v4l_captures_per_frame from Config to Monitor and Local Camera
This commit is contained in:
parent
eb5f299512
commit
9385471392
|
@ -323,6 +323,8 @@ CREATE TABLE `Monitors` (
|
||||||
`Device` varchar(64) NOT NULL default '',
|
`Device` varchar(64) NOT NULL default '',
|
||||||
`Channel` tinyint(3) unsigned NOT NULL default '0',
|
`Channel` tinyint(3) unsigned NOT NULL default '0',
|
||||||
`Format` int(10) unsigned NOT NULL default '0',
|
`Format` int(10) unsigned NOT NULL default '0',
|
||||||
|
`V4LMultiBuffer` tinyint(1) unsigned NOT NULL default '0',
|
||||||
|
`V4LCapturesPerFrame` tinyint(3) unsigned NOT NULL default '1',
|
||||||
`Protocol` varchar(16) NOT NULL default '',
|
`Protocol` varchar(16) NOT NULL default '',
|
||||||
`Method` varchar(16) NOT NULL default '',
|
`Method` varchar(16) NOT NULL default '',
|
||||||
`Host` varchar(64) NOT NULL default '',
|
`Host` varchar(64) NOT NULL default '',
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
zoneminder (1.27.1-1) precise; urgency=low
|
zoneminder (1.27.0+1-trusty-v4ltomonitor-1) trusty; urgency=high
|
||||||
|
|
||||||
* Convert from php mysql ext to PDO
|
* Snapshot release -
|
||||||
|
|
||||||
-- Isaac Connor <iconnor@connortechnology.com> Wed, 16 Oct 2013 15:51:39 -0400
|
|
||||||
|
|
||||||
zoneminder (1.26.4-2) precise; urgency=high
|
|
||||||
|
|
||||||
* improvements to zmupdate.pl, cleanups
|
|
||||||
|
|
||||||
-- Isaac Connor <iconnor@connortechnology.com> Thu, 03 Oct 2013 11:40:32 -0400
|
|
||||||
|
|
||||||
zoneminder (1.26.3-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* A 'minor' release focusing on performance improvement and bug fixes.
|
|
||||||
|
|
||||||
-- Isaac Connor <iconnor@connortechnology.com> Sun, 22 Sep 2013 09:36:42 +0800
|
|
||||||
|
|
||||||
zoneminder (1.25.1-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Initial Version.
|
|
||||||
|
|
||||||
-- Isaac Connor <iconnor@connortechnology.com> Mon, 29 Apr 2013 12:38:00 -0400
|
|
||||||
|
|
||||||
|
-- Isaac Connor <iconnor@connortechnology.com> Wed, 09 Jul 2014 21:35:29 -0400
|
||||||
|
|
|
@ -283,7 +283,7 @@ AVFrame **LocalCamera::capturePictures = 0;
|
||||||
|
|
||||||
LocalCamera *LocalCamera::last_camera = NULL;
|
LocalCamera *LocalCamera::last_camera = NULL;
|
||||||
|
|
||||||
LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel, int p_standard, const std::string &p_method, int p_width, int p_height, int p_colours, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture, unsigned int p_extras) :
|
LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel, int p_standard, bool p_v4l_multi_buffer, unsigned int p_v4l_captures_per_frame, const std::string &p_method, int p_width, int p_height, int p_colours, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture, unsigned int p_extras) :
|
||||||
Camera( p_id, LOCAL_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture ),
|
Camera( p_id, LOCAL_SRC, p_width, p_height, p_colours, ZM_SUBPIX_ORDER_DEFAULT_FOR_COLOUR(p_colours), p_brightness, p_contrast, p_hue, p_colour, p_capture ),
|
||||||
device( p_device ),
|
device( p_device ),
|
||||||
channel( p_channel ),
|
channel( p_channel ),
|
||||||
|
@ -296,6 +296,8 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
|
||||||
// do the initial opening etc
|
// do the initial opening etc
|
||||||
device_prime = (camera_count++ == 0);
|
device_prime = (camera_count++ == 0);
|
||||||
v4l_version = (p_method=="v4l2"?2:1);
|
v4l_version = (p_method=="v4l2"?2:1);
|
||||||
|
v4l_multi_buffer = p_v4l_multi_buffer;
|
||||||
|
v4l_captures_per_frame = p_v4l_captures_per_frame;
|
||||||
|
|
||||||
if ( capture )
|
if ( capture )
|
||||||
{
|
{
|
||||||
|
@ -363,15 +365,13 @@ LocalCamera::LocalCamera( int p_id, const std::string &p_device, int p_channel,
|
||||||
if ( width != last_camera->width || height != last_camera->height )
|
if ( width != last_camera->width || height != last_camera->height )
|
||||||
Warning( "Different capture sizes defined for monitors sharing same device, results may be unpredictable or completely wrong" );
|
Warning( "Different capture sizes defined for monitors sharing same device, results may be unpredictable or completely wrong" );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#if HAVE_LIBSWSCALE
|
#if HAVE_LIBSWSCALE
|
||||||
if( capture ) {
|
|
||||||
/* Get ffmpeg pixel format based on capture palette and endianness */
|
/* Get ffmpeg pixel format based on capture palette and endianness */
|
||||||
capturePixFormat = getFfPixFormatFromV4lPalette( v4l_version, palette );
|
capturePixFormat = getFfPixFormatFromV4lPalette( v4l_version, palette );
|
||||||
imagePixFormat = PIX_FMT_NONE;
|
imagePixFormat = PIX_FMT_NONE;
|
||||||
}
|
|
||||||
#endif // HAVE_LIBSWSCALE
|
#endif // HAVE_LIBSWSCALE
|
||||||
|
}
|
||||||
|
|
||||||
/* V4L2 format matching */
|
/* V4L2 format matching */
|
||||||
#if ZM_HAS_V4L2
|
#if ZM_HAS_V4L2
|
||||||
|
@ -782,7 +782,7 @@ void LocalCamera::Initialise()
|
||||||
|
|
||||||
memset( &v4l2_data.reqbufs, 0, sizeof(v4l2_data.reqbufs) );
|
memset( &v4l2_data.reqbufs, 0, sizeof(v4l2_data.reqbufs) );
|
||||||
if ( channel_count > 1 )
|
if ( channel_count > 1 )
|
||||||
if ( config.v4l_multi_buffer )
|
if ( v4l_multi_buffer )
|
||||||
v4l2_data.reqbufs.count = 2*channel_count;
|
v4l2_data.reqbufs.count = 2*channel_count;
|
||||||
else
|
else
|
||||||
v4l2_data.reqbufs.count = 1;
|
v4l2_data.reqbufs.count = 1;
|
||||||
|
@ -803,7 +803,7 @@ void LocalCamera::Initialise()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( v4l2_data.reqbufs.count < (config.v4l_multi_buffer?2:1) )
|
if ( v4l2_data.reqbufs.count < (v4l_multi_buffer?2:1) )
|
||||||
Fatal( "Insufficient buffer memory %d on video device", v4l2_data.reqbufs.count );
|
Fatal( "Insufficient buffer memory %d on video device", v4l2_data.reqbufs.count );
|
||||||
|
|
||||||
Debug( 3, "Setting up %d data buffers", v4l2_data.reqbufs.count );
|
Debug( 3, "Setting up %d data buffers", v4l2_data.reqbufs.count );
|
||||||
|
@ -967,7 +967,7 @@ void LocalCamera::Initialise()
|
||||||
Debug( 3, "Setting up request buffers" );
|
Debug( 3, "Setting up request buffers" );
|
||||||
if ( ioctl( vid_fd, VIDIOCGMBUF, &v4l1_data.frames ) < 0 )
|
if ( ioctl( vid_fd, VIDIOCGMBUF, &v4l1_data.frames ) < 0 )
|
||||||
Fatal( "Failed to setup memory: %s", strerror(errno) );
|
Fatal( "Failed to setup memory: %s", strerror(errno) );
|
||||||
if ( channel_count > 1 && !config.v4l_multi_buffer )
|
if ( channel_count > 1 && !v4l_multi_buffer )
|
||||||
v4l1_data.frames.frames = 1;
|
v4l1_data.frames.frames = 1;
|
||||||
v4l1_data.buffers = new video_mmap[v4l1_data.frames.frames];
|
v4l1_data.buffers = new video_mmap[v4l1_data.frames.frames];
|
||||||
Debug( 4, "vmb.frames = %d", v4l1_data.frames.frames );
|
Debug( 4, "vmb.frames = %d", v4l1_data.frames.frames );
|
||||||
|
@ -1974,7 +1974,7 @@ int LocalCamera::Capture( Image &image )
|
||||||
|
|
||||||
int captures_per_frame = 1;
|
int captures_per_frame = 1;
|
||||||
if ( channel_count > 1 )
|
if ( channel_count > 1 )
|
||||||
captures_per_frame = config.captures_per_frame;
|
captures_per_frame = v4l_captures_per_frame;
|
||||||
|
|
||||||
|
|
||||||
// Do the capture, unless we are the second or subsequent camera on a channel, in which case just reuse the buffer
|
// Do the capture, unless we are the second or subsequent camera on a channel, in which case just reuse the buffer
|
||||||
|
|
|
@ -86,13 +86,14 @@ protected:
|
||||||
|
|
||||||
uint32_t AutoSelectFormat(int p_colours);
|
uint32_t AutoSelectFormat(int p_colours);
|
||||||
|
|
||||||
protected:
|
|
||||||
static int camera_count;
|
static int camera_count;
|
||||||
static int channel_count;
|
static int channel_count;
|
||||||
static int channels[VIDEO_MAX_FRAME];
|
static int channels[VIDEO_MAX_FRAME];
|
||||||
static int standards[VIDEO_MAX_FRAME];
|
static int standards[VIDEO_MAX_FRAME];
|
||||||
static int vid_fd;
|
static int vid_fd;
|
||||||
static int v4l_version;
|
static int v4l_version;
|
||||||
|
bool v4l_multi_buffer;
|
||||||
|
unsigned int v4l_captures_per_frame;
|
||||||
|
|
||||||
#if ZM_HAS_V4L2
|
#if ZM_HAS_V4L2
|
||||||
static V4L2Data v4l2_data;
|
static V4L2Data v4l2_data;
|
||||||
|
@ -112,7 +113,7 @@ protected:
|
||||||
static LocalCamera *last_camera;
|
static LocalCamera *last_camera;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LocalCamera( int p_id, const std::string &device, int p_channel, int p_format, const std::string &p_method, int p_width, int p_height, int p_colours, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture, unsigned int p_extras = 0);
|
LocalCamera( int p_id, const std::string &device, int p_channel, int p_format, bool v4lmultibuffer, unsigned int v4lcapturesperframe, const std::string &p_method, int p_width, int p_height, int p_colours, int p_palette, int p_brightness, int p_contrast, int p_hue, int p_colour, bool p_capture, unsigned int p_extras = 0);
|
||||||
~LocalCamera();
|
~LocalCamera();
|
||||||
|
|
||||||
void Initialise();
|
void Initialise();
|
||||||
|
|
|
@ -1827,11 +1827,11 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
||||||
static char sql[ZM_SQL_MED_BUFSIZ];
|
static char sql[ZM_SQL_MED_BUFSIZ];
|
||||||
if ( !device[0] )
|
if ( !device[0] )
|
||||||
{
|
{
|
||||||
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) );
|
strncpy( sql, "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' order by Device, Channel", sizeof(sql) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device );
|
snprintf( sql, sizeof(sql), "select Id, Name, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LCapturesPerFrame, Method, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Function != 'None' and Type = 'Local' and Device = '%s' order by Channel", device );
|
||||||
}
|
}
|
||||||
if ( mysql_query( &dbconn, sql ) )
|
if ( mysql_query( &dbconn, sql ) )
|
||||||
{
|
{
|
||||||
|
@ -1862,6 +1862,8 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
||||||
const char *device = dbrow[col]; col++;
|
const char *device = dbrow[col]; col++;
|
||||||
int channel = atoi(dbrow[col]); col++;
|
int channel = atoi(dbrow[col]); col++;
|
||||||
int format = atoi(dbrow[col]); col++;
|
int format = atoi(dbrow[col]); col++;
|
||||||
|
bool v4l_multi_buffer = atoi(dbrow[col]); col++;
|
||||||
|
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
|
||||||
const char *method = dbrow[col]; col++;
|
const char *method = dbrow[col]; col++;
|
||||||
|
|
||||||
int width = atoi(dbrow[col]); col++;
|
int width = atoi(dbrow[col]); col++;
|
||||||
|
@ -1914,6 +1916,8 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
||||||
device,
|
device,
|
||||||
channel,
|
channel,
|
||||||
format,
|
format,
|
||||||
|
v4l_multi_buffer,
|
||||||
|
v4l_captures_per_frame,
|
||||||
method,
|
method,
|
||||||
cam_width,
|
cam_width,
|
||||||
cam_height,
|
cam_height,
|
||||||
|
@ -2430,7 +2434,7 @@ int Monitor::LoadFfmpegMonitors( const char *file, Monitor **&monitors, Purpose
|
||||||
Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
|
Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
|
||||||
{
|
{
|
||||||
static char sql[ZM_SQL_MED_BUFSIZ];
|
static char sql[ZM_SQL_MED_BUFSIZ];
|
||||||
snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = %d", id );
|
snprintf( sql, sizeof(sql), "select Id, Name, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour from Monitors where Id = %d", id );
|
||||||
if ( mysql_query( &dbconn, sql ) )
|
if ( mysql_query( &dbconn, sql ) )
|
||||||
{
|
{
|
||||||
Error( "Can't run query: %s", mysql_error( &dbconn ) );
|
Error( "Can't run query: %s", mysql_error( &dbconn ) );
|
||||||
|
@ -2460,6 +2464,8 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
|
||||||
std::string device = dbrow[col]; col++;
|
std::string device = dbrow[col]; col++;
|
||||||
int channel = atoi(dbrow[col]); col++;
|
int channel = atoi(dbrow[col]); col++;
|
||||||
int format = atoi(dbrow[col]); col++;
|
int format = atoi(dbrow[col]); col++;
|
||||||
|
bool v4l_multi_buffer = atoi(dbrow[col]); col++;
|
||||||
|
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
|
||||||
|
|
||||||
std::string protocol = dbrow[col]; col++;
|
std::string protocol = dbrow[col]; col++;
|
||||||
std::string method = dbrow[col]; col++;
|
std::string method = dbrow[col]; col++;
|
||||||
|
@ -2523,6 +2529,8 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
|
||||||
device.c_str(),
|
device.c_str(),
|
||||||
channel,
|
channel,
|
||||||
format,
|
format,
|
||||||
|
v4l_multi_buffer,
|
||||||
|
v4l_captures_per_frame,
|
||||||
method,
|
method,
|
||||||
cam_width,
|
cam_width,
|
||||||
cam_height,
|
cam_height,
|
||||||
|
|
|
@ -215,6 +215,8 @@ protected:
|
||||||
bool enabled; // Whether the monitor is enabled or asleep
|
bool enabled; // Whether the monitor is enabled or asleep
|
||||||
unsigned int width; // Normally the same as the camera, but not if partly rotated
|
unsigned int width; // Normally the same as the camera, but not if partly rotated
|
||||||
unsigned int height; // Normally the same as the camera, but not if partly rotated
|
unsigned int height; // Normally the same as the camera, but not if partly rotated
|
||||||
|
bool v4l_multi_buffer;
|
||||||
|
unsigned int v4l_captures_per_frame;
|
||||||
Orientation orientation; // Whether the image has to be rotated at all
|
Orientation orientation; // Whether the image has to be rotated at all
|
||||||
unsigned int deinterlacing;
|
unsigned int deinterlacing;
|
||||||
int brightness; // The statically saved brightness of the camera
|
int brightness; // The statically saved brightness of the camera
|
||||||
|
|
|
@ -34,20 +34,18 @@ if ( ZM_OPT_CONTROL && canView( 'Control' ) )
|
||||||
if ( ZM_OPT_X10 )
|
if ( ZM_OPT_X10 )
|
||||||
$tabs["x10"] = $SLANG['X10'];
|
$tabs["x10"] = $SLANG['X10'];
|
||||||
$tabs["misc"] = $SLANG['Misc'];
|
$tabs["misc"] = $SLANG['Misc'];
|
||||||
|
$tabs["v4l"] = $SLANG['V4L'];
|
||||||
|
|
||||||
if ( isset($_REQUEST['tab']) )
|
if ( isset($_REQUEST['tab']) )
|
||||||
$tab = validHtmlStr($_REQUEST['tab']);
|
$tab = validHtmlStr($_REQUEST['tab']);
|
||||||
else
|
else
|
||||||
$tab = "general";
|
$tab = "general";
|
||||||
|
|
||||||
if ( !empty($_REQUEST['mid']) )
|
if ( ! empty($_REQUEST['mid']) ) {
|
||||||
{
|
|
||||||
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
|
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
|
||||||
if ( ZM_OPT_X10 )
|
if ( ZM_OPT_X10 )
|
||||||
$x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array( $_REQUEST['mid']) );
|
$x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']) );
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$nextId = getTableAutoInc( 'Monitors' );
|
$nextId = getTableAutoInc( 'Monitors' );
|
||||||
$monitor = array(
|
$monitor = array(
|
||||||
'Id' => 0,
|
'Id' => 0,
|
||||||
|
@ -107,6 +105,8 @@ else
|
||||||
'SignalCheckColour' => '#0000c0',
|
'SignalCheckColour' => '#0000c0',
|
||||||
'WebColour' => 'red',
|
'WebColour' => 'red',
|
||||||
'Triggers' => "",
|
'Triggers' => "",
|
||||||
|
'V4LMultiBuffer' => '',
|
||||||
|
'V4LCapturesPerFrame' => 1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,8 @@ if ( $newMonitor['MaxFPS'] == '0.00' )
|
||||||
if ( $newMonitor['AlarmMaxFPS'] == '0.00' )
|
if ( $newMonitor['AlarmMaxFPS'] == '0.00' )
|
||||||
$newMonitor['AlarmMaxFPS'] = '';
|
$newMonitor['AlarmMaxFPS'] = '';
|
||||||
|
|
||||||
if ( !empty($_REQUEST['preset']) ) {
|
if ( !empty($_REQUEST['preset']) )
|
||||||
|
{
|
||||||
$preset = dbFetchOne( 'SELECT Type, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale FROM MonitorPresets WHERE Id = ?', NULL, array($_REQUEST['preset']) );
|
$preset = dbFetchOne( 'SELECT Type, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale FROM MonitorPresets WHERE Id = ?', NULL, array($_REQUEST['preset']) );
|
||||||
foreach ( $preset as $name=>$value )
|
foreach ( $preset as $name=>$value )
|
||||||
{
|
{
|
||||||
|
@ -608,7 +609,7 @@ switch ( $tab )
|
||||||
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction )
|
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<option value="<?= $optFunction ?>"<?php if ( $optFunction == $newMonitor['Function'] ) { ?> selected="selected"<?php } ?>><?= $SLANG['Fn'.$optFunction] ?></option>
|
<option value="<?= $optFunction ?>"<?php if ( $optFunction == $newMonitor['Function'] ) { ?> selected="selected"<?php } ?>><?= $optFunction ?></option>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -705,6 +706,10 @@ switch ( $tab )
|
||||||
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
<tr><td><?= $SLANG['V4LMultiBuffer'] ?></td><td><input type="checkbox" name="V4LMultiBuffer" value="1" <?php echo $newMonitor['V4LMultiBuffer'] ? 'checked="checked"' : '' ?>/></td></tr>
|
||||||
|
<tr><td><?= $SLANG['V4LCapturesPerFrame'] ?></td><td><input type="number" name="V4LCapturesPerFrame" value="<?= $newMonitor['V4LCapturesPerFrame'] ?>"/></td></tr>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
elseif ( $newMonitor['Type'] == "Remote" )
|
elseif ( $newMonitor['Type'] == "Remote" )
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,20 +34,18 @@ if ( ZM_OPT_CONTROL && canView( 'Control' ) )
|
||||||
if ( ZM_OPT_X10 )
|
if ( ZM_OPT_X10 )
|
||||||
$tabs["x10"] = $SLANG['X10'];
|
$tabs["x10"] = $SLANG['X10'];
|
||||||
$tabs["misc"] = $SLANG['Misc'];
|
$tabs["misc"] = $SLANG['Misc'];
|
||||||
|
$tabs["v4l"] = $SLANG['V4L'];
|
||||||
|
|
||||||
if ( isset($_REQUEST['tab']) )
|
if ( isset($_REQUEST['tab']) )
|
||||||
$tab = validHtmlStr($_REQUEST['tab']);
|
$tab = validHtmlStr($_REQUEST['tab']);
|
||||||
else
|
else
|
||||||
$tab = "general";
|
$tab = "general";
|
||||||
|
|
||||||
if ( !empty($_REQUEST['mid']) )
|
if ( ! empty($_REQUEST['mid']) ) {
|
||||||
{
|
|
||||||
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
|
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
|
||||||
if ( ZM_OPT_X10 )
|
if ( ZM_OPT_X10 )
|
||||||
$x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']) );
|
$x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']) );
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$nextId = getTableAutoInc( 'Monitors' );
|
$nextId = getTableAutoInc( 'Monitors' );
|
||||||
$monitor = array(
|
$monitor = array(
|
||||||
'Id' => 0,
|
'Id' => 0,
|
||||||
|
@ -107,6 +105,8 @@ else
|
||||||
'SignalCheckColour' => '#0000c0',
|
'SignalCheckColour' => '#0000c0',
|
||||||
'WebColour' => 'red',
|
'WebColour' => 'red',
|
||||||
'Triggers' => "",
|
'Triggers' => "",
|
||||||
|
'V4LMultiBuffer' => '',
|
||||||
|
'V4LCapturesPerFrame' => 1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -706,6 +706,10 @@ switch ( $tab )
|
||||||
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
<tr><td><?= $SLANG['V4LMultiBuffer'] ?></td><td><input type="checkbox" name="V4LMultiBuffer" value="1" <?php echo $newMonitor['V4LMultiBuffer'] ? 'checked="checked"' : '' ?>/></td></tr>
|
||||||
|
<tr><td><?= $SLANG['V4LCapturesPerFrame'] ?></td><td><input type="number" name="V4LCapturesPerFrame" value="<?= $newMonitor['V4LCapturesPerFrame'] ?>"/></td></tr>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
elseif ( $newMonitor['Type'] == "Remote" )
|
elseif ( $newMonitor['Type'] == "Remote" )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue