summaryrefslogtreecommitdiff
path: root/src/tests/emotion
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2013-02-27 22:49:34 +0100
committerdavemds <dave@gurumeditation.it>2013-02-27 22:49:34 +0100
commit23cbcb5fa42f84b7ae55babbe7f7111c71f261f7 (patch)
tree387ad47280a5fbb11947392cbc8565c8139ca1a1 /src/tests/emotion
parent4e0b7d7bca71d6a8bb849bb4c5f36f0a187dd3b9 (diff)
emotion_test is now able to play streams from webcams (and other sources maybe)
just run: emotion_test -w
Diffstat (limited to 'src/tests/emotion')
-rw-r--r--src/tests/emotion/emotion_test_main.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c
index 09dfbcee46..dbc833f756 100644
--- a/src/tests/emotion/emotion_test_main.c
+++ b/src/tests/emotion/emotion_test_main.c
@@ -30,6 +30,7 @@ static const Ecore_Getopt options = {
30 ecore_getopt_callback_geometry_parse, NULL), 30 ecore_getopt_callback_geometry_parse, NULL),
31 ECORE_GETOPT_STORE_STR('b', "backend", "backend to use"), 31 ECORE_GETOPT_STORE_STR('b', "backend", "backend to use"),
32 ECORE_GETOPT_STORE_INT('v', "vis", "visualization type"), 32 ECORE_GETOPT_STORE_INT('v', "vis", "visualization type"),
33 ECORE_GETOPT_STORE_TRUE('w', "webcams", "show all the available v4l streams"),
33 ECORE_GETOPT_COUNT('v', "verbose", "be more verbose"), 34 ECORE_GETOPT_COUNT('v', "verbose", "be more verbose"),
34 ECORE_GETOPT_STORE_TRUE('R', "reflex", "show video reflex effect"), 35 ECORE_GETOPT_STORE_TRUE('R', "reflex", "show video reflex effect"),
35 ECORE_GETOPT_VERSION('V', "version"), 36 ECORE_GETOPT_VERSION('V', "version"),
@@ -684,6 +685,7 @@ main(int argc, char **argv)
684 char *engine = NULL; 685 char *engine = NULL;
685 char *backend = NULL; 686 char *backend = NULL;
686 int verbose = 0; 687 int verbose = 0;
688 Eina_Bool webcams = EINA_FALSE;
687 int visual = EMOTION_VIS_NONE; 689 int visual = EMOTION_VIS_NONE;
688 unsigned char help = 0; 690 unsigned char help = 0;
689 unsigned char engines_listed = 0; 691 unsigned char engines_listed = 0;
@@ -693,6 +695,7 @@ main(int argc, char **argv)
693 ECORE_GETOPT_VALUE_PTR_CAST(geometry), 695 ECORE_GETOPT_VALUE_PTR_CAST(geometry),
694 ECORE_GETOPT_VALUE_STR(backend), 696 ECORE_GETOPT_VALUE_STR(backend),
695 ECORE_GETOPT_VALUE_INT(visual), 697 ECORE_GETOPT_VALUE_INT(visual),
698 ECORE_GETOPT_VALUE_BOOL(webcams),
696 ECORE_GETOPT_VALUE_INT(verbose), 699 ECORE_GETOPT_VALUE_INT(verbose),
697 ECORE_GETOPT_VALUE_BOOL(reflex), 700 ECORE_GETOPT_VALUE_BOOL(reflex),
698 ECORE_GETOPT_VALUE_NONE, 701 ECORE_GETOPT_VALUE_NONE,
@@ -718,7 +721,7 @@ main(int argc, char **argv)
718 if (args < 0) goto shutdown_edje; 721 if (args < 0) goto shutdown_edje;
719 else if (help) goto shutdown_edje; 722 else if (help) goto shutdown_edje;
720 else if (engines_listed) goto shutdown_edje; 723 else if (engines_listed) goto shutdown_edje;
721 else if (args == argc) 724 else if ((args == argc) && (!webcams))
722 { 725 {
723 printf("must provide at least one file to play!\n"); 726 printf("must provide at least one file to play!\n");
724 goto shutdown_edje; 727 goto shutdown_edje;
@@ -759,6 +762,21 @@ main(int argc, char **argv)
759 for (; args < argc; args++) 762 for (; args < argc; args++)
760 init_video_object(backend, argv[args]); 763 init_video_object(backend, argv[args]);
761 764
765 if (webcams)
766 {
767 const Eina_List *wl, *l;
768 Emotion_Webcam *webcam;
769
770 wl = emotion_webcams_get();
771 EINA_LIST_FOREACH(wl, l, webcam)
772 {
773 printf("Playing stream: '%s' url: '%s'\n",
774 emotion_webcam_name_get(webcam),
775 emotion_webcam_device_get(webcam));
776 init_video_object(backend, emotion_webcam_device_get(webcam));
777 }
778 }
779
762 ecore_animator_add(check_positions, NULL); 780 ecore_animator_add(check_positions, NULL);
763 781
764 ecore_main_loop_begin(); 782 ecore_main_loop_begin();