diff --git a/legacy/emotion/configure.ac b/legacy/emotion/configure.ac index 13b8ed676e..3015c308fb 100644 --- a/legacy/emotion/configure.ac +++ b/legacy/emotion/configure.ac @@ -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 +#include + ]], + [[ +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}" diff --git a/legacy/emotion/src/lib/emotion_main.c b/legacy/emotion/src/lib/emotion_main.c index f25fa37cfe..80c7ed72aa 100644 --- a/legacy/emotion/src/lib/emotion_main.c +++ b/legacy/emotion/src/lib/emotion_main.c @@ -6,7 +6,9 @@ #include #include # include -# include +# ifdef HAVE_V4L2 +# include +# endif # include # include @@ -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);