1 #ifndef _EMOTION_MODULE_H_
2 #define _EMOTION_MODULE_H_ 1
3 
4 #include "Emotion.h"
5 
6 #ifdef EAPI
7 # undef EAPI
8 #endif
9 
10 #ifdef _WIN32
11 # ifdef EFL_BUILD
12 #  ifdef DLL_EXPORT
13 #   define EAPI __declspec(dllexport)
14 #  else
15 #   define EAPI
16 #  endif
17 # else
18 #  define EAPI __declspec(dllimport)
19 # endif
20 #else
21 # ifdef __GNUC__
22 #  if __GNUC__ >= 4
23 #   define EAPI __attribute__ ((visibility("default")))
24 #  else
25 #   define EAPI
26 #  endif
27 # else
28 #  define EAPI
29 # endif
30 #endif
31 
32 #define META_TRACK_TITLE 1
33 #define META_TRACK_ARTIST 2
34 #define META_TRACK_GENRE 3
35 #define META_TRACK_COMMENT 4
36 #define META_TRACK_ALBUM 5
37 #define META_TRACK_YEAR 6
38 #define META_TRACK_DISCID 7
39 #define META_TRACK_COUNT 8
40 
41 typedef enum _Emotion_Format Emotion_Format;
42 typedef struct _Emotion_Engine Emotion_Engine;
43 typedef struct _Emotion_Module_Options Emotion_Module_Options;
44 typedef struct _Eina_Emotion_Plugins Eina_Emotion_Plugins;
45 
46 enum _Emotion_Format
47 {
48    EMOTION_FORMAT_NONE,
49    EMOTION_FORMAT_I420,
50    EMOTION_FORMAT_YV12,
51    EMOTION_FORMAT_YUY2,     /* unused for now since evas does not support yuy2 format */
52    EMOTION_FORMAT_BGRA
53 };
54 
55 struct _Emotion_Module_Options
56 {
57    Eina_Bool no_video : 1;
58    Eina_Bool no_audio : 1;
59 };
60 
61 struct _Emotion_Engine
62 {
63 #define EMOTION_ENGINE_API_VERSION (1U)
64    unsigned       version;
65 
66 #define EMOTION_ENGINE_PRIORITY_DEFAULT (50)
67    int            priority; /* default priority, may be overwritten by user. Try to keep from 0-100. */
68 
69    const char    *name;
70    void          *(*add)(const Emotion_Engine *api, Evas_Object *obj, const Emotion_Module_Options *opts);
71    void           (*del)(void *ef);
72 
73    Eina_Bool      (*file_open) (void *ef, const char *file);
74    void           (*file_close) (void *ef);
75    void           (*play) (void *ef, double pos);
76    void           (*stop) (void *ef);
77    void           (*size_get) (void *ef, int *w, int *h);
78    void           (*pos_set) (void *ef, double pos);
79    double         (*len_get) (void *ef);
80    double         (*buffer_size_get) (void *ef);
81    int            (*fps_num_get) (void *ef);
82    int            (*fps_den_get) (void *ef);
83    double         (*fps_get) (void *ef);
84    double         (*pos_get) (void *ef);
85    void           (*vis_set) (void *ef, Emotion_Vis vis);
86    Emotion_Vis    (*vis_get) (void *ef);
87    Eina_Bool      (*vis_supported) (void *ef, Emotion_Vis vis);
88    double         (*ratio_get) (void *ef);
89    int            (*video_handled) (void *ef);
90    int            (*audio_handled) (void *ef);
91    int            (*seekable) (void *ef);
92    void           (*frame_done) (void *ef);
93    Emotion_Format (*format_get) (void *ef);
94    void           (*video_data_size_get) (void *ef, int *w, int *h);
95    int            (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
96    int            (*bgra_data_get) (void *ef, unsigned char **bgra_data);
97    void           (*event_feed) (void *ef, int event);
98    void           (*event_mouse_button_feed) (void *ef, int button, int x, int y);
99    void           (*event_mouse_move_feed) (void *ef, int x, int y);
100    int            (*video_channel_count) (void *ef);
101    void           (*video_channel_set) (void *ef, int channel);
102    int            (*video_channel_get) (void *ef);
103    void           (*video_subtitle_file_set) (void *ef, const char *filepath);
104    const char *   (*video_subtitle_file_get) (void *ef);
105    const char *   (*video_channel_name_get) (void *ef, int channel);
106    void           (*video_channel_mute_set) (void *ef, int mute);
107    int            (*video_channel_mute_get) (void *ef);
108    int            (*audio_channel_count) (void *ef);
109    void           (*audio_channel_set) (void *ef, int channel);
110    int            (*audio_channel_get) (void *ef);
111    const char *   (*audio_channel_name_get) (void *ef, int channel);
112    void           (*audio_channel_mute_set) (void *ef, int mute);
113    int            (*audio_channel_mute_get) (void *ef);
114    void           (*audio_channel_volume_set) (void *ef, double vol);
115    double         (*audio_channel_volume_get) (void *ef);
116    int            (*spu_channel_count) (void *ef);
117    void           (*spu_channel_set) (void *ef, int channel);
118    int            (*spu_channel_get) (void *ef);
119    const char *   (*spu_channel_name_get) (void *ef, int channel);
120    void           (*spu_channel_mute_set) (void *ef, int mute);
121    int            (*spu_channel_mute_get) (void *ef);
122    int            (*chapter_count) (void *ef);
123    void           (*chapter_set) (void *ef, int chapter);
124    int            (*chapter_get) (void *ef);
125    const char *   (*chapter_name_get) (void *ef, int chapter);
126    void           (*speed_set) (void *ef, double speed);
127    double         (*speed_get) (void *ef);
128    int            (*eject) (void *ef);
129    const char *   (*meta_get) (void *ef, int meta);
130    void           (*priority_set) (void *ef, Eina_Bool priority);
131    Eina_Bool      (*priority_get) (void *ef);
132    void       *   (*meta_artwork_get)(void *ef, Evas_Object *img, const char *path, Emotion_Artwork_Info type);
133 };
134 
135 EAPI void *_emotion_video_get(const Evas_Object *obj);
136 EAPI void  _emotion_frame_new(Evas_Object *obj);
137 EAPI void  _emotion_video_pos_update(Evas_Object *obj, double pos, double len);
138 EAPI void  _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio);
139 EAPI void  _emotion_frame_refill(Evas_Object *obj, double w, double h);
140 EAPI void  _emotion_decode_stop(Evas_Object *obj);
141 EAPI void  _emotion_open_done(Evas_Object *obj);
142 EAPI void  _emotion_playback_started(Evas_Object *obj);
143 EAPI void  _emotion_playback_finished(Evas_Object *obj);
144 EAPI void  _emotion_audio_level_change(Evas_Object *obj);
145 EAPI void  _emotion_channels_change(Evas_Object *obj);
146 EAPI void  _emotion_title_set(Evas_Object *obj, char *title);
147 EAPI void  _emotion_progress_set(Evas_Object *obj, char *info, double stat);
148 EAPI void  _emotion_file_ref_set(Evas_Object *obj, const char *file, int num);
149 EAPI void  _emotion_spu_button_num_set(Evas_Object *obj, int num);
150 EAPI void  _emotion_spu_button_set(Evas_Object *obj, int button);
151 EAPI void  _emotion_seek_done(Evas_Object *obj);
152 EAPI void  _emotion_image_reset(Evas_Object *obj);
153 
154 EAPI void _emotion_pending_object_ref(void);
155 EAPI void _emotion_pending_object_unref(void);
156 
157 EAPI void _emotion_pending_ecore_begin(void);
158 EAPI void _emotion_pending_ecore_end(void);
159 
160 
161 EAPI const char *emotion_webcam_custom_get(const char *device);
162 
163 EAPI Eina_Bool _emotion_module_register(const Emotion_Engine *api);
164 EAPI Eina_Bool _emotion_module_unregister(const Emotion_Engine *api);
165 
166 #undef EAPI
167 #define EAPI
168 
169 #endif
170