Skip to content

Commit 8249105

Browse files
committed
Initial support for MMAL camera on raspberry pi
Originally by dozencrows on github; mostly this commit: dozencrows/motion@6d1ed5b Changes to merge back into motion upstream made by Joseph Heenan (with help from lowflyerUK on github, see dozencrows/motion#1 ): - changed back to using autoconf etc as per the main project - submitted the one change we need to the raspicam files back upstream ( raspberrypi/userland#332 ) - imported latest versions of files in raspicam, now exactly match upstream - added README.txt to raspicam directory with brief explanation - replaced some tabs with spaces - removed dependency on checkout of raspberrypi userland repo; now we use the headers provided by libraspberrypi-dev - merged in a couple of the trivial later bugfix commits - merged in mmalcam_control_params commit to allow config of camera options - fixed many merge conflicts rebased on top of latest upstream motion
1 parent 1f6cc87 commit 8249105

15 files changed

Lines changed: 3283 additions & 4 deletions

Makefile.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ examplesdir = $(datadir)/@PACKAGE_NAME@/examples
3131
# These variables contain compiler flags, object files to build and files to #
3232
# install. #
3333
################################################################################
34-
CFLAGS = @CFLAGS@ -Wall -DVERSION=\"@PACKAGE_VERSION@\" -Dsysconfdir=\"$(sysconfdir)\" @FFMPEG_CFLAGS@
34+
CFLAGS = @CFLAGS@ -Wall -DVERSION=\"@PACKAGE_VERSION@\" -Dsysconfdir=\"$(sysconfdir)\" @FFMPEG_CFLAGS@ @MMAL_CFLAGS@
3535
LDFLAGS = @LDFLAGS@
36-
LIBS = @LIBS@ @FFMPEG_LIBS@
36+
LIBS = @LIBS@ @MMAL_LIBS@ @FFMPEG_LIBS@
3737
VIDEO_OBJ = @VIDEO@
3838
OBJ = motion.o logger.o conf.o draw.o jpegutils.o vloopback_motion.o $(VIDEO_OBJ) \
3939
netcam.o netcam_ftp.o netcam_jpeg.o netcam_wget.o track.o \
4040
alg.o event.o picture.o rotate.o webhttpd.o \
41-
stream.o md5.o netcam_rtsp.o @FFMPEG_OBJ@ @SDL_OBJ@
41+
stream.o md5.o netcam_rtsp.o \
42+
@FFMPEG_OBJ@ @MMAL_OBJ@ @SDL_OBJ@
4243
SRC = $(OBJ:.o=.c)
4344
DOC = CHANGELOG COPYING CREDITS README motion_guide.html
4445
EXAMPLES = *.conf

conf.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ struct config conf_template = {
148148
netcam_proxy: NULL,
149149
netcam_tolerant_check: 0,
150150
rtsp_uses_tcp: 1,
151+
#ifdef HAVE_MMAL
152+
mmalcam_name: NULL,
153+
mmalcam_control_params: NULL,
154+
#endif
151155
text_changes: 0,
152156
text_left: NULL,
153157
text_right: DEF_TIMESTAMP,
@@ -421,6 +425,26 @@ config_param config_params[] = {
421425
copy_bool,
422426
print_bool
423427
},
428+
#ifdef HAVE_MMAL
429+
{
430+
"mmalcam_name",
431+
"# Name of camera to use if you are using a camera accessed through OpenMax/MMAL\n"
432+
" Default: Not defined",
433+
0,
434+
CONF_OFFSET(mmalcam_name),
435+
copy_string,
436+
print_string
437+
},
438+
{
439+
"mmalcam_control_params",
440+
"# Camera control parameters (see raspivid/raspistill tool documentation)\n"
441+
" Default: Not defined",
442+
0,
443+
CONF_OFFSET(mmalcam_control_params),
444+
copy_string,
445+
print_string
446+
},
447+
#endif
424448
{
425449
"auto_brightness",
426450
"# Let motion regulate the brightness of a video device (default: off).\n"

conf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ struct config {
127127
const char *netcam_proxy;
128128
unsigned int netcam_tolerant_check;
129129
unsigned int rtsp_uses_tcp;
130+
#ifdef HAVE_MMAL
131+
const char *mmalcam_name;
132+
const char *mmalcam_control_params;
133+
#endif
130134
int text_changes;
131135
const char *text_left;
132136
const char *text_right;

0 commit comments

Comments
 (0)