efl/ecore: hopefully fix all examples.

SVN revision: 82243
This commit is contained in:
Gustavo Sverzut Barbieri 2013-01-04 23:51:53 +00:00
parent 49152f6982
commit 4a35861791
5 changed files with 67 additions and 14 deletions

View File

@ -363,6 +363,8 @@ case "$build_crypto" in
EFL_DEPEND_PKG([crypto], [OPENSSL], [openssl]) EFL_DEPEND_PKG([crypto], [OPENSSL], [openssl])
;; ;;
esac esac
AM_CONDITIONAL([HAVE_CRYPTO_GNUTLS], [test "${build_crypto}" = "gnutls"])
AM_CONDITIONAL([HAVE_CRYPTO_OPENSSL], [test "${build_crypto}" = "openssl"])
#### Checks for header files #### Checks for header files
@ -1743,6 +1745,22 @@ AC_ARG_ENABLE([g-main-loop],
], ],
[want_g_main_loop="no"]) [want_g_main_loop="no"])
AC_ARG_ENABLE([gstreamer],
[AC_HELP_STRING([--disable-gstreamer],
[disable gstreamer support. @<:@default=enabled@:>@])],
[
if test "x${withval}" = "xyes" ; then
want_gstreamer="yes"
else
if test "x${withval}" = "xalways" ; then
want_gstreamer="always"
else
want_gstreamer="no"
fi
fi
],
[want_gstreamer="yes"])
### Default values ### Default values
if test "${have_windows}" = "yes"; then if test "${have_windows}" = "yes"; then
@ -1786,6 +1804,12 @@ if test "x${want_g_main_loop}" = "xyes" ; then
AC_DEFINE([USE_G_MAIN_LOOP], [1], [Use g_main_loop in ecore]) AC_DEFINE([USE_G_MAIN_LOOP], [1], [Use g_main_loop in ecore])
fi fi
# not EFL_OPTIONAL_DEPEND_PKG() because it's only used for ecore examples
if test "${want_gstreamer}" = "yes"; then
PKG_CHECK_MODULES([GSTREAMER], [gstreamer-0.10])
fi
AM_CONDITIONAL([HAVE_GSTREAMER], [test "${want_gstreamer}" = "yes"])
EFL_EVAL_PKGS([ECORE]) EFL_EVAL_PKGS([ECORE])
EFL_ADD_LIBS([ECORE], [${platform_libs}]) EFL_ADD_LIBS([ECORE], [${platform_libs}])

View File

@ -13,7 +13,9 @@ AM_CPPFLAGS = \
-I$(top_builddir)/src/lib/eo \ -I$(top_builddir)/src/lib/eo \
-I$(top_builddir)/src/lib/evas \ -I$(top_builddir)/src/lib/evas \
-I$(top_builddir)/src/lib/ecore \ -I$(top_builddir)/src/lib/ecore \
-I$(top_builddir)/src/lib/ecore_file \
-I$(top_builddir)/src/lib/ecore_input \ -I$(top_builddir)/src/lib/ecore_input \
-I$(top_builddir)/src/lib/ecore_imf \
-I$(top_builddir)/src/lib/ecore_con \ -I$(top_builddir)/src/lib/ecore_con \
-I$(top_builddir)/src/lib/ecore_evas \ -I$(top_builddir)/src/lib/ecore_evas \
-I$(top_builddir)/src/lib/ecore_audio \ -I$(top_builddir)/src/lib/ecore_audio \
@ -44,7 +46,6 @@ ecore_event_example_02 \
ecore_exe_example \ ecore_exe_example \
ecore_exe_example_child \ ecore_exe_example_child \
ecore_fd_handler_example \ ecore_fd_handler_example \
ecore_fd_handler_gnutls_example \
ecore_file_download_example \ ecore_file_download_example \
ecore_idler_example \ ecore_idler_example \
ecore_imf_example \ ecore_imf_example \
@ -161,23 +162,35 @@ ecore_exe_example_child_LDADD = $(ECORE_COMMON_LDADD)
ecore_fd_handler_example_SOURCES = ecore_fd_handler_example.c ecore_fd_handler_example_SOURCES = ecore_fd_handler_example.c
ecore_fd_handler_example_LDADD = $(ECORE_COMMON_LDADD) ecore_fd_handler_example_LDADD = $(ECORE_COMMON_LDADD)
if HAVE_CRYPTO_GNUTLS
EXTRA_PROGRAMS += ecore_fd_handler_gnutls_example
ecore_fd_handler_gnutls_example_SOURCES = ecore_fd_handler_gnutls_example.c ecore_fd_handler_gnutls_example_SOURCES = ecore_fd_handler_gnutls_example.c
ecore_fd_handler_gnutls_example_LDADD = $(ECORE_COMMON_LDADD) ecore_fd_handler_gnutls_example_LDADD = $(ECORE_COMMON_LDADD) @ECORE_CON_LIBS@
ecore_fd_handler_gnutls_example_CFLAGS = @ECORE_CON_CFLAGS@
endif
ecore_file_download_example_SOURCES = ecore_file_download_example.c ecore_file_download_example_SOURCES = ecore_file_download_example.c
ecore_file_download_example_LDADD = $(ECORE_COMMON_LDADD) ecore_file_download_example_LDADD = $(ECORE_COMMON_LDADD) \
$(top_builddir)/src/lib/ecore_file/libecore_file.la
ecore_idler_example_SOURCES = ecore_idler_example.c ecore_idler_example_SOURCES = ecore_idler_example.c
ecore_idler_example_LDADD = $(ECORE_COMMON_LDADD) ecore_idler_example_LDADD = $(ECORE_COMMON_LDADD)
ecore_imf_example_SOURCES = ecore_imf_example.c ecore_imf_example_SOURCES = ecore_imf_example.c
ecore_imf_example_LDADD = $(ECORE_COMMON_LDADD) ecore_imf_example_LDADD = $(ECORE_COMMON_LDADD) \
$(top_builddir)/src/lib/ecore_imf/libecore_imf.la \
$(top_builddir)/src/lib/ecore_imf/libecore_imf_evas.la \
$(top_builddir)/src/lib/ecore_evas/libecore_evas.la
ecore_job_example_SOURCES = ecore_job_example.c ecore_job_example_SOURCES = ecore_job_example.c
ecore_job_example_LDADD = $(ECORE_COMMON_LDADD) ecore_job_example_LDADD = $(ECORE_COMMON_LDADD)
if HAVE_GSTREAMER
ecore_pipe_gstreamer_example_SOURCES = ecore_pipe_gstreamer_example.c ecore_pipe_gstreamer_example_SOURCES = ecore_pipe_gstreamer_example.c
ecore_pipe_gstreamer_example_LDADD = $(ECORE_COMMON_LDADD) ecore_pipe_gstreamer_example_LDADD = $(ECORE_COMMON_LDADD) @GSTREAMER_LIBS@
ecore_pipe_gstreamer_example_CFLAGS = @GSTREAMER_CFLAGS@
endif
ecore_pipe_simple_example_SOURCES = ecore_pipe_simple_example.c ecore_pipe_simple_example_SOURCES = ecore_pipe_simple_example.c
ecore_pipe_simple_example_LDADD = $(ECORE_COMMON_LDADD) ecore_pipe_simple_example_LDADD = $(ECORE_COMMON_LDADD)

View File

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <Ecore.h> #include <Ecore.h>
#include <Ecore_Con.h> #include <Ecore_Con.h>
@ -6,12 +10,15 @@
* 2010 Mike Blumenkrantz * 2010 Mike Blumenkrantz
*/ */
/* comment if not using gnutls */ #ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
static void static void
tls_log_func(int level, const char *str) tls_log_func(int level, const char *str)
{ {
fprintf(stderr, "|<%d>| %s", level, str); fprintf(stderr, "|<%d>| %s", level, str);
} }
#endif
Eina_Bool Eina_Bool
_add(void *data, int type, Ecore_Con_Event_Server_Add *ev) _add(void *data, int type, Ecore_Con_Event_Server_Add *ev)
@ -58,9 +65,10 @@ main()
ecore_init(); ecore_init();
ecore_con_init(); ecore_con_init();
/* comment if not using gnutls */ #ifdef HAVE_GNUTLS
gnutls_global_set_log_level(9); gnutls_global_set_log_level(9);
gnutls_global_set_log_function(tls_log_func); gnutls_global_set_log_function(tls_log_func);
#endif
if (!(it = eina_file_ls("/etc/ssl/certs"))) if (!(it = eina_file_ls("/etc/ssl/certs")))
exit(1); exit(1);

View File

@ -1,3 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> #include <stdio.h>
#include <Ecore.h> #include <Ecore.h>
#include <Ecore_Con.h> #include <Ecore_Con.h>
@ -6,12 +10,15 @@
* 2010 Mike Blumenkrantz * 2010 Mike Blumenkrantz
*/ */
/* comment if not using gnutls */ #ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
static void static void
tls_log_func(int level, const char *str) tls_log_func(int level, const char *str)
{ {
fprintf(stderr, "|<%d>| %s", level, str); fprintf(stderr, "|<%d>| %s", level, str);
} }
#endif
Eina_Bool Eina_Bool
_add(void *data, int type, Ecore_Con_Event_Client_Add *ev) _add(void *data, int type, Ecore_Con_Event_Client_Add *ev)
@ -56,9 +63,10 @@ main()
ecore_init(); ecore_init();
ecore_con_init(); ecore_con_init();
/* comment if not using gnutls */ #ifdef HAVE_GNUTLS
gnutls_global_set_log_level(9); gnutls_global_set_log_level(9);
gnutls_global_set_log_function(tls_log_func); gnutls_global_set_log_function(tls_log_func);
#endif
/* to use a PEM certificate with TLS and SSL3, uncomment the lines below */ /* to use a PEM certificate with TLS and SSL3, uncomment the lines below */
if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_USE_SSL3 | ECORE_CON_LOAD_CERT, "127.0.0.1", 8080, NULL))) if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_USE_SSL3 | ECORE_CON_LOAD_CERT, "127.0.0.1", 8080, NULL)))

View File

@ -3,7 +3,7 @@
static int nbr = 0; static int nbr = 0;
static GstElement *_buid_pipeline(gchar *filename, Ecore_Pipe *pipe); static GstElement *_build_pipeline(gchar *filename, Ecore_Pipe *pipe);
static void new_decoded_pad_cb(GstElement *demuxer, static void new_decoded_pad_cb(GstElement *demuxer,
GstPad *new_pad, GstPad *new_pad,
@ -48,7 +48,7 @@ main(int argc, char *argv[])
return 0; return 0;
} }
pipe = ecore_pipe_add(handler); pipe = ecore_pipe_add(handler, NULL);
if (!pipe) if (!pipe)
{ {
ecore_shutdown(); ecore_shutdown();
@ -66,7 +66,7 @@ main(int argc, char *argv[])
} }
filename = argv[1]; filename = argv[1];
pipeline = _buid_pipeline(filename, pipe); pipeline = _build_pipeline(filename, pipe);
if (!pipeline) if (!pipeline)
{ {
g_print("Error during the pipeline building\n"); g_print("Error during the pipeline building\n");
@ -115,8 +115,8 @@ new_decoded_pad_cb(GstElement *demuxer,
gst_caps_unref(caps); gst_caps_unref(caps);
} }
static GstElement static GstElement *
_buid_pipeline(gchar *filename, Ecore_Pipe *pipe) _build_pipeline(gchar *filename, Ecore_Pipe *pipe)
{ {
GstElement *pipeline; GstElement *pipeline;
GstElement *filesrc; GstElement *filesrc;