emotion: make v4l2 optionnal.

SVN revision: 62243
This commit is contained in:
Cedric BAIL 2011-08-09 09:15:56 +00:00
parent 6ac11a9806
commit 592e18828f
2 changed files with 27 additions and 1 deletions

View File

@ -206,6 +206,25 @@ setxattr("/", "user.ethumb.md5", NULL, 0, 0);
AC_MSG_CHECKING([for Xattr])
AC_MSG_RESULT([${have_xattr}])
### Check for video4linux
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stdio.h>
#include <linux/videodev2.h>
]],
[[
fprintf(stdout, "%i\n", V4L2_CAP_VIDEO_CAPTURE);
]])],
[
AC_DEFINE(HAVE_V4L2, 1, [Define to 1 if you have Video4Linux 2 available])
have_v4l2="yes"
],
[have_v4l2="no"])
AC_MSG_CHECKING([for V4L2])
AC_MSG_RESULT([${have_v4l2}])
### Modules
EMOTION_CHECK_MODULE([Xine], [${want_xine}])
@ -283,6 +302,7 @@ echo " Edje EXTERNAL support: ${have_edje_external}"
echo
echo " Xattr................: ${have_xattr}"
echo " Eio..................: ${have_eio}"
echo " V4L2.................: ${have_v4l2}"
echo
echo "Documentation..........: ${build_doc}"
echo "Examples.............: ${enable_build_examples}"

View File

@ -6,7 +6,9 @@
#include <sys/stat.h>
#include <fcntl.h>
# include <sys/ioctl.h>
# include <linux/videodev2.h>
# ifdef HAVE_V4L2
# include <linux/videodev2.h>
# endif
# include <Ecore.h>
# include <Eeze.h>
@ -144,12 +146,15 @@ emotion_webcam_destroy(Emotion_Webcam *ew)
static void
_emotion_check_device(Emotion_Webcam *ew)
{
#ifdef HAVE_V4L2
Emotion_Webcam *check;
Eina_List *l;
struct v4l2_capability caps;
int fd;
#endif
if (!ew) return ;
#ifdef HAVE_V4L2
if (!ew->device) goto on_error;
fd = open(ew->filename, O_RDONLY);
@ -175,6 +180,7 @@ _emotion_check_device(Emotion_Webcam *ew)
return ;
on_error:
#endif
fprintf(stderr, "'%s' is not a webcam ['%s']\n", ew->name, strerror(errno));
eina_stringshare_del(ew->syspath);
eina_stringshare_del(ew->device);