summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c3
-rw-r--r--legacy/emotion/src/modules/emotion_xine.c58
-rw-r--r--legacy/emotion/src/modules/emotion_xine.h3
-rw-r--r--legacy/emotion/src/modules/emotion_xine_vo_out.c6
4 files changed, 38 insertions, 32 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 539b7d2b5b..e071df7a1d 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -1038,7 +1038,10 @@ _pixels_get(void *data, Evas_Object *obj)
1038 } 1038 }
1039 } 1039 }
1040 } 1040 }
1041// no need for this because on any new frame decode info from the decoder
1042// module, the previous "current frame" is released (done) for us anyway
1041// sd->module->frame_done(sd->video); 1043// sd->module->frame_done(sd->video);
1044
1042/* 1045/*
1043 evas_object_image_size_get(obj, &iw, &ih); 1046 evas_object_image_size_get(obj, &iw, &ih);
1044 sd->module->video_data_size_get(sd->video, &w, &h); 1047 sd->module->video_data_size_get(sd->video, &w, &h);
diff --git a/legacy/emotion/src/modules/emotion_xine.c b/legacy/emotion/src/modules/emotion_xine.c
index c5328a6944..e9cb98fe60 100644
--- a/legacy/emotion/src/modules/emotion_xine.c
+++ b/legacy/emotion/src/modules/emotion_xine.c
@@ -276,7 +276,7 @@ em_shutdown(void *video)
276// pthread_mutex_lock(&(ev->seek_mutex)); 276// pthread_mutex_lock(&(ev->seek_mutex));
277 if (!ev->seek_thread_deleted) 277 if (!ev->seek_thread_deleted)
278 { 278 {
279 printf("closing seek thread\n"); 279 printf("closing seek thread %p\n", ev);
280 pthread_cond_broadcast(&(ev->seek_cond)); 280 pthread_cond_broadcast(&(ev->seek_cond));
281 while (ev->seek_to); 281 while (ev->seek_to);
282 } 282 }
@@ -284,20 +284,20 @@ em_shutdown(void *video)
284// pthread_mutex_lock(&(ev->get_pos_len_mutex)); 284// pthread_mutex_lock(&(ev->get_pos_len_mutex));
285 if (!ev->get_pos_thread_deleted) 285 if (!ev->get_pos_thread_deleted)
286 { 286 {
287 printf("closing get_pos thread\n"); 287 printf("closing get_pos thread, %p\n", ev);
288 pthread_cond_broadcast(&(ev->get_pos_len_cond)); 288 pthread_cond_broadcast(&(ev->get_pos_len_cond));
289 while (ev->get_poslen); 289 while (ev->get_poslen);
290 } 290 }
291 291
292 printf("EX dispose\n"); 292 printf("EX dispose %p\n", ev);
293 xine_dispose(ev->stream); 293 xine_dispose(ev->stream);
294 printf("EX dispose evq\n"); 294 printf("EX dispose evq %p\n", ev);
295 xine_event_dispose_queue(ev->queue); 295 xine_event_dispose_queue(ev->queue);
296 printf("EX close video drv\n"); 296 printf("EX close video drv %p\n", ev);
297 if (ev->video) xine_close_video_driver(ev->decoder, ev->video); 297 if (ev->video) xine_close_video_driver(ev->decoder, ev->video);
298 printf("EX close audio drv\n"); 298 printf("EX close audio drv %p\n", ev);
299 if (ev->audio) xine_close_audio_driver(ev->decoder, ev->audio); 299 if (ev->audio) xine_close_audio_driver(ev->decoder, ev->audio);
300 printf("EX del fds\n"); 300 printf("EX del fds %p\n", ev);
301 ecore_main_fd_handler_del(ev->fd_handler); 301 ecore_main_fd_handler_del(ev->fd_handler);
302 close(ev->fd_write); 302 close(ev->fd_write);
303 close(ev->fd_read); 303 close(ev->fd_read);
@@ -365,18 +365,24 @@ em_file_close(void *ef)
365 365
366 ev = (Emotion_Xine_Video *)ef; 366 ev = (Emotion_Xine_Video *)ef;
367 if (!ev) return; 367 if (!ev) return;
368 printf("EX pause end...\n"); 368 printf("EX pause end... %p\n", ev);
369 if (!emotion_object_play_get(ev->obj)) 369 if (!emotion_object_play_get(ev->obj))
370// if (xine_get_param(ev->stream, XINE_PARAM_SPEED) == XINE_SPEED_PAUSE) 370// if (xine_get_param(ev->stream, XINE_PARAM_SPEED) == XINE_SPEED_PAUSE)
371 { 371 {
372 printf(" ... unpause\n"); 372 printf(" ... unpause %p\n", ev);
373 xine_set_param(ev->stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL); 373 xine_set_param(ev->stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL);
374 } 374 }
375 printf("EX stop\n"); 375// xine_set_param(ev->stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE);
376 printf("EX done %p\n", ev);
377 em_frame_done(ev);
378// printf("EX seek 0 %p\n", ev);
379// xine_play(ev->stream, 0, 0);
380 printf("EX: fq %i %p\n", ev->fq, ev);
381 printf("EX stop %p\n", ev);
376 xine_stop(ev->stream); 382 xine_stop(ev->stream);
377 printf("EX close\n"); 383 printf("EX close %p\n", ev);
378 xine_close(ev->stream); 384 xine_close(ev->stream);
379 printf("EX del timer\n"); 385 printf("EX del timer %p\n", ev);
380 if (ev->timer) 386 if (ev->timer)
381 { 387 {
382 ecore_timer_del(ev->timer); 388 ecore_timer_del(ev->timer);
@@ -591,13 +597,15 @@ em_frame_done(void *ef)
591 ev = (Emotion_Xine_Video *)ef; 597 ev = (Emotion_Xine_Video *)ef;
592 if (ev->cur_frame) 598 if (ev->cur_frame)
593 { 599 {
600 ev->fq--;
594 if (ev->cur_frame->done_func) 601 if (ev->cur_frame->done_func)
595 ev->cur_frame->done_func(ev->cur_frame->done_data); 602 ev->cur_frame->done_func(ev->cur_frame->done_data);
596 ev->cur_frame = NULL; 603 ev->cur_frame = NULL;
597 } 604 }
598} 605}
599 606
600static Emotion_Format em_format_get(void *ef) 607static Emotion_Format
608em_format_get(void *ef)
601{ 609{
602 Emotion_Xine_Video *ev; 610 Emotion_Xine_Video *ev;
603 Emotion_Xine_Video_Frame *fr; 611 Emotion_Xine_Video_Frame *fr;
@@ -605,8 +613,7 @@ static Emotion_Format em_format_get(void *ef)
605 ev = (Emotion_Xine_Video *)ef; 613 ev = (Emotion_Xine_Video *)ef;
606 fr = ev->cur_frame; 614 fr = ev->cur_frame;
607 615
608 if (fr) 616 if (fr) return fr->format;
609 return fr->format;
610 return EMOTION_FORMAT_YV12; 617 return EMOTION_FORMAT_YV12;
611} 618}
612 619
@@ -660,7 +667,7 @@ em_bgra_data_get(void *ef, unsigned char **bgra_data)
660 if (!fr) return 0; 667 if (!fr) return 0;
661 if (fr->bgra_data) 668 if (fr->bgra_data)
662 { 669 {
663 *bgra_data = fr->bgra_data; 670 *bgra_data = fr->bgra_data;
664 return 1; 671 return 1;
665 } 672 }
666 return 0; 673 return 0;
@@ -1154,25 +1161,14 @@ _em_fd_active(void *data, Ecore_Fd_Handler *fdh)
1154 ev = _emotion_video_get(fr->obj); 1161 ev = _emotion_video_get(fr->obj);
1155 if (ev) 1162 if (ev)
1156 { 1163 {
1157 if (ev->cur_frame) 1164 em_frame_done(ev);
1158 {
1159 if (ev->cur_frame->done_func)
1160 ev->cur_frame->done_func(ev->cur_frame->done_data);
1161 }
1162 ev->cur_frame = fr; 1165 ev->cur_frame = fr;
1163 _em_get_pos_len(ev); 1166 _em_get_pos_len(ev);
1164 if ((xine_get_stream_info(ev->stream, XINE_STREAM_INFO_HAS_VIDEO)) && 1167 if ((xine_get_stream_info(ev->stream, XINE_STREAM_INFO_HAS_VIDEO)) &&
1165 (xine_get_stream_info(ev->stream, XINE_STREAM_INFO_VIDEO_HANDLED))) 1168 (xine_get_stream_info(ev->stream, XINE_STREAM_INFO_VIDEO_HANDLED)))
1166 { 1169 {
1167 1170 if (ev->video_mute) em_frame_done(ev);
1168 if (ev->video_mute) 1171 else _emotion_frame_new(fr->obj);
1169 {
1170 if (ev->cur_frame->done_func)
1171 ev->cur_frame->done_func(ev->cur_frame->done_data);
1172 ev->cur_frame = NULL;
1173 }
1174 else
1175 _emotion_frame_new(fr->obj);
1176 } 1172 }
1177 _emotion_frame_resize(fr->obj, fr->w, fr->h, fr->ratio); 1173 _emotion_frame_resize(fr->obj, fr->w, fr->h, fr->ratio);
1178 _emotion_video_pos_update(fr->obj, ev->pos, ev->len); 1174 _emotion_video_pos_update(fr->obj, ev->pos, ev->len);
@@ -1274,7 +1270,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1274 xine_audio_level_data_t *e; 1270 xine_audio_level_data_t *e;
1275 1271
1276 e = (xine_audio_level_data_t *)eev->xine_event; 1272 e = (xine_audio_level_data_t *)eev->xine_event;
1277 _emotion_audio_level_change(ev->obj); 1273 _emotion_audio_level_change(ev->obj);
1278 printf("EV: Audio Level [FIXME: break this out to emotion api]\n"); 1274 printf("EV: Audio Level [FIXME: break this out to emotion api]\n");
1279 // e->left (0->100) 1275 // e->left (0->100)
1280 // e->right 1276 // e->right
diff --git a/legacy/emotion/src/modules/emotion_xine.h b/legacy/emotion/src/modules/emotion_xine.h
index 5816b4ef87..0b2affbed7 100644
--- a/legacy/emotion/src/modules/emotion_xine.h
+++ b/legacy/emotion/src/modules/emotion_xine.h
@@ -25,10 +25,11 @@ struct _Emotion_Xine_Video
25 double ratio; 25 double ratio;
26 int w, h; 26 int w, h;
27 Evas_Object *obj; 27 Evas_Object *obj;
28 Emotion_Xine_Video_Frame *cur_frame; 28 volatile Emotion_Xine_Video_Frame *cur_frame;
29 volatile int seek_to; 29 volatile int seek_to;
30 volatile int get_poslen; 30 volatile int get_poslen;
31 volatile double seek_to_pos; 31 volatile double seek_to_pos;
32 volatile int fq;
32 Emotion_Vis vis; 33 Emotion_Vis vis;
33 Ecore_Timer *timer; 34 Ecore_Timer *timer;
34 int fd_read; 35 int fd_read;
diff --git a/legacy/emotion/src/modules/emotion_xine_vo_out.c b/legacy/emotion/src/modules/emotion_xine_vo_out.c
index a339e5135c..6c5f5ae91d 100644
--- a/legacy/emotion/src/modules/emotion_xine_vo_out.c
+++ b/legacy/emotion/src/modules/emotion_xine_vo_out.c
@@ -436,6 +436,10 @@ _emotion_frame_display(vo_driver_t *vo_driver, vo_frame_t *vo_frame)
436 dv = (Emotion_Driver *)vo_driver; 436 dv = (Emotion_Driver *)vo_driver;
437 fr = (Emotion_Frame *)vo_frame; 437 fr = (Emotion_Frame *)vo_frame;
438// printf("emotion: _emotion_frame_display()\n"); 438// printf("emotion: _emotion_frame_display()\n");
439// printf("EX VO: fq %i %p\n", dv->ev->fq, dv->ev);
440// if my frame queue is too deep ( > 4 frames) simply block and wait for them
441// to drain
442 while (dv->ev->fq > 4) usleep(1);
439 if (dv->ev) 443 if (dv->ev)
440 { 444 {
441 void *buf; 445 void *buf;
@@ -450,9 +454,11 @@ _emotion_frame_display(vo_driver_t *vo_driver, vo_frame_t *vo_frame)
450 fr->frame.timestamp = (double)fr->vo_frame.vpts / 90000.0; 454 fr->frame.timestamp = (double)fr->vo_frame.vpts / 90000.0;
451 fr->frame.done_func = _emotion_frame_data_unlock; 455 fr->frame.done_func = _emotion_frame_data_unlock;
452 fr->frame.done_data = fr; 456 fr->frame.done_data = fr;
457// printf("FRAME FOR %p\n", dv->ev);
453 ret = write(dv->ev->fd, &buf, sizeof(void *)); 458 ret = write(dv->ev->fd, &buf, sizeof(void *));
454// printf("-- FRAME DEC %p == %i\n", fr->frame.obj, ret); 459// printf("-- FRAME DEC %p == %i\n", fr->frame.obj, ret);
455 fr->in_use = 1; 460 fr->in_use = 1;
461 dv->ev->fq++;
456 } 462 }
457 /* hmm - must find a way to sanely copy data out... FIXME problem */ 463 /* hmm - must find a way to sanely copy data out... FIXME problem */
458// fr->vo_frame.free(&fr->vo_frame); 464// fr->vo_frame.free(&fr->vo_frame);