summaryrefslogtreecommitdiff
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
parent50c9d1aeaa9172e4b6492eabd0da49aafd3523bb (diff)
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
196 EMOTION_META_INFO_TRACK_COUNT /**< track count - number of the track in the album */ 196 EMOTION_META_INFO_TRACK_COUNT /**< track count - number of the track in the album */
197}; 197};
198 198
199enum _Emotion_Artwork_Info
200{
201 EMOTION_ARTWORK_IMAGE,
202 EMOTION_ARTWORK_PREVIEW_IMAGE
203};
204
199/** 205/**
200 * @enum _Emotion_Vis 206 * @enum _Emotion_Vis
201 * 207 *
@@ -266,6 +272,7 @@ typedef enum _Emotion_Event Emotion_Event;
266typedef enum _Emotion_Meta_Info Emotion_Meta_Info; /**< Meta info type to be retrieved. */ 272typedef enum _Emotion_Meta_Info Emotion_Meta_Info; /**< Meta info type to be retrieved. */
267typedef enum _Emotion_Vis Emotion_Vis; /**< Type of visualization. */ 273typedef enum _Emotion_Vis Emotion_Vis; /**< Type of visualization. */
268typedef enum _Emotion_Aspect Emotion_Aspect; /**< Aspect ratio option. */ 274typedef enum _Emotion_Aspect Emotion_Aspect; /**< Aspect ratio option. */
275typedef enum _Emotion_Artwork_Info Emotion_Artwork_Info;
269 276
270#define EMOTION_CHANNEL_AUTO -1 277#define EMOTION_CHANNEL_AUTO -1
271#define EMOTION_CHANNEL_DEFAULT 0 278#define EMOTION_CHANNEL_DEFAULT 0
@@ -1341,6 +1348,17 @@ EAPI const char *emotion_webcam_name_get(const Emotion_Webcam *ew);
1341EAPI const char *emotion_webcam_device_get(const Emotion_Webcam *ew); 1348EAPI const char *emotion_webcam_device_get(const Emotion_Webcam *ew);
1342 1349
1343/** 1350/**
1351 * @brief Get the album artwork from file meta data tags.
1352 *
1353 * @param obj The evas object we are working with.
1354 * @param path The local path for the file.
1355 * @param type The metadata location type (GST_IMAGE_PREVIEW_IMAGE or GST_PREVIEW).
1356 *
1357 * @ingroup Emotion_Artwork
1358 */
1359
1360EAPI Evas_Object *emotion_file_meta_artwork_get(const Evas_Object *obj, const char *path, Emotion_Artwork_Info type);
1361/**
1344 * @} 1362 * @}
1345 */ 1363 */
1346 1364
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)
791 EMOTION_ENGINE_INSTANCE_CALL_RET(inst, meta_get, NULL, meta); 791 EMOTION_ENGINE_INSTANCE_CALL_RET(inst, meta_get, NULL, meta);
792} 792}
793 793
794void *
795emotion_engine_instance_meta_artwork_get(const Emotion_Engine_Instance *inst, Evas_Object *img, const char *path, Emotion_Artwork_Info type)
796{
797 EMOTION_ENGINE_INSTANCE_CALL_RET(inst, meta_artwork_get, NULL, img, path, type);
798}
799
794void 800void
795emotion_engine_instance_priority_set(Emotion_Engine_Instance *inst, Eina_Bool priority) 801emotion_engine_instance_priority_set(Emotion_Engine_Instance *inst, Eina_Bool priority)
796{ 802{
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
129 const char * (*meta_get) (void *ef, int meta); 129 const char * (*meta_get) (void *ef, int meta);
130 void (*priority_set) (void *ef, Eina_Bool priority); 130 void (*priority_set) (void *ef, Eina_Bool priority);
131 Eina_Bool (*priority_get) (void *ef); 131 Eina_Bool (*priority_get) (void *ef);
132 void * (*meta_artwork_get)(void *ef, Evas_Object *img, const char *path, Emotion_Artwork_Info type);
132}; 133};
133 134
134EAPI void *_emotion_video_get(const Evas_Object *obj); 135EAPI 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);
89const char * emotion_engine_instance_meta_get(const Emotion_Engine_Instance *inst, int meta); 89const char * emotion_engine_instance_meta_get(const Emotion_Engine_Instance *inst, int meta);
90void emotion_engine_instance_priority_set(Emotion_Engine_Instance *inst, Eina_Bool priority); 90void emotion_engine_instance_priority_set(Emotion_Engine_Instance *inst, Eina_Bool priority);
91Eina_Bool emotion_engine_instance_priority_get(const Emotion_Engine_Instance *inst); 91Eina_Bool emotion_engine_instance_priority_get(const Emotion_Engine_Instance *inst);
92 92void * emotion_engine_instance_meta_artwork_get(const Emotion_Engine_Instance *inst, Evas_Object *img, const char *path, Emotion_Artwork_Info type);
93
94#endif 93#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)
1262 return emotion_engine_instance_meta_get(sd->engine_instance, id); 1262 return emotion_engine_instance_meta_get(sd->engine_instance, id);
1263} 1263}
1264 1264
1265
1266EAPI Evas_Object *
1267emotion_file_meta_artwork_get(const Evas_Object *obj, const char *path, Emotion_Artwork_Info type)
1268{
1269 Efl_Canvas_Video_Data *sd;
1270 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, NULL);
1271 if (!sd->engine_instance) return NULL;
1272
1273 Evas *ev = evas_object_evas_get(obj);
1274 Evas_Object *artwork = evas_object_image_add(ev);
1275
1276 Evas_Object *result = emotion_engine_instance_meta_artwork_get(sd->engine_instance, artwork, path, type);
1277 if (!result) return NULL;
1278
1279 Evas_Load_Error _error = evas_object_image_load_error_get(result);
1280 if (_error != EVAS_LOAD_ERROR_NONE) return NULL;
1281
1282 return result;
1283}
1284
1265EAPI void 1285EAPI void
1266emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization) 1286emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization)
1267{ 1287{