summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c4
-rw-r--r--legacy/emotion/src/modules/emotion_xine.c139
-rw-r--r--legacy/emotion/src/modules/emotion_xine.h1
3 files changed, 69 insertions, 75 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 89ca196fb0..f8d7552f2d 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -168,9 +168,10 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
168 int w, h; 168 int w, h;
169 169
170 sd->file = strdup(file); 170 sd->file = strdup(file);
171 if (sd->video) 171 if ((sd->video) && (sd->module))
172 { 172 {
173 sd->module->file_close(sd->video); 173 sd->module->file_close(sd->video);
174 sd->video = NULL;
174 evas_object_image_size_set(sd->obj, 0, 0); 175 evas_object_image_size_set(sd->obj, 0, 0);
175 } 176 }
176 if (sd->module) _emotion_module_close(sd->module); 177 if (sd->module) _emotion_module_close(sd->module);
@@ -191,6 +192,7 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
191 if (sd->video) 192 if (sd->video)
192 { 193 {
193 sd->module->file_close(sd->video); 194 sd->module->file_close(sd->video);
195 sd->video = NULL;
194 evas_object_image_size_set(sd->obj, 0, 0); 196 evas_object_image_size_set(sd->obj, 0, 0);
195 } 197 }
196 if (sd->module) _emotion_module_close(sd->module); 198 if (sd->module) _emotion_module_close(sd->module);
diff --git a/legacy/emotion/src/modules/emotion_xine.c b/legacy/emotion/src/modules/emotion_xine.c
index 395b673da6..29df39c511 100644
--- a/legacy/emotion/src/modules/emotion_xine.c
+++ b/legacy/emotion/src/modules/emotion_xine.c
@@ -3,7 +3,6 @@
3#include "emotion_xine.h" 3#include "emotion_xine.h"
4 4
5static int init_count = 0; 5static int init_count = 0;
6static xine_t *decoder = NULL;
7 6
8static int em_init(void); 7static int em_init(void);
9static int em_shutdown(void); 8static int em_shutdown(void);
@@ -66,22 +65,6 @@ em_init(void)
66{ 65{
67 init_count++; 66 init_count++;
68 if (init_count > 1) return init_count; 67 if (init_count > 1) return init_count;
69 decoder = xine_new();
70 if (decoder)
71 {
72 /* load config... */
73 if (0)
74 {
75 xine_cfg_entry_t entry;
76
77 if (xine_config_lookup_entry(decoder, "video.num_buffers", &entry))
78 {
79 entry.num_value = 1;
80 xine_config_update_entry(decoder, &entry);
81 }
82 }
83 xine_init(decoder);
84 }
85 return init_count; 68 return init_count;
86} 69}
87 70
@@ -90,11 +73,6 @@ em_shutdown(void)
90{ 73{
91 init_count--; 74 init_count--;
92 if (init_count > 0) return init_count; 75 if (init_count > 0) return init_count;
93 if (decoder)
94 {
95 xine_exit(decoder);
96 decoder = NULL;
97 }
98 return 0; 76 return 0;
99} 77}
100 78
@@ -111,13 +89,20 @@ em_file_open(const char *file, Evas_Object *obj)
111 if (!ev) return NULL; 89 if (!ev) return NULL;
112 ev->obj = obj; 90 ev->obj = obj;
113 91
92 ev->decoder = xine_new();
93 if (!ev->decoder)
94 {
95 free(ev);
96 return NULL;
97 }
98 xine_init(ev->decoder);
114 if (1) 99 if (1)
115 { 100 {
116 xine_cfg_entry_t cf; 101 xine_cfg_entry_t cf;
117 if (xine_config_lookup_entry(decoder, "input.dvd_use_readahead", &cf)) 102 if (xine_config_lookup_entry(ev->decoder, "input.dvd_use_readahead", &cf))
118 { 103 {
119 cf.num_value = 1; // 0 or 1 104 cf.num_value = 1; // 0 or 1
120 xine_config_update_entry(decoder, &cf); 105 xine_config_update_entry(ev->decoder, &cf);
121 } 106 }
122 } 107 }
123 /* some notes on parameters we could swizzle for certain inputs */ 108 /* some notes on parameters we could swizzle for certain inputs */
@@ -125,77 +110,82 @@ em_file_open(const char *file, Evas_Object *obj)
125 { 110 {
126 xine_cfg_entry_t cf; 111 xine_cfg_entry_t cf;
127 112
128 if (xine_config_lookup_entry(decoder, "input.dvd_device", &cf)) 113 if (xine_config_lookup_entry(ev->decoder, "video.num_buffers", &cf))
114 {
115 cf.num_value = 1;
116 xine_config_update_entry(ev->decoder, &cf);
117 }
118 if (xine_config_lookup_entry(ev->decoder, "input.dvd_device", &cf))
129 { 119 {
130 cf.str_value = "/dev/dvd"; 120 cf.str_value = "/dev/dvd";
131 xine_config_update_entry(decoder, &cf); 121 xine_config_update_entry(ev->decoder, &cf);
132 } 122 }
133 if (xine_config_lookup_entry(decoder, "input.css_decryption_method", &cf)) 123 if (xine_config_lookup_entry(ev->decoder, "input.css_decryption_method", &cf))
134 { 124 {
135 cf.str_value = "key"; // "key" "disk" "title" 125 cf.str_value = "key"; // "key" "disk" "title"
136 xine_config_update_entry(decoder, &cf); 126 xine_config_update_entry(ev->decoder, &cf);
137 } 127 }
138 if (xine_config_lookup_entry(decoder, "input.dvd_region", &cf)) 128 if (xine_config_lookup_entry(ev->decoder, "input.dvd_region", &cf))
139 { 129 {
140 cf.num_value = 0; // 0 ... 1 - 8 130 cf.num_value = 0; // 0 ... 1 - 8
141 xine_config_update_entry(decoder, &cf); 131 xine_config_update_entry(ev->decoder, &cf);
142 } 132 }
143 if (xine_config_lookup_entry(decoder, "input.dvd_use_readahead", &cf)) 133 if (xine_config_lookup_entry(ev->decoder, "input.dvd_use_readahead", &cf))
144 { 134 {
145 cf.num_value = 1; // 0 or 1 135 cf.num_value = 1; // 0 or 1
146 xine_config_update_entry(decoder, &cf); 136 xine_config_update_entry(ev->decoder, &cf);
147 } 137 }
148 // these are used any time in runtime - so changing affects all dvd's 138 // these are used any time in runtime - so changing affects all dvd's
149 if (xine_config_lookup_entry(decoder, "input.dvd_skip_behaviour", &cf)) 139 if (xine_config_lookup_entry(ev->decoder, "input.dvd_skip_behaviour", &cf))
150 { 140 {
151 cf.str_value = "skip program"; // "skip program" "skip part" "skip title" 141 cf.str_value = "skip program"; // "skip program" "skip part" "skip title"
152 xine_config_update_entry(decoder, &cf); 142 xine_config_update_entry(ev->decoder, &cf);
153 } 143 }
154 // these are used any time in runtime - so changing affects all dvd's 144 // these are used any time in runtime - so changing affects all dvd's
155 if (xine_config_lookup_entry(decoder, "input.dvd_seek_behaviour", &cf)) 145 if (xine_config_lookup_entry(ev->decoder, "input.dvd_seek_behaviour", &cf))
156 { 146 {
157 cf.str_value = "seek in program chain"; // "seek in program chain" "seek in program" 147 cf.str_value = "seek in program chain"; // "seek in program chain" "seek in program"
158 xine_config_update_entry(decoder, &cf); 148 xine_config_update_entry(ev->decoder, &cf);
159 } 149 }
160 if (xine_config_lookup_entry(decoder, "input.v4l_video_device_path", &cf)) 150 if (xine_config_lookup_entry(ev->decoder, "input.v4l_video_device_path", &cf))
161 { 151 {
162 cf.str_value = "/dev/video0"; 152 cf.str_value = "/dev/video0";
163 xine_config_update_entry(decoder, &cf); 153 xine_config_update_entry(ev->decoder, &cf);
164 } 154 }
165 if (xine_config_lookup_entry(decoder, "input.cdda_use_cddb", &cf)) 155 if (xine_config_lookup_entry(ev->decoder, "input.cdda_use_cddb", &cf))
166 { 156 {
167 cf.num_value = 0; // 0 or 1 157 cf.num_value = 0; // 0 or 1
168 xine_config_update_entry(decoder, &cf); 158 xine_config_update_entry(ev->decoder, &cf);
169 } 159 }
170 if (xine_config_lookup_entry(decoder, "input.cdda_device", &cf)) 160 if (xine_config_lookup_entry(ev->decoder, "input.cdda_device", &cf))
171 { 161 {
172 cf.str_value = "/dev/cdrom"; 162 cf.str_value = "/dev/cdrom";
173 xine_config_update_entry(decoder, &cf); 163 xine_config_update_entry(ev->decoder, &cf);
174 } 164 }
175 if (xine_config_lookup_entry(decoder, "audio.oss_device_name", &cf)) 165 if (xine_config_lookup_entry(ev->decoder, "audio.oss_device_name", &cf))
176 { 166 {
177 cf.str_value = "/dev/dsp"; 167 cf.str_value = "/dev/dsp";
178 xine_config_update_entry(decoder, &cf); 168 xine_config_update_entry(ev->decoder, &cf);
179 } 169 }
180 if (xine_config_lookup_entry(decoder, "audio.oss_device_number", &cf)) 170 if (xine_config_lookup_entry(ev->decoder, "audio.oss_device_number", &cf))
181 { 171 {
182 cf.num_value = -1; // -1 or 0 1 2 ... 172 cf.num_value = -1; // -1 or 0 1 2 ...
183 xine_config_update_entry(decoder, &cf); 173 xine_config_update_entry(ev->decoder, &cf);
184 } 174 }
185 if (xine_config_lookup_entry(decoder, "audio.alsa_mmap_enable", &cf)) 175 if (xine_config_lookup_entry(ev->decoder, "audio.alsa_mmap_enable", &cf))
186 { 176 {
187 cf.num_value = 1; // 0 or 1 177 cf.num_value = 1; // 0 or 1
188 xine_config_update_entry(decoder, &cf); 178 xine_config_update_entry(ev->decoder, &cf);
189 } 179 }
190 if (xine_config_lookup_entry(decoder, "codec.a52_surround_downmix", &cf)) 180 if (xine_config_lookup_entry(ev->decoder, "codec.a52_surround_downmix", &cf))
191 { 181 {
192 cf.num_value = 1; // 0 or 1 182 cf.num_value = 1; // 0 or 1
193 xine_config_update_entry(decoder, &cf); 183 xine_config_update_entry(ev->decoder, &cf);
194 } 184 }
195 if (xine_config_lookup_entry(decoder, "vcd.default_device", &cf)) 185 if (xine_config_lookup_entry(ev->decoder, "vcd.default_device", &cf))
196 { 186 {
197 cf.str_value = "/dev/cdrom"; 187 cf.str_value = "/dev/cdrom";
198 xine_config_update_entry(decoder, &cf); 188 xine_config_update_entry(ev->decoder, &cf);
199 } 189 }
200 } 190 }
201 if (0) 191 if (0)
@@ -203,7 +193,7 @@ em_file_open(const char *file, Evas_Object *obj)
203 xine_mrl_t **mrls; 193 xine_mrl_t **mrls;
204 int mrls_num; 194 int mrls_num;
205 195
206 mrls = xine_get_browse_mrls(decoder, "dvd", "dvd://", &mrls_num); 196 mrls = xine_get_browse_mrls(ev->decoder, "dvd", "dvd://", &mrls_num);
207 printf("mrls = %p\n", mrls); 197 printf("mrls = %p\n", mrls);
208 if (mrls) 198 if (mrls)
209 { 199 {
@@ -222,7 +212,7 @@ em_file_open(const char *file, Evas_Object *obj)
222 char **auto_play_mrls; 212 char **auto_play_mrls;
223 int auto_play_num; 213 int auto_play_num;
224 214
225 auto_play_mrls = xine_get_autoplay_mrls(decoder, "dvd", &auto_play_num); 215 auto_play_mrls = xine_get_autoplay_mrls(ev->decoder, "dvd", &auto_play_num);
226 printf("auto_play_mrls = %p\n", auto_play_mrls); 216 printf("auto_play_mrls = %p\n", auto_play_mrls);
227 if (auto_play_mrls) 217 if (auto_play_mrls)
228 { 218 {
@@ -268,12 +258,12 @@ em_file_open(const char *file, Evas_Object *obj)
268 } 258 }
269 ev->fd = ev->fd_write; 259 ev->fd = ev->fd_write;
270 260
271 ev->video = xine_open_video_driver(decoder, "emotion", XINE_VISUAL_TYPE_NONE, ev); 261 ev->video = xine_open_video_driver(ev->decoder, "emotion", XINE_VISUAL_TYPE_NONE, ev);
272 ev->audio = xine_open_audio_driver(decoder, "oss", ev); 262 ev->audio = xine_open_audio_driver(ev->decoder, "oss", ev);
273// ev->audio = xine_open_audio_driver(decoder, "alsa", ev); 263// ev->audio = xine_open_audio_driver(ev->decoder, "alsa", ev);
274// ev->audio = xine_open_audio_driver(decoder, "arts", ev); 264// ev->audio = xine_open_audio_driver(ev->decoder, "arts", ev);
275// ev->audio = xine_open_audio_driver(decoder, "esd", ev); 265// ev->audio = xine_open_audio_driver(ev->decoder, "esd", ev);
276 ev->stream = xine_stream_new(decoder, ev->audio, ev->video); 266 ev->stream = xine_stream_new(ev->decoder, ev->audio, ev->video);
277 ev->queue = xine_event_new_queue(ev->stream); 267 ev->queue = xine_event_new_queue(ev->stream);
278 xine_event_create_listener_thread(ev->queue, _em_event, ev); 268 xine_event_create_listener_thread(ev->queue, _em_event, ev);
279 if (!xine_open(ev->stream, file)) 269 if (!xine_open(ev->stream, file))
@@ -285,8 +275,8 @@ em_file_open(const char *file, Evas_Object *obj)
285 close(ev->fd_ev_write); 275 close(ev->fd_ev_write);
286 close(ev->fd_ev_read); 276 close(ev->fd_ev_read);
287 xine_dispose(ev->stream); 277 xine_dispose(ev->stream);
288 if (ev->video) xine_close_video_driver(decoder, ev->video); 278 if (ev->video) xine_close_video_driver(ev->decoder, ev->video);
289 if (ev->audio) xine_close_audio_driver(decoder, ev->audio); 279 if (ev->audio) xine_close_audio_driver(ev->decoder, ev->audio);
290 xine_event_dispose_queue(ev->queue); 280 xine_event_dispose_queue(ev->queue);
291 free(ev); 281 free(ev);
292 return NULL; 282 return NULL;
@@ -369,9 +359,9 @@ em_file_close(void *ef)
369 printf("EX dispose evq\n"); 359 printf("EX dispose evq\n");
370 xine_event_dispose_queue(ev->queue); 360 xine_event_dispose_queue(ev->queue);
371 printf("EX close video drv\n"); 361 printf("EX close video drv\n");
372 if (ev->video) xine_close_video_driver(decoder, ev->video); 362 if (ev->video) xine_close_video_driver(ev->decoder, ev->video);
373 printf("EX close audio drv\n"); 363 printf("EX close audio drv\n");
374 if (ev->audio) xine_close_audio_driver(decoder, ev->audio); 364 if (ev->audio) xine_close_audio_driver(ev->decoder, ev->audio);
375 printf("EX del timer\n"); 365 printf("EX del timer\n");
376 if (ev->timer) ecore_timer_del(ev->timer); 366 if (ev->timer) ecore_timer_del(ev->timer);
377 printf("EX del fds\n"); 367 printf("EX del fds\n");
@@ -381,6 +371,7 @@ em_file_close(void *ef)
381 ecore_main_fd_handler_del(ev->fd_ev_handler); 371 ecore_main_fd_handler_del(ev->fd_ev_handler);
382 close(ev->fd_ev_write); 372 close(ev->fd_ev_write);
383 close(ev->fd_ev_read); 373 close(ev->fd_ev_read);
374 xine_exit(ev->decoder);
384 free(ev); 375 free(ev);
385} 376}
386 377
@@ -1132,7 +1123,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1132 { 1123 {
1133 xine_ui_data_t *e; 1124 xine_ui_data_t *e;
1134 1125
1135 e = eev->xine_event; 1126 e = (xine_ui_data_t *)eev->xine_event;
1136 _emotion_title_set(ev->obj, e->str); 1127 _emotion_title_set(ev->obj, e->str);
1137 } 1128 }
1138 break; 1129 break;
@@ -1140,14 +1131,14 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1140 { 1131 {
1141 xine_format_change_data_t *e; 1132 xine_format_change_data_t *e;
1142 1133
1143 e = eev->xine_event; 1134 e = (xine_format_change_data_t *)eev->xine_event;
1144 } 1135 }
1145 break; 1136 break;
1146 case XINE_EVENT_UI_MESSAGE: 1137 case XINE_EVENT_UI_MESSAGE:
1147 { 1138 {
1148 xine_ui_message_data_t *e; 1139 xine_ui_message_data_t *e;
1149 1140
1150 e = eev->xine_event; 1141 e = (xine_ui_message_data_t *)eev->xine_event;
1151 printf("EV: UI Message [FIXME: break this out to emotion api]\n"); 1142 printf("EV: UI Message [FIXME: break this out to emotion api]\n");
1152 // e->type = error type(XINE_MSG_NO_ERROR, XINE_MSG_GENERAL_WARNING, XINE_MSG_UNKNOWN_HOST etc.) 1143 // e->type = error type(XINE_MSG_NO_ERROR, XINE_MSG_GENERAL_WARNING, XINE_MSG_UNKNOWN_HOST etc.)
1153 // e->messages is a list of messages DOUBLE null terminated 1144 // e->messages is a list of messages DOUBLE null terminated
@@ -1157,7 +1148,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1157 { 1148 {
1158 xine_audio_level_data_t *e; 1149 xine_audio_level_data_t *e;
1159 1150
1160 e = eev->xine_event; 1151 e = (xine_audio_level_data_t *)eev->xine_event;
1161 printf("EV: Audio Level [FIXME: break this out to emotion api]\n"); 1152 printf("EV: Audio Level [FIXME: break this out to emotion api]\n");
1162 // e->left (0->100) 1153 // e->left (0->100)
1163 // e->right 1154 // e->right
@@ -1168,15 +1159,15 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1168 { 1159 {
1169 xine_progress_data_t *e; 1160 xine_progress_data_t *e;
1170 1161
1171 e = eev->xine_event; 1162 e = (xine_progress_data_t *)eev->xine_event;
1172 _emotion_progress_set(ev->obj, e->description, (double)e->percent / 100.0); 1163 _emotion_progress_set(ev->obj, (char *)e->description, (double)e->percent / 100.0);
1173 } 1164 }
1174 break; 1165 break;
1175 case XINE_EVENT_MRL_REFERENCE: 1166 case XINE_EVENT_MRL_REFERENCE:
1176 { 1167 {
1177 xine_mrl_reference_data_t *e; 1168 xine_mrl_reference_data_t *e;
1178 1169
1179 e = eev->xine_event; 1170 e = (xine_mrl_reference_data_t *)eev->xine_event;
1180 _emotion_file_ref_set(ev->obj, e->mrl, e->alternative); 1171 _emotion_file_ref_set(ev->obj, e->mrl, e->alternative);
1181 } 1172 }
1182 break; 1173 break;
@@ -1184,7 +1175,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1184 { 1175 {
1185 xine_ui_data_t *e; 1176 xine_ui_data_t *e;
1186 1177
1187 e = eev->xine_event; 1178 e = (xine_ui_data_t *)eev->xine_event;
1188 _emotion_spu_button_num_set(ev->obj, e->num_buttons); 1179 _emotion_spu_button_num_set(ev->obj, e->num_buttons);
1189 } 1180 }
1190 break; 1181 break;
@@ -1192,7 +1183,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1192 { 1183 {
1193 xine_spu_button_t *e; 1184 xine_spu_button_t *e;
1194 1185
1195 e = eev->xine_event; 1186 e = (xine_spu_button_t *)eev->xine_event;
1196 if (e->direction == 1) 1187 if (e->direction == 1)
1197 _emotion_spu_button_set(ev->obj, e->button); 1188 _emotion_spu_button_set(ev->obj, e->button);
1198 else 1189 else
@@ -1203,7 +1194,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1203 { 1194 {
1204 xine_dropped_frames_t *e; 1195 xine_dropped_frames_t *e;
1205 1196
1206 e = eev->xine_event; 1197 e = (xine_dropped_frames_t *)eev->xine_event;
1207 printf("EV: Dropped Frames (skipped %i) (discarded %i) [FIXME: break this out to the emotion api]\n", e->skipped_frames, e->discarded_frames); 1198 printf("EV: Dropped Frames (skipped %i) (discarded %i) [FIXME: break this out to the emotion api]\n", e->skipped_frames, e->discarded_frames);
1208 // e->skipped_frames = % frames skipped * 10 1199 // e->skipped_frames = % frames skipped * 10
1209 // e->discarded_frames = % frames skipped * 10 1200 // e->discarded_frames = % frames skipped * 10
diff --git a/legacy/emotion/src/modules/emotion_xine.h b/legacy/emotion/src/modules/emotion_xine.h
index fe3bee5717..60a7dc4aae 100644
--- a/legacy/emotion/src/modules/emotion_xine.h
+++ b/legacy/emotion/src/modules/emotion_xine.h
@@ -12,6 +12,7 @@ typedef struct _Emotion_Xine_Event Emotion_Xine_Event;
12 12
13struct _Emotion_Xine_Video 13struct _Emotion_Xine_Video
14{ 14{
15 xine_t *decoder;
15 xine_video_port_t *video; 16 xine_video_port_t *video;
16 xine_audio_port_t *audio; 17 xine_audio_port_t *audio;
17 xine_stream_t *stream; 18 xine_stream_t *stream;