EFL 1.7 svn doobies
[profile/ivi/emotion.git] / src / lib / emotion_private.h
1 #ifndef EMOTION_PRIVATE_H
2 #define EMOTION_PRIVATE_H
3
4 #define META_TRACK_TITLE 1
5 #define META_TRACK_ARTIST 2
6 #define META_TRACK_GENRE 3
7 #define META_TRACK_COMMENT 4
8 #define META_TRACK_ALBUM 5
9 #define META_TRACK_YEAR 6
10 #define META_TRACK_DISCID 7
11 #define META_TRACK_COUNT 8
12
13 typedef enum _Emotion_Format Emotion_Format;
14 typedef struct _Emotion_Video_Module Emotion_Video_Module;
15 typedef struct _Emotion_Module_Options Emotion_Module_Options;
16 typedef struct _Eina_Emotion_Plugins Eina_Emotion_Plugins;
17
18 typedef Eina_Bool (*Emotion_Module_Open)(Evas_Object *, const Emotion_Video_Module **, void **, Emotion_Module_Options *);
19 typedef void (*Emotion_Module_Close)(Emotion_Video_Module *module, void *);
20
21 enum _Emotion_Format
22 {
23    EMOTION_FORMAT_NONE,
24    EMOTION_FORMAT_I420,
25    EMOTION_FORMAT_YV12,
26    EMOTION_FORMAT_YUY2,     /* unused for now since evas does not support yuy2 format */
27    EMOTION_FORMAT_BGRA
28 };
29
30 struct _Emotion_Module_Options
31 {
32    const char *player;
33    Eina_Bool no_video : 1;
34    Eina_Bool no_audio : 1;
35 };
36
37 struct _Eina_Emotion_Plugins
38 {
39    Emotion_Module_Open open;
40    Emotion_Module_Close close;
41 };
42
43 struct _Emotion_Video_Module
44 {
45    unsigned char  (*init) (Evas_Object *obj, void **video, Emotion_Module_Options *opt);
46    int            (*shutdown) (void *video);
47    unsigned char  (*file_open) (const char *file, Evas_Object *obj, void *video);
48    void           (*file_close) (void *ef);
49    void           (*play) (void *ef, double pos);
50    void           (*stop) (void *ef);
51    void           (*size_get) (void *ef, int *w, int *h);
52    void           (*pos_set) (void *ef, double pos);
53    double         (*len_get) (void *ef);
54    double         (*buffer_size_get) (void *ef);
55    int            (*fps_num_get) (void *ef);
56    int            (*fps_den_get) (void *ef);
57    double         (*fps_get) (void *ef);
58    double         (*pos_get) (void *ef);
59    void           (*vis_set) (void *ef, Emotion_Vis vis);
60    Emotion_Vis    (*vis_get) (void *ef);
61    Eina_Bool      (*vis_supported) (void *ef, Emotion_Vis vis);
62    double         (*ratio_get) (void *ef);
63    int            (*video_handled) (void *ef);
64    int            (*audio_handled) (void *ef);
65    int            (*seekable) (void *ef);
66    void           (*frame_done) (void *ef);
67    Emotion_Format (*format_get) (void *ef);
68    void           (*video_data_size_get) (void *ef, int *w, int *h);
69    int            (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
70    int            (*bgra_data_get) (void *ef, unsigned char **bgra_data);
71    void           (*event_feed) (void *ef, int event);
72    void           (*event_mouse_button_feed) (void *ef, int button, int x, int y);
73    void           (*event_mouse_move_feed) (void *ef, int x, int y);
74    int            (*video_channel_count) (void *ef);
75    void           (*video_channel_set) (void *ef, int channel);
76    int            (*video_channel_get) (void *ef);
77    const char *   (*video_channel_name_get) (void *ef, int channel);
78    void           (*video_channel_mute_set) (void *ef, int mute);
79    int            (*video_channel_mute_get) (void *ef);
80    int            (*audio_channel_count) (void *ef);
81    void           (*audio_channel_set) (void *ef, int channel);
82    int            (*audio_channel_get) (void *ef);
83    const char *   (*audio_channel_name_get) (void *ef, int channel);
84    void           (*audio_channel_mute_set) (void *ef, int mute);
85    int            (*audio_channel_mute_get) (void *ef);
86    void           (*audio_channel_volume_set) (void *ef, double vol);
87    double         (*audio_channel_volume_get) (void *ef);
88    int            (*spu_channel_count) (void *ef);
89    void           (*spu_channel_set) (void *ef, int channel);
90    int            (*spu_channel_get) (void *ef);
91    const char *   (*spu_channel_name_get) (void *ef, int channel);
92    void           (*spu_channel_mute_set) (void *ef, int mute);
93    int            (*spu_channel_mute_get) (void *ef);
94    int            (*chapter_count) (void *ef);
95    void           (*chapter_set) (void *ef, int chapter);
96    int            (*chapter_get) (void *ef);
97    const char *   (*chapter_name_get) (void *ef, int chapter);
98    void           (*speed_set) (void *ef, double speed);
99    double         (*speed_get) (void *ef);
100    int            (*eject) (void *ef);
101    const char *   (*meta_get) (void *ef, int meta);
102    void           (*priority_set) (void *ef, Eina_Bool priority);
103    Eina_Bool      (*priority_get) (void *ef);
104
105    Eina_Emotion_Plugins *plugin;
106 };
107
108 EAPI void *_emotion_video_get(const Evas_Object *obj);
109 EAPI void  _emotion_frame_new(Evas_Object *obj);
110 EAPI void  _emotion_video_pos_update(Evas_Object *obj, double pos, double len);
111 EAPI void  _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio);
112 EAPI void  _emotion_frame_refill(Evas_Object *obj, double w, double h);
113 EAPI void  _emotion_decode_stop(Evas_Object *obj);
114 EAPI void  _emotion_open_done(Evas_Object *obj);
115 EAPI void  _emotion_playback_started(Evas_Object *obj);
116 EAPI void  _emotion_playback_finished(Evas_Object *obj);
117 EAPI void  _emotion_audio_level_change(Evas_Object *obj);
118 EAPI void  _emotion_channels_change(Evas_Object *obj);
119 EAPI void  _emotion_title_set(Evas_Object *obj, char *title);
120 EAPI void  _emotion_progress_set(Evas_Object *obj, char *info, double stat);
121 EAPI void  _emotion_file_ref_set(Evas_Object *obj, const char *file, int num);
122 EAPI void  _emotion_spu_button_num_set(Evas_Object *obj, int num);
123 EAPI void  _emotion_spu_button_set(Evas_Object *obj, int button);
124 EAPI void  _emotion_seek_done(Evas_Object *obj);
125 EAPI void  _emotion_image_reset(Evas_Object *obj);
126
127 EAPI Eina_Bool _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close);
128 EAPI Eina_Bool _emotion_module_unregister(const char *name);
129
130 EAPI const char *emotion_webcam_custom_get(const char *device);
131
132 EAPI void _emotion_pending_object_ref(void);
133 EAPI void _emotion_pending_object_unref(void);
134
135 #endif