summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-06-01 16:59:02 -0700
committerTom Hacohen <tom@stosb.com>2016-06-02 11:35:05 +0100
commit6b5ed1b7118cd99b99a8d133b3e466952885f945 (patch)
treee800e00e4d7239499198598151f50e055d11de4e
parent36f15d761a2d39fc81c38a9db7b13d1d571ef453 (diff)
evas: integrate evas generic loaders into our single tree build system.
-rw-r--r--AUTHORS19
-rw-r--r--COPYING2
-rw-r--r--configure.ac93
-rw-r--r--legacy/emotion_generic_players/m4/emotion_generic_players.m437
-rw-r--r--legacy/emotion_generic_players/src/vlc/emotion_generic_vlc.c790
-rw-r--r--legacy/evas_generic_loaders/AUTHORS15
-rw-r--r--legacy/evas_generic_loaders/COPYING356
-rw-r--r--legacy/evas_generic_loaders/src/bin/Makefile.am24
-rw-r--r--legacy/evas_generic_loaders/src/bin/common/Makefile.am3
-rw-r--r--legacy/evas_generic_loaders/src/bin/gst/Makefile.am91
-rw-r--r--legacy/evas_generic_loaders/src/bin/gst/main.c292
-rw-r--r--legacy/evas_generic_loaders/src/bin/gst/main_0_10.c278
-rw-r--r--legacy/evas_generic_loaders/src/bin/pdf/Makefile.am49
-rw-r--r--legacy/evas_generic_loaders/src/bin/ps/Makefile.am24
-rw-r--r--legacy/evas_generic_loaders/src/bin/raw/Makefile.am44
-rw-r--r--legacy/evas_generic_loaders/src/bin/svg/Makefile.am28
-rw-r--r--legacy/evas_generic_loaders/src/bin/xcf/Makefile.am26
-rw-r--r--src/Makefile_Evas.am153
-rw-r--r--src/generic/.gitignore5
-rw-r--r--src/generic/evas/common/shmfile.c (renamed from legacy/evas_generic_loaders/src/bin/common/shmfile.c)0
-rw-r--r--src/generic/evas/common/shmfile.h (renamed from legacy/evas_generic_loaders/src/bin/common/shmfile.h)0
-rw-r--r--src/generic/evas/common/timeout.c (renamed from legacy/evas_generic_loaders/src/bin/common/timeout.c)0
-rw-r--r--src/generic/evas/common/timeout.h (renamed from legacy/evas_generic_loaders/src/bin/common/timeout.h)0
-rwxr-xr-xsrc/generic/evas/pdf/evas_generic_pdf_loader.libreoffice (renamed from legacy/evas_generic_loaders/src/bin/pdf/evas_generic_pdf_loader.libreoffice)0
-rw-r--r--src/generic/evas/pdf/main.cpp (renamed from legacy/evas_generic_loaders/src/bin/pdf/main.cpp)0
-rw-r--r--src/generic/evas/ps/main.c (renamed from legacy/evas_generic_loaders/src/bin/ps/main.c)0
-rw-r--r--src/generic/evas/raw/main.c (renamed from legacy/evas_generic_loaders/src/bin/raw/main.c)0
-rw-r--r--src/generic/evas/svg/main.c (renamed from legacy/evas_generic_loaders/src/bin/svg/main.c)0
-rw-r--r--src/generic/evas/xcf/common.h (renamed from legacy/evas_generic_loaders/src/bin/xcf/common.h)0
-rw-r--r--src/generic/evas/xcf/main.c (renamed from legacy/evas_generic_loaders/src/bin/xcf/main.c)0
-rw-r--r--src/generic/evas/xcf/pixelfuncs.c (renamed from legacy/evas_generic_loaders/src/bin/xcf/pixelfuncs.c)0
31 files changed, 272 insertions, 2057 deletions
diff --git a/AUTHORS b/AUTHORS
index e5ed206..5243ed7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -149,6 +149,25 @@ Michelle Legrand <legrand.michelle@outlook.com>
149Romain Perier <romain.perier@openwide.fr> 149Romain Perier <romain.perier@openwide.fr>
150Subodh Kumar <s7158.kumar@samsung.com> 150Subodh Kumar <s7158.kumar@samsung.com>
151 151
152Evas Generic Loaders
153--------------------
154
155The Rasterman (Carsten Haitzler) <raster@rasterman.com>
156Christian Kreibich <cK@whoop.org>
157Vincent Torri <vtorri at univ-evry dot fr>
158Michael Bouchaud <michael.bouchaud@gmail.com>
159Fanina "cippp" Cristian <fancris3@gmail.com>
160Cedric BAIL <cedric.bail@free.fr>
161Jérémy Zurcher <jeremy@asynk.ch>
162Stefan Schmidt <stefan@datenfreihafen.org>
163Daniel Juyung Seo <seojuyung2@gmail.com>
164Doug Newgard <scimmia22@outlook.com>
165Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
166Alex-P. Natsios <drakevr@linuxteam.teilar.gr>
167Jihoon Kim <imfine98@gmail.com>
168Samuel F. Baggen <thanatermesis.elive@gmail.com>
169Sebastian Dransfeld <sd@tango.flipp.net>
170
152Ecore 171Ecore
153----- 172-----
154 173
diff --git a/COPYING b/COPYING
index 506e516..7afe4c5 100644
--- a/COPYING
+++ b/COPYING
@@ -34,6 +34,8 @@ ethumb: licenses/COPYING.LGPL
34eolian: licenses/COPYING.BSD 34eolian: licenses/COPYING.BSD
35elua: licenses/COPYING.BSD 35elua: licenses/COPYING.BSD
36elementary: licenses/COPYING.LGPL 36elementary: licenses/COPYING.LGPL
37generic/evas: licenses/COPYING.GPL (separate binary/executable)
38generic/emotion: licenses/COPYING.GPL (separate binary/executable)
37 39
38NOTE: If linked together, the result will be effectively be LGPL (or 40NOTE: If linked together, the result will be effectively be LGPL (or
39GPL if escape is used) due to license characteristics. 41GPL if escape is used) due to license characteristics.
diff --git a/configure.ac b/configure.ac
index 1f70416..f9d6a56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2807,6 +2807,99 @@ EFL_ADD_FEATURE([EVAS], [tile-rotate])
2807EFL_ADD_FEATURE([EVAS], [dither-mask], [${build_evas_dither_mask}]) 2807EFL_ADD_FEATURE([EVAS], [dither-mask], [${build_evas_dither_mask}])
2808EFL_ADD_FEATURE([EVAS], [hyphen]) 2808EFL_ADD_FEATURE([EVAS], [hyphen])
2809 2809
2810#### Generic backend
2811
2812### Option to turn on generic loader for evas
2813want_poppler="no"
2814want_spectre="no"
2815want_libraw="no"
2816want_rsvg="no"
2817
2818AC_ARG_ENABLE([poppler],
2819 [AC_HELP_STRING([--enable-poppler], [enable poppler support @<:@default==disabled@:>@])],
2820 [want_poppler=$enableval])
2821
2822AC_ARG_ENABLE([spectre],
2823 [AC_HELP_STRING([--enable-spectre], [enable spectre support @<:@default==disabled@:>@])],
2824 [want_spectre=$enableval])
2825
2826AC_ARG_ENABLE([libraw],
2827 [AC_HELP_STRING([--enable-libraw], [enable libraw support @<:@default==disabled@:>@])],
2828 [want_libraw=$enableval])
2829
2830AC_ARG_ENABLE([librsvg],
2831 [AC_HELP_STRING([--enable-librsvg], [enable svg support @<:@default==disabled@:>@])],
2832 [want_rsvg=$enableval])
2833
2834have_poppler="no"
2835have_spectre="no"
2836have_raw="no"
2837have_rsvg="no"
2838
2839### Check needed dependency for each generic loader
2840if test "x${want_poppler}" = "xyes"; then
2841 PKG_CHECK_EXISTS([poppler >= 0.12 poppler < 0.20],
2842 [
2843 poppler_pc="poppler >= 0.12 poppler < 0.20"
2844 have_poppler="yes"
2845 ],
2846 [have_poppler="no"])
2847
2848 if test "x${have_poppler}" = "xno" ; then
2849 PKG_CHECK_EXISTS([poppler >= 0.20 poppler < 0.31],
2850 [
2851 poppler_pc="poppler >= 0.20 poppler < 0.31"
2852 AC_DEFINE(HAVE_POPPLER_020, 1, [Have poppler 0.20])
2853 have_poppler="yes"
2854 ],
2855 [have_poppler="no"])
2856 fi
2857
2858 if test "x${have_poppler}" = "xno" ; then
2859 PKG_CHECK_EXISTS([poppler >= 0.31],
2860 [
2861 poppler_pc="poppler >= 0.31"
2862 AC_DEFINE(HAVE_POPPLER_031, 1, [Have poppler 0.31])
2863 have_poppler="yes"
2864 ],
2865 [have_poppler="no"])
2866 fi
2867
2868 if test "x${have_poppler}" = "xyes" ; then
2869 PKG_CHECK_MODULES([POPPLER], [${poppler_pc}],
2870 [have_poppler="yes"])
2871 fi
2872fi
2873
2874if test "x${want_spectre}" = "xyes"; then
2875 PKG_CHECK_MODULES([SPECTRE], [libspectre], [have_spectre="yes"])
2876fi
2877
2878if test "x${want_libraw}" = "xyes"; then
2879 PKG_CHECK_MODULES([LIBRAW], [libraw], [have_raw="yes"])
2880fi
2881
2882if test "x${want_librsvg}" = "xyes"; then
2883 PKG_CHECK_MODULES([RSVG], [librsvg-2.0 >= 2.14.0 cairo >= 1.0.0], [have_rsvg="yes"])
2884 PKG_CHECK_MODULES(
2885 [SVG_2_36], [librsvg-2.0 >= 2.36.0 cairo >= 1.0.0],
2886 [
2887 have_rsvg_2_36="yes"
2888 AC_DEFINE(HAVE_SVG_2_36, 1, [Have librsvg >= 2.36])
2889 ],
2890 [have_rsvg_2_36="no"])
2891fi
2892
2893AM_CONDITIONAL([HAVE_POPPLER], [test "x${have_poppler}" = "xyes"])
2894AM_CONDITIONAL([HAVE_SPECTRE], [test "x${have_spectre}" = "xyes"])
2895AM_CONDITIONAL([HAVE_LIBRAW], [test "x${have_raw}" = "xyes"])
2896AM_CONDITIONAL([HAVE_RSVG], [test "x${have_rsvg}" = "xyes"])
2897
2898EFL_ADD_FEATURE([EVAS_LOADER], [poppler], [${want_poppler}])
2899EFL_ADD_FEATURE([EVAS_LOADER], [spectre], [${want_spectre}])
2900EFL_ADD_FEATURE([EVAS_LOADER], [raw], [${want_libraw}])
2901EFL_ADD_FEATURE([EVAS_LOADER], [rsvg], [${want_rsvg}])
2902
2810EFL_LIB_END([Evas]) 2903EFL_LIB_END([Evas])
2811#### End of Evas 2904#### End of Evas
2812 2905
diff --git a/legacy/emotion_generic_players/m4/emotion_generic_players.m4 b/legacy/emotion_generic_players/m4/emotion_generic_players.m4
deleted file mode 100644
index d852dba..0000000
--- a/legacy/emotion_generic_players/m4/emotion_generic_players.m4
+++ /dev/null
@@ -1,37 +0,0 @@
1dnl EMOTION_GENERIC_PLAYER(NAME, DEFAULT_STATE, [PKG_CONFIG_DEPS])
2dnl Does the following:
3dnl * AC_ARG_WITH(NAME)
4dnl * define with_name to yes or no
5dnl * PKG_CHECK_MODULES(NAME, PKG_CONFIG_DEPS)
6dnl * AC_DEFINE([HAVE_NAME])
7dnl * AM_CONDITIONAL([HAVE_NAME])
8AC_DEFUN([EMOTION_GENERIC_PLAYER],
9[dnl
10m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
11m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
12
13AC_ARG_WITH([DOWN],
14 [AC_HELP_STRING([--with-]m4_defn([DOWN]),
15 [build generic player ]m4_defn([UP])[. @<:@default=$2@:>@])],
16 [], [with_]m4_defn([DOWN])[="$2"])
17
18if test "${with_[]m4_defn([DOWN])}" = "yes"; then
19 m4_ifval([$3], [dnl
20 PKG_CHECK_MODULES(m4_defn([UP]), [$3])
21 ], [dnl
22 m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS}"
23 m4_defn([UP])_CFLAGS="${m4_defn([UP])_CFLAGS}"
24 AC_SUBST(m4_defn([UP])[_LIBS])
25 AC_SUBST(m4_defn([UP])[_CFLAGS])
26 ])
27
28 AC_SEARCH_LIBS([shm_open], [rt], [], [AC_MSG_ERROR([unable to find the shm_open() function])])
29 if test "${ac_cv_search_shm_open}" != "none required"; then
30 m4_defn([UP])_LIBS="${m4_defn([UP])_LIBS} ${ac_cv_search_shm_open}"
31 fi
32fi
33AM_CONDITIONAL([HAVE_]m4_defn([UP]), [test "$with_[]m4_defn([DOWN])" = "yes"])
34
35m4_popdef([UP])dnl
36m4_popdef([DOWN])dnl
37])
diff --git a/legacy/emotion_generic_players/src/vlc/emotion_generic_vlc.c b/legacy/emotion_generic_players/src/vlc/emotion_generic_vlc.c
deleted file mode 100644
index 456509e..0000000
--- a/legacy/emotion_generic_players/src/vlc/emotion_generic_vlc.c
+++ /dev/null
@@ -1,790 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <errno.h>
6#include <limits.h>
7#include <stdio.h>
8#include <stdlib.h>
9#include <unistd.h>
10#include <string.h>
11#include <sys/mman.h>
12#include <sys/stat.h>
13#include <fcntl.h>
14#include <pthread.h>
15#include <poll.h>
16
17#include <signal.h>
18
19#include <vlc/vlc.h>
20
21#include <Emotion_Generic_Plugin.h>
22#include <Eina.h>
23#include <Ecore.h>
24
25static int _em_vlc_log_dom = -1;
26#define ERR(...) EINA_LOG_DOM_ERR(_em_vlc_log_dom, __VA_ARGS__)
27#define DBG(...) EINA_LOG_DOM_DBG(_em_vlc_log_dom, __VA_ARGS__)
28#define INF(...) EINA_LOG_DOM_INFO(_em_vlc_log_dom, __VA_ARGS__)
29#define WRN(...) EINA_LOG_DOM_WARN(_em_vlc_log_dom, __VA_ARGS__)
30#define CRIT(...) EINA_LOG_DOM_CRIT(_em_vlc_log_dom, __VA_ARGS__)
31
32
33typedef struct _App App;
34struct _App {
35 Emotion_Generic_Video_Shared *vs;
36 Emotion_Generic_Video_Frame vf;
37
38 libvlc_instance_t *libvlc;
39 libvlc_media_t *m;
40 libvlc_media_player_t *mp;
41 libvlc_event_manager_t *event_mgr;
42
43 Ecore_Pipe *fd_read; // read commands from emotion here
44 Ecore_Pipe *fd_write; // write commands for emotion here
45 Eina_Lock cmd_mutex;// lock used to send just one command at a time
46 int last_order; // current command received from emotion
47
48 char *filename;
49 char *subtitle_path;
50 char *shmname;
51 unsigned w, h;
52 int volume;
53 Eina_Bool audio_muted;
54
55 Eina_Bool opening;
56 Eina_Bool closing;
57 Eina_Bool playing;
58 Eina_Bool inited;
59};
60
61static void _player_setup(App *app);
62
63
64/* Utilities to send commands back to emotion */
65#define SEND_CMD_PARAM(app, i) \
66 if ((app)->fd_write) \
67 if (!ecore_pipe_write((app)->fd_write, &(i), sizeof((i)))) \
68 ecore_main_loop_quit();
69
70static void
71_send_cmd(App *app, int cmd)
72{
73 if (!app->fd_write)
74 return;
75
76 eina_lock_take(&app->cmd_mutex); /* LOCK HERE */
77
78 if (!ecore_pipe_write(app->fd_write, &cmd, sizeof(cmd)))
79 ecore_main_loop_quit();
80}
81
82static void
83_send_cmd_str(App *app, const char *str)
84{
85 int len;
86
87 len = str ? strlen(str) + 1 : 0;
88 if (app->fd_write)
89 if (!ecore_pipe_write(app->fd_write, &len, sizeof(len)))
90 ecore_main_loop_quit();
91 if (app->fd_write)
92 if (!ecore_pipe_write(app->fd_write, str, len))
93 ecore_main_loop_quit();
94}
95
96static void
97_send_cmd_finish(App *app)
98{
99 eina_lock_release(&app->cmd_mutex); /* UNLOCK HERE */
100}
101
102/* Commands sent to the emotion pipe */
103static void
104_send_file_closed(App *app)
105{
106 _send_cmd(app, EM_RESULT_FILE_CLOSE);
107 _send_cmd_finish(app);
108}
109
110static void
111_send_time_changed(App *app)
112{
113 float new_time;
114
115 if (app->vs->frame_drop > 1)
116 return;
117
118 new_time = libvlc_media_player_get_time(app->mp);
119 new_time /= 1000;
120 _send_cmd(app, EM_RESULT_POSITION_CHANGED);
121 SEND_CMD_PARAM(app, new_time);
122 _send_cmd_finish(app);
123}
124
125static void
126_send_resize(App *app, int width, int height)
127{
128 _send_cmd(app, EM_RESULT_FRAME_SIZE);
129 SEND_CMD_PARAM(app, width);
130 SEND_CMD_PARAM(app, height);
131 _send_cmd_finish(app);
132}
133
134static void
135_send_track_info(App *app, int cmd, int current, int count, libvlc_track_description_t *desc)
136{
137 _send_cmd(app, cmd);
138 SEND_CMD_PARAM(app, current);
139 SEND_CMD_PARAM(app, count);
140 while (desc)
141 {
142 int tid = desc->i_id;
143 const char *name = desc->psz_name;
144 SEND_CMD_PARAM(app, tid);
145 _send_cmd_str(app, name);
146 desc = desc->p_next;
147 }
148 _send_cmd_finish(app);
149}
150
151static void
152_send_all_track_info(App *app)
153{
154 int track_count, current;
155 libvlc_track_description_t *desc;
156
157 current = libvlc_audio_get_track(app->mp);
158 track_count = libvlc_audio_get_track_count(app->mp);
159 desc = libvlc_audio_get_track_description(app->mp);
160
161 _send_track_info(app, EM_RESULT_AUDIO_TRACK_INFO,
162 current, track_count, desc);
163
164 current = libvlc_video_get_track(app->mp);
165 track_count = libvlc_video_get_track_count(app->mp);
166 desc = libvlc_video_get_track_description(app->mp);
167
168 _send_track_info(app, EM_RESULT_VIDEO_TRACK_INFO,
169 current, track_count, desc);
170
171 current = libvlc_video_get_spu(app->mp);
172 track_count = libvlc_video_get_spu_count(app->mp);
173 desc = libvlc_video_get_spu_description(app->mp);
174
175 _send_track_info(app, EM_RESULT_SPU_TRACK_INFO,
176 current, track_count, desc);
177}
178
179static void
180_send_all_meta_info(App *app)
181{
182 const char *meta;
183
184 _send_cmd(app, EM_RESULT_META_INFO);
185
186 /*
187 * Will send in this order: title, artist, album, year,
188 * genre, comments, disc id and track count.
189 */
190 meta = libvlc_media_get_meta(app->m, libvlc_meta_Title);
191 _send_cmd_str(app, meta);
192 meta = libvlc_media_get_meta(app->m, libvlc_meta_Artist);
193 _send_cmd_str(app, meta);
194 meta = libvlc_media_get_meta(app->m, libvlc_meta_Album);
195 _send_cmd_str(app, meta);
196 meta = libvlc_media_get_meta(app->m, libvlc_meta_Date);
197 _send_cmd_str(app, meta);
198 meta = libvlc_media_get_meta(app->m, libvlc_meta_Genre);
199 _send_cmd_str(app, meta);
200 meta = NULL; // sending empty comments
201 _send_cmd_str(app, meta);
202 meta = NULL; // sending empty disc id
203 _send_cmd_str(app, meta);
204 meta = libvlc_media_get_meta(app->m, libvlc_meta_TrackNumber);
205 _send_cmd_str(app, meta);
206
207 _send_cmd_finish(app);
208}
209
210static void
211_send_length_changed(App *app)
212{
213 float length = libvlc_media_player_get_length(app->mp);
214
215 length /= 1000;
216 _send_cmd(app, EM_RESULT_LENGTH_CHANGED);
217 SEND_CMD_PARAM(app, length);
218 _send_cmd_finish(app);
219}
220
221static void
222_send_seekable_changed(App *app, const struct libvlc_event_t *ev)
223{
224 int seekable = ev->u.media_player_seekable_changed.new_seekable;
225
226 _send_cmd(app, EM_RESULT_SEEKABLE_CHANGED);
227 SEND_CMD_PARAM(app, seekable);
228 _send_cmd_finish(app);
229}
230
231static void
232_send_playback_started(App *app)
233{
234 _send_cmd(app, EM_RESULT_PLAYBACK_STARTED);
235 _send_cmd_finish(app);
236}
237
238static void
239_send_playback_stopped(App *app)
240{
241 _send_cmd(app, EM_RESULT_PLAYBACK_STOPPED);
242 _send_cmd_finish(app);
243}
244
245static void
246_send_init(App *app)
247{
248 _send_cmd(app, EM_RESULT_INIT);
249 _send_cmd_finish(app);
250}
251
252static void
253_send_file_set(App *app)
254{
255 _send_cmd(app, EM_RESULT_FILE_SET);
256 _send_cmd_finish(app);
257}
258
259static void
260_send_file_set_done(App *app, int success)
261{
262 _send_cmd(app, EM_RESULT_FILE_SET_DONE);
263 SEND_CMD_PARAM(app, success);
264 _send_cmd_finish(app);
265}
266
267
268/* VLC events and callbacks */
269static void
270_event_cb(const struct libvlc_event_t *ev, void *data)
271{
272 App *app = data;
273
274 ecore_thread_main_loop_begin();
275 switch (ev->type)
276 {
277 case libvlc_MediaPlayerTimeChanged:
278 // DBG("libvlc_MediaPlayerTimeChanged");
279 _send_time_changed(app);
280 break;
281 case libvlc_MediaPlayerLengthChanged:
282 DBG("libvlc_MediaPlayerLengthChanged");
283 _send_length_changed(app);
284 break;
285 case libvlc_MediaPlayerSeekableChanged:
286 DBG("libvlc_MediaPlayerSeekableChanged");
287 _send_seekable_changed(app, ev);
288 break;
289 case libvlc_MediaPlayerPlaying:
290 DBG("libvlc_MediaPlayerPlaying");
291 libvlc_audio_set_volume(app->mp, app->volume);
292 libvlc_audio_set_mute(app->mp, app->audio_muted);
293 _send_playback_started(app);
294 break;
295 case libvlc_MediaPlayerStopped:
296 DBG("libvlc_MediaPlayerStopped");
297 _send_playback_stopped(app);
298 if (app->closing)
299 {
300 free(app->filename);
301 app->filename = NULL;
302 free(app->subtitle_path);
303 app->subtitle_path = NULL;
304 libvlc_media_release(app->m);
305 app->m = NULL;
306 libvlc_media_player_release(app->mp);
307 app->mp = NULL;
308 emotion_generic_shm_free(app->vs);
309 app->playing = EINA_FALSE;
310 app->closing = EINA_FALSE;
311 _send_file_closed(app);
312 }
313 break;
314 case libvlc_MediaPlayerEndReached:
315 DBG("libvlc_MediaPlayerEndReached");
316 app->playing = EINA_FALSE;
317 /* vlc had released the media_playere here, we create a new one */
318 app->mp = libvlc_media_player_new_from_media(app->m);
319 _player_setup(app);
320 _send_playback_stopped(app);
321 break;
322 }
323 ecore_thread_main_loop_end();
324}
325
326static void
327_tmp_playing_event_cb(const struct libvlc_event_t *ev, void *data)
328{
329 App *app = data;
330
331 if (ev->type != libvlc_MediaPlayerPlaying)
332 return;
333
334 /* pause and stop listening the temporary event */
335 libvlc_event_detach(app->event_mgr,libvlc_MediaPlayerPlaying,
336 _tmp_playing_event_cb, app);
337 libvlc_media_player_set_pause(app->mp, 1);
338
339 /* sending size info */
340 libvlc_video_get_size(app->mp, 0, &app->w, &app->h);
341 _send_resize(app, app->w, app->h);
342
343 /* sending total lenght */
344 _send_length_changed(app);
345
346 /* sending audio track info */
347 _send_all_track_info(app);
348
349 /* sending meta info */
350 _send_all_meta_info(app);
351
352 /* ok, we are done! Now let emotion create the shmem for us */
353 _send_file_set(app);
354}
355
356static void *
357_lock(void *data, void **pixels)
358{
359 App *app = data;
360
361 if (app->playing)
362 *pixels = app->vf.frames[app->vs->frame.player];
363 else
364 *pixels = NULL;
365
366 return NULL; // picture identifier, not needed here
367}
368
369static void
370_unlock(void *data EINA_UNUSED, void *id EINA_UNUSED, void *const *pixels EINA_UNUSED)
371{
372}
373
374static void
375_display(void *data, void *id EINA_UNUSED)
376{
377 App *app = data;
378
379 if (!app->playing)
380 return;
381
382 eina_semaphore_lock(&app->vs->lock);
383 app->vs->frame.last = app->vs->frame.player;
384 app->vs->frame.player = app->vs->frame.next;
385 app->vs->frame.next = app->vs->frame.last;
386 if (!app->vs->frame_drop++)
387 {
388 _send_cmd(app, EM_RESULT_FRAME_NEW);
389 _send_cmd_finish(app);
390 }
391 eina_semaphore_release(&app->vs->lock, 1);
392}
393
394static void
395_player_setup(App *app)
396{
397
398 libvlc_video_set_format(app->mp, "RV32", app->w, app->h, app->w * 4);
399 libvlc_video_set_callbacks(app->mp, _lock, _unlock, _display, app);
400
401 app->event_mgr = libvlc_media_player_event_manager(app->mp);
402 libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPlaying,
403 _event_cb, app);
404 libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerTimeChanged,
405 _event_cb, app);
406 libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerLengthChanged,
407 _event_cb, app);
408 libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerSeekableChanged,
409 _event_cb, app);
410 libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerEndReached,
411 _event_cb, app);
412 libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerStopped,
413 _event_cb, app);
414}
415
416/* Commands received from the emotion pipe */
417static void
418_file_set(App *app)
419{
420 DBG("Path: %s", app->filename);
421 app->m = libvlc_media_new_path(app->libvlc, app->filename);
422 if (!app->m)
423 {
424 ERR("could not open path: \"%s\"", app->filename);
425 return;
426 }
427
428 app->mp = libvlc_media_player_new_from_media(app->m);
429 if (!app->mp)
430 {
431 ERR("could not create new player from media.");
432 return;
433 }
434
435 app->opening = EINA_TRUE;
436
437 /* Here we start playing and connect a temporary callback to know when
438 * the file is parsed and ready to be played for real.
439 */
440 app->event_mgr = libvlc_media_player_event_manager(app->mp);
441 libvlc_event_attach(app->event_mgr, libvlc_MediaPlayerPlaying,
442 _tmp_playing_event_cb, app);
443
444 libvlc_media_player_play(app->mp);
445}
446
447static void
448_file_set_done(App *app)
449{
450 int r;
451
452 DBG("Path: %s", app->filename);
453 app->opening = EINA_FALSE;
454
455 r = emotion_generic_shm_get(app->shmname, &app->vs, &app->vf);
456 if (!r)
457 {
458 free(app->filename);
459 libvlc_media_release(app->m);
460 libvlc_media_player_release(app->mp);
461 app->filename = NULL;
462 app->m = NULL;
463 app->mp = NULL;
464 }
465 else
466 {
467 _player_setup(app);
468 }
469
470 _send_file_set_done(app, r);
471}
472
473static void
474_file_close(App *app)
475{
476 DBG("closing file");
477
478 if (!app->mp)
479 return;
480
481 app->closing = EINA_TRUE;
482 libvlc_media_player_stop(app->mp);
483}
484
485static void
486_stop(App *app)
487{
488 DBG("Stop");
489 if (app->mp)
490 libvlc_media_player_set_pause(app->mp, 1);
491}
492
493static void
494_play(App *app, float pos)
495{
496 DBG("Play at %.3f", pos);
497
498 if (!app->mp)
499 return;
500
501 if (app->playing)
502 {
503 libvlc_media_player_set_pause(app->mp, 0);
504 }
505 else
506 {
507 libvlc_time_t new_time = pos * 1000;
508 libvlc_media_player_set_time(app->mp, new_time);
509 libvlc_media_player_play(app->mp);
510
511 if (app->subtitle_path)
512 libvlc_video_set_subtitle_file(app->mp, app->subtitle_path);
513
514 app->playing = EINA_TRUE;
515 }
516}
517
518static void
519_position_set(App *app, float position)
520{
521 libvlc_time_t new_time;
522
523 DBG("Position set %.3f", position);
524 if (!app->mp)
525 return;
526
527 new_time = position * 1000;
528 libvlc_media_player_set_time(app->mp, new_time);
529
530 if (libvlc_media_player_get_state(app->mp) == libvlc_Paused)
531 _send_time_changed(app);
532}
533
534static void
535_speed_set(App *app, float rate)
536{
537 DBG("Speed set %.3f", rate);
538 if (!app->mp)
539 return;
540
541 libvlc_media_player_set_rate(app->mp, rate);
542}
543
544static void
545_mute_set(App *app, int mute)
546{
547 DBG("Mute %d", mute);
548 if (!app->mp)
549 return;
550
551 app->audio_muted = mute;
552 libvlc_audio_set_mute(app->mp, mute);
553}
554
555static void
556_volume_set(App *app, float volume)
557{
558 DBG("Volume set %.2f", volume);
559 if (!app->mp)
560 return;
561
562 app->volume = volume * 100;
563 libvlc_audio_set_volume(app->mp, app->volume);
564}
565
566static void
567_spu_track_set(App *app, int track)
568{
569 DBG("SPU track %d", track);
570 libvlc_video_set_spu(app->mp, track);
571}
572
573static void
574_audio_track_set(App *app, int track)
575{
576 DBG("Audio track %d", track);
577 libvlc_audio_set_track(app->mp, track);
578}
579
580static void
581_video_track_set(App *app, int track)
582{
583 DBG("Video Track %d", track);
584 libvlc_video_set_track(app->mp, track);
585}
586
587static void
588_remote_command(void *data, void *buffer, unsigned int nbyte)
589{
590 App *app = data;
591
592 if (nbyte == 0)
593 {
594 ecore_main_loop_quit();
595 return ;
596 }
597
598 if (app->last_order == EM_CMD_LAST)
599 {
600 if (nbyte != sizeof (int))
601 {
602 ERR("didn't receive a valid command from emotion (%i) !", nbyte);
603 ecore_main_loop_quit();
604 return ;
605 }
606
607 app->last_order = *((int*) buffer);
608
609 if (!app->inited &&
610 app->last_order != EM_CMD_INIT)
611 {
612 ERR("wrong init command!");
613 ecore_main_loop_quit();
614 return ;
615 }
616
617 switch (app->last_order)
618 {
619 case EM_CMD_FILE_SET:
620 if (app->opening)
621 {
622 libvlc_media_release(app->m);
623 libvlc_media_player_release(app->mp);
624 free(app->filename);
625 app->opening = EINA_FALSE;
626 }
627 break;
628 case EM_CMD_FILE_SET_DONE:
629 _file_set_done(app);
630 app->last_order = EM_CMD_LAST;
631 break;
632 case EM_CMD_FILE_CLOSE:
633 _file_close(app);
634 app->last_order = EM_CMD_LAST;
635 break;
636 case EM_CMD_STOP:
637 _stop(app);
638 app->last_order = EM_CMD_LAST;
639 break;
640 }
641 }
642 else
643 {
644 switch (app->last_order)
645 {
646 case EM_CMD_INIT:
647 app->shmname = strdup(buffer);
648 app->inited = EINA_TRUE;
649 _send_init(app);
650 break;
651 case EM_CMD_FILE_SET:
652 app->filename = strdup(buffer);
653 _file_set(app);
654 break;
655 case EM_CMD_SUBTITLE_SET:
656 app->subtitle_path = strdup(buffer);
657 break;
658 case EM_CMD_PLAY:
659 _play(app, *(float*) buffer);
660 break;
661 case EM_CMD_POSITION_SET:
662 _position_set(app, *(float*) buffer);
663 break;
664 case EM_CMD_SPEED_SET:
665 _speed_set(app, *(float*) buffer);
666 break;
667 case EM_CMD_AUDIO_MUTE_SET:
668 _mute_set(app, *(int*) buffer);
669 break;
670 case EM_CMD_VOLUME_SET:
671 _volume_set(app, *(float*) buffer);
672 break;
673 case EM_CMD_SPU_TRACK_SET:
674 _spu_track_set(app, *(int*) buffer);
675 break;
676 case EM_CMD_AUDIO_TRACK_SET:
677 _audio_track_set(app, *(int*) buffer);
678 break;
679 case EM_CMD_VIDEO_TRACK_SET:
680 _video_track_set(app, *(int*) buffer);
681 break;
682 }
683 app->last_order = EM_CMD_LAST;
684 }
685}
686
687static void
688_dummy(void *data EINA_UNUSED, void *buffer EINA_UNUSED, unsigned int nbyte EINA_UNUSED)
689{
690 /* This function is useless for the pipe we use to send message back
691 to emotion, but still needed */
692}
693
694/* Main */
695static Eina_Bool
696exit_func(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev EINA_UNUSED)
697{
698 DBG("Quit signal received !");
699 ecore_main_loop_quit();
700 return EINA_TRUE;
701}
702
703int
704main(int argc, const char *argv[])
705{
706 App app;
707 Ecore_Event_Handler *hld;
708 int vlc_argc;
709
710 const char *vlc_argv[] =
711 {
712 "--quiet",
713 "--intf", "dummy", /* no interface */
714 "--vout", "dummy", /* we don't want video (output) */
715 "--no-video-title-show", /* nor the filename displayed */
716 "--no-sub-autodetect-file", /* we don't want automatic subtitles */
717 "--no-stats", /* no stats */
718 "--no-inhibit", /* we don't want interfaces */
719 "--no-disable-screensaver", /* we don't want interfaces */
720// XXX: causes newer vlcs to segv!
721// "--codec", "avcodec",
722// XXX: disable this just in case
723// "--demux", "avformat"
724 };
725 vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
726
727 memset(&app, 0, sizeof(app));
728 if (!eina_init())
729 {
730 EINA_LOG_CRIT("Can't initialize generic vlc player, eina failed.");
731 return -1;
732 }
733
734 _em_vlc_log_dom = eina_log_domain_register("emotion_generic_vlc",
735 EINA_COLOR_CYAN);
736 if (_em_vlc_log_dom < 0)
737 {
738 EINA_LOG_CRIT("Unable to register emotion_generic_vlc log domain.");
739 goto error;
740 }
741
742 if (!eina_log_domain_level_check(_em_vlc_log_dom, EINA_LOG_LEVEL_WARN))
743 eina_log_domain_level_set("emotion_generic_vlc", EINA_LOG_LEVEL_WARN);
744
745 if (argc < 3)
746 {
747 ERR("missing parameters.");
748 ERR("syntax:\n\t%s <fd read> <fd write>", argv[0]);
749 goto error;
750 }
751
752 ecore_init();
753
754 eina_lock_new(&app.cmd_mutex);
755
756 app.fd_read = ecore_pipe_full_add(_remote_command, &app,
757 atoi(argv[1]), -1, EINA_FALSE, EINA_FALSE);
758 app.fd_write = ecore_pipe_full_add(_dummy, NULL,
759 -1, atoi(argv[2]), EINA_FALSE, EINA_FALSE);
760
761 hld = ecore_event_handler_add(ECORE_EVENT_SIGNAL_HUP, exit_func, NULL);
762
763 app.libvlc = libvlc_new(vlc_argc, vlc_argv);
764 app.mp = NULL;
765 app.filename = NULL;
766 app.subtitle_path = NULL;
767 app.w = 0;
768 app.h = 0;
769 app.opening = EINA_FALSE;
770 app.playing = EINA_FALSE;
771 app.inited = EINA_FALSE;
772 app.last_order = EM_CMD_LAST;
773
774 ecore_main_loop_begin();
775
776 libvlc_release(app.libvlc);
777 ecore_pipe_del(app.fd_read);
778 ecore_pipe_del(app.fd_write);
779 ecore_event_handler_del(hld);
780 eina_lock_free(&app.cmd_mutex);
781
782 ecore_shutdown();
783 eina_shutdown();
784 return 0;
785
786 error:
787 eina_shutdown();
788 return -1;
789}
790#undef SEND_CMD_PARAM
diff --git a/legacy/evas_generic_loaders/AUTHORS b/legacy/evas_generic_loaders/AUTHORS
deleted file mode 100644
index 6dc53f5..0000000
--- a/legacy/evas_generic_loaders/AUTHORS
+++ /dev/null
@@ -1,15 +0,0 @@
1The Rasterman (Carsten Haitzler) <raster@rasterman.com>
2Christian Kreibich <cK@whoop.org>
3Vincent Torri <vtorri at univ-evry dot fr>
4Michael Bouchaud <michael.bouchaud@gmail.com>
5Fanina "cippp" Cristian <fancris3@gmail.com>
6Cedric BAIL <cedric.bail@free.fr>
7Jérémy Zurcher <jeremy@asynk.ch>
8Stefan Schmidt <stefan@datenfreihafen.org>
9Daniel Juyung Seo <seojuyung2@gmail.com>
10Doug Newgard <scimmia22@outlook.com>
11Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
12Alex-P. Natsios <drakevr@linuxteam.teilar.gr>
13Jihoon Kim <imfine98@gmail.com>
14Samuel F. Baggen <thanatermesis.elive@gmail.com>
15Sebastian Dransfeld <sd@tango.flipp.net>
diff --git a/legacy/evas_generic_loaders/COPYING b/legacy/evas_generic_loaders/COPYING
deleted file mode 100644
index 8795172..0000000
--- a/legacy/evas_generic_loaders/COPYING
+++ /dev/null
@@ -1,356 +0,0 @@
1Copyright notice for Evas generic loaders:
2
3Copyright (C) 2011-2014 Carsten Haitzler and various contributors (see AUTHORS)
4
5This library is free software; you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by the
7Free Software Foundation; version 2 of the License.
8
9This library is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13Below is a copy of the GNU General Public License that is distributed
14along with this library. If you do not have a copy below, write to the Free
15Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1602110-1301 USA
17
18 GNU GENERAL PUBLIC LICENSE
19 Version 2, June 1991
20
21 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 Everyone is permitted to copy and distribute verbatim copies
24 of this license document, but changing it is not allowed.
25
26 Preamble
27
28 The licenses for most software are designed to take away your
29freedom to share and change it. By contrast, the GNU General Public
30License is intended to guarantee your freedom to share and change free
31software--to make sure the software is free for all its users. This
32General Public License applies to most of the Free Software
33Foundation's software and to any other program whose authors commit to
34using it. (Some other Free Software Foundation software is covered by
35the GNU Lesser General Public License instead.) You can apply it to
36your programs, too.
37
38 When we speak of free software, we are referring to freedom, not
39price. Our General Public Licenses are designed to make sure that you
40have the freedom to distribute copies of free software (and charge for
41this service if you wish), that you receive source code or can get it
42if you want it, that you can change the software or use pieces of it
43in new free programs; and that you know you can do these things.
44
45 To protect your rights, we need to make restrictions that forbid
46anyone to deny you these rights or to ask you to surrender the rights.
47These restrictions translate to certain responsibilities for you if you
48distribute copies of the software, or if you modify it.
49
50 For example, if you distribute copies of such a program, whether
51gratis or for a fee, you must give the recipients all the rights that
52you have. You must make sure that they, too, receive or can get the
53source code. And you must show them these terms so they know their
54rights.
55
56 We protect your rights with two steps: (1) copyright the software, and
57(2) offer you this license which gives you legal permission to copy,
58distribute and/or modify the software.
59
60 Also, for each author's protection and ours, we want to make certain
61that everyone understands that there is no warranty for this free
62software. If the software is modified by someone else and passed on, we
63want its recipients to know that what they have is not the original, so
64that any problems introduced by others will not reflect on the original
65authors' reputations.
66
67 Finally, any free program is threatened constantly by software
68patents. We wish to avoid the danger that redistributors of a free
69program will individually obtain patent licenses, in effect making the
70program proprietary. To prevent this, we have made it clear that any
71patent must be licensed for everyone's free use or not licensed at all.
72
73 The precise terms and conditions for copying, distribution and
74modification follow.
75
76 GNU GENERAL PUBLIC LICENSE
77 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
78
79 0. This License applies to any program or other work which contains
80a notice placed by the copyright holder saying it may be distributed
81under the terms of this General Public License. The "Program", below,
82refers to any such program or work, and a "work based on the Program"
83means either the Program or any derivative work under copyright law:
84that is to say, a work containing the Program or a portion of it,
85either verbatim or with modifications and/or translated into another
86language. (Hereinafter, translation is included without limitation in
87the term "modification".) Each licensee is addressed as "you".
88
89Activities other than copying, distribution and modification are not
90covered by this License; they are outside its scope. The act of
91running the Program is not restricted, and the output from the Program
92is covered only if its contents constitute a work based on the
93Program (independent of having been made by running the Program).
94Whether that is true depends on what the Program does.
95
96 1. You may copy and distribute verbatim copies of the Program's
97source code as you receive it, in any medium, provided that you
98conspicuously and appropriately publish on each copy an appropriate
99copyright notice and disclaimer of warranty; keep intact all the
100notices that refer to this License and to the absence of any warranty;
101and give any other recipients of the Program a copy of this License
102along with the Program.
103
104You may charge a fee for the physical act of transferring a copy, and
105you may at your option offer warranty protection in exchange for a fee.
106
107 2. You may modify your copy or copies of the Program or any portion
108of it, thus forming a work based on the Program, and copy and
109distribute such modifications or work under the terms of Section 1
110above, provided that you also meet all of these conditions:
111
112 a) You must cause the modified files to carry prominent notices
113 stating that you changed the files and the date of any change.
114
115 b) You must cause any work that you distribute or publish, that in
116 whole or in part contains or is derived from the Program or any
117 part thereof, to be licensed as a whole at no charge to all third
118 parties under the terms of this License.
119
120 c) If the modified program normally reads commands interactively
121 when run, you must cause it, when started running for such
122 interactive use in the most ordinary way, to print or display an
123 announcement including an appropriate copyright notice and a
124 notice that there is no warranty (or else, saying that you provide
125 a warranty) and that users may redistribute the program under
126 these conditions, and telling the user how to view a copy of this
127 License. (Exception: if the Program itself is interactive but
128 does not normally print such an announcement, your work based on
129 the Program is not required to print an announcement.)
130
131These requirements apply to the modified work as a whole. If
132identifiable sections of that work are not derived from the Program,
133and can be reasonably considered independent and separate works in
134themselves, then this License, and its terms, do not apply to those
135sections when you distribute them as separate works. But when you
136distribute the same sections as part of a whole which is a work based
137on the Program, the distribution of the whole must be on the terms of
138this License, whose permissions for other licensees extend to the
139entire whole, and thus to each and every part regardless of who wrote it.
140
141Thus, it is not the intent of this section to claim rights or contest
142your rights to work written entirely by you; rather, the intent is to
143exercise the right to control the distribution of derivative or
144collective works based on the Program.
145
146In addition, mere aggregation of another work not based on the Program
147with the Program (or with a work based on the Program) on a volume of
148a storage or distribution medium does not bring the other work under
149the scope of this License.
150
151 3. You may copy and distribute the Program (or a work based on it,
152under Section 2) in object code or executable form under the terms of
153Sections 1 and 2 above provided that you also do one of the following:
154
155 a) Accompany it with the complete corresponding machine-readable
156 source code, which must be distributed under the terms of Sections
157 1 and 2 above on a medium customarily used for software interchange; or,
158
159 b) Accompany it with a written offer, valid for at least three
160 years, to give any third party, for a charge no more than your
161 cost of physically performing source distribution, a complete
162 machine-readable copy of the corresponding source code, to be
163 distributed under the terms of Sections 1 and 2 above on a medium
164 customarily used for software interchange; or,
165
166 c) Accompany it with the information you received as to the offer
167 to distribute corresponding source code. (This alternative is
168 allowed only for noncommercial distribution and only if you
169 received the program in object code or executable form with such
170 an offer, in accord with Subsection b above.)
171
172The source code for a work means the preferred form of the work for
173making modifications to it. For an executable work, complete source
174code means all the source code for all modules it contains, plus any
175associated interface definition files, plus the scripts used to
176control compilation and installation of the executable. However, as a
177special exception, the source code distributed need not include
178anything that is normally distributed (in either source or binary
179form) with the major components (compiler, kernel, and so on) of the
180operating system on which the executable runs, unless that component
181itself accompanies the executable.
182
183If distribution of executable or object code is made by offering
184access to copy from a designated place, then offering equivalent
185access to copy the source code from the same place counts as
186distribution of the source code, even though third parties are not
187compelled to copy the source along with the object code.
188
189 4. You may not copy, modify, sublicense, or distribute the Program
190except as expressly provided under this License. Any attempt
191otherwise to copy, modify, sublicense or distribute the Program is
192void, and will automatically terminate your rights under this License.
193However, parties who have received copies, or rights, from you under
194this License will not have their licenses terminated so long as such
195parties remain in full compliance.
196
197 5. You are not required to accept this License, since you have not
198signed it. However, nothing else grants you permission to modify or
199distribute the Program or its derivative works. These actions are
200prohibited by law if you do not accept this License. Therefore, by
201modifying or distributing the Program (or any work based on the
202Program), you indicate your acceptance of this License to do so, and
203all its terms and conditions for copying, distributing or modifying
204the Program or works based on it.
205
206 6. Each time you redistribute the Program (or any work based on the
207Program), the recipient automatically receives a license from the
208original licensor to copy, distribute or modify the Program subject to
209these terms and conditions. You may not impose any further
210restrictions on the recipients' exercise of the rights granted herein.
211You are not responsible for enforcing compliance by third parties to
212this License.
213
214 7. If, as a consequence of a court judgment or allegation of patent
215infringement or for any other reason (not limited to patent issues),
216conditions are imposed on you (whether by court order, agreement or
217otherwise) that contradict the conditions of this License, they do not
218excuse you from the conditions of this License. If you cannot
219distribute so as to satisfy simultaneously your obligations under this
220License and any other pertinent obligations, then as a consequence you
221may not distribute the Program at all. For example, if a patent
222license would not permit royalty-free redistribution of the Program by
223all those who receive copies directly or indirectly through you, then
224the only way you could satisfy both it and this License would be to
225refrain entirely from distribution of the Program.
226
227If any portion of this section is held invalid or unenforceable under
228any particular circumstance, the balance of the section is intended to
229apply and the section as a whole is intended to apply in other
230circumstances.
231
232It is not the purpose of this section to induce you to infringe any
233patents or other property right claims or to contest validity of any
234such claims; this section has the sole purpose of protecting the
235integrity of the free software distribution system, which is
236implemented by public license practices. Many people have made
237generous contributions to the wide range of software distributed
238through that system in reliance on consistent application of that
239system; it is up to the author/donor to decide if he or she is willing
240to distribute software through any other system and a licensee cannot
241impose that choice.
242
243This section is intended to make thoroughly clear what is believed to
244be a consequence of the rest of this License.
245
246 8. If the distribution and/or use of the Program is restricted in
247certain countries either by patents or by copyrighted interfaces, the
248original copyright holder who places the Program under this License
249may add an explicit geographical distribution limitation excluding
250those countries, so that distribution is permitted only in or among
251countries not thus excluded. In such case, this License incorporates
252the limitation as if written in the body of this License.
253
254 9. The Free Software Foundation may publish revised and/or new versions
255of the General Public License from time to time. Such new versions will
256be similar in spirit to the present version, but may differ in detail to
257address new problems or concerns.
258
259Each version is given a distinguishing version number. If the Program
260specifies a version number of this License which applies to it and "any
261later version", you have the option of following the terms and conditions
262either of that version or of any later version published by the Free
263Software Foundation. If the Program does not specify a version number of
264this License, you may choose any version ever published by the Free Software
265Foundation.
266
267 10. If you wish to incorporate parts of the Program into other free
268programs whose distribution conditions are different, write to the author
269to ask for permission. For software which is copyrighted by the Free
270Software Foundation, write to the Free Software Foundation; we sometimes
271make exceptions for this. Our decision will be guided by the two goals
272of preserving the free status of all derivatives of our free software and
273of promoting the sharing and reuse of software generally.
274
275 NO WARRANTY
276
277 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
278FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
279OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
280PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
281OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
282MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
283TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
284PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
285REPAIR OR CORRECTION.
286
287 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
288WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
289REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
290INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
291OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
292TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
293YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
294PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
295POSSIBILITY OF SUCH DAMAGES.
296
297 END OF TERMS AND CONDITIONS
298
299 How to Apply These Terms to Your New Programs
300
301 If you develop a new program, and you want it to be of the greatest
302possible use to the public, the best way to achieve this is to make it
303free software which everyone can redistribute and change under these terms.
304
305 To do so, attach the following notices to the program. It is safest
306to attach them to the start of each source file to most effectively
307convey the exclusion of warranty; and each file should have at least
308the "copyright" line and a pointer to where the full notice is found.
309
310 <one line to give the program's name and a brief idea of what it does.>
311 Copyright (C) <year> <name of author>
312
313 This program is free software; you can redistribute it and/or modify
314 it under the terms of the GNU General Public License as published by
315 the Free Software Foundation; either version 2 of the License, or
316 (at your option) any later version.
317
318 This program is distributed in the hope that it will be useful,
319 but WITHOUT ANY WARRANTY; without even the implied warranty of
320 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
321 GNU General Public License for more details.
322
323 You should have received a copy of the GNU General Public License along
324 with this program; if not, write to the Free Software Foundation, Inc.,
325 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
326
327Also add information on how to contact you by electronic and paper mail.
328
329If the program is interactive, make it output a short notice like this
330when it starts in an interactive mode:
331
332 Gnomovision version 69, Copyright (C) year name of author
333 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
334 This is free software, and you are welcome to redistribute it
335 under certain conditions; type `show c' for details.
336
337The hypothetical commands `show w' and `show c' should show the appropriate
338parts of the General Public License. Of course, the commands you use may
339be called something other than `show w' and `show c'; they could even be
340mouse-clicks or menu items--whatever suits your program.
341
342You should also get your employer (if you work as a programmer) or your
343school, if any, to sign a "copyright disclaimer" for the program, if
344necessary. Here is a sample; alter the names:
345
346 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
347 `Gnomovision' (which makes passes at compilers) written by James Hacker.
348
349 <signature of Ty Coon>, 1 April 1989
350 Ty Coon, President of Vice
351
352This General Public License does not permit incorporating your program into
353proprietary programs. If your program is a subroutine library, you may
354consider it more useful to permit linking proprietary applications with the
355library. If this is what you want to do, use the GNU Lesser General
356Public License instead of this License.
diff --git a/legacy/evas_generic_loaders/src/bin/Makefile.am b/legacy/evas_generic_loaders/src/bin/Makefile.am
deleted file mode 100644
index 040ae49..0000000
--- a/legacy/evas_generic_loaders/src/bin/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = common \
4xcf
5
6if HAVE_GST
7SUBDIRS += gst
8endif
9
10if HAVE_PDF
11SUBDIRS += pdf
12endif
13
14if HAVE_PS
15SUBDIRS += ps
16endif
17
18if HAVE_RAW
19SUBDIRS += raw
20endif
21
22if HAVE_SVG
23SUBDIRS += svg
24endif
diff --git a/legacy/evas_generic_loaders/src/bin/common/Makefile.am b/legacy/evas_generic_loaders/src/bin/common/Makefile.am
deleted file mode 100644
index 59035f0..0000000
--- a/legacy/evas_generic_loaders/src/bin/common/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = shmfile.c shmfile.h timeout.c timeout.h
diff --git a/legacy/evas_generic_loaders/src/bin/gst/Makefile.am b/legacy/evas_generic_loaders/src/bin/gst/Makefile.am
deleted file mode 100644
index 955c623..0000000
--- a/legacy/evas_generic_loaders/src/bin/gst/Makefile.am
+++ /dev/null
@@ -1,91 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src \
6-I$(top_srcdir)/src/bin \
7-I$(top_srcdir)/src/bin/common \
8-I$(top_srcdir)/src/bin/gst \
9-DPACKAGE_BIN_DIR=\"$(bindir)\" \
10-DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
12@EINA_CFLAGS@ \
13@GSTREAMER_CFLAGS@
14
15bin_PROGRAMS = evas_image_loader.gst
16bindir = $(libdir)/evas/utils
17
18if HAVE_GST1
19
20evas_image_loader_gst_SOURCES = \
21main.c \
22$(top_srcdir)/src/bin/common/shmfile.c \
23$(top_srcdir)/src/bin/common/timeout.c
24
25else
26
27evas_image_loader_gst_SOURCES = \
28main_0_10.c \
29$(top_srcdir)/src/bin/common/shmfile.c \
30$(top_srcdir)/src/bin/common/timeout.c
31
32endif
33
34evas_image_loader_gst_CFLAGS =
35evas_image_loader_gst_LDADD = @GSTREAMER_LIBS@ @EINA_LIBS@ @SHM_OPEN_LIBS@
36evas_image_loader_gst_LDFLAGS =
37
38## good list of extensions:
39## http://www.fileinfo.com/filetypes/video
40## should check which ones gst does support and make sure they are here
41install-exec-hook:
42 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.264
43 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.3g2
44 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.3gp
45 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.3gp2
46 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.3gpp
47 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.3gpp2
48 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.3p2
49 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.asf
50 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.avi
51 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.bdm
52 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.bdmv
53 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.clpi
54 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.cpi
55 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.dv
56 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.fla
57 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.flv
58 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.m1v
59 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.m2t
60 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.m2v
61 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.m4v
62 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mkv
63 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mov
64 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mp2
65 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mp2ts
66 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mp4
67 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mpe
68 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mpeg
69 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mpg
70 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mpl
71 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mpls
72 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mts
73 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mxf
74 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nut
75 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nuv
76 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ogg
77 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ogm
78 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ogv
79 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.qt
80 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rm
81 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rmj
82 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rmm
83 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rms
84 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rmx
85 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rmvb
86 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rv
87 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.swf
88 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ts
89 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.webm
90 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.weba
91 ln -sf evas_image_loader.gst $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.wmv
diff --git a/legacy/evas_generic_loaders/src/bin/gst/main.c b/legacy/evas_generic_loaders/src/bin/gst/main.c
deleted file mode 100644
index d9e6fa7..0000000
--- a/legacy/evas_generic_loaders/src/bin/gst/main.c
+++ /dev/null
@@ -1,292 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <sys/mman.h>
6#include <fcntl.h>
7#include <unistd.h>
8
9#include <gst/gst.h>
10
11#include <Eina.h>
12
13#include "shmfile.h"
14#include "timeout.h"
15
16#define DATA32 unsigned int
17
18//#define GST_DBG
19
20#ifdef GST_DBG
21#define D(fmt, args...) fprintf(stderr, fmt, ## args)
22#else
23#define D(fmt, args...)
24#endif
25
26#ifdef WORDS_BIGENDIAN
27# define CAPS "video/x-raw,format=ARGB"
28#else
29# define CAPS "video/x-raw,format=BGRA"
30#endif
31
32static GstElement *pipeline = NULL;
33static GstElement *sink = NULL;
34static gint64 duration = -1;
35
36int width = 0;
37int height = 0;
38void *data = NULL;
39
40
41static Eina_Bool
42_gst_init(const char *filename)
43{
44 GstPad *pad;
45 GstCaps *caps;
46 GstStructure *structure;
47 gchar *descr;
48 gchar *uri;
49 GError *error = NULL;
50 GstFormat format;
51 GstStateChangeReturn ret;
52// int vidstr = 0;
53
54 if (!filename || !*filename)
55 return EINA_FALSE;
56
57 if (!gst_init_check(NULL, NULL, &error))
58 return EINA_FALSE;
59
60 if ((*filename == '/') || (*filename == '~'))
61 {
62 uri = g_filename_to_uri(filename, NULL, NULL);
63 if (!uri)
64 {
65 D("could not create new uri from %s", filename);
66 goto unref_pipeline;
67 }
68 }
69 else
70 uri = strdup(filename);
71
72 D("Setting file %s\n", uri);
73
74 descr = g_strdup_printf("uridecodebin uri=%s ! typefind ! videoconvert ! "
75 " appsink name=sink caps=\"" CAPS "\"", uri);
76 pipeline = gst_parse_launch(descr, &error);
77 free(uri);
78
79 if (error != NULL)
80 {
81 D("could not construct pipeline: %s\n", error->message);
82 g_error_free (error);
83 goto gst_shutdown;
84 }
85/* needs gst 1.0+
86 * also only works on playbin objects!!! this is a uridecodebin!
87 g_object_get(G_OBJECT(pipeline),
88 "n-video", &vidstr,
89 NULL);
90 if (vidstr <= 0)
91 {
92 D("no video stream\n");
93 goto gst_shutdown;
94 }
95*/
96 sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
97
98 ret = gst_element_set_state (pipeline, GST_STATE_PAUSED);
99 switch (ret)
100 {
101 case GST_STATE_CHANGE_FAILURE:
102 D("failed to play the file\n");
103 goto unref_pipeline;
104 case GST_STATE_CHANGE_NO_PREROLL:
105 D("live sources not supported yet\n");
106 goto unref_pipeline;
107 default:
108 break;
109 }
110
111 ret = gst_element_get_state((pipeline), NULL, NULL, GST_CLOCK_TIME_NONE);
112 if (ret == GST_STATE_CHANGE_FAILURE)
113 {
114 D("could not complete pause\n");
115 goto unref_pipeline;
116 }
117
118 format = GST_FORMAT_TIME;
119 gst_element_query_duration (pipeline, format, &duration);
120 if (duration == -1)
121 {
122 fprintf(stderr, "duration fetch err\n");
123 D("could not retrieve the duration, set it to 1s\n");
124 duration = 1 * GST_SECOND;
125 }
126
127 pad = gst_element_get_static_pad(sink, "sink");
128 if (!pad)
129 {
130 D("could not retrieve the sink pad\n");
131 goto unref_pipeline;
132 }
133
134 caps = gst_pad_get_current_caps(pad);
135 if (!caps)
136 goto unref_pad;
137
138 structure = gst_caps_get_structure(caps, 0);
139
140 if (!gst_structure_get_int(structure, "width", &width))
141 goto unref_caps;
142 if (!gst_structure_get_int(structure, "height", &height))
143 goto unref_caps;
144
145 gst_caps_unref(caps);
146 gst_object_unref(pad);
147
148 return EINA_TRUE;
149
150 unref_caps:
151 gst_caps_unref(caps);
152 unref_pad:
153 gst_object_unref(pad);
154 unref_pipeline:
155 gst_element_set_state (pipeline, GST_STATE_NULL);
156 gst_object_unref(pipeline);
157 gst_shutdown:
158 gst_deinit();
159
160 return EINA_FALSE;
161}
162
163static void
164_gst_shutdown()
165{
166 gst_element_set_state (pipeline, GST_STATE_NULL);
167 gst_object_unref(pipeline);
168 gst_deinit();
169}
170
171static void
172_gst_load_image(int size_w EINA_UNUSED, int size_h EINA_UNUSED, double pos)
173{
174 GstBuffer *buffer;
175 GstMapInfo info;
176 GstSample *sample;
177
178 D("load image\n");
179 if (pos >= 0.0)
180 gst_element_seek_simple(pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
181 pos);
182 else
183 gst_element_seek_simple(pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
184 duration / 2);
185 g_signal_emit_by_name(sink, "pull-preroll", &sample, NULL);
186
187 shm_alloc(width * height * sizeof(DATA32));
188 if (!shm_addr) return;
189 data = shm_addr;
190
191 buffer = gst_sample_get_buffer (sample);
192 gst_buffer_map (buffer, &info, GST_MAP_READ);
193 D("load image: %p %d\n", info.data, info.size);
194
195 memcpy(data, info.data, info.size);
196
197 gst_buffer_unmap(buffer, &info);
198}
199
200int
201main(int argc, char **argv)
202{
203 char *file, *p;
204 int i, numonly;
205 int size_w = 0, size_h = 0;
206 int head_only = 0;
207 long long pos = -1.0;
208
209 if (argc < 2) return -1;
210 // file is ALWAYS first arg, other options come after
211 file = argv[1];
212 for (i = 2; i < argc; i++)
213 {
214 if (!strcmp(argv[i], "-head"))
215 // asked to only load header, not body/data
216 head_only = 1;
217 else if (!strcmp(argv[i], "-key"))
218 {
219 i++;
220 numonly = 1;
221 for (p = argv[i]; *p; p++)
222 {
223 if ((*p < '0') || (*p > '9'))
224 {
225 numonly = 0;
226 break;
227 }
228 }
229 if (numonly) pos = atoll(argv[i]) * 1000000;
230 i++;
231 }
232 else if (!strcmp(argv[i], "-opt-scale-down-by"))
233 { // not used by ps loader
234 i++;
235 // int scale_down = atoi(argv[i]);
236 }
237 else if (!strcmp(argv[i], "-opt-dpi"))
238 {
239 i++;
240 }
241 else if (!strcmp(argv[i], "-opt-size"))
242 { // not used by ps loader
243 i++;
244 size_w = atoi(argv[i]);
245 i++;
246 size_h = atoi(argv[i]);
247 }
248 }
249
250 timeout_init(10);
251
252 D("_gst_init_file\n");
253
254 if (!_gst_init(file))
255 return -1;
256 D("_gst_init done\n");
257
258 if ((pos >= 0) && (pos > duration)) return -1;
259
260 if (!head_only)
261 {
262 _gst_load_image(size_w, size_h, pos);
263 }
264
265 D("size...: %ix%i\n", width, height);
266 D("alpha..: 0\n");
267
268 printf("size %i %i\n", width, height);
269 printf("alpha 0\n");
270
271 if (!head_only)
272 {
273 if (shm_fd >= 0)
274 {
275 printf("shmfile %s\n", shmfile);
276 }
277 else
278 {
279 // could also to "tmpfile %s\n" like shmfile but just
280 // a mmaped tmp file on the system
281 printf("data\n");
282 fwrite(data, width * height * sizeof(DATA32), 1, stdout);
283 }
284 shm_free();
285 }
286 else
287 printf("done\n");
288
289 _gst_shutdown();
290 fflush(stdout);
291 return 0;
292}
diff --git a/legacy/evas_generic_loaders/src/bin/gst/main_0_10.c b/legacy/evas_generic_loaders/src/bin/gst/main_0_10.c
deleted file mode 100644
index 3e0c02b..0000000
--- a/legacy/evas_generic_loaders/src/bin/gst/main_0_10.c
+++ /dev/null
@@ -1,278 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <sys/mman.h>
6#include <fcntl.h>
7#include <unistd.h>
8
9#include <gst/gst.h>
10
11#include <Eina.h>
12
13#include "shmfile.h"
14#include "timeout.h"
15
16#define DATA32 unsigned int
17
18//#define GST_DBG
19
20#ifdef GST_DBG
21#define D(fmt, args...) fprintf(stderr, fmt, ## args)
22#else
23#define D(fmt, args...)
24#endif
25
26#define CAPS "video/x-raw-rgb,bpp=(int)32,depth=(int)32,endianness=(int)4321,red_mask=(int)0x0000ff00, green_mask=(int)0x00ff0000, blue_mask=(int)0xff000000"
27
28static GstElement *pipeline = NULL;
29static GstElement *sink = NULL;
30static gint64 duration = -1;
31
32int width = 0;
33int height = 0;
34void *data = NULL;
35
36
37static Eina_Bool
38_gst_init(const char *filename)
39{
40 GstPad *pad;
41 GstCaps *caps;
42 GstStructure *structure;
43 gchar *descr;
44 gchar *uri;
45 GError *error = NULL;
46 GstFormat format;
47 GstStateChangeReturn ret;
48// int vidstr = 0;
49
50 if (!filename || !*filename)
51 return EINA_FALSE;
52
53 if (!gst_init_check(NULL, NULL, &error))
54 return EINA_FALSE;
55
56 if ((*filename == '/') || (*filename == '~'))
57 {
58 uri = g_filename_to_uri(filename, NULL, NULL);
59 if (!uri)
60 {
61 D("could not create new uri from %s", filename);
62 goto unref_pipeline;
63 }
64 }
65 else
66 uri = strdup(filename);
67
68 D("Setting file %s\n", uri);
69
70 descr = g_strdup_printf("uridecodebin uri=%s ! typefind ! ffmpegcolorspace ! "
71 " appsink name=sink caps=\"" CAPS "\"", uri);
72 pipeline = gst_parse_launch(descr, &error);
73 free(uri);
74
75 if (error != NULL)
76 {
77 D("could not construct pipeline: %s\n", error->message);
78 g_error_free (error);
79 goto gst_shutdown;
80 }
81/* needs gst 1.0+
82 * also only works on playbin objects!!! this is a uridecodebin!
83 g_object_get(G_OBJECT(pipeline),
84 "n-video", &vidstr,
85 NULL);
86 if (vidstr <= 0)
87 {
88 D("no video stream\n");
89 goto gst_shutdown;
90 }
91*/
92 sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
93
94 ret = gst_element_set_state (pipeline, GST_STATE_PAUSED);
95 switch (ret)
96 {
97 case GST_STATE_CHANGE_FAILURE:
98 D("failed to play the file\n");
99 goto unref_pipeline;
100 case GST_STATE_CHANGE_NO_PREROLL:
101 D("live sources not supported yet\n");
102 goto unref_pipeline;
103 default:
104 break;
105 }
106
107 ret = gst_element_get_state((pipeline), NULL, NULL, GST_CLOCK_TIME_NONE);
108 if (ret == GST_STATE_CHANGE_FAILURE)
109 {
110 D("could not complete pause\n");
111 goto unref_pipeline;
112 }
113
114 format = GST_FORMAT_TIME;
115 gst_element_query_duration (pipeline, &format, &duration);
116 if (duration == -1)
117 {
118 D("could not retrieve the duration, set it to 1s\n");
119 duration = 1 * GST_SECOND;
120 }
121
122 pad = gst_element_get_static_pad(sink, "sink");
123 if (!pad)
124 {
125 D("could not retrieve the sink pad\n");
126 goto unref_pipeline;
127 }
128
129 caps = gst_pad_get_negotiated_caps(pad);
130 if (!caps)
131 goto unref_pad;
132
133 structure = gst_caps_get_structure(caps, 0);
134
135 if (!gst_structure_get_int(structure, "width", &width))
136 goto unref_caps;
137 if (!gst_structure_get_int(structure, "height", &height))
138 goto unref_caps;
139
140 gst_caps_unref(caps);
141 gst_object_unref(pad);
142
143 return EINA_TRUE;
144
145 unref_caps:
146 gst_caps_unref(caps);
147 unref_pad:
148 gst_object_unref(pad);
149 unref_pipeline:
150 gst_element_set_state (pipeline, GST_STATE_NULL);
151 gst_object_unref(pipeline);
152 gst_shutdown:
153 gst_deinit();
154
155 return EINA_FALSE;
156}
157
158static void
159_gst_shutdown()
160{
161 gst_element_set_state (pipeline, GST_STATE_NULL);
162 gst_object_unref(pipeline);
163 gst_deinit();
164}
165
166static void
167_gst_load_image(int size_w EINA_UNUSED, int size_h EINA_UNUSED, double pos)
168{
169 GstBuffer *buffer;
170
171 D("load image\n");
172 if (pos >= 0.0)
173 gst_element_seek_simple(pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
174 pos * 1000000000.0);
175 else
176 gst_element_seek_simple(pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
177 duration / 2);
178 g_signal_emit_by_name(sink, "pull-preroll", &buffer, NULL);
179 D("load image : %p %d\n", GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer));
180
181 shm_alloc(width * height * sizeof(DATA32));
182 if (!shm_addr) return;
183 data = shm_addr;
184
185 memcpy(data, GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer));
186}
187
188int
189main(int argc, char **argv)
190{
191 char *file, *p;
192 int i, numonly;
193 int size_w = 0, size_h = 0;
194 int head_only = 0;
195 long long pos = -1.0;
196
197 if (argc < 2) return -1;
198 // file is ALWAYS first arg, other options come after
199 file = argv[1];
200 for (i = 2; i < argc; i++)
201 {
202 if (!strcmp(argv[i], "-head"))
203 // asked to only load header, not body/data
204 head_only = 1;
205 else if (!strcmp(argv[i], "-key"))
206 {
207 i++;
208 numonly = 1;
209 for (p = argv[i]; *p; p++)
210 {
211 if ((!*p < '0') || (*p > 9))
212 {
213 numonly = 0;
214 break;
215 }
216 }
217 if (numonly) pos = (double)(atoll(argv[i])) / 1000.0;
218 i++;
219 }
220 else if (!strcmp(argv[i], "-opt-scale-down-by"))
221 { // not used by ps loader
222 i++;
223 // int scale_down = atoi(argv[i]);
224 }
225 else if (!strcmp(argv[i], "-opt-dpi"))
226 {
227 i++;
228 }
229 else if (!strcmp(argv[i], "-opt-size"))
230 { // not used by ps loader
231 i++;
232 size_w = atoi(argv[i]);
233 i++;
234 size_h = atoi(argv[i]);
235 }
236 }
237
238 timeout_init(10);
239
240 D("_gst_init_file\n");
241
242 if (!_gst_init(file))
243 return -1;
244 D("_gst_init done\n");
245
246 if (!head_only)
247 {
248 _gst_load_image(size_w, size_h, pos);
249 }
250
251 D("size...: %ix%i\n", width, height);
252 D("alpha..: 0\n");
253
254 printf("size %i %i\n", width, height);
255 printf("alpha 0\n");
256
257 if (!head_only)
258 {
259 if (shm_fd >= 0)
260 {
261 printf("shmfile %s\n", shmfile);
262 }
263 else
264 {
265 // could also to "tmpfile %s\n" like shmfile but just
266 // a mmaped tmp file on the system
267 printf("data\n");
268 fwrite(data, width * height * sizeof(DATA32), 1, stdout);
269 }
270 shm_free();
271 }
272 else
273 printf("done\n");
274
275 _gst_shutdown();
276 fflush(stdout);
277 return 0;
278}
diff --git a/legacy/evas_generic_loaders/src/bin/pdf/Makefile.am b/legacy/evas_generic_loaders/src/bin/pdf/Makefile.am
deleted file mode 100644
index d57c9a0..0000000
--- a/legacy/evas_generic_loaders/src/bin/pdf/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src \
6-I$(top_srcdir)/src/bin \
7-I$(top_srcdir)/src/bin/common \
8-I$(top_srcdir)/src/bin/pdf \
9-DPACKAGE_BIN_DIR=\"$(bindir)\" \
10-DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
12@EINA_CFLAGS@ \
13@POPPLER_CFLAGS@
14
15EXTRA_DIST = evas_generic_pdf_loader.libreoffice
16
17bin_SCRIPTS = evas_generic_pdf_loader.libreoffice
18bin_PROGRAMS = evas_image_loader.pdf
19bindir = $(libdir)/evas/utils
20
21evas_image_loader_pdf_SOURCES = \
22main.cpp \
23$(top_srcdir)/src/bin/common/shmfile.c \
24$(top_srcdir)/src/bin/common/timeout.c
25evas_image_loader_pdf_CFLAGS =
26evas_image_loader_pdf_LDADD = @POPPLER_LIBS@ @EINA_LIBS@ @SHM_OPEN_LIBS@
27evas_image_loader_pdf_LDFLAGS =
28
29install-exec-hook:
30 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ppt
31 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.pptx
32 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.odp
33 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.xls
34 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.xlsx
35 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ods
36 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.doc
37 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.docx
38 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.odt
39 ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rtf
40 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.ppt
41 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.pptx
42 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.odp
43 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.xls
44 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.xlsx
45 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.ods
46 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.doc
47 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.docx
48 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.odt
49 ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.rtf
diff --git a/legacy/evas_generic_loaders/src/bin/ps/Makefile.am b/legacy/evas_generic_loaders/src/bin/ps/Makefile.am
deleted file mode 100644
index eb62cc6..0000000
--- a/legacy/evas_generic_loaders/src/bin/ps/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src \
6-I$(top_srcdir)/src/bin \
7-I$(top_srcdir)/src/bin/common \
8-I$(top_srcdir)/src/bin/ps \
9-DPACKAGE_BIN_DIR=\"$(bindir)\" \
10-DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
12@EINA_CFLAGS@ \
13@SPECTRE_CFLAGS@
14
15bin_PROGRAMS = evas_image_loader.ps
16bindir = $(libdir)/evas/utils
17
18evas_image_loader_ps_SOURCES = \
19main.c \
20$(top_srcdir)/src/bin/common/shmfile.c \
21$(top_srcdir)/src/bin/common/timeout.c
22evas_image_loader_ps_CFLAGS =
23evas_image_loader_ps_LDADD = @SPECTRE_LIBS@ @EINA_LIBS@ @SHM_OPEN_LIBS@
24evas_image_loader_ps_LDFLAGS =
diff --git a/legacy/evas_generic_loaders/src/bin/raw/Makefile.am b/legacy/evas_generic_loaders/src/bin/raw/Makefile.am
deleted file mode 100644
index 90d9005..0000000
--- a/legacy/evas_generic_loaders/src/bin/raw/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src \
6-I$(top_srcdir)/src/bin \
7-I$(top_srcdir)/src/bin/common \
8-I$(top_srcdir)/src/bin/raw \
9-DPACKAGE_BIN_DIR=\"$(bindir)\" \
10-DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
12@EINA_CFLAGS@
13
14bin_PROGRAMS = evas_image_loader.raw
15bindir = $(libdir)/evas/utils
16
17evas_image_loader_raw_SOURCES = \
18main.c \
19$(top_srcdir)/src/bin/common/shmfile.c \
20$(top_srcdir)/src/bin/common/timeout.c
21evas_image_loader_raw_CFLAGS = @LIBRAW_CFLAGS@
22evas_image_loader_raw_LDADD = @SHM_OPEN_LIBS@ @LIBRAW_LIBS@ -lm
23evas_image_loader_raw_LDFLAGS =
24
25install-exec-hook:
26 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.arw
27 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.cr2
28 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.crw
29 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.dcr
30 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.dng
31 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.k25
32 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.kdc
33 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.erf
34 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mrw
35 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nef
36 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nrf
37 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nrw
38 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.orf
39 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rw2
40 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.pef
41 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.raf
42 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.sr2
43 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.srf
44 ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.x3f
diff --git a/legacy/evas_generic_loaders/src/bin/svg/Makefile.am b/legacy/evas_generic_loaders/src/bin/svg/Makefile.am
deleted file mode 100644
index e5d85a7..0000000
--- a/legacy/evas_generic_loaders/src/bin/svg/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src \
6-I$(top_srcdir)/src/bin \
7-I$(top_srcdir)/src/bin/common \
8-I$(top_srcdir)/src/bin/svg \
9-DPACKAGE_BIN_DIR=\"$(bindir)\" \
10-DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
12@EINA_CFLAGS@
13
14bin_PROGRAMS = evas_image_loader.svg
15bindir = $(libdir)/evas/utils
16
17evas_image_loader_svg_SOURCES = \
18main.c \
19$(top_srcdir)/src/bin/common/shmfile.c \
20$(top_srcdir)/src/bin/common/timeout.c
21evas_image_loader_svg_CFLAGS = @SVG_CFLAGS@
22evas_image_loader_svg_LDADD = @SVG_LIBS@ @SHM_OPEN_LIBS@ -lm
23evas_image_loader_svg_LDFLAGS =
24
25
26install-exec-hook:
27 ln -sf evas_image_loader.svg $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.svgz
28 ln -sf evas_image_loader.svg $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.svg.gz
diff --git a/legacy/evas_generic_loaders/src/bin/xcf/Makefile.am b/legacy/evas_generic_loaders/src/bin/xcf/Makefile.am
deleted file mode 100644
index 041e8b3..0000000
--- a/legacy/evas_generic_loaders/src/bin/xcf/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src \
6-I$(top_srcdir)/src/bin \
7-I$(top_srcdir)/src/bin/common \
8-I$(top_srcdir)/src/bin/xcf \
9-DPACKAGE_BIN_DIR=\"$(bindir)\" \
10-DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
12@EINA_CFLAGS@
13
14bin_PROGRAMS = evas_image_loader.xcf
15bindir = $(libdir)/evas/utils
16
17evas_image_loader_xcf_SOURCES = \
18main.c pixelfuncs.c common.h \
19$(top_srcdir)/src/bin/common/shmfile.c \
20$(top_srcdir)/src/bin/common/timeout.c
21evas_image_loader_xcf_CFLAGS = @EINA_CFLAGS@
22evas_image_loader_xcf_LDADD = @EINA_LIBS@ -lz -lm @SHM_OPEN_LIBS@
23evas_image_loader_xcf_LDFLAGS =
24
25install-exec-hook:
26 ln -sf evas_image_loader.xcf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.xcf.gz
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index f1e5332..bb510ad 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -2377,3 +2377,156 @@ if HAVE_CXX11
2377evas_eolian_cxx_hh = $(evas_eolian_pub_files:%.eo=%.eo.hh) 2377evas_eolian_cxx_hh = $(evas_eolian_pub_files:%.eo=%.eo.hh)
2378evas_eolian_cxx_impl = $(evas_eolian_pub_files:%.eo=%.eo.impl.hh) 2378evas_eolian_cxx_impl = $(evas_eolian_pub_files:%.eo=%.eo.impl.hh)
2379endif 2379endif
2380
2381EXTRA_DIST += \
2382generic/evas/common/shmfile.c \
2383generic/evas/common/shmfile.h \
2384generic/evas/common/timeout.c \
2385generic/evas/common/timeout.h
2386
2387evasgenericloadersdir = \
2388$(libdir)/evas/utils
2389
2390evasgenericloaders_PROGRAMS =
2391evasgenericloaders_SCRIPT =
2392
2393### Libreoffice converter to pdf
2394EXTRA_DIST += generic/evas/pdf/evas_generic_pdf_loader.libreoffice
2395
2396if HAVE_POPPLER
2397
2398evasgenericloaders_SCRIPT += generic/evas/pdf/evas_generic_pdf_loader.libreoffice
2399evasgenericloaders_PROGRAMS += generic/evas/pdf/evas_image_loader.pdf
2400
2401generic_evas_pdf_evas_image_loader_pdf_SOURCES = \
2402generic/evas/pdf/main.cpp \
2403generic/evas/common/shmfile.c \
2404generic/evas/common/timeout.c
2405generic_evas_pdf_evas_image_loader_pdf_CFLAGS = \
2406-I$(top_srcdir)/src/lib/efl \
2407-I$(top_srcdir)/src/lib/eina \
2408-I$(top_srcdir)/src/generic/evas/common \
2409@POPPLER_CFLAGS@
2410generic_evas_pdf_evas_image_loader_pdf_CXXFLAGS = \
2411-I$(top_srcdir)/src/lib/efl \
2412-I$(top_srcdir)/src/lib/eina \
2413-I$(top_srcdir)/src/generic/evas/common \
2414@POPPLER_CFLAGS@
2415generic_evas_pdf_evas_image_loader_pdf_LDADD = @POPPLER_LIBS@ @USE_EINA_INTERNAL_LIBS@ @SHM_LIBS@
2416
2417EFL_INSTALL_EXEC_HOOK += \
2418ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ppt; \
2419ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.pptx; \
2420ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.odp; \
2421ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.xls; \
2422ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.xlsx; \
2423ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.ods; \
2424ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.doc; \
2425ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.docx; \
2426ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.odt; \
2427ln -sf evas_image_loader.pdf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rtf; \
2428ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.ppt; \
2429ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.pptx; \
2430ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.odp; \
2431ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.xls; \
2432ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.xlsx; \
2433ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.ods; \
2434ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.doc; \
2435ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.docx; \
2436ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.odt; \
2437ln -sf evas_generic_pdf_loader.libreoffice $(DESTDIR)$(libdir)/evas/utils/evas_generic_pdf_loader.rtf;
2438
2439endif
2440
2441if HAVE_SPECTRE
2442
2443evasgenericloaders_PROGRAMS += generic/evas/ps/evas_image_loader.ps
2444
2445generic_evas_ps_evas_image_loader_ps_SOURCES = \
2446generic/evas/ps/main.c \
2447generic/evas/common/shmfile.c \
2448generic/evas/common/timeout.c
2449generic_evas_ps_evas_image_loader_ps_LDADD = @SPECTRE_LIBS@ @USE_EINA_INTERNAL_LIBS@ @SHM_LIBS@
2450generic_evas_ps_evas_image_loader_ps_CFLAGS = \
2451-I$(top_srcdir)/src/lib/efl \
2452-I$(top_srcdir)/src/lib/eina \
2453-I$(top_srcdir)/src/generic/evas/common
2454
2455endif
2456
2457if HAVE_LIBRAW
2458
2459evasgenericloaders_PROGRAMS += generic/evas/raw/evas_image_loader.raw
2460
2461generic_evas_raw_evas_image_loader_raw_SOURCES = \
2462generic/evas/raw/main.c \
2463generic/evas/common/shmfile.c \
2464generic/evas/common/timeout.c
2465generic_evas_raw_evas_image_loader_raw_LDADD = @SHM_LIBS@ @USE_EINA_INTERNAL_LIBS@ @LIBRAW_LIBS@ -lm
2466generic_evas_raw_evas_image_loader_raw_CFLAGS = \
2467-I$(top_srcdir)/src/lib/efl \
2468-I$(top_srcdir)/src/lib/eina \
2469-I$(top_srcdir)/src/generic/evas/common \
2470@LIBRAW_CFLAGS@
2471
2472EFL_INSTALL_EXEC_HOOK += \
2473ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.arw; \
2474ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.cr2; \
2475ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.crw; \
2476ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.dcr; \
2477ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.dng; \
2478ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.k25; \
2479ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.kdc; \
2480ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.erf; \
2481ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.mrw; \
2482ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nef; \
2483ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nrf; \
2484ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.nrw; \
2485ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.orf; \
2486ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.rw2; \
2487ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.pef; \
2488ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.raf; \
2489ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.sr2; \
2490ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.srf; \
2491ln -sf evas_image_loader.raw $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.x3f;
2492
2493endif
2494
2495if HAVE_RSVG
2496
2497evasgenericloaders_PROGRAMS += generic/evas/svg/evas_image_loader.svg
2498
2499generic_evas_svg_evas_image_loader_svg_SOURCES = \
2500generic/evas/svg/main.c \
2501generic/evas/common/shmfile.c \
2502generic/evas/common/timeout.c
2503generic_evas_svg_evas_image_loader_svg_CFLAGS = \
2504-I$(top_srcdir)/src/lib/efl \
2505-I$(top_srcdir)/src/lib/eina \
2506-I$(top_srcdir)/src/generic/evas/common \
2507@RSVG_CFLAGS@
2508generic_evas_svg_evas_image_loader_svg_LDADD = @RSVG_LIBS@ @USE_EINA_INTERNAL_LIBS@ @SHM_LIBS@ -lm
2509
2510EFL_INSTALL_EXEC_HOOK += \
2511ln -sf evas_image_loader.svg $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.svgz; \
2512ln -sf evas_image_loader.svg $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.svg.gz;
2513
2514endif
2515
2516EXTRA_DIST += generic/evas/xcf/common.h
2517
2518evasgenericloaders_PROGRAMS += generic/evas/xcf/evas_image_loader.xcf
2519
2520generic_evas_xcf_evas_image_loader_xcf_SOURCES = \
2521generic/evas/xcf/main.c \
2522generic/evas/xcf/pixelfuncs.c \
2523generic/evas/common/shmfile.c \
2524generic/evas/common/timeout.c
2525generic_evas_xcf_evas_image_loader_xcf_CFLAGS = \
2526-I$(top_srcdir)/src/lib/efl \
2527-I$(top_srcdir)/src/lib/eina \
2528-I$(top_srcdir)/src/generic/evas/common
2529generic_evas_xcf_evas_image_loader_xcf_LDADD = @USE_EINA_INTERNAL_LIBS@ @SHM_LIBS@ -lm -lz
2530
2531EFL_INSTALL_EXEC_HOOK += \
2532ln -sf evas_image_loader.xcf $(DESTDIR)$(libdir)/evas/utils/evas_image_loader.xcf.gz;
diff --git a/src/generic/.gitignore b/src/generic/.gitignore
new file mode 100644
index 0000000..f901c12
--- /dev/null
+++ b/src/generic/.gitignore
@@ -0,0 +1,5 @@
1/emotion/vlc/vlc
2/evas/pdf/evas_image_loader.pdf
3/evas/ps/evas_image_loader.ps
4/evas/raw/evas_image_loader.raw
5/evas/xcf/evas_image_loader.xcf
diff --git a/legacy/evas_generic_loaders/src/bin/common/shmfile.c b/src/generic/evas/common/shmfile.c
index 538a314..538a314 100644
--- a/legacy/evas_generic_loaders/src/bin/common/shmfile.c
+++ b/src/generic/evas/common/shmfile.c
diff --git a/legacy/evas_generic_loaders/src/bin/common/shmfile.h b/src/generic/evas/common/shmfile.h
index f70a8fd..f70a8fd 100644
--- a/legacy/evas_generic_loaders/src/bin/common/shmfile.h
+++ b/src/generic/evas/common/shmfile.h
diff --git a/legacy/evas_generic_loaders/src/bin/common/timeout.c b/src/generic/evas/common/timeout.c
index 6d52aa9..6d52aa9 100644
--- a/legacy/evas_generic_loaders/src/bin/common/timeout.c
+++ b/src/generic/evas/common/timeout.c
diff --git a/legacy/evas_generic_loaders/src/bin/common/timeout.h b/src/generic/evas/common/timeout.h
index 8725627..8725627 100644
--- a/legacy/evas_generic_loaders/src/bin/common/timeout.h
+++ b/src/generic/evas/common/timeout.h
diff --git a/legacy/evas_generic_loaders/src/bin/pdf/evas_generic_pdf_loader.libreoffice b/src/generic/evas/pdf/evas_generic_pdf_loader.libreoffice
index b36e11e..b36e11e 100755
--- a/legacy/evas_generic_loaders/src/bin/pdf/evas_generic_pdf_loader.libreoffice
+++ b/src/generic/evas/pdf/evas_generic_pdf_loader.libreoffice
diff --git a/legacy/evas_generic_loaders/src/bin/pdf/main.cpp b/src/generic/evas/pdf/main.cpp
index 6b1de13..6b1de13 100644
--- a/legacy/evas_generic_loaders/src/bin/pdf/main.cpp
+++ b/src/generic/evas/pdf/main.cpp
diff --git a/legacy/evas_generic_loaders/src/bin/ps/main.c b/src/generic/evas/ps/main.c
index 48e8a4b..48e8a4b 100644
--- a/legacy/evas_generic_loaders/src/bin/ps/main.c
+++ b/src/generic/evas/ps/main.c
diff --git a/legacy/evas_generic_loaders/src/bin/raw/main.c b/src/generic/evas/raw/main.c
index ac9f810..ac9f810 100644
--- a/legacy/evas_generic_loaders/src/bin/raw/main.c
+++ b/src/generic/evas/raw/main.c
diff --git a/legacy/evas_generic_loaders/src/bin/svg/main.c b/src/generic/evas/svg/main.c
index 5fc7912..5fc7912 100644
--- a/legacy/evas_generic_loaders/src/bin/svg/main.c
+++ b/src/generic/evas/svg/main.c
diff --git a/legacy/evas_generic_loaders/src/bin/xcf/common.h b/src/generic/evas/xcf/common.h
index 5abaab8..5abaab8 100644
--- a/legacy/evas_generic_loaders/src/bin/xcf/common.h
+++ b/src/generic/evas/xcf/common.h
diff --git a/legacy/evas_generic_loaders/src/bin/xcf/main.c b/src/generic/evas/xcf/main.c
index 373823b..373823b 100644
--- a/legacy/evas_generic_loaders/src/bin/xcf/main.c
+++ b/src/generic/evas/xcf/main.c
diff --git a/legacy/evas_generic_loaders/src/bin/xcf/pixelfuncs.c b/src/generic/evas/xcf/pixelfuncs.c
index 67d66d8..67d66d8 100644
--- a/legacy/evas_generic_loaders/src/bin/xcf/pixelfuncs.c
+++ b/src/generic/evas/xcf/pixelfuncs.c