"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mmalcam.c" between
motion-release-4.2.2.tar.gz and motion-Release-4.3.0.tar.gz

About: Motion monitors the video signal from one or more cameras and is able to detect motion.

mmalcam.c  (motion-release-4.2.2):mmalcam.c  (motion-Release-4.3.0)
skipping to change at line 14 skipping to change at line 14
* Raspberry Pi camera module using MMAL API. * Raspberry Pi camera module using MMAL API.
* *
* Built upon functionality from the Raspberry Pi userland utility raspivid. * Built upon functionality from the Raspberry Pi userland utility raspivid.
* *
* Copyright 2013 by Nicholas Tuckett * Copyright 2013 by Nicholas Tuckett
* This software is distributed under the GNU public license version 2 * This software is distributed under the GNU public license version 2
* See also the file 'COPYING'. * See also the file 'COPYING'.
* *
*/ */
#include "translate.h"
#include "motion.h"
#include "rotate.h"
#ifdef HAVE_MMAL
#include "interface/vcos/vcos.h" #include "interface/vcos/vcos.h"
#include "interface/mmal/mmal.h" #include "interface/mmal/mmal.h"
#include "interface/mmal/mmal_buffer.h" #include "interface/mmal/mmal_buffer.h"
#include "interface/mmal/mmal_port.h" #include "interface/mmal/mmal_port.h"
#include "interface/mmal/util/mmal_util.h" #include "interface/mmal/util/mmal_util.h"
#include "interface/mmal/util/mmal_util_params.h" #include "interface/mmal/util/mmal_util_params.h"
#include "interface/mmal/util/mmal_default_components.h" #include "interface/mmal/util/mmal_default_components.h"
#include "interface/mmal/util/mmal_connection.h" #include "interface/mmal/util/mmal_connection.h"
#include "raspicam/RaspiCamControl.h" #include "raspicam/RaspiCamControl.h"
#include "translate.h"
#include "motion.h"
#include "rotate.h"
#define MMALCAM_OK 0 #define MMALCAM_OK 0
#define MMALCAM_ERROR -1 #define MMALCAM_ERROR -1
#define MMAL_CAMERA_PREVIEW_PORT 0 #define MMAL_CAMERA_PREVIEW_PORT 0
#define MMAL_CAMERA_VIDEO_PORT 1 #define MMAL_CAMERA_VIDEO_PORT 1
#define MMAL_CAMERA_CAPTURE_PORT 2 #define MMAL_CAMERA_CAPTURE_PORT 2
#define VIDEO_FRAME_RATE_NUM 30 #define VIDEO_FRAME_RATE_NUM 30
#define VIDEO_FRAME_RATE_DEN 1 #define VIDEO_FRAME_RATE_DEN 1
#define VIDEO_OUTPUT_BUFFERS_NUM 3 #define VIDEO_OUTPUT_BUFFERS_NUM 3
skipping to change at line 226 skipping to change at line 228
return MMALCAM_ERROR; return MMALCAM_ERROR;
} }
return MMALCAM_OK; return MMALCAM_OK;
} }
static int send_pooled_buffers_to_port(MMAL_POOL_T *pool, MMAL_PORT_T *port) static int send_pooled_buffers_to_port(MMAL_POOL_T *pool, MMAL_PORT_T *port)
{ {
int num = mmal_queue_length(pool->queue); int num = mmal_queue_length(pool->queue);
for (int i = 0; i < num; i++) { int i;
for (i = 0; i < num; i++) {
MMAL_BUFFER_HEADER_T *buffer = mmal_queue_get(pool->queue); MMAL_BUFFER_HEADER_T *buffer = mmal_queue_get(pool->queue);
if (!buffer) { if (!buffer) {
MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO
,_("Unable to get a required buffer %d from pool queue"), i); ,_("Unable to get a required buffer %d from pool queue"), i);
return MMALCAM_ERROR; return MMALCAM_ERROR;
} }
if (mmal_port_send_buffer(port, buffer) != MMAL_SUCCESS) { if (mmal_port_send_buffer(port, buffer) != MMAL_SUCCESS) {
MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO, _("Unable to send a buffer to port (%d)"), i); MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO, _("Unable to send a buffer to port (%d)"), i);
skipping to change at line 424 skipping to change at line 427
if (!new_buffer || status != MMAL_SUCCESS) if (!new_buffer || status != MMAL_SUCCESS)
MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO MOTION_LOG(ERR, TYPE_VIDEO, NO_ERRNO
,_("Unable to return a buffer to the camera video port")); ,_("Unable to return a buffer to the camera video port"));
} }
rotate_map(cnt,img_data); rotate_map(cnt,img_data);
return 0; return 0;
} }
#endif
 End of changes. 4 change blocks. 
5 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)