EFL_EDJE_EXTERNAL([have_edje_external="yes"], [have_edje_external="no"])
+PKG_CHECK_MODULES(EEZE, [eeze >= 1.0.99], [have_eeze="yes"], [have_eeze="no"])
+
+if test "x${have_eeze}" = "xyes"; then
+ AC_DEFINE(EMOTION_HAVE_EEZE, 1, [Define to 1 if Eeze is available])
+fi
### Checks for header files
AC_HEADER_STDC
* @defgroup Emotion_Info Miscellaneous information retrieval functions
*/
+EAPI Eina_Bool emotion_init(void);
+EAPI Eina_Bool emotion_shutdown(void);
+
/**
* @brief Add an emotion object to the canvas.
*
EAPI void emotion_object_suspend_set (Evas_Object *obj, Emotion_Suspend state);
EAPI Emotion_Suspend emotion_object_suspend_get (Evas_Object *obj);
-EAPI Eina_Bool emotion_object_extension_can_play_get(const Evas_Object *obj, const char *file);
-EAPI Eina_Bool emotion_object_extension_can_play_fast_get(const Evas_Object *obj, const char *file);
-
EAPI Eina_Bool emotion_object_extension_may_play_fast_get(const char *file);
EAPI Eina_Bool emotion_object_extension_may_play_get(const char *file);
+typedef struct _Emotion_Webcam Emotion_Webcam;
+
+EAPI const Eina_List *emotion_webcams_get(void);
+EAPI const char *emotion_webcam_name_get(Emotion_Webcam *ew);
+EAPI const char *emotion_webcam_device_get(Emotion_Webcam *ew);
+
/**
* @}
*/
@EMOTION_CPPFLAGS@ \
@EMOTION_CFLAGS@ \
@EIO_CFLAGS@ \
-@EFL_EMOTION_BUILD@
+@EFL_EMOTION_BUILD@ \
+@EEZE_CFLAGS@
if EMOTION_STATIC_BUILD_XINE
AM_CPPFLAGS += @XINE_CFLAGS@
includes_HEADERS = Emotion.h
includesdir = $(includedir)/emotion-@VMAJ@
-libemotion_la_SOURCES = emotion_smart.c
+libemotion_la_SOURCES = emotion_smart.c emotion_main.c
if EMOTION_STATIC_BUILD_XINE
libemotion_la_SOURCES += \
$(top_srcdir)/src/modules/vlc/emotion_vlc.c
endif
-libemotion_la_LIBADD = @EMOTION_LIBS@ @EIO_LIBS@
+libemotion_la_LIBADD = @EMOTION_LIBS@ @EIO_LIBS@ @EEZE_LIBS@
if EMOTION_STATIC_BUILD_XINE
libemotion_la_LIBADD += @XINE_LIBS@
double (*speed_get) (void *ef);
int (*eject) (void *ef);
const char * (*meta_get) (void *ef, int meta);
- Eina_Bool (*can_play_get) (const void *ef, const char *file);
Eina_Emotion_Plugins *plugin;
};
EAPI void _emotion_spu_button_set(Evas_Object *obj, int button);
EAPI void _emotion_seek_done(Evas_Object *obj);
-EAPI Eina_Bool _emotion_object_extension_can_play_generic_get(const void *data __UNUSED__, const char *file);
-
EAPI Eina_Bool _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close);
EAPI Eina_Bool _emotion_module_unregister(const char *name);
#endif
}
-EAPI Eina_Bool
-emotion_object_extension_can_play_fast_get(const Evas_Object *obj, const char *file)
-{
- const Smart_Data *sd;
-
- E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
- if (!sd->module) return EINA_FALSE;
- if (!sd->video) return EINA_FALSE;
- if (!sd->module->can_play_get) return EINA_FALSE;
- return sd->module->can_play_get(sd->video, file);
-}
-
-EAPI Eina_Bool
-emotion_object_extension_can_play_get(const Evas_Object *obj, const char *file)
-{
- const char *tmp;
- Eina_Bool result;
-
- tmp = eina_stringshare_add(file);
- result = emotion_object_extension_can_play_fast_get(obj, tmp);
- eina_stringshare_del(tmp);
-
- return result;
-}
-
-EAPI Eina_Bool
-emotion_object_extension_may_play_fast_get(const char *file)
-{
- if (!file) return EINA_FALSE;
- return _emotion_object_extension_can_play_generic_get(NULL, file);
-}
-
-EAPI Eina_Bool
-emotion_object_extension_may_play_get(const char *file)
-{
- const char *tmp;
- Eina_Bool result;
-
- if (!file) return EINA_FALSE;
- tmp = eina_stringshare_add(file);
- result = emotion_object_extension_may_play_fast_get(tmp);
- eina_stringshare_del(tmp);
-
- return result;
-}
-
EAPI void
emotion_object_suspend_set(Evas_Object *obj, Emotion_Suspend state)
{
/* Utility calls for modules */
/*****************************/
-struct ext_match_s
-{
- unsigned int length;
- const char *extension;
-};
-
-#define MATCHING(Ext) \
- { sizeof (Ext), Ext }
-
-static const struct ext_match_s matchs[] =
-{ /* map extensions to know if it's a emotion playable content for good first-guess tries */
- MATCHING(".264"),
- MATCHING(".3g2"),
- MATCHING(".3gp"),
- MATCHING(".3gp2"),
- MATCHING(".3gpp"),
- MATCHING(".3gpp2"),
- MATCHING(".3p2"),
- MATCHING(".asf"),
- MATCHING(".avi"),
- MATCHING(".bdm"),
- MATCHING(".bdmv"),
- MATCHING(".clpi"),
- MATCHING(".clp"),
- MATCHING(".fla"),
- MATCHING(".flv"),
- MATCHING(".m1v"),
- MATCHING(".m2v"),
- MATCHING(".m2t"),
- MATCHING(".m4v"),
- MATCHING(".mkv"),
- MATCHING(".mov"),
- MATCHING(".mp2"),
- MATCHING(".mp2ts"),
- MATCHING(".mp4"),
- MATCHING(".mpe"),
- MATCHING(".mpeg"),
- MATCHING(".mpg"),
- MATCHING(".mpl"),
- MATCHING(".mpls"),
- MATCHING(".mts"),
- MATCHING(".mxf"),
- MATCHING(".nut"),
- MATCHING(".nuv"),
- MATCHING(".ogg"),
- MATCHING(".ogm"),
- MATCHING(".ogv"),
- MATCHING(".rm"),
- MATCHING(".rmj"),
- MATCHING(".rmm"),
- MATCHING(".rms"),
- MATCHING(".rmx"),
- MATCHING(".rmvb"),
- MATCHING(".swf"),
- MATCHING(".ts"),
- MATCHING(".weba"),
- MATCHING(".webm"),
- MATCHING(".wmv")
-};
-
-EAPI Eina_Bool
-_emotion_object_extension_can_play_generic_get(const void *data __UNUSED__, const char *file)
-{
- unsigned int length;
- unsigned int i;
-
- length = eina_stringshare_strlen(file) + 1;
- if (length < 5) return EINA_FALSE;
-
- for (i = 0; i < sizeof (matchs) / sizeof (struct ext_match_s); ++i)
- {
- if (matchs[i].length > length) continue;
-
- if (!strcasecmp(matchs[i].extension,
- file + length - matchs[i].length))
- return EINA_TRUE;
- }
-
- return EINA_FALSE;
-}
-
EAPI void *
_emotion_video_get(const Evas_Object *obj)
{
if (!sd) return NULL;
return sd->obj;
}
+
em_speed_get, /* speed_get */
em_eject, /* eject */
em_meta_get, /* meta_get */
- _emotion_object_extension_can_play_generic_get, /* play_get */
NULL /* handle */
};
Emotion_Gstreamer_Video *ev;
Eina_Strbuf *sbuf = NULL;
const char *uri;
+ double start, end;
int i;
ev = (Emotion_Gstreamer_Video *)video;
eina_strbuf_append(sbuf, file);
}
+ start = ecore_time_get();
uri = sbuf ? eina_strbuf_string_get(sbuf) : file;
DBG("setting file to '%s'", uri);
ev->pipeline = gstreamer_video_sink_new(ev, obj, uri);
if (sbuf) eina_strbuf_free(sbuf);
+ end = ecore_time_get();
+ DBG("Pipeline creation: %f", end - start);
if (!ev->pipeline)
return EINA_FALSE;
+ start = ecore_time_get();
ev->eos_bus = gst_pipeline_get_bus(GST_PIPELINE(ev->pipeline));
if (!ev->eos_bus)
{
ERR("could not get the bus");
return EINA_FALSE;
}
+ end = ecore_time_get();
+ DBG("Get the bus: %f", end - start);
/* Evas Object */
ev->obj = obj;
/* video stream */
+ start = ecore_time_get();
for (i = 0; i < ev->video_stream_nbr; i++)
{
Emotion_Video_Stream *vstream;
unref_pad_v:
gst_object_unref(pad);
}
+ end = ecore_time_get();
+ DBG("Get video streams: %f", end - start);
/* Audio streams */
+ start = ecore_time_get();
for (i = 0; i < ev->audio_stream_nbr; i++)
{
Emotion_Audio_Stream *astream;
unref_pad_a:
gst_object_unref(pad);
}
+ end = ecore_time_get();
+ DBG("Get audio streams: %f", end - start);
/* Visualization sink */
+ start = ecore_time_get();
if (ev->video_stream_nbr == 0)
{
GstElement *vis = NULL;
flags |= 0x00000008;
g_object_set(G_OBJECT(ev->pipeline), "flags", flags, NULL);
}
+ end = ecore_time_get();
+ DBG("Get visualization streams: %f", end - start);
finalize:
_free_metadata(ev->metadata);
ev->metadata = calloc(1, sizeof(Emotion_Gstreamer_Metadata));
+ start = ecore_time_get();
em_audio_channel_volume_set(ev, ev->volume);
_eos_timer_fct(ev);
_emotion_open_done(ev->obj);
+ end = ecore_time_get();
+ DBG("Last stuff: %f", end - start);
return 1;
}
if (priv->format == GST_VIDEO_FORMAT_I420) {
int i;
- unsigned char **rows;
+ const unsigned char **rows;
evas_object_image_pixels_dirty_set(priv->o, 1);
- rows = (unsigned char **)evas_data;
+ rows = (const unsigned char **)evas_data;
for (i = 0; i < priv->height; i++)
rows[i] = &gst_data[i * priv->width];
if (priv->format == GST_VIDEO_FORMAT_YV12) {
int i;
- unsigned char **rows;
+ const unsigned char **rows;
evas_object_image_pixels_dirty_set(priv->o, 1);
- rows = (unsigned char **)evas_data;
+ rows = (const unsigned char **)evas_data;
for (i = 0; i < priv->height; i++)
rows[i] = &gst_data[i * priv->width];
GstElement *sink;
Evas_Object *obj;
GstStateChangeReturn res;
+ double start, end;
obj = _emotion_image_get(o);
if (!obj)
return NULL;
}
+ start = ecore_time_get();
playbin = gst_element_factory_make("playbin2", "playbin");
if (!playbin)
{
ERR("Unable to create 'playbin' GstElement.");
return NULL;
}
+ end = ecore_time_get();
+ DBG("Playbin2: %f", end - start);
+ start = ecore_time_get();
sink = gst_element_factory_make("emotion-sink", "sink");
if (!sink)
{
g_object_set(G_OBJECT(playbin), "video-sink", sink, NULL);
g_object_set(G_OBJECT(playbin), "uri", uri, NULL);
g_object_set(G_OBJECT(sink), "evas-object", obj, NULL);
+ end = ecore_time_get();
+ DBG("emotion-sink: %f", end - start);
+
+ start = ecore_time_get();
res = gst_element_set_state(playbin, GST_STATE_PAUSED);
if (res == GST_STATE_CHANGE_FAILURE)
{
ERR("Unable to set GST_STATE_PAUSED.");
goto unref_pipeline;
}
+ end = ecore_time_get();
+ DBG("Pause pipeline: %f", end - start);
+ start = ecore_time_get();
res = gst_element_get_state(playbin, NULL, NULL, GST_CLOCK_TIME_NONE);
if (res != GST_STATE_CHANGE_SUCCESS)
{
ERR("Unable to get GST_CLOCK_TIME_NONE.");
goto unref_pipeline;
}
+ end = ecore_time_get();
+ DBG("No time: %f", end - start);
evas_object_data_set(obj, "_emotion_gstreamer_video", ev);
em_speed_get, /* speed_get */
em_eject, /* eject */
em_meta_get, /* meta_get */
- _emotion_object_extension_can_play_generic_get, /* can_play_get */
-
NULL /* handle */
};
em_speed_get, /* speed_get */
em_eject, /* eject */
em_meta_get, /* meta_get */
- _emotion_object_extension_can_play_generic_get, /* can_play_get */
NULL /* handle */
};