summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authormoom16 <moom16>2005-04-24 14:42:50 +0000
committermoom16 <moom16@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2005-04-24 14:42:50 +0000
commit36a904a439e93dbf8428e03a59cbbc34f6b24852 (patch)
treeb34f2f4fc034599ff3d9ca65e4cf27e40df9f514 /legacy/emotion
parent93f67dbe89701dae2e436bacda6ff20709549dd0 (diff)
* add two functions to know if audio and video are handled (emotion_object_audio_handled_get and emotion_object_video_handled_get)
* add a smart callback "audio_level_change" to deal with audio level change * alsa is now used by default since many people report troubles with oss SVN revision: 14320
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/src/lib/Emotion.h2
-rw-r--r--legacy/emotion/src/lib/emotion_private.h3
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c27
-rw-r--r--legacy/emotion/src/modules/emotion_xine.c27
4 files changed, 57 insertions, 2 deletions
diff --git a/legacy/emotion/src/lib/Emotion.h b/legacy/emotion/src/lib/Emotion.h
index e7fe3c391f..01a578f753 100644
--- a/legacy/emotion/src/lib/Emotion.h
+++ b/legacy/emotion/src/lib/Emotion.h
@@ -61,6 +61,8 @@ void emotion_object_play_set (Evas_Object *obj, Evas_Bool p
61Evas_Bool emotion_object_play_get (Evas_Object *obj); 61Evas_Bool emotion_object_play_get (Evas_Object *obj);
62void emotion_object_position_set (Evas_Object *obj, double sec); 62void emotion_object_position_set (Evas_Object *obj, double sec);
63double emotion_object_position_get (Evas_Object *obj); 63double emotion_object_position_get (Evas_Object *obj);
64Evas_Bool emotion_object_video_handled_get (Evas_Object *obj);
65Evas_Bool emotion_object_audio_handled_get (Evas_Object *obj);
64Evas_Bool emotion_object_seekable_get (Evas_Object *obj); 66Evas_Bool emotion_object_seekable_get (Evas_Object *obj);
65double emotion_object_play_length_get (Evas_Object *obj); 67double emotion_object_play_length_get (Evas_Object *obj);
66void emotion_object_size_get (Evas_Object *obj, int *iw, int *ih); 68void emotion_object_size_get (Evas_Object *obj, int *iw, int *ih);
diff --git a/legacy/emotion/src/lib/emotion_private.h b/legacy/emotion/src/lib/emotion_private.h
index ea745f05a1..15eab8e56d 100644
--- a/legacy/emotion/src/lib/emotion_private.h
+++ b/legacy/emotion/src/lib/emotion_private.h
@@ -31,6 +31,8 @@ struct _Emotion_Video_Module
31 double (*fps_get) (void *ef); 31 double (*fps_get) (void *ef);
32 double (*pos_get) (void *ef); 32 double (*pos_get) (void *ef);
33 double (*ratio_get) (void *ef); 33 double (*ratio_get) (void *ef);
34 int (*video_handled) (void *ef);
35 int (*audio_handled) (void *ef);
34 int (*seekable) (void *ef); 36 int (*seekable) (void *ef);
35 void (*frame_done) (void *ef); 37 void (*frame_done) (void *ef);
36 void (*yuv_size_get) (void *ef, int *w, int *h); 38 void (*yuv_size_get) (void *ef, int *w, int *h);
@@ -76,6 +78,7 @@ void _emotion_video_pos_update(Evas_Object *obj, double pos, double len);
76void _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio); 78void _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio);
77void _emotion_decode_stop(Evas_Object *obj); 79void _emotion_decode_stop(Evas_Object *obj);
78void _emotion_playback_finished(Evas_Object *obj); 80void _emotion_playback_finished(Evas_Object *obj);
81void _emotion_audio_level_change(Evas_Object *obj);
79void _emotion_channels_change(Evas_Object *obj); 82void _emotion_channels_change(Evas_Object *obj);
80void _emotion_title_set(Evas_Object *obj, char *title); 83void _emotion_title_set(Evas_Object *obj, char *title);
81void _emotion_progress_set(Evas_Object *obj, char *info, double stat); 84void _emotion_progress_set(Evas_Object *obj, char *info, double stat);
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 12df051a16..64be4bc0df 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -265,6 +265,28 @@ emotion_object_seekable_get(Evas_Object *obj)
265 return sd->module->seekable(sd->video); 265 return sd->module->seekable(sd->video);
266} 266}
267 267
268Evas_Bool
269emotion_object_video_handled_get(Evas_Object *obj)
270{
271 Smart_Data *sd;
272
273 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
274 if (!sd->module) return 0;
275 if (!sd->video) return 0;
276 return sd->module->video_handled(sd->video);
277}
278
279Evas_Bool
280emotion_object_audio_handled_get(Evas_Object *obj)
281{
282 Smart_Data *sd;
283
284 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
285 if (!sd->module) return 0;
286 if (!sd->video) return 0;
287 return sd->module->audio_handled(sd->video);
288}
289
268double 290double
269emotion_object_play_length_get(Evas_Object *obj) 291emotion_object_play_length_get(Evas_Object *obj)
270{ 292{
@@ -810,6 +832,11 @@ _emotion_playback_finished(Evas_Object *obj)
810 evas_object_smart_callback_call(obj, "playback_finished", NULL); 832 evas_object_smart_callback_call(obj, "playback_finished", NULL);
811} 833}
812 834
835void _emotion_audio_level_change(Evas_Object *obj)
836{
837 evas_object_smart_callback_call(obj, "audio_level_change", NULL);
838}
839
813void 840void
814_emotion_channels_change(Evas_Object *obj) 841_emotion_channels_change(Evas_Object *obj)
815{ 842{
diff --git a/legacy/emotion/src/modules/emotion_xine.c b/legacy/emotion/src/modules/emotion_xine.c
index d7927f3a41..fe0961b895 100644
--- a/legacy/emotion/src/modules/emotion_xine.c
+++ b/legacy/emotion/src/modules/emotion_xine.c
@@ -227,8 +227,8 @@ em_init(Evas_Object *obj, void **emotion_video)
227 ev->fd = ev->fd_write; 227 ev->fd = ev->fd_write;
228 228
229 ev->video = xine_open_video_driver(ev->decoder, "emotion", XINE_VISUAL_TYPE_NONE, ev); 229 ev->video = xine_open_video_driver(ev->decoder, "emotion", XINE_VISUAL_TYPE_NONE, ev);
230 ev->audio = xine_open_audio_driver(ev->decoder, "oss", ev); 230// ev->audio = xine_open_audio_driver(ev->decoder, "oss", ev);
231// ev->audio = xine_open_audio_driver(ev->decoder, "alsa", ev); 231 ev->audio = xine_open_audio_driver(ev->decoder, "alsa", ev);
232// ev->audio = xine_open_audio_driver(ev->decoder, "arts", ev); 232// ev->audio = xine_open_audio_driver(ev->decoder, "arts", ev);
233// ev->audio = xine_open_audio_driver(ev->decoder, "esd", ev); 233// ev->audio = xine_open_audio_driver(ev->decoder, "esd", ev);
234 ev->stream = xine_stream_new(ev->decoder, ev->audio, ev->video); 234 ev->stream = xine_stream_new(ev->decoder, ev->audio, ev->video);
@@ -497,6 +497,26 @@ em_ratio_get(void *ef)
497} 497}
498 498
499static int 499static int
500em_video_handled(void *ef)
501{
502 Emotion_Xine_Video *ev;
503
504 ev = (Emotion_Xine_Video *)ef;
505 return (xine_get_stream_info(ev->stream, XINE_STREAM_INFO_HAS_VIDEO) &&
506 xine_get_stream_info(ev->stream, XINE_STREAM_INFO_VIDEO_HANDLED));
507}
508
509static int
510em_audio_handled(void *ef)
511{
512 Emotion_Xine_Video *ev;
513
514 ev = (Emotion_Xine_Video *)ef;
515 return (xine_get_stream_info(ev->stream, XINE_STREAM_INFO_HAS_AUDIO) &&
516 xine_get_stream_info(ev->stream, XINE_STREAM_INFO_AUDIO_HANDLED));
517}
518
519static int
500em_seekable(void *ef) 520em_seekable(void *ef)
501{ 521{
502 Emotion_Xine_Video *ev; 522 Emotion_Xine_Video *ev;
@@ -1167,6 +1187,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1167 xine_audio_level_data_t *e; 1187 xine_audio_level_data_t *e;
1168 1188
1169 e = (xine_audio_level_data_t *)eev->xine_event; 1189 e = (xine_audio_level_data_t *)eev->xine_event;
1190 _emotion_audio_level_change(ev->obj);
1170 printf("EV: Audio Level [FIXME: break this out to emotion api]\n"); 1191 printf("EV: Audio Level [FIXME: break this out to emotion api]\n");
1171 // e->left (0->100) 1192 // e->left (0->100)
1172 // e->right 1193 // e->right
@@ -1309,6 +1330,8 @@ static Emotion_Video_Module em_module =
1309 em_fps_get, /* fps_get */ 1330 em_fps_get, /* fps_get */
1310 em_pos_get, /* pos_get */ 1331 em_pos_get, /* pos_get */
1311 em_ratio_get, /* ratio_get */ 1332 em_ratio_get, /* ratio_get */
1333 em_video_handled, /* video_handled */
1334 em_audio_handled, /* audio_handled */
1312 em_seekable, /* seekable */ 1335 em_seekable, /* seekable */
1313 em_frame_done, /* frame_done */ 1336 em_frame_done, /* frame_done */
1314 em_yuv_size_get, /* yuv_size_get */ 1337 em_yuv_size_get, /* yuv_size_get */