Send Motion-user mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Motionplus for FreeBSD (Roger McCalman)


----------------------------------------------------------------------

Message: 1
Date: Tue, 4 Jul 2023 16:56:13 +0000
From: Roger McCalman <[email protected]>
To: [email protected]
Subject: [Motion-user] Motionplus for FreeBSD
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hi,


I have been using motion on FreeBSD for some time now and thought I 
would give motion plus a try. I couldn?t see a port for it so I clone 
the git repo and compiled it after some minor changes. The changes are 
below if anyone is interested. These look like they are not FreeBSD 
specific, just compiler warnings and errors.

I have tested only with network cameras so far.

Cheers, Roger

*diff --git a/src/conf.cpp b/src/conf.cpp*

*index 1637541..f3f5e84 100644*

*--- a/src/conf.cpp*

*+++ b/src/conf.cpp*

@@ -4008,7 +4008,7 @@void conf_parms_write_app(ctx_motapp *motapp)

 ? if (conffile == NULL) {

 ? ? ? MOTPLS_LOG(NTC, TYPE_ALL, NO_ERRNO

 ? ? ? ? ? , _("Failed to write configuration to %s")

- , motapp->conf->conf_filename);

+ , motapp->conf->conf_filename.c_str());

 ? ? ? return;

 ? }

*diff --git a/src/netcam.cpp b/src/netcam.cpp*

*index 0d277f2..2d6fcc3 100644*

*--- a/src/netcam.cpp*

*+++ b/src/netcam.cpp*

@@ -1441,7 +1441,7 @@static void netcam_set_path (ctx_dev *cam, 
ctx_netcam *netcam )

 ? netcam->path = NULL;

 ? memset(&url, 0, sizeof(url));

- memset(userpass,0,PATH_MAX);

+ memset(userpass,0,sizeof(userpass));

 ? if (netcam->high_resolution) {

 ? ? ? netcam_url_parse(&url, cam->conf->netcam_high_url.c_str());

@@ -1451,8 +1451,8 @@static void netcam_set_path (ctx_dev *cam, 
ctx_netcam *netcam )

 ? if (cam->conf->netcam_userpass != "") {

 ? ? ? cam->conf->netcam_userpass.copy(userpass, PATH_MAX);

-? ? } else if (url.userpass != NULL) {

- retcd = snprintf(userpass,PATH_MAX,"%s",url.userpass);

+? ? } else if (url.userpass) {

+ retcd = snprintf(userpass,sizeof(userpass),"%s",url.userpass);

 ? ? ? if ((retcd <0) || (retcd>=PATH_MAX)) {

[roger@dev2 motionplus]$git diff | cat

diff --git a/src/conf.cpp b/src/conf.cpp

index 1637541..f3f5e84 100644

--- a/src/conf.cpp

+++ b/src/conf.cpp

@@ -4008,7 +4008,7 @@ void conf_parms_write_app(ctx_motapp *motapp)

 ? if (conffile == NULL) {

 ? ? ? MOTPLS_LOG(NTC, TYPE_ALL, NO_ERRNO

 ? ? ? ? ? , _("Failed to write configuration to %s")

- ? ? ? ? ? , motapp->conf->conf_filename);

+ ? ? ? ? ? , motapp->conf->conf_filename.c_str());

 ? ? ? return;

 ? }

diff --git a/src/netcam.cpp b/src/netcam.cpp

index 0d277f2..2d6fcc3 100644

--- a/src/netcam.cpp

+++ b/src/netcam.cpp

@@ -1441,7 +1441,7 @@ static void netcam_set_path (ctx_dev *cam, 
ctx_netcam *netcam )

 ? netcam->path = NULL;

 ? memset(&url, 0, sizeof(url));

- ? memset(userpass,0,PATH_MAX);

+ ? memset(userpass,0,sizeof(userpass));

 ? if (netcam->high_resolution) {

 ? ? ? netcam_url_parse(&url, cam->conf->netcam_high_url.c_str());

@@ -1451,8 +1451,8 @@ static void netcam_set_path (ctx_dev *cam, 
ctx_netcam *netcam )

 ? if (cam->conf->netcam_userpass != "") {

 ? ? ? cam->conf->netcam_userpass.copy(userpass, PATH_MAX);

- ? } else if (url.userpass != NULL) {

- ? ? ? retcd = snprintf(userpass,PATH_MAX,"%s",url.userpass);

+ ? } else if (url.userpass) {

+ ? ? ? retcd = snprintf(userpass,sizeof(userpass),"%s",url.userpass);

 ? ? ? if ((retcd <0) || (retcd>=PATH_MAX)) {

 ? ? ? ? ? MOTPLS_LOG(INF, TYPE_NETCAM, NO_ERRNO,_("Error getting 
userpass"));

 ? ? ? }

@@ -1471,7 +1471,7 @@ static void netcam_set_path (ctx_dev *cam, 
ctx_netcam *netcam )

 ? } else {

 ? ? ? MOTPLS_LOG(INF, TYPE_NETCAM, NO_ERRNO

 ? ? ? ? ? ,_("Setting up %s "),url.service);

- ? ? ? if (userpass != NULL) {

+ ? ? ? if (strlen(userpass)) {

 ? ? ? ? ? netcam->path =(char*) mymalloc(strlen(url.service) + 3 + 
strlen(userpass)

 ? ? ? ? ? ? ? ? + 1 + strlen(url.host) + 6 + strlen(url.path) + 2 );

 ? ? ? ? ? sprintf((char *)netcam->path, "%s://%s@%s:%d%s",
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 203, Issue 4
*******************************************

Reply via email to