Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package motion for openSUSE:Factory checked in at 2023-01-05 15:55:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/motion (Old) and /work/SRC/openSUSE:Factory/.motion.new.1563 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "motion" Thu Jan 5 15:55:04 2023 rev:14 rq:1056200 version:4.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/motion/motion.changes 2022-12-05 18:01:57.312827956 +0100 +++ /work/SRC/openSUSE:Factory/.motion.new.1563/motion.changes 2023-01-05 15:55:05.310917145 +0100 @@ -1,0 +2,12 @@ +Thu Jan 5 08:00:38 UTC 2023 - Dirk Müller <[email protected]> + +- update to 4.5.1: + * Improve closing of v4l2 devices + * Fix creation of pid_file + * Add header check for mmal + * Fix pause when used as command line option + * Fix json pages when multiple cameras used + * Fix codec for movie_codec for mpeg4 + * Fix rotation for v4l2 devices + +------------------------------------------------------------------- Old: ---- release-4.5.0.tar.gz New: ---- release-4.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ motion.spec ++++++ --- /var/tmp/diff_new_pack.JMSWx3/_old 2023-01-05 15:55:05.890920288 +0100 +++ /var/tmp/diff_new_pack.JMSWx3/_new 2023-01-05 15:55:05.894920310 +0100 @@ -1,7 +1,7 @@ # # spec file for package motion # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define spooldir /var/spool/motion Name: motion -Version: 4.5.0 +Version: 4.5.1 Release: 0 Summary: A motion detection system License: GPL-2.0-or-later ++++++ release-4.5.0.tar.gz -> release-4.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/motion-release-4.5.0/configure.ac new/motion-release-4.5.1/configure.ac --- old/motion-release-4.5.0/configure.ac 2022-10-30 21:30:49.000000000 +0100 +++ new/motion-release-4.5.1/configure.ac 2022-12-18 01:36:49.000000000 +0100 @@ -225,19 +225,22 @@ export PKG_CONFIG_PATH AC_MSG_RESULT($PKG_CONFIG_PATH) - AC_MSG_CHECKING(for MMAL) AS_IF([pkg-config mmal], [ + AC_CHECK_HEADERS(interface/vcos/vcos.h interface/mmal/mmal.h,,[MMAL="no"]) + AC_MSG_CHECKING(for MMAL) + AS_IF([test "${MMAL}" = "no"], [ + AC_MSG_RESULT([no]) + ],[ TEMP_CFLAGS="$TEMP_CFLAGS -Irasppicam "`pkg-config --cflags mmal` - TEMP_LIBS="$TEMP_LIBS "`pkg-config --libs mmal` - #pkg config parm does not provide -lvchostif that buildroot requires - TEMP_LIBS="$TEMP_LIBS -lvchostif " + TEMP_LIBS="$TEMP_LIBS "`pkg-config --libs mmal`" -lvchostif " AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_MMAL], [1], [Define to 1 if MMAL is around]) - ],[ - AC_MSG_RESULT([no]) - MMAL="no" - ] - ) + ]) + ],[ + AC_MSG_CHECKING(for MMAL) + AC_MSG_RESULT([no]) + MMAL="no" + ]) PKG_CONFIG_PATH=$TEMP_PATH export PKG_CONFIG_PATH ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/motion-release-4.5.0/doc/CHANGELOG new/motion-release-4.5.1/doc/CHANGELOG --- old/motion-release-4.5.0/doc/CHANGELOG 2022-10-30 21:30:49.000000000 +0100 +++ new/motion-release-4.5.1/doc/CHANGELOG 2022-12-18 01:36:49.000000000 +0100 @@ -1,3 +1,11 @@ +Summary of changes for version 4.5.1 are below + * Improve closing of v4l2 devices + * Fix creation of pid_file + * Add header check for mmal + * Fix pause when used as command line option + * Fix json pages when multiple cameras used + * Fix codec for movie_codec for mpeg4 + * Fix rotation for v4l2 devices Summary of changes for version 4.5.0 are below * Do not translate the ignoring IP alert message * Fix processing for native_language config option diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/motion-release-4.5.0/scripts/version.sh new/motion-release-4.5.1/scripts/version.sh --- old/motion-release-4.5.0/scripts/version.sh 2022-10-30 21:30:49.000000000 +0100 +++ new/motion-release-4.5.1/scripts/version.sh 2022-12-18 01:36:49.000000000 +0100 @@ -1,5 +1,5 @@ #!/bin/sh -BASE_VERSION="4.5.0" +BASE_VERSION="4.5.1" if [ -d .git ]; then if test "`git diff --name-only`" = "" ; then GIT_COMMIT="git" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/motion-release-4.5.0/src/ffmpeg.c new/motion-release-4.5.1/src/ffmpeg.c --- old/motion-release-4.5.0/src/ffmpeg.c 2022-10-30 21:30:49.000000000 +0100 +++ new/motion-release-4.5.1/src/ffmpeg.c 2022-12-18 01:36:49.000000000 +0100 @@ -241,6 +241,9 @@ if (mystreq(codec_name, "mpeg4")) { ffmpeg->oc->oformat = av_guess_format("avi", NULL, NULL); retcd = snprintf(ffmpeg->filename,PATH_MAX,"%s.avi",basename); + if (ffmpeg->oc->oformat) { + ffmpeg->oc->video_codec_id = MY_CODEC_ID_MSMPEG4V2; + } } if (mystreq(codec_name, "msmpeg4")) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/motion-release-4.5.0/src/motion.c new/motion-release-4.5.1/src/motion.c --- old/motion-release-4.5.0/src/motion.c 2022-10-30 21:30:49.000000000 +0100 +++ new/motion-release-4.5.1/src/motion.c 2022-12-18 01:36:49.000000000 +0100 @@ -479,7 +479,7 @@ */ void motion_remove_pid(void) { - if ((cnt_list[0]->daemon) && (cnt_list[0]->conf.pid_file) && (restart == 0)) { + if ((cnt_list[0]->conf.pid_file) && (restart == 0)) { if (!unlink(cnt_list[0]->conf.pid_file)) { MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO, _("Removed process id file (pid file).")); } else { @@ -1071,7 +1071,10 @@ cnt->imgs.height_high = 0; cnt->imgs.size_high = 0; cnt->movie_passthrough = cnt->conf.movie_passthrough; - cnt->pause = cnt->conf.pause; + /* Pause may have been set via command line. If so, keep that value*/ + if (cnt->pause == 0) { + cnt->pause = cnt->conf.pause; + } MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO ,_("Camera %d started: motion detection %s"), @@ -1409,6 +1412,13 @@ cnt->smartmask_lastrate = 0; cnt->passflag = 0; //only purpose to flag first frame + /*If multiple cameras then we must set the pass flag for + * context zero since it is just the master and will + * not be set as a camera loop occurs */ + if (cnt_list[1] != NULL) { + cnt_list[0]->passflag = 1; + } + cnt->rolling_frame = 0; if (cnt->conf.emulate_motion) { @@ -2866,7 +2876,6 @@ static void become_daemon(void) { int i; - FILE *pidf = NULL; struct sigaction sig_ign_action; /* Setup sig_ign_action */ @@ -2885,29 +2894,6 @@ } /* - * Create the pid file if defined, if failed exit - * If we fail we report it. If we succeed we postpone the log entry till - * later when we have closed stdout. Otherwise Motion hangs in the terminal waiting - * for an enter. - */ - if (cnt_list[0]->conf.pid_file) { - pidf = myfopen(cnt_list[0]->conf.pid_file, "w+e"); - - if (pidf) { - (void)fprintf(pidf, "%d\n", getpid()); - myfclose(pidf); - } else { - MOTION_LOG(EMG, TYPE_ALL, SHOW_ERRNO - ,_("Exit motion, cannot create process" - " id file (pid file) %s"), cnt_list[0]->conf.pid_file); - if (ptr_logfile) { - myfclose(ptr_logfile); - } - exit(0); - } - } - - /* * Changing dir to root enables people to unmount a disk * without having to stop Motion */ @@ -2915,7 +2901,6 @@ MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO, _("Could not change directory")); } - #if (defined(BSD) && !defined(__APPLE__)) setpgrp(0, getpid()); #else @@ -2944,18 +2929,32 @@ close(i); } - /* Now it is safe to add the PID creation to the logs */ - if (pidf) { - MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO - ,_("Created process id file %s. Process ID is %d") - ,cnt_list[0]->conf.pid_file, getpid()); - } - sigaction(SIGTTOU, &sig_ign_action, NULL); sigaction(SIGTTIN, &sig_ign_action, NULL); sigaction(SIGTSTP, &sig_ign_action, NULL); } +static void pid_write(void) +{ + FILE *pidf = NULL; + + if (cnt_list[0]->conf.pid_file) { + pidf = myfopen(cnt_list[0]->conf.pid_file, "w+e"); + + if (pidf) { + (void)fprintf(pidf, "%d\n", getpid()); + myfclose(pidf); + MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO + ,_("Created process id file %s. Process ID is %d") + ,cnt_list[0]->conf.pid_file, getpid()); + } else { + MOTION_LOG(ERR, TYPE_ALL, SHOW_ERRNO + ,_("Cannot create process id file (pid file) %s") + , cnt_list[0]->conf.pid_file); + } + } +} + static void cntlist_create(int argc, char *argv[]) { /* @@ -3203,6 +3202,8 @@ } } + pid_write(); + if (cnt_list[0]->conf.setup_mode) { MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO,_("Motion running in setup mode.")); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/motion-release-4.5.0/src/video_v4l2.c new/motion-release-4.5.1/src/video_v4l2.c --- old/motion-release-4.5.0/src/video_v4l2.c 2022-10-30 21:30:49.000000000 +0100 +++ new/motion-release-4.5.1/src/video_v4l2.c 2022-12-18 01:36:49.000000000 +0100 @@ -1191,8 +1191,8 @@ src_v4l2_t *vid_source = (src_v4l2_t *) curdev->v4l2_private; video_buff *src; - width = cnt->imgs.width; - height = cnt->imgs.height; + width = curdev->width; + height = curdev->height; src = &vid_source->buffers[vid_source->buf.index]; /*The FALLTHROUGH is a special comment required by compiler.*/ @@ -1415,9 +1415,7 @@ static int v4l2_device_open(struct context *cnt, struct video_dev *curdev) { - int fd_device; - /* Open the video device */ MOTION_LOG(NTC, TYPE_VIDEO, NO_ERRNO ,_("Using videodevice %s and input %d") @@ -1427,13 +1425,14 @@ cnt->watchdog = (cnt->conf.watchdog_tmo * 2); curdev->video_device = cnt->conf.video_device; + src_v4l2_t *vid_source = (src_v4l2_t *) curdev->v4l2_private; curdev->fd_device = -1; + vid_source->fd_device = -1; fd_device = -1; fd_device = open(curdev->video_device, O_RDWR|O_CLOEXEC); if (fd_device > 0) { curdev->fd_device = fd_device; - src_v4l2_t *vid_source = (src_v4l2_t *) curdev->v4l2_private; vid_source->fd_device = fd_device; return 0; } @@ -1447,39 +1446,35 @@ static void v4l2_device_close(struct video_dev *curdev) { - src_v4l2_t *vid_source = (src_v4l2_t *) curdev->v4l2_private; enum v4l2_buf_type type; type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - if (vid_source != NULL) { - xioctl(vid_source, VIDIOC_STREAMOFF, &type); - } - - if (vid_source->fd_device != -1) { - close(vid_source->fd_device); - vid_source->fd_device = -1; + if (vid_source->fd_device != -1) { + MOTION_LOG(DBG, TYPE_VIDEO, NO_ERRNO, "close"); + xioctl(vid_source, VIDIOC_STREAMOFF, &type); + close(vid_source->fd_device); + vid_source->fd_device = -1; + } } } static void v4l2_device_cleanup(struct video_dev *curdev) { - src_v4l2_t *vid_source = (src_v4l2_t *) curdev->v4l2_private; - unsigned int indx; int indx2; - if (vid_source->buffers != NULL) { - for (indx = 0; indx < vid_source->req.count; indx++) { - munmap(vid_source->buffers[indx].ptr, vid_source->buffers[indx].size); - } - free(vid_source->buffers); - vid_source->buffers = NULL; - } - if (vid_source != NULL) { + MOTION_LOG(DBG, TYPE_VIDEO, NO_ERRNO, "vid_source"); + if (vid_source->buffers != NULL) { + for (indx = 0; indx < vid_source->req.count; indx++) { + munmap(vid_source->buffers[indx].ptr, vid_source->buffers[indx].size); + } + free(vid_source->buffers); + vid_source->buffers = NULL; + } free(vid_source); curdev->v4l2_private = NULL; }
