Merge branch 'master' into feature-h264-videostorage

This commit is contained in:
Isaac Connor 2016-11-03 16:26:18 -04:00
commit a2f782d61a
25 changed files with 269 additions and 134 deletions

View File

@ -77,6 +77,8 @@ my %soap_version_of :ATTR(:default<('1.1')>);
sub service
{
my ($self, $serviceName, $attr) = @_;
#print "service: " . $services_of{${$self}}{$serviceName}{$attr} . "\n";
# Please note that the Std::Class::Fast docs say not to use ident.
$services_of{ident $self}{$serviceName}{$attr};
}
@ -113,27 +115,59 @@ sub set_soap_version
delete $serializer_of{ ident $self };
}
sub get_service_urls
{
sub get_service_urls {
my ($self) = @_;
my $result = $self->service('device', 'ep')->GetServices( {
IncludeCapability => 'true', # boolean
},,
);
die $result if not $result;
# print $result . "\n";
foreach my $svc ( @{ $result->get_Service() } ) {
my $short_name = $namespace_map{$svc->get_Namespace()};
my $url_svc = $svc->get_XAddr()->get_value();
if(defined $short_name && defined $url_svc) {
if ( $result ) {
foreach my $svc ( @{ $result->get_Service() } ) {
my $short_name = $namespace_map{$svc->get_Namespace()};
my $url_svc = $svc->get_XAddr()->get_value();
if(defined $short_name && defined $url_svc) {
# print "Got $short_name service\n";
$self->set_service($short_name, 'url', $url_svc);
$self->set_service($short_name, 'url', $url_svc);
}
}
# } else {
#print "No results from GetServices: $result\n";
}
}
# Some devices do not support getServices, so we have to try getCapabilities
$result = $self->service('device', 'ep')->GetCapabilities( {}, , );
if ( ! $result ) {
print "No results from GetCapabilities: $result\n";
return;
}
# Result is a GetCapabilitiesResponse
foreach my $capabilities ( @{ $result->get_Capabilities() } ) {
foreach my $capability ( 'PTZ', 'Media', 'Imaging', 'Events', 'Device' ) {
if ( my $function = $capabilities->can( "get_$capability" ) ) {
my $Services = $function->( $capabilities );
if ( ! $Services ) {
print "Nothing returned ffrom get_$capability\n";
} else {
foreach my $svc ( @{ $Services } ) {
# The capability versions don't have a namespace, so just lowercase them.
my $short_name = lc $capability;
my $url_svc = $svc->get_XAddr()->get_value();
if( defined $url_svc) {
# print "Got $short_name service\n";
$self->set_service($short_name, 'url', $url_svc);
}
} # end foreach svr
}
} else {
print "No $capability function\n";
} # end if has a get_ function
} # end foreach capability
} # end foreach capabilities
} # end sub get_service_urls
sub http_digest {
my ($service, $username, $password) = @_;

View File

@ -272,7 +272,11 @@ sub _initialize {
#
$_method =~s{\.}{__}xg;
$_method =~s{\-}{_}xg;
$list->[-1]->$_method( $current );
if ( $list->[-1]->can( $_method ) ) {
$list->[-1]->$_method( $current );
} else {
print ( "ERror " . $list->[-1] . " cannot $_method\n" );
}
$current = pop @$list; # step up in object hierarchy

View File

@ -15,6 +15,7 @@ __PACKAGE__->__set_ref();
use base qw(
SOAP::WSDL::XSD::Typelib::Element
WSDiscovery10::Types::ProbeType
WSDiscovery10::Types::ProbeMatchesType
);
}

View File

@ -1,4 +1,5 @@
#!/usr/bin/perl -w
use strict;
#
# ==========================================================================
#
@ -41,6 +42,7 @@ require WSDiscovery::TransportUDP;
# Globals
my $verbose = 0;
my $soap_version = undef;
my $client;
# =========================================================================
@ -171,61 +173,66 @@ sub discover
my %services;
my $uuid_gen = Data::UUID->new();
if ( ( ! $soap_version ) or ( $soap_version eq '1.1' ) ) {
if($verbose) {
print "Probing for SOAP 1.1\n"
}
my $svc_discover = WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort->new({
if($verbose) {
print "Probing for SOAP 1.1\n"
}
my $svc_discover = WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort->new({
# no_dispatch => '1',
});
$svc_discover->set_soap_version('1.1');
});
$svc_discover->set_soap_version('1.1');
my $uuid = $uuid_gen->create_str();
my $uuid = $uuid_gen->create_str();
my $result = $svc_discover->ProbeOp(
{ # WSDiscovery::Types::ProbeType
Types => 'http://www.onvif.org/ver10/network/wsdl:NetworkVideoTransmitter http://www.onvif.org/ver10/device/wsdl:Device', # QNameListType
Scopes => { value => '' },
},
WSDiscovery10::Elements::Header->new({
Action => { value => 'http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe' },
MessageID => { value => "urn:uuid:$uuid" },
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
})
);
# print $result . "\n";
my $result = $svc_discover->ProbeOp(
{ # WSDiscovery::Types::ProbeType
Types => 'http://www.onvif.org/ver10/network/wsdl:NetworkVideoTransmitter http://www.onvif.org/ver10/device/wsdl:Device', # QNameListType
Scopes => { value => '' },
},
WSDiscovery10::Elements::Header->new({
Action => { value => 'http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe' },
MessageID => { value => "urn:uuid:$uuid" },
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
})
);
print $result . "\n" if $verbose;
interpret_messages($svc_discover, \%services, @responses);
@responses = ();
interpret_messages($svc_discover, \%services, @responses);
@responses = ();
} # end if doing soap 1.1
if($verbose) {
print "Probing for SOAP 1.2\n"
}
$svc_discover = WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort->new({
if ( ( ! $soap_version ) or ( $soap_version eq '1.2' ) ) {
if($verbose) {
print "Probing for SOAP 1.2\n"
}
my $svc_discover = WSDiscovery10::Interfaces::WSDiscovery::WSDiscoveryPort->new({
# no_dispatch => '1',
});
$svc_discover->set_soap_version('1.2');
});
$svc_discover->set_soap_version('1.2');
# copies of the same Probe message must have the same MessageID.
# This is not a copy. So we generate a new uuid.
$uuid = $uuid_gen->create_str();
# copies of the same Probe message must have the same MessageID.
# This is not a copy. So we generate a new uuid.
my $uuid = $uuid_gen->create_str();
$result = $svc_discover->ProbeOp(
{ # WSDiscovery::Types::ProbeType
xmlattr => { 'xmlns:dn' => 'http://www.onvif.org/ver10/network/wsdl',
'xmlns:tds' => 'http://www.onvif.org/ver10/device/wsdl', },
Types => 'dn:NetworkVideoTransmitter tds:Device', # QNameListType
Scopes => { value => '' },
},
WSDiscovery10::Elements::Header->new({
Action => { value => 'http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe' },
MessageID => { value => "urn:uuid:$uuid" },
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
})
);
# print $result . "\n";
# Everyone else, like the nodejs onvif code and odm only ask for NetworkVideoTransmitter
my $result = $svc_discover->ProbeOp(
{ # WSDiscovery::Types::ProbeType
xmlattr => { 'xmlns:dn' => 'http://www.onvif.org/ver10/network/wsdl', },
Types => 'dn:NetworkVideoTransmitter', # QNameListType
Scopes => { value => '' },
},
WSDiscovery10::Elements::Header->new({
Action => { value => 'http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe' },
MessageID => { value => "urn:uuid:$uuid" },
To => { value => 'urn:schemas-xmlsoap-org:ws:2005:04:discovery' },
})
);
print $result . "\n" if $verbose;
interpret_messages($svc_discover, \%services, @responses);
} # end if doing soap 1.2
interpret_messages($svc_discover, \%services, @responses);
}
@ -321,7 +328,7 @@ my $OPTIONS = "v";
sub HELP_MESSAGE
{
my ($fh, $pkg, $ver, $opts) = @_;
print $fh "Usage: " . __FILE__ . " [-v] probe \n";
print $fh "Usage: " . __FILE__ . " [-v] probe <soap version>\n";
print $fh " " . __FILE__ . " [-v] <command> <device URI> <soap version> <user> <password>\n";
print $fh <<EOF
Commands are:
@ -359,14 +366,15 @@ if(!defined $action) {
}
if($action eq "probe") {
$soap_version = shift;
discover();
}
else {
# all other actions need URI and credentials
my $url_svc_device = shift;
my $soap_version = shift;
my $username = shift;
my $password = shift;
my $url_svc_device = shift @ARGV;
$soap_version = shift @ARGV;
my $username = @ARGV ? shift @ARGV : '';
my $password = @ARGV ? shift @ARGV: '';
$client = ONVIF::Client->new( {
'url_svc_device' => $url_svc_device,

View File

@ -1700,7 +1700,7 @@ our @options =
},
{
name => "ZM_OPT_FAST_DELETE",
default => "yes",
default => "no",
description => "Delete only event database records for speed",
help => qqq("
Normally an event created as the result of an alarm consists of
@ -1711,7 +1711,8 @@ our @options =
option which means that the browser client only deletes the key
entries in the events table, which means the events will no
longer appear in the listing, and leaves the zmaudit daemon to
clear up the rest later.
clear up the rest later. Note that this feature is less relevant
with modern hardware. Recommend this feature be left off.
"),
type => $types{boolean},
category => "system",

View File

@ -152,11 +152,13 @@ Image::Image( const Image &p_image )
strncpy( text, p_image.text, sizeof(text) );
}
Image::~Image()
{
Image::~Image() {
DumpImgBuffer();
if ( initialised )
{
}
/* Should be called as part of program shutdown to free everything */
void Image::Deinitialise() {
if ( initialised ) {
/*
delete[] y_table;
delete[] uv_table;
@ -166,18 +168,24 @@ Image::~Image()
delete[] b_u_table;
*/
initialised = false;
}
if ( readjpg_dcinfo )
{
jpeg_destroy_decompress( readjpg_dcinfo );
delete readjpg_dcinfo;
readjpg_dcinfo = 0;
}
if ( decodejpg_dcinfo )
{
jpeg_destroy_decompress( decodejpg_dcinfo );
delete decodejpg_dcinfo;
decodejpg_dcinfo = 0;
if ( readjpg_dcinfo ) {
jpeg_destroy_decompress( readjpg_dcinfo );
delete readjpg_dcinfo;
readjpg_dcinfo = 0;
}
if ( decodejpg_dcinfo )
{
jpeg_destroy_decompress( decodejpg_dcinfo );
delete decodejpg_dcinfo;
decodejpg_dcinfo = 0;
}
for ( unsigned int quality=0; quality <= 100; quality += 1 ) {
if ( writejpg_ccinfo[quality] ) {
jpeg_destroy_compress( writejpg_ccinfo[quality] );
delete writejpg_ccinfo[quality];
writejpg_ccinfo[quality] = NULL;
}
} // end foreach quality
}
}
@ -187,14 +195,14 @@ void Image::Initialise()
if(config.fast_image_blends) {
if(config.cpu_extensions && sseversion >= 20) {
fptr_blend = &sse2_fastblend; /* SSE2 fast blend */
Debug(2,"Blend: Using SSE2 fast blend function");
Debug(4,"Blend: Using SSE2 fast blend function");
} else {
fptr_blend = &std_fastblend; /* standard fast blend */
Debug(2,"Blend: Using fast blend function");
Debug(4,"Blend: Using fast blend function");
}
} else {
fptr_blend = &std_blend;
Debug(2,"Blend: Using standard blend function");
Debug(4,"Blend: Using standard blend function");
}
__attribute__((aligned(16))) uint8_t blend1[16] = {142,255,159,91,88,227,0,52,37,80,152,97,104,252,90,82};
@ -223,7 +231,7 @@ void Image::Initialise()
fptr_delta8_argb = &ssse3_delta8_argb;
fptr_delta8_abgr = &ssse3_delta8_abgr;
fptr_delta8_gray8 = &sse2_delta8_gray8;
Debug(2,"Delta: Using SSSE3 delta functions");
Debug(4,"Delta: Using SSSE3 delta functions");
} else if(sseversion >= 20) {
/* SSE2 available */
fptr_delta8_rgba = &sse2_delta8_rgba;
@ -240,7 +248,7 @@ void Image::Initialise()
// fptr_delta8_argb = &std_delta8_argb;
// fptr_delta8_abgr = &std_delta8_abgr;
fptr_delta8_gray8 = &sse2_delta8_gray8;
Debug(2,"Delta: Using SSE2 delta functions");
Debug(4,"Delta: Using SSE2 delta functions");
} else {
/* No suitable SSE version available */
fptr_delta8_rgba = &std_delta8_rgba;
@ -248,7 +256,7 @@ void Image::Initialise()
fptr_delta8_argb = &std_delta8_argb;
fptr_delta8_abgr = &std_delta8_abgr;
fptr_delta8_gray8 = &std_delta8_gray8;
Debug(2,"Delta: Using standard delta functions");
Debug(4,"Delta: Using standard delta functions");
}
} else {
/* CPU extensions disabled */
@ -257,7 +265,7 @@ void Image::Initialise()
fptr_delta8_argb = &std_delta8_argb;
fptr_delta8_abgr = &std_delta8_abgr;
fptr_delta8_gray8 = &std_delta8_gray8;
Debug(2,"Delta: CPU extensions disabled, using standard delta functions");
Debug(4,"Delta: CPU extensions disabled, using standard delta functions");
}
/* Use SSSE3 deinterlace functions? */
@ -267,23 +275,23 @@ void Image::Initialise()
fptr_deinterlace_4field_argb = &ssse3_deinterlace_4field_argb;
fptr_deinterlace_4field_abgr = &ssse3_deinterlace_4field_abgr;
fptr_deinterlace_4field_gray8 = &ssse3_deinterlace_4field_gray8;
Debug(2,"Deinterlace: Using SSSE3 delta functions");
Debug(4,"Deinterlace: Using SSSE3 delta functions");
} else {
fptr_deinterlace_4field_rgba = &std_deinterlace_4field_rgba;
fptr_deinterlace_4field_bgra = &std_deinterlace_4field_bgra;
fptr_deinterlace_4field_argb = &std_deinterlace_4field_argb;
fptr_deinterlace_4field_abgr = &std_deinterlace_4field_abgr;
fptr_deinterlace_4field_gray8 = &std_deinterlace_4field_gray8;
Debug(2,"Deinterlace: Using standard delta functions");
Debug(4,"Deinterlace: Using standard delta functions");
}
/* Use SSE2 aligned memory copy? */
if(config.cpu_extensions && sseversion >= 20) {
fptr_imgbufcpy = &sse2_aligned_memcpy;
Debug(2,"Image buffer copy: Using SSE2 aligned memcpy");
Debug(4,"Image buffer copy: Using SSE2 aligned memcpy");
} else {
fptr_imgbufcpy = &memcpy;
Debug(2,"Image buffer copy: Using standard memcpy");
Debug(4,"Image buffer copy: Using standard memcpy");
}
/* Code below relocated from zm_local_camera */

View File

@ -137,7 +137,6 @@ protected:
static jpeg_decompress_struct *decodejpg_dcinfo;
static struct zm_error_mgr jpg_err;
protected:
unsigned int width;
unsigned int height;
unsigned int pixels;
@ -150,8 +149,6 @@ protected:
int holdbuffer; /* Hold the buffer instead of replacing it with new one */
char text[1024];
protected:
static void Initialise();
public:
Image();
@ -159,6 +156,8 @@ public:
Image( int p_width, int p_height, int p_colours, int p_subpixelorder, uint8_t *p_buffer=0);
Image( const Image &p_image );
~Image();
static void Initialise();
static void Deinitialise();
inline unsigned int Width() const { return( width ); }
inline unsigned int Height() const { return( height ); }

View File

@ -198,6 +198,7 @@ int main( int argc, char *argv[] )
{
fprintf( stderr, "Can't find monitor with id of %d\n", id );
}
Image::Deinitialise();
logTerm();
zmDbClose();
return( 0 );

View File

@ -357,6 +357,7 @@ int main( int argc, char *argv[] )
delete [] next_delays;
delete [] last_capture_times;
Image::Deinitialise();
logTerm();
zmDbClose();

View File

@ -1,5 +1,5 @@
<VirtualHost *:80>
DocumentRoot /var/www/zm
DocumentRoot /usr/local/share/zoneminder
DirectoryIndex index.php
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

View File

@ -53,10 +53,10 @@ escaped="$(echo $temp | sed 's/\//\\\//g')"
}
# Assign variables once they are properly escaped
escape $1
variable=$escaped
escape $2
default=$escaped
escape "$1"
variable="$escaped"
escape "$2"
default="$escaped"
# Set the path to ConfigData
if [ -n "$3" ]; then
@ -82,7 +82,7 @@ fi
# Don't stare too closely. You will burn your eyes out.
sed -i '/.*'${variable}'.*/{
$!{ N
s/\(.*'${variable}'.*\n.*\)\"\(.*\)\"/\1\"'${default}'\"/
s/\(.*'${variable}'.*\n.*\)\"\(.*\)\"/\1\"'"${default}"'\"/
t yes
P
D

View File

@ -71,7 +71,7 @@ class DATABASE_CONFIG {
'password' => ZM_DB_PASS,
'database' => ZM_DB_NAME,
'prefix' => '',
//'encoding' => 'utf8',
'encoding' => 'utf8',
);
public $test = array(

View File

@ -99,7 +99,18 @@ class HostController extends AppController {
));
}
function getTimeZone()
{
//http://php.net/manual/en/function.date-default-timezone-get.php
$tz = date_default_timezone_get();
$this->set(array(
'tz' => $tz,
'_serialize' => array('tz')
));
}
function getVersion() {
//throw new UnauthorizedException(__('API Disabled'));
$version = Configure::read('ZM_VERSION');
// not going to use the ZM_API_VERSION
// requires recompilation and dependency on ZM upgrade

View File

@ -338,7 +338,9 @@ if ( !empty($action) )
$monitor = dbFetchOne( "SELECT * FROM Monitors WHERE Id=?", NULL, array($mid) );
$newFunction = validStr($_REQUEST['newFunction']);
$newEnabled = isset( $_REQUEST['newEnabled'] ) and $_REQUEST['newEnabled'] != "1" ? "0" : "1";
# Because we use a checkbox, it won't get passed in the request. So not being in _REQUEST means 0
$newEnabled = ( !isset( $_REQUEST['newEnabled'] ) or $_REQUEST['newEnabled'] != '1' ) ? '0' : '1';
$oldFunction = $monitor['Function'];
$oldEnabled = $monitor['Enabled'];
if ( $newFunction != $oldFunction || $newEnabled != $oldEnabled )

View File

@ -547,6 +547,28 @@ function makePopupButton( $url, $winName, $winSize, $buttonValue, $condition=1,
return( $string );
}
function htmlSelect( $name, $contents, $values, $behaviours=false ) {
$behaviourText = "";
if ( !empty($behaviours) ) {
if ( is_array($behaviours) ) {
foreach ( $behaviours as $event=>$action ) {
$behaviourText .= ' '.$event.'="'.$action.'"';
}
} else {
$behaviourText = ' onchange="'.$behaviours.'"';
}
}
$html = "<select name=\"$name\" id=\"$name\"$behaviourText>";
foreach ( $contents as $value=>$text ) {
$selected = is_array( $values ) ? in_array( $value, $values ) : $value==$values;
$html .= "<option value=\"$value\"".($selected?" selected=\"selected\"":'').">$text</option>";
}
$html .= "</select>";
return $html;
}
function truncText( $text, $length, $deslash=1 ) {
return( preg_replace( "/^(.{".$length.",}?)\b.*$/", "\\1&hellip;", ($deslash?stripslashes($text):$text) ) );
}

View File

@ -519,6 +519,7 @@ $SLANG = array(
'NewUser' => 'New User',
'Next' => 'Next',
'NoDetectedCameras' => 'No Detected Cameras',
'NoDetectedProfiles' => 'No Detected Profiles',
'NoFramesRecorded' => 'There are no frames recorded for this event',
'NoGroup' => 'No Group',
'NoneAvailable' => 'None available',

View File

@ -1,4 +1,3 @@
<?php
//
// ZoneMinder web UK English language file, $Date$, $Revision$

View File

@ -102,7 +102,12 @@ function getPopupSize( tag, width, height )
function zmWindow()
{
var zmWin = window.open( 'http://www.zoneminder.com', 'ZoneMinder' );
zmWin.focus();
if ( ! zmWin ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
zmWin.focus();
}
}
function createPopup( url, name, tag, width, height )
@ -114,7 +119,12 @@ function createPopup( url, name, tag, width, height )
if ( popupSize.height > 0 )
popupDimensions += ",height="+popupSize.height;
var popup = window.open( url, name, popupOptions+popupDimensions );
popup.focus();
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus();
}
}
function createEventPopup( eventId, eventFilter, width, height )
@ -125,7 +135,12 @@ function createEventPopup( eventId, eventFilter, width, height )
var name = 'zmEvent';
var popupSize = getPopupSize( 'event', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
popup.focus();
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus();
}
}
function createFramesPopup( eventId, width, height )
@ -134,7 +149,12 @@ function createFramesPopup( eventId, width, height )
var name = 'zmFrames';
var popupSize = getPopupSize( 'frames', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
popup.focus();
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus();
}
}
function createFramePopup( eventId, frameId, width, height )
@ -143,7 +163,12 @@ function createFramePopup( eventId, frameId, width, height )
var name = 'zmFrame';
var popupSize = getPopupSize( 'frame', width, height );
var popup = window.open( url, name, popupOptions+",width="+popupSize.width+",height="+popupSize.height );
popup.focus();
if ( ! popup ) {
// if popup blocking is enabled, the popup won't be defined.
console.log("Please disable popup blocking.");
} else {
popup.focus();
}
}
function windowToFront()

View File

@ -41,10 +41,14 @@ if ( isset( $_REQUEST['rate'] ) )
$rate = validInt($_REQUEST['rate']);
else
$rate = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
if ( isset( $_REQUEST['scale'] ) )
$scale = validInt($_REQUEST['scale']);
else
$scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
if ( isset( $_REQUEST['scale'] ) ) {
$scale = validInt($_REQUEST['scale']);
} else if ( isset( $_COOKIE['zmEventScale'.$event['MonitorId']] ) ) {
$scale = $_COOKIE['zmEventScale'.$event['MonitorId']];
} else {
$scale = reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
}
$replayModes = array(
'single' => translate('ReplaySingle'),

View File

@ -16,7 +16,9 @@ function changeScale()
vid.width = newWidth;
vid.height = newHeight;
} else {
streamScale( scale );
streamScale( scale );
Cookie.write( 'zmEventScale'+eventData.MonitorId, scale, { duration: 10*365 } );
/*Stream could be an applet so can't use moo tools*/
var streamImg = document.getElementById('evtStream');
streamImg.style.width = newWidth + "px";
streamImg.style.height = newHeight + "px";

View File

@ -27,6 +27,7 @@ var connKey = '<?php echo $connkey ?>';
var eventData = {
Id: <?php echo $event['Id'] ?>,
MonitorId: <?php echo $event['MonitorId'] ?>,
Width: <?php echo $event['Width'] ?>,
Height: <?php echo $event['Height'] ?>,
Length: <?php echo $event['Length'] ?>

View File

@ -32,8 +32,7 @@ function changeScale()
var newWidth = ( monitorWidth * scale ) / SCALE_BASE;
var newHeight = ( monitorHeight * scale ) / SCALE_BASE;
// This causes FF3 to kill the stream now, ok with FF2
//streamCmdScale( scale );
Cookie.write( 'zmWatchScale'+monitorId, scale, { duration: 10*365 } );
/*Stream could be an applet so can't use moo tools*/
var streamImg = document.getElementById('liveStream');

View File

@ -41,7 +41,7 @@ xhtmlHeaders(__FILE__, translate('Login') );
<tbody>
<tr>
<td class="colLeft"><?php echo translate('Username') ?></td>
<td class="colRight"><input type="text" name="username" value="<?php echo isset($_REQUEST['username'])?validHtmlStr($_REQUEST['username']):"" ?>" size="12"/></td>
<td class="colRight"><input type="text" name="username" autocorrect="off" autocapitalize="off" spellcheck="false" value="<?php echo isset($_REQUEST['username'])?validHtmlStr($_REQUEST['username']):"" ?>" size="12"/></td>
</tr>
<tr>
<td class="colLeft"><?php echo translate('Password') ?></td>

View File

@ -27,13 +27,21 @@ if ( !canEdit( 'Monitors' ) )
$cameras = array();
$cameras[0] = translate('ChooseDetectedCamera');
$profiles = array();
$profiles[0] = translate('ChooseDetectedProfile');
function execONVIF( $cmd )
{
exec( escapeshellcmd(ZM_PATH_BIN . "/zmonvif-probe.pl $cmd"), $output, $status );
if ( $status )
Fatal( "Unable to probe network cameras, status is '$status'" );
function execONVIF( $cmd ) {
$shell_command = escapeshellcmd(ZM_PATH_BIN . "/zmonvif-probe.pl $cmd");
exec( $shell_command, $output, $status );
if ( $status ) {
$html_output = implode( '<br/>', $output );
Fatal( "Unable to probe network cameras, status is '$status'. Output was:<br/><br/>
$html_output<br/><br/>
Please the following command from a command line for more information:<br/><br/>$shell_command"
);
}
return $output;
}
@ -216,9 +224,10 @@ if( !isset($_REQUEST['step']) || ($_REQUEST['step'] == "1")) {
}
else if($_REQUEST['step'] == "2")
{
if ( empty($_REQUEST['probe']) || empty($_REQUEST['username']) ||
empty($_REQUEST['password']) )
Fatal("Internal error. Please re-open this page.");
if ( empty($_REQUEST['probe']) )
Fatal("No probe passed in request. Please go back and try again.");
#|| empty($_REQUEST['username']) ||
#empty($_REQUEST['password']) )
$probe = unserialize(base64_decode($_REQUEST['probe']));
foreach ( $probe as $name=>$value )
@ -248,11 +257,11 @@ else if($_REQUEST['step'] == "2")
$monitor['Path'] = $profile['Path'];
// $sourceDesc = htmlspecialchars(serialize($monitor));
$sourceDesc = base64_encode(serialize($monitor));
$cameras[$sourceDesc] = $sourceString;
$profiles[$sourceDesc] = $sourceString;
}
if ( count($cameras) <= 0 )
$cameras[0] = translate('NoDetectedCameras');
if ( count($profiles) <= 0 )
$profiles[0] = translate('NoDetectedProfiles');
?>
<body>
@ -269,7 +278,7 @@ else if($_REQUEST['step'] == "2")
<?php echo translate('ProfileProbeIntro') ?>
</p>
<p>
<label for="probe"><?php echo translate('DetectedProfiles') ?></label><?php echo buildSelect( "probe", $cameras, 'configureButtons( this )' ); ?>
<label for="probe"><?php echo translate('DetectedProfiles') ?></label><?php echo buildSelect( 'probe', $profiles, 'configureButtons( this )' ); ?>
</p>
<div id="contentButtons">
<input type="button" name="prevBtn" value="<?php echo translate('Prev') ?>" onclick="gotoStep1( this )"/>

View File

@ -44,10 +44,13 @@ else
$showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable() && canView( 'Control' ) );
if ( isset( $_REQUEST['scale'] ) )
$scale = validInt($_REQUEST['scale']);
else
$scale = reScale( SCALE_BASE, $monitor->DefaultScale, ZM_WEB_DEFAULT_SCALE );
if ( isset( $_REQUEST['scale'] ) ) {
$scale = validInt($_REQUEST['scale']);
} else if ( isset( $_COOKIE['zmWatchScale'.$mid] ) ) {
$scale = $_COOKIE['zmWatchScale'.$mid];
} else {
$scale = reScale( SCALE_BASE, $monitor->DefaultScale, ZM_WEB_DEFAULT_SCALE );
}
$connkey = generateConnKey();