From: cedric Date: Tue, 9 Aug 2011 09:15:56 +0000 (+0000) Subject: emotion: make v4l2 optionnal. X-Git-Tag: submit/2.0alpha-wayland/20121127.222018~197 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=553f442e32ffb258b6de9f09be356cff3d6be907;p=profile%2Fivi%2Femotion.git emotion: make v4l2 optionnal. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@62243 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.ac b/configure.ac index 13b8ed6..3015c30 100644 --- a/configure.ac +++ b/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/src/lib/emotion_main.c b/src/lib/emotion_main.c index f25fa37..80c7ed7 100644 --- a/src/lib/emotion_main.c +++ b/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);