aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/emotion
diff options
context:
space:
mode:
authorAl Poole <netstar@gmail.com>2017-01-12 14:09:49 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-01-12 14:37:19 -0800
commit1f9e915b5a001b4f4845defda559434b35588e96 (patch)
treed54da0c896305fab2b89fcf648af6b44ad01a0c0 /src/lib/emotion
parentUi text: fix deletion of the swallowed text object (diff)
downloadefl-1f9e915b5a001b4f4845defda559434b35588e96.tar.gz
emotion: add support for obtaining embedded artwork from media files with gstreamer1 backend.
Reviewers: raster, cedric Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4550 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/emotion')
-rw-r--r--src/lib/emotion/Emotion.h18
-rw-r--r--src/lib/emotion/emotion_modules.c6
-rw-r--r--src/lib/emotion/emotion_modules.h1
-rw-r--r--src/lib/emotion/emotion_private.h3
-rw-r--r--src/lib/emotion/emotion_smart.c20
5 files changed, 46 insertions, 2 deletions
diff --git a/src/lib/emotion/Emotion.h b/src/lib/emotion/Emotion.h
index 3ea786391d..b4914d65a5 100644
--- a/src/lib/emotion/Emotion.h
+++ b/src/lib/emotion/Emotion.h
@@ -196,6 +196,12 @@ enum _Emotion_Meta_Info
EMOTION_META_INFO_TRACK_COUNT /**< track count - number of the track in the album */
};
+enum _Emotion_Artwork_Info
+{
+ EMOTION_ARTWORK_IMAGE,
+ EMOTION_ARTWORK_PREVIEW_IMAGE
+};
+
/**
* @enum _Emotion_Vis
*
@@ -266,6 +272,7 @@ typedef enum _Emotion_Event Emotion_Event;
typedef enum _Emotion_Meta_Info Emotion_Meta_Info; /**< Meta info type to be retrieved. */
typedef enum _Emotion_Vis Emotion_Vis; /**< Type of visualization. */
typedef enum _Emotion_Aspect Emotion_Aspect; /**< Aspect ratio option. */
+typedef enum _Emotion_Artwork_Info Emotion_Artwork_Info;
#define EMOTION_CHANNEL_AUTO -1
#define EMOTION_CHANNEL_DEFAULT 0
@@ -1341,6 +1348,17 @@ EAPI const char *emotion_webcam_name_get(const Emotion_Webcam *ew);
EAPI const char *emotion_webcam_device_get(const Emotion_Webcam *ew);
/**
+ * @brief Get the album artwork from file meta data tags.
+ *
+ * @param obj The evas object we are working with.
+ * @param path The local path for the file.
+ * @param type The metadata location type (GST_IMAGE_PREVIEW_IMAGE or GST_PREVIEW).
+ *
+ * @ingroup Emotion_Artwork
+ */
+
+EAPI Evas_Object *emotion_file_meta_artwork_get(const Evas_Object *obj, const char *path, Emotion_Artwork_Info type);
+/**
* @}
*/
diff --git a/src/lib/emotion/emotion_modules.c b/src/lib/emotion/emotion_modules.c
index 273bb9acc4..719b5d3e85 100644
--- a/src/lib/emotion/emotion_modules.c
+++ b/src/lib/emotion/emotion_modules.c
@@ -791,6 +791,12 @@ emotion_engine_instance_meta_get(const Emotion_Engine_Instance *inst, int meta)
EMOTION_ENGINE_INSTANCE_CALL_RET(inst, meta_get, NULL, meta);
}
+void *
+emotion_engine_instance_meta_artwork_get(const Emotion_Engine_Instance *inst, Evas_Object *img, const char *path, Emotion_Artwork_Info type)
+{
+ EMOTION_ENGINE_INSTANCE_CALL_RET(inst, meta_artwork_get, NULL, img, path, type);
+}
+
void
emotion_engine_instance_priority_set(Emotion_Engine_Instance *inst, Eina_Bool priority)
{
diff --git a/src/lib/emotion/emotion_modules.h b/src/lib/emotion/emotion_modules.h
index eb9af156ea..4a0244177d 100644
--- a/src/lib/emotion/emotion_modules.h
+++ b/src/lib/emotion/emotion_modules.h
@@ -129,6 +129,7 @@ struct _Emotion_Engine
const char * (*meta_get) (void *ef, int meta);
void (*priority_set) (void *ef, Eina_Bool priority);
Eina_Bool (*priority_get) (void *ef);
+ void * (*meta_artwork_get)(void *ef, Evas_Object *img, const char *path, Emotion_Artwork_Info type);
};
EAPI void *_emotion_video_get(const Evas_Object *obj);
diff --git a/src/lib/emotion/emotion_private.h b/src/lib/emotion/emotion_private.h
index cb66c6a628..e884dc3448 100644
--- a/src/lib/emotion/emotion_private.h
+++ b/src/lib/emotion/emotion_private.h
@@ -89,6 +89,5 @@ Eina_Bool emotion_engine_instance_eject(Emotion_Engine_Instance *inst);
const char * emotion_engine_instance_meta_get(const Emotion_Engine_Instance *inst, int meta);
void emotion_engine_instance_priority_set(Emotion_Engine_Instance *inst, Eina_Bool priority);
Eina_Bool emotion_engine_instance_priority_get(const Emotion_Engine_Instance *inst);
-
-
+void * emotion_engine_instance_meta_artwork_get(const Emotion_Engine_Instance *inst, Evas_Object *img, const char *path, Emotion_Artwork_Info type);
#endif
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index 8ba69400b7..93cf1975ff 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -1262,6 +1262,26 @@ emotion_object_meta_info_get(const Evas_Object *obj, Emotion_Meta_Info meta)
return emotion_engine_instance_meta_get(sd->engine_instance, id);
}
+
+EAPI Evas_Object *
+emotion_file_meta_artwork_get(const Evas_Object *obj, const char *path, Emotion_Artwork_Info type)
+{
+ Efl_Canvas_Video_Data *sd;
+ E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
+ if (!sd->engine_instance) return NULL;
+
+ Evas *ev = evas_object_evas_get(obj);
+ Evas_Object *artwork = evas_object_image_add(ev);
+
+ Evas_Object *result = emotion_engine_instance_meta_artwork_get(sd->engine_instance, artwork, path, type);
+ if (!result) return NULL;
+
+ Evas_Load_Error _error = evas_object_image_load_error_get(result);
+ if (_error != EVAS_LOAD_ERROR_NONE) return NULL;
+
+ return result;
+}
+
EAPI void
emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization)
{