From 950c8f19d3143d2d82e2533f4db666e55de55ba7 Mon Sep 17 00:00:00 2001 From: abishai Date: Thu, 22 Jun 2017 17:14:24 +0300 Subject: [PATCH 01/15] Upstream FreeBSD patches (#1926) * apply FreeBSD patches * timeval struct needs time.h * typo * added forgotten destination for systemd startup script install --- scripts/CMakeLists.txt | 5 ++++- src/zm_local_camera.cpp | 4 ++-- src/zm_packet.h | 4 ++++ src/zm_signal.cpp | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 5846a39d2..f69a71ab1 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -33,8 +33,11 @@ FOREACH(PERLSCRIPT ${perlscripts}) ENDFOREACH(PERLSCRIPT ${perlscripts}) # Install the perl scripts -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmaudit.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcontrol.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmdc.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmfilter.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmpkg.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrack.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrigger.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmupdate.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmvideo.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmwatch.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcamtool.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmsystemctl.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtelemetry.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmaudit.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcontrol.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmdc.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmfilter.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmpkg.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrack.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtrigger.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmupdate.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmvideo.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmwatch.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmcamtool.pl" "${CMAKE_CURRENT_BINARY_DIR}/zmtelemetry.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) if(NOT ZM_NO_X10) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmx10.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endif(NOT ZM_NO_X10) +if(WITH_SYSTEMD) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zmsystemctl.pl" DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +endif(WITH_SYSTEMD) diff --git a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp index f13733b11..48f805a1f 100644 --- a/src/zm_local_camera.cpp +++ b/src/zm_local_camera.cpp @@ -32,8 +32,8 @@ #include #include -/* Workaround for GNU/kFreeBSD */ -#if defined(__FreeBSD_kernel__) +/* Workaround for GNU/kFreeBSD and FreeBSD */ +#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) #ifndef ENODATA #define ENODATA ENOATTR #endif diff --git a/src/zm_packet.h b/src/zm_packet.h index 9fd7ed8ee..303b3af35 100644 --- a/src/zm_packet.h +++ b/src/zm_packet.h @@ -24,6 +24,10 @@ extern "C" { #include } +#ifdef __FreeBSD__ +#include +#endif // __FreeBSD__ + class ZMPacket { public: diff --git a/src/zm_signal.cpp b/src/zm_signal.cpp index 08f3d76a0..034ff7d66 100644 --- a/src/zm_signal.cpp +++ b/src/zm_signal.cpp @@ -63,13 +63,13 @@ RETSIGTYPE zm_die_handler(int signal) ucontext_t *uc = (ucontext_t *) context; cr2 = info->si_addr; #if defined(__x86_64__) - #ifdef __FreeBSD_kernel__ + #if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) ip = (void *)(uc->uc_mcontext.mc_rip); #else ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]); #endif #else - #ifdef __FreeBSD_kernel__ + #if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) ip = (void *)(uc->uc_mcontext.mc_eip); #else ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]); From b10779ab3ae44425dd3b015e4f917e785dce1485 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Thu, 22 Jun 2017 10:57:11 -0500 Subject: [PATCH 02/15] Update rsync_xfer.sh add rsync -l flag to transfer symlinks --- utils/packpack/rsync_xfer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/packpack/rsync_xfer.sh b/utils/packpack/rsync_xfer.sh index e981f646f..46cda18cb 100755 --- a/utils/packpack/rsync_xfer.sh +++ b/utils/packpack/rsync_xfer.sh @@ -37,7 +37,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then # Don't keep packages older than 5 days find ./zmrepo/$targetfolder/ -maxdepth 1 -type f -mtime +5 -delete - rsync -vzh --ignore-errors build/* zmrepo/$targetfolder/ + rsync -vzlh --ignore-errors build/* zmrepo/$targetfolder/ fusermount -zu zmrepo else echo From fcc852c85955fa0264c4f061f45ea0c4711e0f8c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 22 Jun 2017 16:06:31 -0400 Subject: [PATCH 03/15] fix cpplint.py complaints --- src/zm_video.cpp | 849 +++++++++++++++++++++++++---------------------- 1 file changed, 452 insertions(+), 397 deletions(-) diff --git a/src/zm_video.cpp b/src/zm_video.cpp index ec1371ba3..7f88fa1ef 100644 --- a/src/zm_video.cpp +++ b/src/zm_video.cpp @@ -1,522 +1,577 @@ +// Copyright (C) 2001-2017 ZoneMinder LLC // 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. -// +// #include "zm.h" #include "zm_video.h" #include "zm_image.h" #include "zm_utils.h" #include "zm_rgb.h" #include +#include +#include -VideoWriter::VideoWriter(const char* p_container, const char* p_codec, const char* p_path, const unsigned int p_width, const unsigned int p_height, const unsigned int p_colours, const unsigned int p_subpixelorder) : -container(p_container), codec(p_codec), path(p_path), width(p_width), height(p_height), colours(p_colours), subpixelorder(p_subpixelorder), frame_count(0) { - Debug(7,"Video object created"); - - /* Parameter checking */ - if(path.empty()) { - Error("Invalid file path"); - } - if(!width || !height) { - Error("Invalid width or height"); - } +VideoWriter::VideoWriter( + const char* p_container, + const char* p_codec, + const char* p_path, + const unsigned int p_width, + const unsigned int p_height, + const unsigned int p_colours, + const unsigned int p_subpixelorder) : + container(p_container), + codec(p_codec), + path(p_path), + width(p_width), + height(p_height), + colours(p_colours), + subpixelorder(p_subpixelorder), + frame_count(0) { + Debug(7, "Video object created"); + /* Parameter checking */ + if ( path.empty() ) { + Error("Invalid file path"); + } + if ( !width || !height ) { + Error("Invalid width or height"); + } } VideoWriter::~VideoWriter() { - Debug(7,"Video object destroyed"); - + Debug(7, "Video object destroyed"); } int VideoWriter::Reset(const char* new_path) { - /* Common variables reset */ + /* Common variables reset */ - /* If there is a new path, use it */ - if(new_path != NULL) { - path = new_path; - } + /* If there is a new path, use it */ + if ( new_path != NULL ) { + path = new_path; + } - /* Reset frame counter */ - frame_count = 0; + /* Reset frame counter */ + frame_count = 0; - return 0; + return 0; } #if ZM_HAVE_VIDEOWRITER_X264MP4 -X264MP4Writer::X264MP4Writer(const char* p_path, const unsigned int p_width, const unsigned int p_height, const unsigned int p_colours, const unsigned int p_subpixelorder, const std::vector* p_user_params) : VideoWriter("mp4", "h264", p_path, p_width, p_height, p_colours, p_subpixelorder), bOpen(false), bGotH264AVCInfo(false), bFirstFrame(true) { - - /* Initialize ffmpeg if it hasn't been initialized yet */ - FFMPEGInit(); +X264MP4Writer::X264MP4Writer( + const char* p_path, + const unsigned int p_width, + const unsigned int p_height, + const unsigned int p_colours, + const unsigned int p_subpixelorder, + const std::vector* p_user_params) : + VideoWriter( + "mp4", + "h264", + p_path, + p_width, + p_height, + p_colours, + p_subpixelorder), + bOpen(false), + bGotH264AVCInfo(false), + bFirstFrame(true) { + /* Initialize ffmpeg if it hasn't been initialized yet */ + FFMPEGInit(); - /* Initialize swscale */ - zm_pf = GetFFMPEGPixelFormat(colours,subpixelorder); - if(zm_pf == 0) { - Error("Unable to match ffmpeg pixelformat"); - } - codec_pf = AV_PIX_FMT_YUV420P; + /* Initialize swscale */ + zm_pf = GetFFMPEGPixelFormat(colours, subpixelorder); + if ( zm_pf == 0 ) { + Error("Unable to match ffmpeg pixelformat"); + } + codec_pf = AV_PIX_FMT_YUV420P; - swscaleobj.SetDefaults(zm_pf, codec_pf, width, height); + swscaleobj.SetDefaults(zm_pf, codec_pf, width, height); - /* Calculate the image sizes. We will need this for parameter checking */ - zm_imgsize = colours * width * height; + /* Calculate the image sizes. We will need this for parameter checking */ + zm_imgsize = colours * width * height; #if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0) - codec_imgsize = av_image_get_buffer_size( codec_pf, width, height, 1 ); + codec_imgsize = av_image_get_buffer_size(codec_pf, width, height, 1); #else - codec_imgsize = avpicture_get_size( codec_pf, width, height); + codec_imgsize = avpicture_get_size(codec_pf, width, height); #endif - if(!codec_imgsize) { - Error("Failed calculating codec pixel format image size"); - } + if ( !codec_imgsize ) { + Error("Failed calculating codec pixel format image size"); + } - /* If supplied with user parameters to the encoder, copy them */ - if(p_user_params != NULL) { - user_params = *p_user_params; - } - - /* Setup x264 parameters */ - if(x264config() < 0) { - Error("Failed setting x264 parameters"); - } - - /* Allocate x264 input picture */ - x264_picture_alloc(&x264picin, X264_CSP_I420, x264params.i_width, x264params.i_height); - + /* If supplied with user parameters to the encoder, copy them */ + if ( p_user_params != NULL ) { + user_params = *p_user_params; + } + + /* Setup x264 parameters */ + if ( x264config() < 0 ) { + Error("Failed setting x264 parameters"); + } + + /* Allocate x264 input picture */ + x264_picture_alloc( + &x264picin, + X264_CSP_I420, + x264params.i_width, + x264params.i_height); } X264MP4Writer::~X264MP4Writer() { + /* Free x264 input picture */ + x264_picture_clean(&x264picin); - /* Free x264 input picture */ - x264_picture_clean(&x264picin); - - if(bOpen) - Close(); - + if ( bOpen ) + Close(); } int X264MP4Writer::Open() { + /* Open the encoder */ + x264enc = x264_encoder_open(&x264params); + if ( x264enc == NULL ) { + Error("Failed opening x264 encoder"); + return -1; + } - /* Open the encoder */ - x264enc = x264_encoder_open(&x264params); - if(x264enc == NULL) { - Error("Failed opening x264 encoder"); - return -1; - } + // Debug(4,"x264 maximum delayed frames: %d", + // x264_encoder_maximum_delayed_frames(x264enc)); - // Debug(4,"x264 maximum delayed frames: %d",x264_encoder_maximum_delayed_frames(x264enc)); - - x264_nal_t* nals; - int i_nals; - if(!x264_encoder_headers(x264enc,&nals,&i_nals)) { - Error("Failed getting encoder headers"); - return -2; - } - - /* Search SPS NAL for AVC information */ - for(int i=0;i 0; i-- ) { + x264encodeloop(true); + } - /* Flush all pending frames */ - for(int i = (x264_encoder_delayed_frames(x264enc) + 1); i > 0; i-- ) { - x264encodeloop(true); - } + /* Close the encoder */ + x264_encoder_close(x264enc); - /* Close the encoder */ - x264_encoder_close(x264enc); + /* Close MP4 handle */ + MP4Close(mp4h); - /* Close MP4 handle */ - MP4Close(mp4h); - - /* Required for proper HTTP streaming */ - MP4Optimize((path + ".incomplete").c_str(), path.c_str()); + /* Required for proper HTTP streaming */ + MP4Optimize((path + ".incomplete").c_str(), path.c_str()); - /* Delete the temporary file */ - unlink((path + ".incomplete").c_str()); - - bOpen = false; + /* Delete the temporary file */ + unlink((path + ".incomplete").c_str()); - Debug(7, "Video closed. Total frames: %d", frame_count); - - return 0; + bOpen = false; + + Debug(7, "Video closed. Total frames: %d", frame_count); + + return 0; } int X264MP4Writer::Reset(const char* new_path) { - - /* Close the encoder and file */ - if(bOpen) - Close(); + /* Close the encoder and file */ + if ( bOpen ) + Close(); - /* Reset common variables */ - VideoWriter::Reset(new_path); + /* Reset common variables */ + VideoWriter::Reset(new_path); - /* Reset local variables */ - bFirstFrame = true; - bGotH264AVCInfo = false; - prevnals.clear(); - prevpayload.clear(); - - /* Reset x264 parameters */ - x264config(); + /* Reset local variables */ + bFirstFrame = true; + bGotH264AVCInfo = false; + prevnals.clear(); + prevpayload.clear(); - /* Open the encoder */ - Open(); - - return 0; + /* Reset x264 parameters */ + x264config(); + + /* Open the encoder */ + Open(); + + return 0; } -int X264MP4Writer::Encode(const uint8_t* data, const size_t data_size, const unsigned int frame_time) { +int X264MP4Writer::Encode( + const uint8_t* data, + const size_t data_size, + const unsigned int frame_time) { + /* Parameter checking */ + if ( data == NULL ) { + Error("NULL buffer"); + return -1; + } - /* Parameter checking */ - if(data == NULL) { - Error("NULL buffer"); - return -1; - } + if ( data_size != zm_imgsize ) { + Error("The data buffer size (%d) != expected (%d)", data_size, zm_imgsize); + return -2; + } - if(data_size != zm_imgsize) { - Error("The data buffer size does not match the expected size. Expected: %d Current: %d", zm_imgsize, data_size); - return -2; - } - - if(!bOpen) { - Warning("The encoder was not initialized, initializing now"); - Open(); - } - - /* Convert the image into the x264 input picture */ - if(swscaleobj.ConvertDefaults(data, data_size, x264picin.img.plane[0], codec_imgsize) < 0) { - Error("Image conversion failed"); - return -3; - } + if ( !bOpen ) { + Warning("The encoder was not initialized, initializing now"); + Open(); + } - /* Set PTS */ - x264picin.i_pts = frame_time; + /* Convert the image into the x264 input picture */ + if ( swscaleobj.ConvertDefaults(data, data_size, x264picin.img.plane[0], codec_imgsize) < 0 ) { + Error("Image conversion failed"); + return -3; + } - /* Do the encoding */ - x264encodeloop(); + /* Set PTS */ + x264picin.i_pts = frame_time; - /* Increment frame counter */ - frame_count++; + /* Do the encoding */ + x264encodeloop(); - return 0; + /* Increment frame counter */ + frame_count++; + + return 0; } int X264MP4Writer::Encode(const Image* img, const unsigned int frame_time) { - - if(img->Width() != width) { - Error("Source image width differs. Source: %d Output: %d",img->Width(), width); - return -12; - } + if ( img->Width() != width ) { + Error("Source image width differs. Source: %d Output: %d", img->Width(), width); + return -12; + } - if(img->Height() != height) { - Error("Source image height differs. Source: %d Output: %d",img->Height(), height); - return -13; - } - - return Encode(img->Buffer(),img->Size(),frame_time); + if ( img->Height() != height ) { + Error("Source image height differs. Source: %d Output: %d", img->Height(), height); + return -13; + } + + return Encode(img->Buffer(), img->Size(), frame_time); } int X264MP4Writer::x264config() { - /* Sets up the encoder configuration */ + /* Sets up the encoder configuration */ - int x264ret; + int x264ret; - /* Defaults */ - const char* preset = "veryfast"; - const char* tune = "stillimage"; - const char* profile = "main"; + /* Defaults */ + const char* preset = "veryfast"; + const char* tune = "stillimage"; + const char* profile = "main"; - /* Search the user parameters for preset, tune and profile */ - for(unsigned int i=0; i < user_params.size(); i++) { - if(strcmp(user_params[i].pname, "preset") == 0) { - /* Got preset */ - preset = user_params[i].pvalue; - } else if(strcmp(user_params[i].pname, "tune") == 0) { - /* Got tune */ - tune = user_params[i].pvalue; - } else if(strcmp(user_params[i].pname, "profile") == 0) { - /* Got profile */ - profile = user_params[i].pvalue; - } - } + /* Search the user parameters for preset, tune and profile */ + for ( unsigned int i = 0; i < user_params.size(); i++ ) { + if ( strcmp(user_params[i].pname, "preset") == 0 ) { + /* Got preset */ + preset = user_params[i].pvalue; + } else if ( strcmp(user_params[i].pname, "tune") == 0 ) { + /* Got tune */ + tune = user_params[i].pvalue; + } else if ( strcmp(user_params[i].pname, "profile") == 0 ) { + /* Got profile */ + profile = user_params[i].pvalue; + } + } - /* Set the defaults and preset and tune */ - x264ret = x264_param_default_preset(&x264params, preset, tune); - if(x264ret != 0) { - Error("Failed setting x264 preset %s and tune %s : %d",preset,tune,x264ret); - } - - /* Set the profile */ - x264ret = x264_param_apply_profile(&x264params, profile); - if(x264ret != 0) { - Error("Failed setting x264 profile %s : %d",profile,x264ret); - } - - /* Input format */ - x264params.i_width = width; - x264params.i_height = height; - x264params.i_csp = X264_CSP_I420; - - /* Quality control */ - x264params.rc.i_rc_method = X264_RC_CRF; - x264params.rc.f_rf_constant = 23.0; + /* Set the defaults and preset and tune */ + x264ret = x264_param_default_preset(&x264params, preset, tune); + if ( x264ret != 0 ) { + Error("Failed setting x264 preset %s and tune %s : %d", preset, tune, x264ret); + } - /* Enable b-frames */ - x264params.i_bframe = 16; - x264params.i_bframe_adaptive = 1; - - /* Timebase */ - x264params.i_timebase_num = 1; - x264params.i_timebase_den = 1000; + /* Set the profile */ + x264ret = x264_param_apply_profile(&x264params, profile); + if ( x264ret != 0 ) { + Error("Failed setting x264 profile %s : %d", profile, x264ret); + } - /* Enable variable frame rate */ - x264params.b_vfr_input = 1; + /* Input format */ + x264params.i_width = width; + x264params.i_height = height; + x264params.i_csp = X264_CSP_I420; - /* Disable annex-b (start codes) */ - x264params.b_annexb = 0; - - /* TODO: Setup error handler */ - //x264params.i_log_level = X264_LOG_DEBUG; + /* Quality control */ + x264params.rc.i_rc_method = X264_RC_CRF; + x264params.rc.f_rf_constant = 23.0; - /* Process user parameters (excluding preset, tune and profile) */ - for(unsigned int i=0; i < user_params.size(); i++) { - /* Skip preset, tune and profile */ - if( (strcmp(user_params[i].pname, "preset") == 0) || (strcmp(user_params[i].pname, "tune") == 0) || (strcmp(user_params[i].pname, "profile") == 0) ) { - continue; - } + /* Enable b-frames */ + x264params.i_bframe = 16; + x264params.i_bframe_adaptive = 1; - /* Pass the name and value to x264 */ - x264ret = x264_param_parse(&x264params, user_params[i].pname, user_params[i].pvalue); + /* Timebase */ + x264params.i_timebase_num = 1; + x264params.i_timebase_den = 1000; - /* Error checking */ - if(x264ret != 0) { - if(x264ret == X264_PARAM_BAD_NAME) { - Error("Failed processing x264 user parameter %s=%s : Bad name", user_params[i].pname, user_params[i].pvalue); - } else if(x264ret == X264_PARAM_BAD_VALUE) { - Error("Failed processing x264 user parameter %s=%s : Bad value", user_params[i].pname, user_params[i].pvalue); - } else { - Error("Failed processing x264 user parameter %s=%s : Unknown error (%d)", user_params[i].pname, user_params[i].pvalue, x264ret); - } - } - } - - return 0; + /* Enable variable frame rate */ + x264params.b_vfr_input = 1; + + /* Disable annex-b (start codes) */ + x264params.b_annexb = 0; + + /* TODO: Setup error handler */ + // x264params.i_log_level = X264_LOG_DEBUG; + + /* Process user parameters (excluding preset, tune and profile) */ + for ( unsigned int i = 0; i < user_params.size(); i++ ) { + /* Skip preset, tune and profile */ + if ( + (strcmp(user_params[i].pname, "preset") == 0) || + (strcmp(user_params[i].pname, "tune") == 0) || + (strcmp(user_params[i].pname, "profile") == 0) ) { + continue; + } + + /* Pass the name and value to x264 */ + x264ret = x264_param_parse(&x264params, user_params[i].pname, user_params[i].pvalue); + + /* Error checking */ + if ( x264ret != 0 ) { + if ( x264ret == X264_PARAM_BAD_NAME ) { + Error("Failed processing x264 user parameter %s=%s : Bad name", + user_params[i].pname, user_params[i].pvalue); + } else if ( x264ret == X264_PARAM_BAD_VALUE ) { + Error("Failed processing x264 user parameter %s=%s : Bad value", + user_params[i].pname, user_params[i].pvalue); + } else { + Error("Failed processing x264 user parameter %s=%s : Unknown error (%d)", + user_params[i].pname, user_params[i].pvalue, x264ret); + } + } + } + + return 0; } void X264MP4Writer::x264encodeloop(bool bFlush) { + x264_nal_t* nals; + int i_nals; + int frame_size; - x264_nal_t* nals; - int i_nals; - int frame_size; + if ( bFlush ) { + frame_size = x264_encoder_encode(x264enc, &nals, &i_nals, NULL, &x264picout); + } else { + frame_size = x264_encoder_encode(x264enc, &nals, &i_nals, &x264picin, &x264picout); + } - if(bFlush) { - frame_size = x264_encoder_encode(x264enc, &nals, &i_nals, NULL, &x264picout); - } else { - frame_size = x264_encoder_encode(x264enc, &nals, &i_nals, &x264picin, &x264picout); - } + if ( frame_size > 0 || bFlush ) { + Debug(8, "x264 Frame: %d PTS: %d DTS: %d Size: %d\n", + frame_count, x264picout.i_pts, x264picout.i_dts, frame_size); - if (frame_size > 0 || bFlush) { - Debug(8, "x264 Frame: %d PTS: %d DTS: %d Size: %d\n",frame_count, x264picout.i_pts, x264picout.i_dts, frame_size); + /* Handle the previous frame */ + if ( !bFirstFrame ) { + buffer.clear(); - /* Handle the previous frame */ - if(!bFirstFrame) { + /* Process the NALs for the previous frame */ + for ( unsigned int i = 0; i < prevnals.size(); i++ ) { + Debug(9, "Processing NAL: Type %d Size %d", + prevnals[i].i_type, + prevnals[i].i_payload); - buffer.clear(); + switch ( prevnals[i].i_type ) { + case NAL_PPS: + /* PPS NAL */ + MP4AddH264PictureParameterSet(mp4h, mp4vtid, prevnals[i].p_payload+4, prevnals[i].i_payload-4); + break; + case NAL_SPS: + /* SPS NAL */ + MP4AddH264SequenceParameterSet(mp4h, mp4vtid, prevnals[i].p_payload+4, prevnals[i].i_payload-4); + break; + default: + /* Anything else, hopefully frames, so copy it into the sample */ + buffer.append(prevnals[i].p_payload, prevnals[i].i_payload); + } + } - /* Process the NALs for the previous frame */ - for(unsigned int i=0; i < prevnals.size(); i++) { - Debug(9,"Processing NAL: Type %d Size %d",prevnals[i].i_type,prevnals[i].i_payload); + /* Calculate frame duration and offset */ + int duration = x264picout.i_dts - prevDTS; + int offset = prevPTS - prevDTS; - switch(prevnals[i].i_type) { - case NAL_PPS: - /* PPS NAL */ - MP4AddH264PictureParameterSet(mp4h, mp4vtid, prevnals[i].p_payload+4, prevnals[i].i_payload-4); - break; - case NAL_SPS: - /* SPS NAL */ - MP4AddH264SequenceParameterSet(mp4h, mp4vtid, prevnals[i].p_payload+4, prevnals[i].i_payload-4); - break; - default: - /* Anything else, hopefully frames, so copy it into the sample */ - buffer.append(prevnals[i].p_payload, prevnals[i].i_payload); - } - } + /* Write the sample */ + if ( !buffer.empty() ) { + if ( !MP4WriteSample( + mp4h, + mp4vtid, + buffer.extract(buffer.size()), + buffer.size(), + duration, + offset, + prevKeyframe) ) { + Error("Failed writing sample"); + } + } - /* Calculate frame duration and offset */ - int duration = x264picout.i_dts - prevDTS; - int offset = prevPTS - prevDTS; + /* Cleanup */ + prevnals.clear(); + prevpayload.clear(); + } - /* Write the sample */ - if(!buffer.empty()) { - if(!MP4WriteSample(mp4h, mp4vtid, buffer.extract(buffer.size()), buffer.size(), duration, offset, prevKeyframe)) { - Error("Failed writing sample"); - } - } + /* Got a frame. Copy this new frame into the previous frame */ + if ( frame_size > 0 ) { + /* Copy the NALs and the payloads */ + for ( unsigned int i = 0; i < i_nals; i++ ) { + prevnals.push_back(nals[i]); + prevpayload.append(nals[i].p_payload, nals[i].i_payload); + } - /* Cleanup */ - prevnals.clear(); - prevpayload.clear(); + /* Update the payload pointers */ + /* This is done in a separate loop because the previous loop might reallocate memory when appending, + making the pointers invalid */ + unsigned int payload_offset = 0; + for ( unsigned int i = 0; i < prevnals.size(); i++ ) { + prevnals[i].p_payload = prevpayload.head() + payload_offset; + payload_offset += nals[i].i_payload; + } - } + /* We need this for the next frame */ + prevPTS = x264picout.i_pts; + prevDTS = x264picout.i_dts; + prevKeyframe = x264picout.b_keyframe; - /* Got a frame. Copy this new frame into the previous frame */ - if(frame_size > 0) { - /* Copy the NALs and the payloads */ - for(int i=0;i* vec) { - if(vec == NULL) { - Error("NULL Encoder parameters vector pointer"); - return -1; - } +int ParseEncoderParameters( + const char* str, + std::vector* vec + ) { + if ( vec == NULL ) { + Error("NULL Encoder parameters vector pointer"); + return -1; + } - if(str == NULL) { - Error("NULL Encoder parameters string"); - return -2; - } + if ( str == NULL ) { + Error("NULL Encoder parameters string"); + return -2; + } - vec->clear(); + vec->clear(); - if(str[0] == 0) { - /* Empty */ - return 0; - } + if ( str[0] == 0 ) { + /* Empty */ + return 0; + } - std::string line; - std::stringstream ss(str); - size_t valueoffset; - size_t valuelen; - unsigned int lineno = 0; - EncoderParameter_t param; + std::string line; + std::stringstream ss(str); + size_t valueoffset; + size_t valuelen; + unsigned int lineno = 0; + EncoderParameter_t param; - while(std::getline(ss, line) ) { - lineno++; + while ( std::getline(ss, line) ) { + lineno++; - /* Remove CR if exists */ - if(line.length() >= 1 && line[line.length()-1] == '\r') { - line.erase(line.length()-1); - } + /* Remove CR if exists */ + if ( line.length() >= 1 && line[line.length()-1] == '\r' ) { + line.erase(line.length() - 1); + } - /* Skip comments and empty lines */ - if(line.empty() || line[0] == '#') { - continue; - } + /* Skip comments and empty lines */ + if ( line.empty() || line[0] == '#' ) { + continue; + } - valueoffset = line.find('='); - if(valueoffset == std::string::npos || valueoffset+1 >= line.length() || valueoffset == 0) { - Warning("Failed parsing encoder parameters line %d: Invalid pair", lineno); - continue; - } + valueoffset = line.find('='); + if ( valueoffset == std::string::npos || valueoffset+1 >= line.length() || valueoffset == 0 ) { + Warning("Failed parsing encoder parameters line %d: Invalid pair", lineno); + continue; + } + if ( valueoffset > (sizeof(param.pname) - 1 ) ) { + Warning("Failed parsing encoder parameters line %d: Name too long", lineno); + continue; + } - if(valueoffset > (sizeof(param.pname)-1) ) { - Warning("Failed parsing encoder parameters line %d: Name too long", lineno); - continue; - } + valuelen = line.length() - (valueoffset+1); - valuelen = line.length() - (valueoffset+1); + if ( valuelen > (sizeof(param.pvalue) - 1 ) ) { + Warning("Failed parsing encoder parameters line %d: Value too long", lineno); + continue; + } - if( valuelen > (sizeof(param.pvalue)-1) ) { - Warning("Failed parsing encoder parameters line %d: Value too long", lineno); - continue; - } + /* Copy and NULL terminate */ + line.copy(param.pname, valueoffset, 0); + line.copy(param.pvalue, valuelen, valueoffset+1); + param.pname[valueoffset] = 0; + param.pvalue[valuelen] = 0; - /* Copy and NULL terminate */ - line.copy(param.pname, valueoffset, 0); - line.copy(param.pvalue, valuelen, valueoffset+1); - param.pname[valueoffset] = 0; - param.pvalue[valuelen] = 0; + /* Push to the vector */ + vec->push_back(param); - /* Push to the vector */ - vec->push_back(param); + Debug(7, "Parsed encoder parameter: %s = %s", param.pname, param.pvalue); + } - Debug(7, "Parsed encoder parameter: %s = %s", param.pname, param.pvalue); - } + Debug(7, "Parsed %d lines", lineno); - Debug(7, "Parsed %d lines", lineno); - - return 0; + return 0; } From b5565bb16ad8074598e8f0803e558014fddbfbc9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Jun 2017 09:04:46 -0400 Subject: [PATCH 04/15] fix filters, refreshparent in wrong block --- web/includes/actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/includes/actions.php b/web/includes/actions.php index 4bd811a41..ad9e03ce5 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -176,8 +176,8 @@ if ( !empty($action) ) { } else { Error("No new Id despite new name"); } + $refreshParent = '/index.php?view=filter&Id='.$_REQUEST['Id']; } - $refreshParent = '/index.php?view=filter&Id='.$_REQUEST['Id']; } } // end if canedit events } // end if action == filter From 2460e1acd90e15f8f180255b99923a77d8ffab60 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Jun 2017 09:58:01 -0400 Subject: [PATCH 05/15] fix whitspace --- scripts/ZoneMinder/lib/ZoneMinder/Logger.pm | 127 ++++++++++---------- 1 file changed, 63 insertions(+), 64 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index 8563a95ef..037889e8e 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -41,7 +41,7 @@ our @ISA = qw(Exporter ZoneMinder::Base); # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. our %EXPORT_TAGS = ( - 'constants' => [ qw( + constants => [ qw( DEBUG INFO WARNING @@ -50,7 +50,7 @@ our %EXPORT_TAGS = ( PANIC NOLOG ) ], - 'functions' => [ qw( + functions => [ qw( logInit logReinit logTerm @@ -72,13 +72,14 @@ our %EXPORT_TAGS = ( Panic ) ] ); - push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; - our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); +push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS; - our @EXPORT = qw(); +our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); - our $VERSION = $ZoneMinder::Base::VERSION; +our @EXPORT = qw(); + +our $VERSION = $ZoneMinder::Base::VERSION; # ========================================================================== # @@ -86,43 +87,43 @@ our %EXPORT_TAGS = ( # # ========================================================================== - use ZoneMinder::Config qw(:all); +use ZoneMinder::Config qw(:all); - use DBI; - use Carp; - use POSIX; - use IO::Handle; - use Data::Dumper; - use Time::HiRes qw/gettimeofday/; - use Sys::Syslog; +use DBI; +use Carp; +use POSIX; +use IO::Handle; +use Data::Dumper; +use Time::HiRes qw/gettimeofday/; +use Sys::Syslog; - use constant { - DEBUG => 1, - INFO => 0, - WARNING => -1, - ERROR => -2, - FATAL => -3, - PANIC => -4, - NOLOG => -5 - }; +use constant { + DEBUG => 1, + INFO => 0, + WARNING => -1, + ERROR => -2, + FATAL => -3, + PANIC => -4, + NOLOG => -5 +}; our %codes = ( - &DEBUG => "DBG", - &INFO => "INF", - &WARNING => "WAR", - &ERROR => "ERR", - &FATAL => "FAT", - &PANIC => "PNC", - &NOLOG => "OFF" + &DEBUG => 'DBG', + &INFO => 'INF', + &WARNING => 'WAR', + &ERROR => 'ERR', + &FATAL => 'FAT', + &PANIC => 'PNC', + &NOLOG => 'OFF' ); our %priorities = ( - &DEBUG => "debug", - &INFO => "info", - &WARNING => "warning", - &ERROR => "err", - &FATAL => "err", - &PANIC => "err" + &DEBUG => 'debug', + &INFO => 'info', + &WARNING => 'warning', + &ERROR => 'err', + &FATAL => 'err', + &PANIC => 'err' ); our $logger; @@ -134,10 +135,10 @@ sub new { $this->{initialised} = undef; -#$this->{id} = "zmundef"; +#$this->{id} = 'zmundef'; ( $this->{id} ) = $0 =~ m|^(?:.*/)?([^/]+?)(?:\.[^/.]+)?$|; $this->{idRoot} = $this->{id}; - $this->{idArgs} = ""; + $this->{idArgs} = ''; $this->{level} = INFO; $this->{termLevel} = NOLOG; @@ -151,7 +152,8 @@ sub new { ( $this->{fileName} = $0 ) =~ s|^.*/||; $this->{logPath} = $Config{ZM_PATH_LOGS}; - $this->{logFile} = $this->{logPath}."/".$this->{id}.".log"; + $this->{logFile} = $this->{logPath}.'/'.$this->{id}.".log"; +print "OUr logfile is at $$this{logFile}\n"; $this->{trace} = 0; @@ -196,7 +198,7 @@ sub initialise( @ ) { $this->{logPath} = $options{logPath} if ( defined($options{logPath}) ); my $tempLogFile; - $tempLogFile = $this->{logPath}."/".$this->{id}.".log"; + $tempLogFile = $this->{logPath}.'/'.$this->{id}.".log"; $tempLogFile = $options{logFile} if ( defined($options{logFile}) ); if ( my $logFile = $this->getTargettedEnv('LOG_FILE') ) { $tempLogFile = $logFile; @@ -231,7 +233,6 @@ sub initialise( @ ) { my $level; $tempLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL')) ); - $tempTermLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_TERM')) ); $tempDatabaseLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_DATABASE')) ); $tempFileLevel = $level if ( defined($level = $this->getTargettedEnv('LOG_LEVEL_FILE')) ); @@ -240,9 +241,9 @@ sub initialise( @ ) { if ( $Config{ZM_LOG_DEBUG} ) { foreach my $target ( split( /\|/, $Config{ZM_LOG_DEBUG_TARGET} ) ) { if ( $target eq $this->{id} - || $target eq "_".$this->{id} + || $target eq '_'.$this->{id} || $target eq $this->{idRoot} - || $target eq "_".$this->{idRoot} + || $target eq '_'.$this->{idRoot} || $target eq "" ) { if ( $Config{ZM_LOG_DEBUG_LEVEL} > NOLOG ) { @@ -271,13 +272,13 @@ sub initialise( @ ) { $this->{initialised} = !undef; - Debug( "LogOpts: level=".$codes{$this->{level}} - ."/".$codes{$this->{effectiveLevel}} - .", screen=".$codes{$this->{termLevel}} - .", database=".$codes{$this->{databaseLevel}} - .", logfile=".$codes{$this->{fileLevel}} - ."->".$this->{logFile} - .", syslog=".$codes{$this->{syslogLevel}} + Debug( 'LogOpts: level='.$codes{$this->{level}} + .'/'.$codes{$this->{effectiveLevel}} + .', screen='.$codes{$this->{termLevel}} + .', database='.$codes{$this->{databaseLevel}} + .', logfile='.$codes{$this->{fileLevel}} + .'->'.$this->{logFile} + .', syslog='.$codes{$this->{syslogLevel}} ); } @@ -322,11 +323,11 @@ sub limit { sub getTargettedEnv { my $this = shift; my $name = shift; - my $envName = $name."_".$this->{id}; + my $envName = $name.'_'.$this->{id}; my $value; $value = $ENV{$envName} if ( defined($ENV{$envName}) ); if ( !defined($value) && $this->{id} ne $this->{idRoot} ) { - $envName = $name."_".$this->{idRoot}; + $envName = $name.'_'.$this->{idRoot}; $value = $ENV{$envName} if ( defined($ENV{$envName}) ); } if ( !defined($value) ) { @@ -490,7 +491,7 @@ sub syslogLevel { sub openSyslog { my $this = shift; - openlog( $this->{id}, "pid", "local1" ); + openlog( $this->{id}, 'pid', "local1" ); } sub closeSyslog { @@ -544,10 +545,8 @@ sub logPrint { my ($seconds, $microseconds) = gettimeofday(); my $message = sprintf( - "%s.%06d %s[%d].%s [%s]" - , strftime( "%x %H:%M:%S" - ,localtime( $seconds ) - ) + '%s.%06d %s[%d].%s [%s]' + , strftime( '%x %H:%M:%S' ,localtime( $seconds ) ) , $microseconds , $this->{id} , $$ @@ -564,7 +563,7 @@ sub logPrint { } print( $LOGFILE $message ) if ( $level <= $this->{fileLevel} ); if ( $level <= $this->{databaseLevel} ) { - my $sql = "insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )"; + my $sql = 'insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )'; $this->{sth} = $this->{dbh}->prepare_cached( $sql ); if ( !$this->{sth} ) { $this->{databaseLevel} = NOLOG; @@ -589,7 +588,7 @@ sub logPrint { sub logInit( ;@ ) { my %options = @_ ? @_ : (); - $logger = ZoneMinder::Logger->new() if ( !$logger ); + $logger = ZoneMinder::Logger->new() if !$logger; $logger->initialise( %options ); } @@ -646,14 +645,14 @@ sub logSyslogLevel { sub Mark { my $level = shift; $level = DEBUG unless( defined($level) ); - my $tag = "Mark"; + my $tag = 'Mark'; fetch()->logPrint( $level, $tag ); } sub Dump { my $var = shift; my $label = shift; - $label = "VAR" unless( defined($label) ); + $label = 'VAR' unless( defined($label) ); fetch()->logPrint( DEBUG, Data::Dumper->Dump( [ $var ], [ $label ] ) ); } @@ -695,10 +694,10 @@ ZoneMinder::Logger - ZoneMinder Logger module use ZoneMinder::Logger; use ZoneMinder::Logger qw(:all); -logInit( "myproc", DEBUG ); +logInit( 'myproc', DEBUG ); -Debug( "This is what is happening" ); -Info( "Something interesting is happening" ); +Debug( 'This is what is happening' ); +Info( 'Something interesting is happening' ); Warning( "Something might be going wrong." ); Error( "Something has gone wrong!!" ); Fatal( "Something has gone badly wrong, gotta stop!!" ); From 3a00656c3fea906bbc12322173cde9fbbccde9ec Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Jun 2017 09:58:19 -0400 Subject: [PATCH 06/15] WHen can't open file log, turn on terminal logging so that the message goes somewhere useful. --- scripts/ZoneMinder/lib/ZoneMinder/Logger.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index 037889e8e..df656d530 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -524,6 +524,7 @@ sub openFile { } } else { $this->fileLevel( NOLOG ); + $this->termLevel( INFO ); Error( "Can't open log file '".$this->{logFile}."': $!" ); } } From 25b66e9629be7623845a34c6ba825aeae638c421 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Jun 2017 09:58:54 -0400 Subject: [PATCH 07/15] whitespace mostly. --- scripts/zmvideo.pl.in | 174 +++++++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 88 deletions(-) diff --git a/scripts/zmvideo.pl.in b/scripts/zmvideo.pl.in index 5f71451a3..ab9d0b347 100644 --- a/scripts/zmvideo.pl.in +++ b/scripts/zmvideo.pl.in @@ -94,20 +94,11 @@ my $size = ''; my $overwrite = 0; my $version = 0; -my @formats = split( /\s+/, $Config{ZM_FFMPEG_FORMATS} ); -for ( my $i = 0; $i < @formats; $i++ ) -{ - if ( $i =~ /^(.+)\*$/ ) - { - $format = $formats[$i] = $1; - } -} - GetOptions( - 'concat|c:s' =>\$concat_name, + 'concat|c:s' =>\$concat_name, 'event|e=i' =>\$event_id, 'filter_name=s' =>\$filter_name, - 'filter_id=i' =>\$filter_id, + 'filter_id=i' =>\$filter_id, 'format|f=s' =>\$format, 'rate|r=f' =>\$rate, 'scale|s=f' =>\$scale, @@ -115,51 +106,51 @@ GetOptions( 'size|S=s' =>\$size, 'overwrite' =>\$overwrite, 'version' =>\$version -) or pod2usage(-exitstatus => -1); + ) or pod2usage(-exitstatus => -1); if ( $version ) { - print ZoneMinder::Base::ZM_VERSION . "\n"; - exit(0); + print ZoneMinder::Base::ZM_VERSION . "\n"; + exit(0); } -if ( !( $filter_id or $filter_name or $event_id ) || $event_id < 0 ) -{ - print( STDERR "Please give a valid event id or filter name\n" ); - pod2usage(-exitstatus => -1); +if ( !( $filter_id or $filter_name or $event_id ) || ($event_id and ( $event_id < 0 ) ) ) { + print( STDERR "Please give a valid event id or filter name\n" ); + pod2usage(-exitstatus => -1); } -if ( ! $Config{ZM_OPT_FFMPEG} ) -{ - print( STDERR "Mpeg encoding is not currently enabled\n" ); - exit(-1); +if ( ! $Config{ZM_OPT_FFMPEG} ) { + print( STDERR "Mpeg encoding is not currently enabled\n" ); + exit(-1); } -if ( !$rate && !$fps ) -{ - $rate = 1; +my @formats = split( /\s+/, $Config{ZM_FFMPEG_FORMATS} ); +for ( my $i = 0; $i < @formats; $i++ ) { + if ( $i =~ /^(.+)\*$/ ) { + $format = $formats[$i] = $1; + } } -if ( !$scale && !$size ) -{ - $scale = 1; +if ( !$rate && !$fps ) { + $rate = 1; } -if ( $rate && ($rate < 0.25 || $rate > 100) ) -{ - print( STDERR "Rate is out of range, 0.25 >= rate <= 100\n" ); - pod2usage(-exitstatus => -1); +if ( !$scale && !$size ) { + $scale = 1; } -if ( $scale && ($scale < 0.25 || $scale > 4) ) -{ - print( STDERR "Scale is out of range, 0.25 >= scale <= 4\n" ); - pod2usage(-exitstatus => -1); +if ( $rate && ($rate < 0.25 || $rate > 100) ) { + print( STDERR "Rate is out of range, 0.25 >= rate <= 100\n" ); + pod2usage(-exitstatus => -1); } -if ( $fps && ($fps > 30) ) -{ - print( STDERR "FPS is out of range, <= 30\n" ); - pod2usage(-exitstatus => -1); +if ( $scale && ($scale < 0.25 || $scale > 4) ) { + print( STDERR "Scale is out of range, 0.25 >= scale <= 4\n" ); + pod2usage(-exitstatus => -1); +} + +if ( $fps && ($fps > 30) ) { + print( STDERR "FPS is out of range, <= 30\n" ); + pod2usage(-exitstatus => -1); } my ( $detaint_format ) = $format =~ /^(\w+)$/; @@ -181,19 +172,25 @@ my $cwd = getcwd; my $video_name; my @event_ids; if ( $event_id ) { - @event_ids = ( $event_id ); - + @event_ids = ( $event_id ); + } elsif ( $filter_name or $filter_id ) { - my $Filter = ZoneMinder::Filter->find_one( - ($filter_name ? ( Name => $filter_name ) : () ), - ($filter_id ? ( Id => $filter_name ) : () ), - ); - if ( ! $Filter ) { - Fatal("Filter $filter_name $filter_id not found."); - } - @event_ids = map { $_->{Id} }$Filter->Execute(); - Fatal( "No events found for $filter_name") if ! @event_ids; - $concat_name = $filter_name if $concat_name eq ''; + my $Filter = ZoneMinder::Filter->find_one( + ($filter_name ? ( Name => $filter_name ) : () ), + ($filter_id ? ( Id => $filter_name ) : () ), + ); + if ( ! $Filter ) { + Fatal("Filter $filter_name $filter_id not found."); + } + @event_ids = map { $_->{Id} } $Filter->Execute(); + if ( ! @event_ids ) { + Fatal( "No events found for $filter_name") + } else { + Debug(@event_ids . " events found for $filter_name"); + } + $concat_name = $filter_name if $concat_name eq ''; +} else { + Warning("Nothing to do"); } my $sql = " SELECT max(F.Delta)-min(F.Delta) as FullLength, @@ -207,53 +204,54 @@ my $sql = " SELECT max(F.Delta)-min(F.Delta) as FullLength, INNER JOIN Events as E on F.EventId = E.Id INNER JOIN Monitors as M on E.MonitorId = M.Id WHERE EventId = ? - GROUP BY F.EventId" - ; + GROUP BY F.EventId"; my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); my @video_files; foreach my $event_id ( @event_ids ) { + my $res = $sth->execute( $event_id ) + or Fatal( "Can't execute: ".$sth->errstr() ); + my $event = $sth->fetchrow_hashref(); - my $res = $sth->execute( $event_id ) - or Fatal( "Can't execute: ".$sth->errstr() ); - my $event = $sth->fetchrow_hashref(); - - my $Event = new ZoneMinder::Event( $$event{Id}, $event ); - my $video_file = $Event->GenerateVideo( $rate, $fps, $scale, $size, $overwrite, $format ); - if ( $video_file ) { - push @video_files, $video_file; - print( STDOUT $video_file."\n" ); - } + my $Event = new ZoneMinder::Event( $$event{Id}, $event ); + my $video_file = $Event->GenerateVideo( $rate, $fps, $scale, $size, $overwrite, $format ); + if ( $video_file ) { + push @video_files, $video_file; + print( STDOUT $video_file."\n" ); + } else { + Warning("No video file generated for event $event_id"); + } } # end foreach event_id if ( $concat_name ) { - ($cwd) = $cwd =~ /(.*)/; # detaint - chdir( $cwd ); - ($concat_name ) = $concat_name =~ /([\-A-Za-z0-9_\.]*)/; - my $concat_list_file = "/tmp/$concat_name.concat.lst"; + ($cwd) = $cwd =~ /(.*)/; # detaint + chdir( $cwd ); + ($concat_name ) = $concat_name =~ /([\-A-Za-z0-9_\.]*)/; + my $concat_list_file = "/tmp/$concat_name.concat.lst"; - my $video_file = $concat_name . '.'. $detaint_format; + my $video_file = $concat_name . '.'. $detaint_format; - open( my $fd, '>', $concat_list_file ) or die "Can't open $concat_list_file: $!"; - foreach ( @video_files ) { - print $fd "file '$_'\n"; - } - close $fd; - my $command = $Config{ZM_PATH_FFMPEG} - . " -f concat -i $concat_list_file -c copy " - ." '$video_file' > ffmpeg.log 2>&1" - ; - Debug( $command."\n" ); - my $output = qx($command); + open( my $fd, '>', $concat_list_file ) or die "Can't open $concat_list_file: $!"; + foreach ( @video_files ) { + print $fd "file '$_'\n"; + } + close $fd; + my $command = $Config{ZM_PATH_FFMPEG} + . " -f concat -i $concat_list_file -c copy " + ." '$video_file' > ffmpeg.log 2>&1" + ; + Debug( $command."\n" ); + my $output = qx($command); - my $status = $? >> 8; + my $status = $? >> 8; - unlink $concat_list_file; - if ( $status ) - { - Error( "Unable to generate video, check /ffmpeg.log for details"); - exit(-1); - } - print( STDOUT $video_file."\n" ); + unlink $concat_list_file; + if ( $status ) { + Error( "Unable to generate video, check /ffmpeg.log for details"); + exit(-1); + } + print( STDOUT $video_file."\n" ); } exit( 0 ); + +__END__ From 12c3bde8b0b1eacb89dc851877cac823dfa08420 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Jun 2017 10:04:50 -0400 Subject: [PATCH 08/15] remove debug --- scripts/ZoneMinder/lib/ZoneMinder/Logger.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index df656d530..ee1022263 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -153,7 +153,6 @@ sub new { ( $this->{fileName} = $0 ) =~ s|^.*/||; $this->{logPath} = $Config{ZM_PATH_LOGS}; $this->{logFile} = $this->{logPath}.'/'.$this->{id}.".log"; -print "OUr logfile is at $$this{logFile}\n"; $this->{trace} = 0; From d97d156efb245d0099149f1316d4033887bfb57e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 26 Jun 2017 11:48:26 -0400 Subject: [PATCH 09/15] Don't do csrf for view_video --- web/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/index.php b/web/index.php index c2b17c061..987a92815 100644 --- a/web/index.php +++ b/web/index.php @@ -177,7 +177,7 @@ isset($view) || $view = NULL; isset($request) || $request = NULL; isset($action) || $action = NULL; -if ( ZM_ENABLE_CSRF_MAGIC && $action != 'login' ) { +if ( ZM_ENABLE_CSRF_MAGIC && $action != 'login' && $action != 'view_video' ) { Logger::Debug("Calling csrf_check with the following values: \$request = \"$request\", \$view = \"$view\", \$action = \"$action\""); csrf_check(); } From 6db9a78dab665daf778e59d3a97ee5537461f3b4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 26 Jun 2017 12:17:49 -0400 Subject: [PATCH 10/15] add compressing options to the sample logrotate config --- misc/logrotate.conf.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/logrotate.conf.in b/misc/logrotate.conf.in index 664b206c3..7c3810f02 100644 --- a/misc/logrotate.conf.in +++ b/misc/logrotate.conf.in @@ -11,6 +11,8 @@ @ZM_LOGDIR@/*.log { missingok notifempty + delaycompress + compress sharedscripts postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true From c1b8105c0ebe46514517b41a93a0908eddd3cacc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 26 Jun 2017 14:23:54 -0400 Subject: [PATCH 11/15] only include csrf if it's going to be used. This fixes view_video using up all ram sending a video file --- web/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/index.php b/web/index.php index 987a92815..0b0c4f45e 100644 --- a/web/index.php +++ b/web/index.php @@ -149,7 +149,6 @@ else require_once( 'includes/lang.php' ); require_once( 'includes/functions.php' ); -require_once( 'includes/csrf/csrf-magic.php' ); # Add Cross domain access headers CORSHeaders(); @@ -178,6 +177,7 @@ isset($request) || $request = NULL; isset($action) || $action = NULL; if ( ZM_ENABLE_CSRF_MAGIC && $action != 'login' && $action != 'view_video' ) { + require_once( 'includes/csrf/csrf-magic.php' ); Logger::Debug("Calling csrf_check with the following values: \$request = \"$request\", \$view = \"$view\", \$action = \"$action\""); csrf_check(); } From 043b382bddb8a6724c2ae1de93bcb004f33d7571 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 26 Jun 2017 13:44:33 -0500 Subject: [PATCH 12/15] include conf.d folder contents in debian packaging (#1934) --- distros/debian/install | 1 + distros/ubuntu1204/zoneminder.install | 1 + distros/ubuntu1504_cmake_split_packages/zoneminder-core.install | 1 + distros/ubuntu1604/zoneminder.install | 1 + 4 files changed, 4 insertions(+) diff --git a/distros/debian/install b/distros/debian/install index 97c5f7a03..337673313 100644 --- a/distros/debian/install +++ b/distros/debian/install @@ -6,3 +6,4 @@ usr/share/perl5/ZoneMinder.pm usr/share/zoneminder/db usr/share/zoneminder/www etc/zm +etc/zm/conf.d/* diff --git a/distros/ubuntu1204/zoneminder.install b/distros/ubuntu1204/zoneminder.install index 8a26777c0..67b135de5 100644 --- a/distros/ubuntu1204/zoneminder.install +++ b/distros/ubuntu1204/zoneminder.install @@ -1,4 +1,5 @@ etc/zm/zm.conf +etc/zm/conf.d/* usr/bin usr/lib/zoneminder usr/share/polkit-1 diff --git a/distros/ubuntu1504_cmake_split_packages/zoneminder-core.install b/distros/ubuntu1504_cmake_split_packages/zoneminder-core.install index bd0a03bc2..4fdac1082 100644 --- a/distros/ubuntu1504_cmake_split_packages/zoneminder-core.install +++ b/distros/ubuntu1504_cmake_split_packages/zoneminder-core.install @@ -1,4 +1,5 @@ etc/zm +etc/zm/conf.d/* usr/bin usr/share/polkit-1/actions usr/share/polkit-1/rules.d diff --git a/distros/ubuntu1604/zoneminder.install b/distros/ubuntu1604/zoneminder.install index 8a26777c0..67b135de5 100644 --- a/distros/ubuntu1604/zoneminder.install +++ b/distros/ubuntu1604/zoneminder.install @@ -1,4 +1,5 @@ etc/zm/zm.conf +etc/zm/conf.d/* usr/bin usr/lib/zoneminder usr/share/polkit-1 From ed4da1e8bcc1fb23dda6a4f113d3224139f3b557 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 28 Jun 2017 14:27:09 -0400 Subject: [PATCH 13/15] change to single quotes --- web/skins/classic/includes/config.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/skins/classic/includes/config.php b/web/skins/classic/includes/config.php index c716e89f2..462403dec 100644 --- a/web/skins/classic/includes/config.php +++ b/web/skins/classic/includes/config.php @@ -26,8 +26,8 @@ $rates = array( '400' => '4x', '200' => '2x', '100' => translate('Real'), - '50' => "1/2x", - '25' => "1/4x", + '50' => '1/2x', + '25' => '1/4x', ); $scales = array( @@ -35,13 +35,13 @@ $scales = array( '400' => '4x', '300' => '3x', '200' => '2x', - '150' => "1.5x", + '150' => '1.5x', '100' => translate('Actual'), - '75' => "3/4x", - '50' => "1/2x", - '33' => "1/3x", - '25' => "1/4x", - "12.5" => "1/8x", + '75' => '3/4x', + '50' => '1/2x', + '33' => '1/3x', + '25' => '1/4x', + '12.5' => '1/8x', ); $bwArray = array( From 8b1459a510859e48aa56ad5e733a8cdf638a1b7b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 28 Jun 2017 15:17:55 -0400 Subject: [PATCH 14/15] fixes for cambozola on ie, and fixes to setting fixed widths --- web/includes/functions.php | 52 ++++++++----- web/skins/classic/views/js/montage.js | 106 +++++++++++++++----------- web/skins/classic/views/montage.php | 12 ++- 3 files changed, 100 insertions(+), 70 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index b293ea5b8..2f2f43b07 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -379,7 +379,7 @@ function outputHelperStream( $id, $src, $width, $height, $title='' ) { echo getHelperStream( $id, $src, $width, $height, $title ); } function getHelperStream( $id, $src, $width, $height, $title='' ) { - return ' - '; + '; } function outputImageStill( $id, $src, $width, $height, $title='' ) { echo getImageStill( $id, $src, $width, $height, $title='' ); } function getImageStill( $id, $src, $width, $height, $title='' ) { - return ''.$title.''; + return ''.$title.''; } function outputControlStill( $src, $width, $height, $monitor, $scale, $target ) { @@ -543,6 +543,7 @@ function makePopupButton( $url, $winName, $winSize, $buttonValue, $condition=1, } function htmlSelect( $name, $contents, $values, $behaviours=false ) { +Logger::Debug("htmlSelect for $name $values"); $behaviourText = ''; if ( !empty($behaviours) ) { @@ -558,6 +559,7 @@ function htmlSelect( $name, $contents, $values, $behaviours=false ) { $html = "'; @@ -2126,9 +2128,24 @@ function validHtmlStr( $input ) { function getStreamHTML( $monitor, $options = array() ) { - if ( isset($options['scale']) and $options['scale'] ) { + if ( isset($options['scale']) and $options['scale'] and ( $options['scale'] != 100 ) ) { $options['width'] = reScale( $monitor->Width(), $options['scale'] ); $options['height'] = reScale( $monitor->Height(), $options['scale'] ); + } else { + if ( ! isset( $options['width'] ) ) { + if ( $options['width'] == 100 ) { + $options['width'] = $monitor->Width(); + } else { + $options['width'] = NULL; + } + } + if ( ! isset( $options['height'] ) ) { + if ( $options['height'] == 100 ) { + $options['height'] = $monitor->Height(); + } else { + $options['height'] = NULL; + } + } } if ( ! isset($options['mode'] ) ) { $options['mode'] = 'stream'; @@ -2146,27 +2163,20 @@ function getStreamHTML( $monitor, $options = array() ) { $streamSrc = $monitor->getStreamSrc( $options ); if ( canStreamNative() ) - return getImageStream( 'liveStream'.$monitor->Id(), $streamSrc, - ( isset($options['width']) ? $options['width'] : NULL ), - ( isset($options['height']) ? $options['height'] : NULL ), - $monitor->Name() - ); + return getImageStream( 'liveStream'.$monitor->Id(), $streamSrc, $options['width'], $options['height'], $monitor->Name()); elseif ( canStreamApplet() ) - return getHelperStream( 'liveStream'.$monitor->Id(), $streamSrc, - ( isset($options['width']) ? $options['width'] : NULL ), - ( isset($options['height']) ? $options['height'] : NULL ), - $monitor->Name() - ); + // Helper, empty widths and heights really don't work. + return getHelperStream( 'liveStream'.$monitor->Id(), $streamSrc, + $options['width'] ? $options['width'] : $monitor->Width(), + $options['height'] ? $options['height'] : $monitor->Height(), + $monitor->Name()); } else { - $streamSrc = $monitor->getStreamSrc( $options ); - if ( $mode == 'stream' ) { + if ( $options['mode'] == 'stream' ) { Info( 'The system has fallen back to single jpeg mode for streaming. Consider enabling Cambozola or upgrading the client browser.' ); } - return getImageStill( 'liveStream'.$monitor->Id(), $streamSrc, - ( isset($options['width']) ? $options['width'] : NULL ), - ( isset($options['height']) ? $options['height'] : NULL ), - $monitor->Name() - ); + $options['mode'] = 'single'; + $streamSrc = $monitor->getStreamSrc( $options ); + return getImageStill( 'liveStream'.$monitor->Id(), $streamSrc, $options['width'], $options['height'], $monitor->Name()); } } // end function getStreamHTML diff --git a/web/skins/classic/views/js/montage.js b/web/skins/classic/views/js/montage.js index b006a0e39..1366e1511 100644 --- a/web/skins/classic/views/js/montage.js +++ b/web/skins/classic/views/js/montage.js @@ -106,31 +106,38 @@ function Monitor( monitorData ) { } function selectLayout( element ) { - var cssFile = skinPath+'/css/'+Cookie.read('zmCSS')+'/views/'+$(element).get('value'); + layout = $(element).get('value') + var cssFile = skinPath+'/css/'+Cookie.read('zmCSS')+'/views/'+layout; if ( $('dynamicStyles') ) $('dynamicStyles').destroy(); new Asset.css( cssFile, { id: 'dynamicStyles' } ); - Cookie.write( 'zmMontageLayout', $(element).get('value'), { duration: 10*365 } ); - Cookie.write( 'zmMontageScale', '', { duration: 10*365 } ); - $('scale').set('value', '' ); - $('width').set('value', ''); + Cookie.write( 'zmMontageLayout', layout, { duration: 10*365 } ); + if ( layout != 'montage_freeform.css' ) { + Cookie.write( 'zmMontageScale', '', { duration: 10*365 } ); + $('scale').set('value', '' ); + $('width').set('value', ''); - for ( var x = 0; x < monitors.length; x++ ) { - var monitor = monitors[x]; - var streamImg = document.getElementById( 'liveStream'+monitor.id ); - if ( streamImg ) { - var src = streamImg.src; - streamImg.src=''; - src = src.replace(/width=[\.\d]+/i,'width=0' ); - src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); - streamImg.src = src; - streamImg.style.width = ''; - } - var zonesSVG = $('zones'+monitor.id); - if ( zonesSVG ) { - zonesSVG.style.width = ''; - } - } // end foreach monitor + for ( var x = 0; x < monitors.length; x++ ) { + var monitor = monitors[x]; + var streamImg = $( 'liveStream'+monitor.id ); + if ( streamImg ) { + if ( streamImg.nodeName == 'IMG' ) { + var src = streamImg.src; + streamImg.src=''; + src = src.replace(/width=[\.\d]+/i,'width=0' ); + src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); + streamImg.src = src; + } else if ( streamImg.nodeName == 'APPLET' || streamImg.nodeName == 'OBJECT' ) { + // APPLET's and OBJECTS need to be re-initialized + } + streamImg.style.width = ''; + } + var zonesSVG = $('zones'+monitor.id); + if ( zonesSVG ) { + zonesSVG.style.width = ''; + } + } // end foreach monitor + } } function changeWidth() { @@ -139,20 +146,23 @@ function changeWidth() { for ( var x = 0; x < monitors.length; x++ ) { var monitor = monitors[x]; /*Stream could be an applet so can't use moo tools*/ - var streamImg = document.getElementById( 'liveStream'+monitor.id ); + var streamImg = $( 'liveStream'+monitor.id ); if ( streamImg ) { - var src = streamImg.src; - streamImg.src=''; - src = src.replace(/width=[\.\d]+/i,'width='+width ); - src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); - streamImg.src = src; + if ( streamImg.nodeName == 'IMG' ) { + var src = streamImg.src; + streamImg.src=''; + src = src.replace(/width=[\.\d]+/i,'width='+width ); + src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); + streamImg.src = src; - streamImg.style.width = width + "px"; - streamImg.style.height = ''; + } + streamImg.style.width = width? width + "px" : null; + //streamImg.style.height = ''; } var zonesSVG = $('zones'+monitor.id); if ( zonesSVG ) { - zonesSVG.style.width = newWidth + "px"; + + zonesSVG.style.width = width ? width + "px" : '100%'; } } $('scale').set('value', '' ); @@ -166,18 +176,20 @@ function changeHeight() { for ( var x = 0; x < monitors.length; x++ ) { var monitor = monitors[x]; /*Stream could be an applet so can't use moo tools*/ - var streamImg = document.getElementById( 'liveStream'+monitor.id ); + var streamImg = $( 'liveStream'+monitor.id ); if ( streamImg ) { - var src = streamImg.src; - streamImg.src=''; - src = src.replace(/height=[\.\d]+/i,'height='+height ); - src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); - streamImg.src = src; - streamImg.style.height = height + "px"; + if ( streamImg.nodeName == 'IMG' ) { + var src = streamImg.src; + streamImg.src=''; + src = src.replace(/height=[\.\d]+/i,'height='+height ); + src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); + streamImg.src = src; + streamImg.style.height = height ? height + "px" : null; + } } var zonesSVG = $('zones'+monitor.id); if ( zonesSVG ) { - zonesSVG.style.height = newHeight + "px"; + zonesSVG.style.height = height + "px"; } } $('scale').set('value', '' ); @@ -195,16 +207,18 @@ function changeScale() { /*Stream could be an applet so can't use moo tools*/ var streamImg = document.getElementById( 'liveStream'+monitor.id ); if ( streamImg ) { - var src = streamImg.src; - streamImg.src=''; + if ( streamImg.nodeName == 'IMG' ) { + var src = streamImg.src; + streamImg.src=''; + //src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); + src = src.replace(/scale=[\.\d]+/i,'scale='+ scale ); + src = src.replace(/width=[\.\d]+/i,'width='+newWidth ); + src = src.replace(/height=[\.\d]+/i,'height='+newHeight ); + streamImg.src = src; + } streamImg.style.width = newWidth + "px"; streamImg.style.height = newHeight + "px"; - //src = src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) )); - src = src.replace(/scale=[\.\d]+/i,'scale='+ scale ); - src = src.replace(/width=[\.\d]+/i,'width='+newWidth ); - src = src.replace(/height=[\.\d]+/i,'height='+newHeight ); - streamImg.src = src; } var zonesSVG = $('zones'+monitor.id); if ( zonesSVG ) { @@ -227,7 +241,7 @@ function initPage() { var delay = Math.round( (Math.random()+0.5)*statusRefreshTimeout ); monitors[i].start( delay ); } - selectLayout( $('layout') ); + selectLayout($('layout')); } // Kick everything off diff --git a/web/skins/classic/views/montage.php b/web/skins/classic/views/montage.php index 49de52c8f..9ed88ed6e 100644 --- a/web/skins/classic/views/montage.php +++ b/web/skins/classic/views/montage.php @@ -55,12 +55,17 @@ $heights = array( 480 => 480, ); -$width_scale = $height_scale = $scale = null; +$scale = '100'; # actual -if ( isset( $_REQUEST['scale'] ) ) +if ( isset( $_REQUEST['scale'] ) ) { $scale = validInt($_REQUEST['scale']); -else if ( isset( $_COOKIE['zmMontageScale'] ) ) + Logger::Debug("Setting scale from request to $scale"); +} else if ( isset( $_COOKIE['zmMontageScale'] ) ) { $scale = $_COOKIE['zmMontageScale']; + Logger::Debug("Setting scale from cookie to $scale"); +} else { + Logger::Debug("scale is $scale"); +} foreach( dbFetchAll( $sql ) as $row ) { if ( !visibleMonitor( $row['Id'] ) ) { @@ -92,6 +97,7 @@ $layouts = array( 'montage_3wide50enlarge.css' => translate('Mtg3widgrx'), ); +$layout = ''; if ( isset($_COOKIE['zmMontageLayout']) ) $layout = $_COOKIE['zmMontageLayout']; From 621d2e0e4180d0359ce7995646c3a49f3f3b04ce Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 28 Jun 2017 15:18:12 -0400 Subject: [PATCH 15/15] remove debug code --- web/includes/functions.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 2f2f43b07..58fda1d13 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -543,7 +543,6 @@ function makePopupButton( $url, $winName, $winSize, $buttonValue, $condition=1, } function htmlSelect( $name, $contents, $values, $behaviours=false ) { -Logger::Debug("htmlSelect for $name $values"); $behaviourText = ''; if ( !empty($behaviours) ) { @@ -559,7 +558,6 @@ Logger::Debug("htmlSelect for $name $values"); $html = "';