summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-17 21:25:06 +0100
committerdavemds <dave@gurumeditation.it>2014-02-17 21:26:46 +0100
commitaf34bc8599c9d17431665728dc7a7052da49dba6 (patch)
tree729a8a188dd48879f8f858b6c09843896be34ca3
parenta739716ceec531a2178ac3c0d59bc15b90bb9167 (diff)
Emotion generic: nothing to see here, just small formatting while reading the code.
-rw-r--r--src/modules/emotion/generic/emotion_generic.c92
1 files changed, 51 insertions, 41 deletions
diff --git a/src/modules/emotion/generic/emotion_generic.c b/src/modules/emotion/generic/emotion_generic.c
index e4b0cc5d0d..086af138e6 100644
--- a/src/modules/emotion/generic/emotion_generic.c
+++ b/src/modules/emotion/generic/emotion_generic.c
@@ -939,12 +939,12 @@ _fork_and_exec(Emotion_Generic_Video *ev)
939 939
940 ev->shmname = eina_stringshare_add(shmname); 940 ev->shmname = eina_stringshare_add(shmname);
941 941
942 ev->player_add = ecore_event_handler_add( 942 ev->player_add = ecore_event_handler_add(ECORE_EXE_EVENT_ADD,
943 ECORE_EXE_EVENT_ADD, _player_add_cb, ev); 943 _player_add_cb, ev);
944 ev->player_del = ecore_event_handler_add( 944 ev->player_del = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
945 ECORE_EXE_EVENT_DEL, _player_del_cb, ev); 945 _player_del_cb, ev);
946 ev->player_data = ecore_event_handler_add( 946 ev->player_data = ecore_event_handler_add(ECORE_EXE_EVENT_DATA,
947 ECORE_EXE_EVENT_DATA, _player_data_cb, ev); 947 _player_data_cb, ev);
948 948
949 if (!_player_exec(ev)) 949 if (!_player_exec(ev))
950 { 950 {
@@ -957,33 +957,6 @@ _fork_and_exec(Emotion_Generic_Video *ev)
957 return EINA_TRUE; 957 return EINA_TRUE;
958} 958}
959 959
960static void *
961em_add(const Emotion_Engine *api, Evas_Object *obj, const Emotion_Module_Options *opt EINA_UNUSED)
962{
963 Emotion_Generic_Video *ev;
964
965 ev = calloc(1, sizeof(*ev));
966 EINA_SAFETY_ON_NULL_RETURN_VAL(ev, NULL);
967
968 ev->fd_read = NULL;
969 ev->fd_write = NULL;
970 ev->speed = 1.0;
971 ev->volume = 1.0;
972 ev->audio_mute = EINA_FALSE;
973 ev->cmd.type = -1;
974
975 ev->obj = obj;
976 ev->engine = (Emotion_Engine_Generic *)api;
977
978 if (!_fork_and_exec(ev))
979 {
980 free(ev);
981 return NULL;
982 }
983
984 return ev;
985}
986
987typedef struct _Delay_Munmap Delay_Munmap; 960typedef struct _Delay_Munmap Delay_Munmap;
988struct _Delay_Munmap 961struct _Delay_Munmap
989{ 962{
@@ -1061,6 +1034,35 @@ em_partial_shutdown(Emotion_Generic_Video *ev)
1061 ev->player_restart = NULL; 1034 ev->player_restart = NULL;
1062} 1035}
1063 1036
1037
1038/* Emotion interface */
1039static void *
1040em_add(const Emotion_Engine *api, Evas_Object *obj, const Emotion_Module_Options *opt EINA_UNUSED)
1041{
1042 Emotion_Generic_Video *ev;
1043
1044 ev = calloc(1, sizeof(*ev));
1045 EINA_SAFETY_ON_NULL_RETURN_VAL(ev, NULL);
1046
1047 ev->fd_read = NULL;
1048 ev->fd_write = NULL;
1049 ev->speed = 1.0;
1050 ev->volume = 1.0;
1051 ev->audio_mute = EINA_FALSE;
1052 ev->cmd.type = -1;
1053
1054 ev->obj = obj;
1055 ev->engine = (Emotion_Engine_Generic *)api;
1056
1057 if (!_fork_and_exec(ev))
1058 {
1059 free(ev);
1060 return NULL;
1061 }
1062
1063 return ev;
1064}
1065
1064static void 1066static void
1065em_del(void *data) 1067em_del(void *data)
1066{ 1068{
@@ -1278,25 +1280,29 @@ em_ratio_get(void *data)
1278 return ev->ratio; 1280 return ev->ratio;
1279} 1281}
1280 1282
1281static int em_video_handled(void *ef EINA_UNUSED) 1283static int
1284em_video_handled(void *ef EINA_UNUSED)
1282{ 1285{
1283 DBG("video handled!"); 1286 DBG("video handled!");
1284 return 1; 1287 return 1;
1285} 1288}
1286 1289
1287static int em_audio_handled(void *ef EINA_UNUSED) 1290static int
1291em_audio_handled(void *ef EINA_UNUSED)
1288{ 1292{
1289 DBG("audio handled!"); 1293 DBG("audio handled!");
1290 return 1; 1294 return 1;
1291} 1295}
1292 1296
1293static int em_seekable(void *data) 1297static int
1298em_seekable(void *data)
1294{ 1299{
1295 Emotion_Generic_Video *ev = data; 1300 Emotion_Generic_Video *ev = data;
1296 return ev->seekable; 1301 return ev->seekable;
1297} 1302}
1298 1303
1299static void em_frame_done(void *ef EINA_UNUSED) 1304static void
1305em_frame_done(void *ef EINA_UNUSED)
1300{ 1306{
1301} 1307}
1302 1308
@@ -1642,7 +1648,8 @@ em_meta_get(void *data, int meta)
1642{ 1648{
1643 Emotion_Generic_Video *ev = data; 1649 Emotion_Generic_Video *ev = data;
1644 1650
1645 switch (meta) { 1651 switch (meta)
1652 {
1646 case EMOTION_META_INFO_TRACK_TITLE: 1653 case EMOTION_META_INFO_TRACK_TITLE:
1647 return ev->meta.title; 1654 return ev->meta.title;
1648 case EMOTION_META_INFO_TRACK_ARTIST: 1655 case EMOTION_META_INFO_TRACK_ARTIST:
@@ -1664,6 +1671,8 @@ em_meta_get(void *data, int meta)
1664 return NULL; 1671 return NULL;
1665} 1672}
1666 1673
1674
1675/* Players/modules */
1667static const Emotion_Engine em_template_engine = 1676static const Emotion_Engine em_template_engine =
1668{ 1677{
1669 EMOTION_ENGINE_API_VERSION, 1678 EMOTION_ENGINE_API_VERSION,
@@ -1792,7 +1801,8 @@ _player_entry_free(Emotion_Engine_Generic *eg)
1792 free(eg); 1801 free(eg);
1793} 1802}
1794 1803
1795static void _players_all_from(const char *path) 1804static void
1805_players_all_from(const char *path)
1796{ 1806{
1797 const Eina_File_Direct_Info *info; 1807 const Eina_File_Direct_Info *info;
1798 int count = 0; 1808 int count = 0;
@@ -1844,8 +1854,8 @@ generic_module_init(void)
1844 return EINA_TRUE; 1854 return EINA_TRUE;
1845 } 1855 }
1846 1856
1847 _emotion_generic_log_domain = eina_log_domain_register 1857 _emotion_generic_log_domain = eina_log_domain_register("emotion-generic",
1848 ("emotion-generic", EINA_COLOR_LIGHTCYAN); 1858 EINA_COLOR_LIGHTCYAN);
1849 if (_emotion_generic_log_domain < 0) 1859 if (_emotion_generic_log_domain < 0)
1850 { 1860 {
1851 EINA_LOG_CRIT("Could not register log domain 'emotion-generic'"); 1861 EINA_LOG_CRIT("Could not register log domain 'emotion-generic'");