4.2.1
This commit is contained in:
Mr-Dave
2018-12-09 10:48:12 -07:00
committed by GitHub
16 changed files with 1023 additions and 778 deletions

View File

@@ -1,3 +1,21 @@
Summary of changes for version 4.2.1 are below
* Update version number to 4.2.1 / Changelog
* Report to log options included in build
* Add log messages on database actions(tosiara)
* Revise log messages of port used for stream
* Revise log messages when using v4l2 via netcam
* Fix null terminator on EXIF of jpgs(tosiara)
* Fix build with static libs for webp(Fabrice)
* Guide update for initial setup.
* Prevent webcontrol update of movie_passthrough
* Remove confusing log message
* Fix motion detection when using privacy mask
* Correct thread locking for movie_passthrough
* Revise guide for better mobile viewing
* Revise additional stream timing
* Fix stream timing(adameat)
* Remove obsolete function reference
* Change version number to 4.2+git
Summary of Changes for version 4.2 are below
* html fixes for legacy interface
* Fix typo in guide
@@ -89,7 +107,7 @@ Summary of Changes for version 4.2 are below
* Revise %{host} and add %{ver} (tosiara)
* Update for passthrough processing of cameras
* Updated motion_guide.html
* Revise webcontrol page to indicate the webcontrol_parms selection
* Revise webcontrol page to indicate the webcontrol_parms selection
* Validate v4l2 parms when using v4l2 via netcam
* Capture images at start to prevent immediate events
* Initialize thread number to eliminate inaccurate log notice.
@@ -101,7 +119,7 @@ Summary of Changes for version 4.2 are below
* Include EXIF for webp images.
* Report to log when user specifies invalid URL.
* Update guide that is installed locally.
* Updated version script to include date and dirty vs clean.
* Updated version script to include date and dirty vs clean.
Version 4.1.1 Changes Below
* Fix file name for debug movies
* Fix image saving when using highres option

4
alg.c
View File

@@ -1327,7 +1327,7 @@ void alg_update_reference_frame(struct context *cnt, int action)
int accept_timer = cnt->lastrate * ACCEPT_STATIC_OBJECT_TIME;
int i, threshold_ref;
int *ref_dyn = cnt->imgs.ref_dyn;
unsigned char *image_virgin = cnt->imgs.image_virgin.image_norm;
unsigned char *image_virgin = cnt->imgs.image_vprvcy.image_norm;
unsigned char *ref = cnt->imgs.ref;
unsigned char *smartmask = cnt->imgs.smartmask_final;
unsigned char *out = cnt->imgs.img_motion.image_norm;
@@ -1367,7 +1367,7 @@ void alg_update_reference_frame(struct context *cnt, int action)
} else { /* action == RESET_REF_FRAME - also used to initialize the frame at startup. */
/* Copy fresh image */
memcpy(cnt->imgs.ref, cnt->imgs.image_virgin.image_norm, cnt->imgs.size_norm);
memcpy(cnt->imgs.ref, cnt->imgs.image_vprvcy.image_norm, cnt->imgs.size_norm);
/* Reset static objects */
memset(cnt->imgs.ref_dyn, 0, cnt->imgs.motionsize * sizeof(*cnt->imgs.ref_dyn));
}

View File

@@ -276,7 +276,7 @@ if test "${WEBP}" = "yes"; then
AC_MSG_RESULT(found)
AC_DEFINE([HAVE_WEBP], 1, [Define to 1 if WEBP is around])
HAVE_WEBP="yes"
TEMP_LIBS="$TEMP_LIBS -lwebp -lwebpmux"
TEMP_LIBS="$TEMP_LIBS -lwebpmux -lwebp"
else
AC_MSG_RESULT(not found)
fi

View File

@@ -159,11 +159,13 @@ static void do_sql_query(char *sqlquery, struct context *cnt, int save_id)
if (strlen(sqlquery) <= 0) {
/* don't try to execute empty queries */
MOTION_LOG(WRN, TYPE_DB, NO_ERRNO, "Ignoring empty sql query");
return;
}
#ifdef HAVE_MYSQL
if (!strcmp(cnt->conf.database_type, "mysql")) {
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO, "Executing mysql query");
if (mysql_query(cnt->database, sqlquery) != 0) {
int error_code = mysql_errno(cnt->database);
@@ -209,6 +211,7 @@ static void do_sql_query(char *sqlquery, struct context *cnt, int save_id)
#ifdef HAVE_PGSQL
if (!strcmp(cnt->conf.database_type, "postgresql")) {
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO, "Executing postgresql query");
PGresult *res;
res = PQexec(cnt->database_pg, sqlquery);
@@ -250,6 +253,7 @@ static void do_sql_query(char *sqlquery, struct context *cnt, int save_id)
if ((!strcmp(cnt->conf.database_type, "sqlite3")) && (cnt->conf.database_dbname)) {
int res;
char *errmsg = 0;
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO, "Executing sqlite query");
res = sqlite3_exec(cnt->database_sqlite3, sqlquery, NULL, 0, &errmsg);
if (res != SQLITE_OK ) {
MOTION_LOG(ERR, TYPE_DB, NO_ERRNO, _("SQLite error was %s"), errmsg);
@@ -672,7 +676,7 @@ static void event_image_preview(struct context *cnt,
* Save best preview-shot also when no movies are recorded or imagepath
* is used. Filename has to be generated - nothing available to reuse!
*/
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, "different filename or picture only!");
/*
* conf.picture_filename would normally be defined but if someone deleted it by
* control interface it is better to revert to the default than fail.

View File

@@ -1234,6 +1234,7 @@ static int motion_init(struct context *cnt)
cnt->imgs.width_high = 0;
cnt->imgs.height_high = 0;
cnt->imgs.size_high = 0;
cnt->movie_passthrough = cnt->conf.movie_passthrough;
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO
,_("Camera %d started: motion detection %s"),
@@ -1245,9 +1246,9 @@ static int motion_init(struct context *cnt)
if (init_camera_type(cnt) != 0 ) return -3;
if ((cnt->camera_type != CAMERA_TYPE_RTSP) &&
(cnt->conf.movie_passthrough)) {
(cnt->movie_passthrough)) {
MOTION_LOG(WRN, TYPE_ALL, NO_ERRNO,_("Pass-through processing disabled."));
cnt->conf.movie_passthrough = 0;
cnt->movie_passthrough = FALSE;
}
if ((cnt->conf.height == 0) || (cnt->conf.width == 0)) {
@@ -1327,6 +1328,7 @@ static int motion_init(struct context *cnt)
/* contains the moving objects of ref. frame */
cnt->imgs.ref_dyn = mymalloc(cnt->imgs.motionsize * sizeof(*cnt->imgs.ref_dyn));
cnt->imgs.image_virgin.image_norm = mymalloc(cnt->imgs.size_norm);
cnt->imgs.image_vprvcy.image_norm = mymalloc(cnt->imgs.size_norm);
cnt->imgs.smartmask = mymalloc(cnt->imgs.motionsize);
cnt->imgs.smartmask_final = mymalloc(cnt->imgs.motionsize);
cnt->imgs.smartmask_buffer = mymalloc(cnt->imgs.motionsize * sizeof(*cnt->imgs.smartmask_buffer));
@@ -1625,6 +1627,9 @@ static void motion_cleanup(struct context *cnt) {
free(cnt->imgs.image_virgin.image_norm);
cnt->imgs.image_virgin.image_norm = NULL;
free(cnt->imgs.image_vprvcy.image_norm);
cnt->imgs.image_vprvcy.image_norm = NULL;
free(cnt->imgs.labels);
cnt->imgs.labels = NULL;
@@ -2048,6 +2053,8 @@ static int mlp_capture(struct context *cnt){
mlp_mask_privacy(cnt);
memcpy(cnt->imgs.image_vprvcy.image_norm, cnt->current_image->image_norm, cnt->imgs.size_norm);
/*
* If the camera is a netcam we let the camera decide the pace.
* Otherwise we will keep on adding duplicate frames.
@@ -2121,7 +2128,7 @@ static int mlp_capture(struct context *cnt){
if (cnt->video_dev >= 0 &&
cnt->missing_frame_counter < (MISSING_FRAMES_TIMEOUT * cnt->conf.framerate)) {
memcpy(cnt->current_image->image_norm, cnt->imgs.image_virgin.image_norm, cnt->imgs.size_norm);
memcpy(cnt->current_image->image_norm, cnt->imgs.image_vprvcy.image_norm, cnt->imgs.size_norm);
} else {
cnt->lost_connection = 1;
@@ -2185,9 +2192,9 @@ static void mlp_detection(struct context *cnt){
* anyway
*/
if (cnt->detecting_motion || cnt->conf.setup_mode)
cnt->current_image->diffs = alg_diff_standard(cnt, cnt->imgs.image_virgin.image_norm);
cnt->current_image->diffs = alg_diff_standard(cnt, cnt->imgs.image_vprvcy.image_norm);
else
cnt->current_image->diffs = alg_diff(cnt, cnt->imgs.image_virgin.image_norm);
cnt->current_image->diffs = alg_diff(cnt, cnt->imgs.image_vprvcy.image_norm);
/* Lightswitch feature - has light intensity changed?
* This can happen due to change of light conditions or due to a sudden change of the camera
@@ -2290,7 +2297,7 @@ static void mlp_tuning(struct context *cnt){
*/
if ((cnt->conf.noise_tune && cnt->shots == 0) &&
(!cnt->detecting_motion && (cnt->current_image->diffs <= cnt->threshold)))
alg_noise_tune(cnt, cnt->imgs.image_virgin.image_norm);
alg_noise_tune(cnt, cnt->imgs.image_vprvcy.image_norm);
/*
@@ -3125,6 +3132,65 @@ static void motion_camera_ids(void){
}
}
static void motion_ntc(void){
#ifdef HAVE_V4L2
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("v4l2 : available"));
#else
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("v4l2 : not available"));
#endif
#ifdef HAVE_BKTR
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("bktr : available"));
#else
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("bktr : not available"));
#endif
#ifdef HAVE_WEBP
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("webp : available"));
#else
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("webp : not available"));
#endif
#ifdef HAVE_MMAL
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("mmal : available"));
#else
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("mmal : not available"));
#endif
#ifdef HAVE_FFMPEG
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("ffmpeg : available"));
#else
MOTION_LOG(DBG, TYPE_ALL, NO_ERRNO,_("ffmpeg : not available"));
#endif
#ifdef HAVE_MYSQL
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("mysql : available"));
#else
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("mysql : not available"));
#endif
#ifdef HAVE_SQLITE3
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("sqlite3: available"));
#else
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("sqlite3: not available"));
#endif
#ifdef HAVE_PGSQL
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("pgsql : available"));
#else
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("pgsql : not available"));
#endif
#ifdef HAVE_INTL
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("nls : available"));
#else
MOTION_LOG(DBG, TYPE_DB, NO_ERRNO,_("nls : not available"));
#endif
}
/**
* motion_startup
@@ -3217,6 +3283,8 @@ static void motion_startup(int daemonize, int argc, char *argv[])
conf_output_parms(cnt_list);
motion_ntc();
motion_camera_ids();
initialize_chars();
@@ -3254,8 +3322,6 @@ static void motion_start_thread(struct context *cnt){
snprintf(service,6,"%s",cnt->conf.netcam_url);
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,_("Camera ID: %d Camera Name: %s Service: %s")
,cnt->camera_id, cnt->conf.camera_name,service);
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Stream port %d"),
cnt->conf.stream_port);
} else {
MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,_("Camera ID: %d Camera Name: %s Device: %s")
,cnt->camera_id, cnt->conf.camera_name,cnt->conf.video_device);
@@ -4039,12 +4105,12 @@ void util_threadname_get(char *threadname){
}
int util_check_passthrough(struct context *cnt){
#if (HAVE_FFMPEG && LIBAVFORMAT_VERSION_MAJOR < 55)
if (cnt->conf.movie_passthrough)
if (cnt->movie_passthrough)
MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO
,_("FFMPEG version too old. Disabling pass-through processing."));
return 0;
#else
if (cnt->conf.movie_passthrough){
if (cnt->movie_passthrough){
MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO
,_("pass-through is enabled but is still experimental."));
return 1;

View File

@@ -301,6 +301,7 @@ struct images {
struct image_data img_motion; /* Picture buffer for motion images */
int *ref_dyn; /* Dynamic objects to be excluded from reference frame */
struct image_data image_virgin; /* Last picture frame with no text or locate overlay */
struct image_data image_vprvcy; /* Virgin image with the privacy mask applied */
struct image_data preview_image; /* Picture buffer for best image when enables */
unsigned char *mask; /* Buffer for the mask file */
unsigned char *smartmask;
@@ -472,9 +473,10 @@ struct context {
char extpipefilename[PATH_MAX];
int movie_last_shot;
struct ffmpeg *ffmpeg_output;
struct ffmpeg *ffmpeg_output_motion;
struct ffmpeg *ffmpeg_timelapse;
struct ffmpeg *ffmpeg_output;
struct ffmpeg *ffmpeg_output_motion;
struct ffmpeg *ffmpeg_timelapse;
int movie_passthrough;
char timelapsefilename[PATH_MAX];
char motionfilename[PATH_MAX];

View File

@@ -6,36 +6,66 @@
<title>Motion</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="motion_stylesheet.css" media="screen">
<script>
function fnc_topnav() {
var x = document.getElementById("id_topnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
function fnc_subnav() {
var x = document.getElementById("id_subnav");
if (x.className === "subnav") {
x.className += " responsive";
} else {
x.className = "subnav";
}
}
</script>
</head>
<body style="margin-left:15%;">
<ul class="nav-button">
<li class="nav-button"><a href="https://motion-project.github.io/motion_support.html">Support</a></li>
<li class="nav-button"><a href="https://motion-project.github.io/motion_news.html">News</a></li>
<li class="nav-button"><a href="https://motion-project.github.io/motion_guide.html">Documentation</a></li>
<li class="nav-button"><a href="https://motion-project.github.io/motion_download.html">Download</a></li>
<li class="nav-button"><a href="https://motion-project.github.io/index.html">Home</a></li>
<li class="nav-button" style="float: left;"> <img src="motion.gif" width="125" height="50"> </li>
</ul>
<body>
<div class="topnav" id="id_topnav">
<img class="logoimg" src="motion.gif">
<a class="topnav-d" href="https://motion-project.github.io/motion_support.html">Support</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_news.html" >News</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_guide.html" >Documentation</a>
<a class="topnav-d" href="https://motion-project.github.io/motion_download.html">Download</a>
<a class="topnav-d" href="https://motion-project.github.io/index.html">Home</a>
<a class="topnav-m" href="https://motion-project.github.io/index.html">Home</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_download.html">Download</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_guide.html" >Documentation</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_news.html" >News</a>
<a class="topnav-m" href="https://motion-project.github.io/motion_support.html">Support</a>
<a href="javascript:void(0);" class="icon" onclick="fnc_topnav()">&#9776;</a>
</div>
<section class="page-header">
<h1>
Installing and Building from Source
</h1>
</section>
<section class="vertical-menu">
<button class="accordian">Installing</button>
<div class="panel">
<div class="subnav" id="id_subnav">
<div class="dropdown">
<button class="dropbtn">Installing</button>
<div class="dropdown-content">
<a href="#Install_Apt"> Installing with apt</a>
<a href="#Install_Deb"> Installing with a release deb package</a>
</div>
<button class="accordian">Abbreviated Building</button>
<div class="panel">
</div>
<div class="dropdown">
<button class="dropbtn">Abbreviated Building</button>
<div class="dropdown-content">
<a href="#Build_Deb"> Building a deb package</a>
<a href="#Abbreviated_Building"> Abbreviated Building Guide</a>
</div>
<button class="accordian">Distribution specific dependencies</button>
<div class="panel">
</div>
<div class="dropdown">
<button class="dropbtn">Distribution Specific Building</button>
<div class="dropdown-content">
<a href="#Preparation_For_Building"> Preparation For Building </a>
<a href="#BUILD_DEBIAN">Debian/Ubuntu/Raspbian</a>
<a href="#BUILD_OPENSUSE">Open SUSE</a>
@@ -43,45 +73,27 @@
<a href="#BUILD_CENTOS">CentOS</a>
<a href="#BUILD_MACOSX">MacOSX </a>
</div>
<button class="accordian">Configure/Make options</button>
<div class="panel">
</div>
<div class="dropdown">
<button class="dropbtn">Configure/Make Options</button>
<div class="dropdown-content">
<a href="#Configure_Script"> Configure Script </a>
<a href="#Make"> Make </a>
<a href="#Make_Install"> Make Install </a>
<a href="#Un_Install"> Un-install </a>
<a href="#Additional_Make_Options"> Additional Make Options </a>
</div>
<button class="accordian">Upgrading / Native Language</button>
<div class="panel">
</div>
<div class="dropdown">
<button class="dropbtn">Upgrading/Translations</button>
<div class="dropdown-content">
<a href="#Upgrading_From_Older_Version"> Upgrading From Older Version </a>
<a href="#Translations"> Native Language Support(Translations)</a>
<div class="panel">
<script>
var acc = document.getElementsByClassName("accordian");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
var fnodes = document.getElementsByClassName("accordian");
var indx;
for (indx = 0; indx < fnodes.length; indx++){
if (this.isSameNode(fnodes[indx])) {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight){
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = (panel.scrollHeight+50) + "px";
}
} else {
var panel = fnodes[indx].nextElementSibling;
panel.style.maxHeight = null;
}
}
});
}
</script>
</div>
</div>
</section>
<a href="javascript:void(0);" class="icon" onclick="fnc_subnav()">menu&#8659;&nbsp&nbsp </a>
</div>
<section class="main-content" style="padding:0.5em 0.1em;height:1000px;font-size: 0.90em;">
@@ -430,7 +442,7 @@
<p></p>
<code><strong>sudo yum groupinstall 'Development Tools'</strong></code>
<p></p>
<code><strong>sudo yum install libjpeg-turbo libjpeg-turbo-devel gettext libmicrohttpd-dev</strong></code>
<code><strong>sudo yum install libjpeg-turbo libjpeg-turbo-devel gettext libmicrohttpd-devel</strong></code>
<p></p>
<code><strong>sudo yum install libzip-devel</strong></code>
<p></p>
@@ -561,6 +573,7 @@
<p></p>
The following options can be specified with the configure script to customize
how Motion is built.
<div class="tblconfig">
<table border="1" class="fixed" >
<colgroup>
<col width="200px">
@@ -784,6 +797,7 @@
</tr>
</tbody>
</table>
</div>
<p></p>
<p></p>
</ul>

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,19 @@
* {
box-sizing: border-box; }
box-sizing: border-box;}
body {
padding: 0;
margin: 0;
font-family: Helvetica, Arial, sans-serif;
word-wrap: break-word;
font-size: 16px;
line-height: 1.5;
color: #606c71;
}
color: #606c71; }
a {
color: #1e6bb8;
text-decoration: none; }
a:hover {
text-decoration: none;}
a:hover {
text-decoration: underline; }
.btn {
display: inline-block;
margin-bottom: 1rem;
@@ -26,145 +24,85 @@ a {
border-width: 1px;
border-radius: 0.3rem;
transition: color 0.2s, background-color 0.2s, border-color 0.2s; }
.btn + .btn {
.btn + .btn {
margin-left: 1rem; }
.btn:hover {
color: rgba(255, 255, 255, 0.8);
text-decoration: none;
background-color: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.3); }
@media screen and (min-width: 64em) {
.btn {
padding: 0.75rem 1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.btn {
padding: 0.6rem 0.9rem;
font-size: 0.9rem; } }
@media screen and (max-width: 42em) {
.btn {
display: block;
width: 100%;
padding: 0.75rem;
font-size: 0.9rem; }
.btn + .btn {
margin-top: 1rem;
margin-left: 0; } }
.page-header {
color: #fff;
text-align: center;
background-color: #159957;
background-image: linear-gradient(120deg, #155799, #159957); }
@media screen and (min-width: 64em) {
.page-header {
padding: 1rem 2rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.page-header {
padding: 1rem 2rem; } }
@media screen and (max-width: 42em) {
.page-header {
padding: 1rem 1rem; } }
.page-header h1 {
margin-bottom: 0.1em;
margin-top: 0.1em;}
.project-name {
margin-top: 0;
margin-bottom: 0.1rem; }
@media screen and (min-width: 64em) {
.project-name {
font-size: 3.25rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.project-name {
font-size: 2.25rem; } }
@media screen and (max-width: 42em) {
.project-name {
font-size: 1.75rem; } }
.project-tagline {
margin-bottom: 2rem;
font-weight: normal;
opacity: 0.7; }
@media screen and (min-width: 64em) {
.project-tagline {
font-size: 1.25rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.project-tagline {
font-size: 1.15rem; } }
@media screen and (max-width: 42em) {
.project-tagline {
font-size: 1rem; } }
.main-content :first-child {
margin-top: 0; }
.main-content img {
max-width: 100%; }
.main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5, .main-content h6 {
margin-top: 2rem;
margin-bottom: 1rem;
margin-top: 0.5em;
margin-bottom: 0.5em;
font-weight: normal;
color: #159957; }
color: #159957;}
.main-content p {
margin-bottom: 1em; }
.main-content code {
padding: 2px 4px;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 0.9rem;
color: #383e41;
background-color: #f3f6fa;
border-radius: 0.3rem; }
border-radius: 0.3rem;}
.main-content pre {
padding: 0.8rem;
margin-top: 0;
margin-bottom: 1rem;
font: 1rem Consolas, "Liberation Mono", Menlo, Courier, monospace;
color: #567482;
word-wrap: normal;
background-color: #f3f6fa;
border: solid 1px #dce6f0;
border-radius: 0.3rem; }
border-radius: 0.3rem;}
.main-content pre > code {
padding: 0;
margin: 0;
font-size: 0.9rem;
color: #567482;
word-break: normal;
white-space: pre;
background: transparent;
border: 0; }
padding: 0;
margin: 0;
font-size: 0.9rem;
color: #567482;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;}
.main-content .highlight {
margin-bottom: 1rem; }
.main-content .highlight pre {
margin-bottom: 0;
word-break: normal; }
margin-bottom: 0;
word-break: normal; }
.main-content .highlight pre, .main-content pre {
padding: 0.8rem;
overflow: auto;
font-size: 0.9rem;
line-height: 1.45;
border-radius: 0.3rem; }
border-radius: 0.3rem;}
.main-content pre code, .main-content pre tt {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
overflow: scroll;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0; }
.main-content pre code:before, .main-content pre code:after, .main-content pre tt:before, .main-content pre tt:after {
content: normal; }
content: normal; }
.main-content ul, .main-content ol {
margin-top: 0; }
.main-content blockquote {
@@ -173,218 +111,375 @@ a {
color: #819198;
border-left: 0.3rem solid #dce6f0; }
.main-content blockquote > :first-child {
margin-top: 0; }
margin-top: 0; }
.main-content blockquote > :last-child {
margin-bottom: 0; }
margin-bottom: 0; }
/*
.main-content table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all; }
}
.main-content table th {
font-weight: bold; }
.main-content table th, .main-content table td {
padding: 0.5rem 1rem;
border: 1px solid #e9ebec; }
font-weight: bold; }
.main-content table th, .main-content table td {
padding: 0.5rem 1rem;
border: 1px solid #e9ebec;}
*/
.main-content dl {
padding: 0; }
.main-content dl dt {
padding: 0;
margin-top: 1rem;
font-size: 1rem;
font-weight: bold; }
.main-content dl dd {
padding: 0;
margin-bottom: 1rem; }
.main-content dl dt {
padding: 0;
margin-top: 1rem;
font-size: 1rem;
font-weight: bold;}
.main-content dl dd {
padding: 0;
margin-bottom: 1rem;}
.main-content hr {
height: 2px;
padding: 0;
margin: 1rem 0;
background-color: #eff0f1;
border: 0; }
@media screen and (min-width: 64em) {
.main-content {
max-width: 64rem;
padding: 2rem 6rem;
margin: 0 auto;
font-size: 1.1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.main-content {
padding: 2rem 4rem;
font-size: 1.1rem; } }
@media screen and (max-width: 42em) {
.main-content {
padding: 2rem 1rem;
font-size: 1rem; } }
border: 0;}
.site-footer {
padding-top: 2rem;
margin-top: 2rem;
border-top: solid 1px #eff0f1; }
border-top: solid 1px #eff0f1;}
.site-footer-owner {
display: block;
font-weight: bold; }
.site-footer-credits {
color: #819198; }
color: #819198;}
@media screen and (min-width: 64em) {
.site-footer {
font-size: 1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.site-footer {
font-size: 1rem; } }
@media screen and (max-width: 42em) {
.site-footer {
font-size: 0.9rem; } }
.nav-button {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
.topnav-d, .topnav-m {
color: #1e6bb8;
text-decoration: none;
}
.nav-button ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: scroll;
.topnav {
background-color: #333;
}
.nav-button li {
float: right;
}
.nav-button li a {
overflow: hidden;
}
.topnav a, .topnav-m, .topnav-d {
float: left;
display: block;
color: white;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
@media screen and (min-width: 64em) {
.nav-button {
font-size: 1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.nav-button {
font-size: 1rem; } }
@media screen and (max-width: 42em) {
.nav-button {
font-size: 0.9rem; } }
.nav-vertical {
list-style-type: none;
margin: 0;
padding: 0;
overflow: scroll;
font-size: 17px;
}
.nav-vertical body {
margin: 0;
.topnav .icon {
display: none;
}
.nav-vertical ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 25%;
background-color: #f1f1f1;
height: 100%;
overflow: scroll;
}
.nav-vertical li {
float: left;
}
.nav-vertical li a {
.topnav a:hover{
background-color: #555;
color: white;
}
@media screen and (min-width: 48em) {
.topnav a {
float: right;
}
.topnav .topnav-d {
float: right;
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
.topnav .topnav-m {
float: right;
display: none;
}
.topnav .logoimg {
width:auto;
height:3.0em;}
}
@media screen and (max-width: 48em) {
.topnav a:not(:first-child) {
display: none;
}
@media screen and (min-width: 64em) {
.nav-vertical {
font-size: 1rem; } }
.topnav .topnav-d{
display: none;
}
@media screen and (min-width: 42em) and (max-width: 64em) {
.nav-vertical {
font-size: 1rem; } }
.topnav .topnav-m:not(:first-child) {
display: none;
}
@media screen and (max-width: 42em) {
.nav-vertical {
font-size: 0.9rem; } }
.topnav a.icon {
float: right;
display: block;
}
.vertical-menu {
height: 100%;
width: 15%;
position: fixed;
z-index: 1;
.topnav.responsive {position: relative;}
.topnav.responsive a.icon {
position: absolute;
right: 0;
top: 0;
left: 0;
overflow-x: scroll;
padding-top: 60px;
transition: 0.5s;
}
.vertical-menu a {
padding: 5px 14px 4px 16px;
text-decoration: none;
font-size: 0.80em ;
display: block;
transition: 0.3s
}
.vertical-menu a:hover {
background-color: #ccc;
}
.vertical-menu a.active {
background-color: #4CAF50;
color: white;
}
.vertical-menu button {
padding: 5px 14px 4px 16px;
text-decoration: none;
.topnav.responsive a {
float: none;
display: block;
transition: 0.3s;
border: none;
width: 100%;
overflow-x: scroll;
text-align: left;
outline: none;
background-color: white;
color: #1e6bb8;
}
.topnav.responsive .topnav-d {
float: none;
display: none;
text-align: left;
}
.topnav.responsive .topnav-m {
float: none;
display: block;
text-align: left;
}
.topnav.responsive .dropdown {float: none;}
.topnav.responsive .dropdown-content {position: relative;}
.topnav.responsive .dropdown .dropbtn {
display: block;
width: 100%;
text-align: left;
}
}
.vertical-menu button:hover {
background-color: #cdc;
.subnav {
overflow: hidden;
background-color: #159957;
background-image: linear-gradient(120deg, #155799, #159957);
border-top: 2px solid black;
}
.subnav a {
float: left;
display: block;
color: white;
text-align: center;
padding: 5px;
text-decoration: none;
font-size: 12px;
}
.subnav .icon {
display: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 12px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.subnav a:hover, .dropdown:hover .dropbtn {
background-color: #555;
color: white;
}
.dropdown-content a:hover {
background-color: #ddd
color: black;
}
.dropdown:hover .dropdown-content {
display: block;
}
@media screen and (min-width: 48em) {
.subnav a {
float: left;
}
}
@media screen and (max-width: 48em) {
.subnav a:not(:first-child), .dropdown .dropbtn {
display: none;
}
.subnav a.icon {
float: right;
display: block;
}
.subnav.responsive {position: relative;}
.subnav.responsive a.icon {
position: absolute;
right: 0;
top: 0;
}
.subnav.responsive a {
float: none;
display: block;
text-align: left;
}
.subnav.responsive .dropdown {float: none;}
.subnav.responsive .dropdown-content {position: relative;}
.subnav.responsive .dropdown .dropbtn {
display: block;
width: 100%;
text-align: left;
}
}
.panel {
padding: 5px 14px 4px 16px;
background-color: white;
max-height: 0;
overflow: scroll;
overflow-x: hidden;
transition: max-height 0.2s ease-out;
padding: 0.5em 1.4em 0.4em 1.6em;
background-color: white;
max-height: 0;
overflow: scroll;
overflow-x: hidden;
transition: max-height 0.2s ease-out;
}
.active {
background-color: #4CAF50;
color: white;
}
.logoimg {
width:auto;
height:3.0em;
}
@media screen and (min-width: 64em) {
.vertical-menu {
font-size: 1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.vertical-menu {
font-size: 1rem; } }
@media screen and (max-width: 42em) {
.vertical-menu {
font-size: 0.9rem; } }
@media screen and (min-width: 48em) {
.nav-vertical { font-size: 1em; }
.accordian { font-size: 1em; }
.nav-button {
font-size: 1em;
height: 2.5em;}
.vertical-menu { font-size: 1em; }
.panel { font-size: 1em; }
.site-footer { font-size: 1em; }
.project-tagline { font-size: 1.25em; }
.project-name { font-size: 3.25em; }
.page-header {
padding: 0.1rem 0.1rem;
font-size: 1rem;
}
.btn {
padding: 0.75em 1em; }
.main-content {
padding: 0.5em 0.5em;
font-size: 1.1rem; }
.tblalpha td {
height: 17px;
}
}
@media screen and (max-width: 48em) {
.logoimg {
width:auto;
height:3em;
}
.nav-vertical { font-size: 0.5rem; }
.nav-button {
font-size: 0.6em;
height: 3em;
}
.vertical-menu { font-size: 0.9rem; }
.vertical-menu a { font-size: 0.7rem; }
.accordian { font-size: 0.5rem; }
.panel { font-size: 0.5rem; }
.site-footer { font-size: 0.5rem;}
.project-tagline { font-size: 1rem; }
.project-name { font-size: 1.75rem; }
.page-header{
font-size: 1rem;
padding: 0.1rem 0.1rem;
}
.btn {
display: block;
padding: 0.75rem;
font-size: 0.9rem; }
.btn + .btn {
margin-top: 1rem;
margin-left: 0; }
.main-content {
padding: 0.5rem 0.5rem;
font-size: 0.7rem;}
.main-content {
table-layout: auto;
}
}
@media screen and (max-width: 48em) {
.tblsignal table,.tblsignal thead,.tblsignal tbody,.tblsignal th,.tblsignal td,.tblsignal tr,
.tblalpha table,.tblalpha thead,.tblalpha tbody,.tblalpha th,.tblalpha td,.tblalpha tr,
.tbldetail table,.tbldetail thead,.tbldetail tbody,.tbldetail th,.tbldetail td,.tbldetail tr,
.tblconvr table,.tblconvr thead,.tblconvr tbody,.tblconvr th,.tblconvr td,.tblconvr tr,
.tblpaltte table,.tblpaltte thead,.tblpaltte tbody,.tblpaltte th,.tblpaltte td,.tblpaltte tr,
.tblconfig table,.tblconfig thead,.tblconfig tbody,.tblconfig th,.tblconfig td,.tblconfig tr
{
display: block;
}
.tblsignal thead tr, .tblalpha thead tr, .tbldetail thead tr, .tblconvr thead tr,
.tblpaltte thead tr, .tblconfig thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
.tblsignal tr, .tblalpha tr, .tbldetail tr, .tblconvr tr,
.tblpaltte tr, .tblconfig tr {
border: 1px solid #ccc;
}
.tblsignal td, .tbldetail td, .tblconvr td, .tblpaltte td {
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 5%;
height: 2.8em;
}
.tblsignal td:before, .tbldetail td:before, .tblconvr td:before,
.tblpaltte td:before, .tblconfig td:before {
position: absolute;
top: 6px;
left: 6px;
width: 65%;
padding-top: 10px;
white-space: nowrap;
padding-left: 5%;
}
.tblalpha td{
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 15px;
height: 2.8em;
}
.tblconfig td {
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 5%;
min-height: 2.8em;
height: auto;
}
}

View File

@@ -72,7 +72,6 @@ static void netcam_rtsp_null_context(struct rtsp_context *rtsp_data){
rtsp_data->frame = NULL;
rtsp_data->codec_context = NULL;
rtsp_data->format_context = NULL;
rtsp_data->pktarray = NULL;
rtsp_data->transfer_format = NULL;
}
@@ -83,11 +82,10 @@ static void netcam_rtsp_close_context(struct rtsp_context *rtsp_data){
if (rtsp_data->swsframe_in != NULL) my_frame_free(rtsp_data->swsframe_in);
if (rtsp_data->swsframe_out != NULL) my_frame_free(rtsp_data->swsframe_out);
if (rtsp_data->frame != NULL) my_frame_free(rtsp_data->frame);
if (rtsp_data->pktarray != NULL) netcam_rtsp_pktarray_free(rtsp_data);
if (rtsp_data->codec_context != NULL) my_avcodec_close(rtsp_data->codec_context);
if (rtsp_data->format_context != NULL) avformat_close_input(&rtsp_data->format_context);
if (rtsp_data->pktarray != NULL) netcam_rtsp_pktarray_free(rtsp_data);
if (rtsp_data->transfer_format != NULL) avformat_close_input(&rtsp_data->transfer_format);
netcam_rtsp_null_context(rtsp_data);
}
@@ -112,13 +110,10 @@ static void netcam_rtsp_pktarray_resize(struct context *cnt, int is_highres){
int64_t idnbr_last, idnbr_first;
int indx;
int resize_pktarray;
struct rtsp_context *rtsp_data;
struct packet_item *tmp;
int newsize;
resize_pktarray = TRUE;
if (is_highres){
idnbr_last = cnt->imgs.image_ring[cnt->imgs.image_ring_out].idnbr_high;
idnbr_first = cnt->imgs.image_ring[cnt->imgs.image_ring_in].idnbr_high;
@@ -133,32 +128,32 @@ static void netcam_rtsp_pktarray_resize(struct context *cnt, int is_highres){
/* The 30 is arbitrary */
/* Double the size plus double last diff so we don't catch our tail */
newsize =((idnbr_first - idnbr_last) * 2 );
newsize = newsize + ((rtsp_data->idnbr - idnbr_last ) * 2);
newsize =((idnbr_first - idnbr_last) * 2 ) + ((rtsp_data->idnbr - idnbr_last ) * 2);
if (newsize < 30) newsize = 30;
if (rtsp_data->pktarray_size >= newsize) resize_pktarray = FALSE;
if ((resize_pktarray) || (rtsp_data->pktarray_size < 30)){
tmp = mymalloc(newsize * sizeof(struct packet_item));
if (rtsp_data->pktarray_size > 0 ){
memcpy(tmp, rtsp_data->pktarray, sizeof(struct packet_item) * rtsp_data->pktarray_size);
}
for(indx = rtsp_data->pktarray_size; indx < newsize; indx++) {
av_init_packet(&tmp[indx].packet);
tmp[indx].packet.data=NULL;
tmp[indx].packet.size=0;
tmp[indx].idnbr = 0;
tmp[indx].iskey = FALSE;
tmp[indx].iswritten = FALSE;
}
pthread_mutex_lock(&rtsp_data->mutex_pktarray);
pthread_mutex_lock(&rtsp_data->mutex_pktarray);
if ((rtsp_data->pktarray_size < newsize) || (rtsp_data->pktarray_size < 30)){
tmp = mymalloc(newsize * sizeof(struct packet_item));
if (rtsp_data->pktarray_size > 0 ){
memcpy(tmp, rtsp_data->pktarray, sizeof(struct packet_item) * rtsp_data->pktarray_size);
}
for(indx = rtsp_data->pktarray_size; indx < newsize; indx++) {
av_init_packet(&tmp[indx].packet);
tmp[indx].packet.data=NULL;
tmp[indx].packet.size=0;
tmp[indx].idnbr = 0;
tmp[indx].iskey = FALSE;
tmp[indx].iswritten = FALSE;
}
if (rtsp_data->pktarray != NULL) free(rtsp_data->pktarray);
rtsp_data->pktarray = tmp;
rtsp_data->pktarray_size = newsize;
pthread_mutex_unlock(&rtsp_data->mutex_pktarray);
MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO
,_("%s: Resized packet array to %d"), rtsp_data->cameratype,newsize);
}
MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO
,_("%s: Resized packet array to %d"), rtsp_data->cameratype,newsize);
}
pthread_mutex_unlock(&rtsp_data->mutex_pktarray);
}
@@ -168,10 +163,13 @@ static void netcam_rtsp_pktarray_add(struct rtsp_context *rtsp_data){
int retcd;
char errstr[128];
if (rtsp_data->pktarray_size == 0) return;
pthread_mutex_lock(&rtsp_data->mutex_pktarray);
if (rtsp_data->pktarray_size == 0){
pthread_mutex_unlock(&rtsp_data->mutex_pktarray);
return;
}
/* Recall pktarray_size is one based but pktarray is zero based */
if (rtsp_data->pktarray_index == (rtsp_data->pktarray_size-1) ){
indx_next = 0;
@@ -702,7 +700,7 @@ static int netcam_rtsp_ntc(struct rtsp_context *rtsp_data){
,rtsp_data->codec_context->width,rtsp_data->codec_context->height
,rtsp_data->imgsize.width,rtsp_data->imgsize.height);
} else {
MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("format than YUV420P. The image sent is being "));
MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("The image sent is being "));
MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("trancoded to YUV420P. If possible change netcam "));
MOTION_LOG(NTC, TYPE_NETCAM, NO_ERRNO, _("picture format to YUV420P to possibly lower CPU usage."));
}
@@ -857,9 +855,11 @@ static void netcam_rtsp_set_v4l2(struct rtsp_context *rtsp_data){
sprintf(optfps, "%s","default");
sprintf(optsize, "%s","default");
}
} else {
sprintf(optfps, "%s","default");
sprintf(optsize, "%s","default");
}
if (rtsp_data->status == RTSP_NOTCONNECTED){
MOTION_LOG(INF, TYPE_NETCAM, NO_ERRNO
,_("%s: Requested v4l2_palette option: %d")
@@ -972,6 +972,7 @@ static void netcam_rtsp_set_parms (struct context *cnt, struct rtsp_context *rts
rtsp_data->img_latest->ptr = mymalloc(NETCAM_BUFFSIZE);
rtsp_data->pktarray_size = 0;
rtsp_data->pktarray_index = -1;
rtsp_data->pktarray = NULL;
rtsp_data->handler_finished = TRUE;
rtsp_data->first_image = TRUE;
@@ -1341,7 +1342,7 @@ static void netcam_rtsp_handler_wait(struct rtsp_context *rtsp_data){
((rtsp_data->frame_curr_tm.tv_sec - rtsp_data->frame_prev_tm.tv_sec) * 1000000L) -
(rtsp_data->frame_curr_tm.tv_usec - rtsp_data->frame_prev_tm.tv_usec);
if ((usec_delay > 0) && (usec_delay < 1000000L)){
SLEEP(0, usec_delay * 1000)
SLEEP(0, usec_delay * 1000);
}
}

View File

@@ -344,7 +344,7 @@ static unsigned prepare_exif(unsigned char **exif,
writing.buf += 2;
if (description)
put_stringentry(&writing, TIFF_TAG_IMAGE_DESCRIPTION, description, 0);
put_stringentry(&writing, TIFF_TAG_IMAGE_DESCRIPTION, description, 1);
if (datetime)
put_stringentry(&writing, TIFF_TAG_DATETIME, datetime, 1);

View File

@@ -20,7 +20,6 @@ int put_picture_memory(struct context *, unsigned char*, int, unsigned char *, i
void put_picture(struct context *, char *, unsigned char *, int);
unsigned char *get_pgm(FILE *, int, int);
void preview_save(struct context *);
unsigned char *scale_half_yuv420p(int origwidth, int origheight, unsigned char *img);
void pic_scale_img(int width_src, int height_src, unsigned char *img_src, unsigned char *img_dst);
#endif /* _INCLUDE_PICTURE_H_ */

View File

@@ -1,5 +1,5 @@
#!/bin/sh
BASE_VERSION="4.2"
BASE_VERSION="4.2.1"
if [ -d .git ]; then
if test "`git diff --name-only`" = "" ; then
GIT_COMMIT="git"

View File

@@ -461,7 +461,7 @@ static int v4l2_autobright(struct context *cnt, struct video_dev *curdev, int me
avg = 0;
pixel_count = 0;
image = cnt->imgs.image_virgin.image_norm;
image = cnt->imgs.image_vprvcy.image_norm;
for (indx = 0; indx < cnt->imgs.motionsize; indx += 10) {
avg += image[indx];
pixel_count++;

46
webu.c
View File

@@ -1147,6 +1147,10 @@ static void webu_answer_strm_type(struct webui_ctx *webui) {
(strcmp(webui->uri_camid,"current") == 0)){
webui->cnct_type = WEBUI_CNCT_STATIC;
} else if ((strlen(webui->uri_camid) > 0) &&
(strlen(webui->uri_cmd1) == 0)){
webui->cnct_type = WEBUI_CNCT_FULL;
} else {
webui->cnct_type = WEBUI_CNCT_UNKNOWN;
}
@@ -1434,7 +1438,7 @@ static void webu_mhd_features_basic(struct mhdstart_ctx *mhdst){
int retcd;
retcd = MHD_is_feature_supported (MHD_FEATURE_BASIC_AUTH);
if (retcd == MHD_YES){
MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("Basic authentication: available"));
MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("Basic authentication: available"));
} else {
if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_auth_method == 1)){
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Basic authentication: disabled"));
@@ -1457,7 +1461,7 @@ static void webu_mhd_features_digest(struct mhdstart_ctx *mhdst){
int retcd;
retcd = MHD_is_feature_supported (MHD_FEATURE_DIGEST_AUTH);
if (retcd == MHD_YES){
MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("Digest authentication: available"));
MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("Digest authentication: available"));
} else {
if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_auth_method == 2)){
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Digest authentication: disabled"));
@@ -1486,9 +1490,9 @@ static void webu_mhd_features_ipv6(struct mhdstart_ctx *mhdst){
int retcd;
retcd = MHD_is_feature_supported (MHD_FEATURE_IPv6);
if (retcd == MHD_YES){
MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("IPV6: available"));
MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("IPV6: available"));
} else {
MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("IPV6: disabled"));
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("IPV6: disabled"));
if (mhdst->ipv6) mhdst->ipv6 = 0;
}
#endif
@@ -1511,7 +1515,7 @@ static void webu_mhd_features_tls(struct mhdstart_ctx *mhdst){
int retcd;
retcd = MHD_is_feature_supported (MHD_FEATURE_SSL);
if (retcd == MHD_YES){
MOTION_LOG(INF, TYPE_STREAM, NO_ERRNO ,_("SSL/TLS: available"));
MOTION_LOG(DBG, TYPE_STREAM, NO_ERRNO ,_("SSL/TLS: available"));
} else {
if ((mhdst->ctrl) && (mhdst->cnt[mhdst->indxthrd]->conf.webcontrol_tls)){
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("SSL/TLS: disabled"));
@@ -1836,6 +1840,10 @@ static void webu_start_ctrl(struct context **cnt){
free(mhdst.mhd_ops);
if (cnt[0]->webcontrol_daemon == NULL){
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO ,_("Unable to start MHD"));
} else {
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO
,_("Started webcontrol on port %d")
,cnt[0]->conf.webcontrol_port);
}
}
@@ -1845,6 +1853,32 @@ static void webu_start_ctrl(struct context **cnt){
return;
}
static void webu_strm_ntc(struct context **cnt, int indxthrd){
int indx;
if (indxthrd == 0 ){
if (cnt[1] != NULL) {
indx = 1;
while (cnt[indx] != NULL){
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO
,_("Started camera %d stream on port/camera_id %d/%d")
,cnt[indx]->camera_id
,cnt[indxthrd]->conf.stream_port
,cnt[indx]->camera_id);
indx++;
}
} else {
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO
,_("Started camera %d stream on port %d")
,cnt[indxthrd]->camera_id,cnt[indxthrd]->conf.stream_port);
}
} else {
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO
,_("Started camera %d stream on port %d")
,cnt[indxthrd]->camera_id,cnt[indxthrd]->conf.stream_port);
}
}
static void webu_start_strm(struct context **cnt){
/* This function starts up the daemon for the streams. It loops through
* all of the camera context's provided and starts streams as requested. If
@@ -1905,6 +1939,8 @@ static void webu_start_strm(struct context **cnt){
MOTION_LOG(NTC, TYPE_STREAM, NO_ERRNO
,_("Unable to start stream for camera %d")
,cnt[mhdst.indxthrd]->camera_id);
} else {
webu_strm_ntc(cnt,mhdst.indxthrd);
}
}
mhdst.indxthrd++;

View File

@@ -44,20 +44,18 @@ static void webu_stream_mjpeg_delay(struct webui_ctx *webui) {
/* The stream rate MUST be less than 1000000000 otherwise undefined behaviour
* will occur with the SLEEP function.
*/
stream_delay = ((time_curr.tv_usec - webui->time_last.tv_usec)*1000000) -
stream_delay = ((time_curr.tv_usec - webui->time_last.tv_usec)*1000) +
((time_curr.tv_sec - webui->time_last.tv_sec)*1000000000);
if (stream_delay < 0) stream_delay = 0;
if (stream_delay > 1000000000 ) stream_delay = 1000000000;
if (webui->cnt->conf.stream_maxrate > 1){
if (webui->cnt->conf.stream_maxrate >= 1){
stream_rate = ( (1000000000 / webui->cnt->conf.stream_maxrate) - stream_delay);
if ((stream_rate > 0) && (stream_rate < 1000000000)){
SLEEP(0,stream_rate);
} else if (stream_rate == 1000000000) {
SLEEP(1,0);
}
} else {
SLEEP(1,0);
}
gettimeofday(&webui->time_last, NULL);
@@ -277,9 +275,9 @@ int webu_stream_mjpeg(struct webui_ctx *webui) {
return MHD_NO;
}
if (webui->cnt->conf.webcontrol_cors_header != NULL){
if (webui->cnt->conf.stream_cors_header != NULL){
MHD_add_response_header (response, MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN
, webui->cnt->conf.webcontrol_cors_header);
, webui->cnt->conf.stream_cors_header);
}
MHD_add_response_header (response, MHD_HTTP_HEADER_CONTENT_TYPE
@@ -330,4 +328,4 @@ int webu_stream_static(struct webui_ctx *webui) {
MHD_destroy_response (response);
return retcd;
}
}