summaryrefslogtreecommitdiff
path: root/legacy/emotion
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-10-07 22:16:43 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-10-07 22:16:43 +0000
commit1520c60364ab6bec3b47f5fabe2f4449b7387a9a (patch)
tree9280befa814428830b8f6e1de5446cc97e1142ef /legacy/emotion
parentb11b2f95b5b702c71c9bd808e66dc54c99e6b0eb (diff)
shutup stupid emotion debug!
to get them back, use EINA_LOG_LEVELS for each module or the catch-all: export EINA_LOG_LEVELS_GLOB='emotion*:4' ah, that was making me sick while playing enjoy... :-D SVN revision: 53170
Diffstat (limited to 'legacy/emotion')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c38
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c62
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h7
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c6
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_cdda.c2
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c8
-rw-r--r--legacy/emotion/src/modules/xine/emotion_xine.c119
-rw-r--r--legacy/emotion/src/modules/xine/emotion_xine.h7
-rw-r--r--legacy/emotion/src/modules/xine/emotion_xine_vo_out.c45
9 files changed, 180 insertions, 114 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 34b63296f8..0526bb1f07 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -25,6 +25,12 @@
25 if (strcmp(_e_smart_str, type)) return ret; \ 25 if (strcmp(_e_smart_str, type)) return ret; \
26 } 26 }
27 27
28#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
29#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
30#define WRN(...) EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__)
31#define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
32#define CRITICAL(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)
33
28#define E_OBJ_NAME "emotion_object" 34#define E_OBJ_NAME "emotion_object"
29 35
30typedef struct _Smart_Data Smart_Data; 36typedef struct _Smart_Data Smart_Data;
@@ -88,6 +94,7 @@ static void _smart_clip_unset(Evas_Object * obj);
88static Evas_Smart *smart = NULL; 94static Evas_Smart *smart = NULL;
89static Eina_Hash *_backends = NULL; 95static Eina_Hash *_backends = NULL;
90static Eina_Array *_modules = NULL; 96static Eina_Array *_modules = NULL;
97static int _log_domain = -1;
91 98
92static const char *_backend_priority[] = { 99static const char *_backend_priority[] = {
93 "xine", 100 "xine",
@@ -160,7 +167,7 @@ _emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **
160 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 167 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
161 if (!_backends) 168 if (!_backends)
162 { 169 {
163 fprintf(stderr, "No backend loaded\n"); 170 ERR("No backend loaded");
164 return NULL; 171 return NULL;
165 } 172 }
166 173
@@ -175,7 +182,7 @@ _emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **
175 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*))) 182 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*)))
176 goto retry; 183 goto retry;
177 184
178 fprintf(stderr, "No backend loaded\n"); 185 ERR("No backend loaded");
179 return EINA_FALSE; 186 return EINA_FALSE;
180 } 187 }
181 188
@@ -191,7 +198,7 @@ _emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **
191 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*))) 198 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*)))
192 goto retry; 199 goto retry;
193 200
194 fprintf (stderr, "Unable to load module %s\n", name); 201 ERR("Unable to load module: %s", name);
195 202
196 return NULL; 203 return NULL;
197} 204}
@@ -298,6 +305,7 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
298 305
299 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 306 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
300 307
308 DBG("file=%s", file);
301 if (!sd->module) return; 309 if (!sd->module) return;
302 310
303 if ((file) && (sd->file) && (!strcmp(file, sd->file))) return; 311 if ((file) && (sd->file) && (!strcmp(file, sd->file))) return;
@@ -344,6 +352,7 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
344 Smart_Data *sd; 352 Smart_Data *sd;
345 353
346 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 354 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
355 DBG("play=%hhu, was=%hhu", play, sd->play);
347 if (play == sd->play) return; 356 if (play == sd->play) return;
348 if (!sd->module) return; 357 if (!sd->module) return;
349 if (!sd->video) return; 358 if (!sd->video) return;
@@ -369,6 +378,7 @@ emotion_object_position_set(Evas_Object *obj, double sec)
369 Smart_Data *sd; 378 Smart_Data *sd;
370 379
371 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 380 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
381 DBG("sec=%f", sec);
372 if (!sd->module) return; 382 if (!sd->module) return;
373 if (!sd->video) return; 383 if (!sd->video) return;
374 sd->seek_pos = sec; 384 sd->seek_pos = sec;
@@ -513,6 +523,7 @@ emotion_object_audio_volume_set(Evas_Object *obj, double vol)
513 Smart_Data *sd; 523 Smart_Data *sd;
514 524
515 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 525 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
526 DBG("vol=%f", vol);
516 if (!sd->module) return; 527 if (!sd->module) return;
517 if (!sd->video) return; 528 if (!sd->video) return;
518 sd->module->audio_channel_volume_set(sd->video, vol); 529 sd->module->audio_channel_volume_set(sd->video, vol);
@@ -535,6 +546,7 @@ emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
535 Smart_Data *sd; 546 Smart_Data *sd;
536 547
537 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 548 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
549 DBG("mute=%hhu", mute);
538 if (!sd->module) return; 550 if (!sd->module) return;
539 if (!sd->video) return; 551 if (!sd->video) return;
540 sd->module->audio_channel_mute_set(sd->video, mute); 552 sd->module->audio_channel_mute_set(sd->video, mute);
@@ -579,6 +591,7 @@ emotion_object_audio_channel_set(Evas_Object *obj, int channel)
579 Smart_Data *sd; 591 Smart_Data *sd;
580 592
581 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 593 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
594 DBG("channel=%d", channel);
582 if (!sd->module) return; 595 if (!sd->module) return;
583 if (!sd->video) return; 596 if (!sd->video) return;
584 sd->module->audio_channel_set(sd->video, channel); 597 sd->module->audio_channel_set(sd->video, channel);
@@ -601,6 +614,7 @@ emotion_object_video_mute_set(Evas_Object *obj, Eina_Bool mute)
601 Smart_Data *sd; 614 Smart_Data *sd;
602 615
603 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 616 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
617 DBG("mute=%hhu", mute);
604 if (!sd->module) return; 618 if (!sd->module) return;
605 if (!sd->video) return; 619 if (!sd->video) return;
606 sd->module->video_channel_mute_set(sd->video, mute); 620 sd->module->video_channel_mute_set(sd->video, mute);
@@ -645,6 +659,7 @@ emotion_object_video_channel_set(Evas_Object *obj, int channel)
645 Smart_Data *sd; 659 Smart_Data *sd;
646 660
647 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 661 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
662 DBG("channel=%d", channel);
648 if (!sd->module) return; 663 if (!sd->module) return;
649 if (!sd->video) return; 664 if (!sd->video) return;
650 sd->module->video_channel_set(sd->video, channel); 665 sd->module->video_channel_set(sd->video, channel);
@@ -667,6 +682,7 @@ emotion_object_spu_mute_set(Evas_Object *obj, Eina_Bool mute)
667 Smart_Data *sd; 682 Smart_Data *sd;
668 683
669 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 684 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
685 DBG("mute=%hhu", mute);
670 if (!sd->module) return; 686 if (!sd->module) return;
671 if (!sd->video) return; 687 if (!sd->video) return;
672 sd->module->spu_channel_mute_set(sd->video, mute); 688 sd->module->spu_channel_mute_set(sd->video, mute);
@@ -711,6 +727,7 @@ emotion_object_spu_channel_set(Evas_Object *obj, int channel)
711 Smart_Data *sd; 727 Smart_Data *sd;
712 728
713 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 729 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
730 DBG("channel=%d", channel);
714 if (!sd->module) return; 731 if (!sd->module) return;
715 if (!sd->video) return; 732 if (!sd->video) return;
716 sd->module->spu_channel_set(sd->video, channel); 733 sd->module->spu_channel_set(sd->video, channel);
@@ -744,6 +761,7 @@ emotion_object_chapter_set(Evas_Object *obj, int chapter)
744 Smart_Data *sd; 761 Smart_Data *sd;
745 762
746 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 763 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
764 DBG("chapter=%d", chapter);
747 if (!sd->module) return; 765 if (!sd->module) return;
748 if (!sd->video) return; 766 if (!sd->video) return;
749 sd->module->chapter_set(sd->video, chapter); 767 sd->module->chapter_set(sd->video, chapter);
@@ -777,6 +795,7 @@ emotion_object_play_speed_set(Evas_Object *obj, double speed)
777 Smart_Data *sd; 795 Smart_Data *sd;
778 796
779 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 797 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
798 DBG("speed=%f", speed);
780 if (!sd->module) return; 799 if (!sd->module) return;
781 if (!sd->video) return; 800 if (!sd->video) return;
782 sd->module->speed_set(sd->video, speed); 801 sd->module->speed_set(sd->video, speed);
@@ -910,6 +929,7 @@ emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization)
910 Smart_Data *sd; 929 Smart_Data *sd;
911 930
912 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 931 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
932 DBG("visualization=%d", visualization);
913 if (!sd->module) return; 933 if (!sd->module) return;
914 if (!sd->video) return; 934 if (!sd->video) return;
915 if (!sd->module->vis_set) return; 935 if (!sd->module->vis_set) return;
@@ -1315,6 +1335,14 @@ _smart_init(void)
1315 { 1335 {
1316 eina_init(); 1336 eina_init();
1317 1337
1338 _log_domain = eina_log_domain_register("emotion", EINA_COLOR_LIGHTCYAN);
1339 if (_log_domain < 0)
1340 {
1341 EINA_LOG_CRIT("Could not register log domain 'emotion'");
1342 eina_shutdown();
1343 return;
1344 }
1345
1318 _backends = eina_hash_string_small_new(free); 1346 _backends = eina_hash_string_small_new(free);
1319 1347
1320 _modules = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/emotion/", 0, NULL, NULL); 1348 _modules = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/emotion/", 0, NULL, NULL);
@@ -1333,8 +1361,8 @@ _smart_init(void)
1333 1361
1334 if (!_modules) 1362 if (!_modules)
1335 { 1363 {
1336 fprintf(stderr, "No module found !\n"); 1364 ERR("No module found!");
1337 return ; 1365 return;
1338 } 1366 }
1339 1367
1340 eina_module_list_load(_modules); 1368 eina_module_list_load(_modules);
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
index 7670f49be1..435e1bab57 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
@@ -8,6 +8,8 @@
8#include "emotion_gstreamer_pipeline.h" 8#include "emotion_gstreamer_pipeline.h"
9#include "Emotion.h" 9#include "Emotion.h"
10 10
11int _emotion_gstreamer_log_domain = -1;
12
11/* Callbacks to get the eos */ 13/* Callbacks to get the eos */
12static Eina_Bool _eos_timer_fct (void *data); 14static Eina_Bool _eos_timer_fct (void *data);
13static void _em_buffer_read(void *data, void *buffer, unsigned int nbyte); 15static void _em_buffer_read(void *data, void *buffer, unsigned int nbyte);
@@ -345,10 +347,10 @@ em_file_open(const char *file,
345 device = NULL; 347 device = NULL;
346 sscanf(file, "cdda://%d", &track); 348 sscanf(file, "cdda://%d", &track);
347 } 349 }
348 fprintf(stderr, "[Emotion] [gst] build CD Audio pipeline\n"); 350 DBG("Build CD Audio pipeline");
349 if (!(emotion_pipeline_cdda_build(ev, device, track))) 351 if (!(emotion_pipeline_cdda_build(ev, device, track)))
350 { 352 {
351 fprintf(stderr, "[Emotion] [gst] error while building CD Audio pipeline\n"); 353 ERR("Could not build CD Audio pipeline");
352 gst_object_unref(ev->pipeline); 354 gst_object_unref(ev->pipeline);
353 return 0; 355 return 0;
354 } 356 }
@@ -357,10 +359,10 @@ em_file_open(const char *file,
357 else if (strstr(file, "dvd://")) 359 else if (strstr(file, "dvd://"))
358 { 360 {
359 361
360 fprintf(stderr, "[Emotion] [gst] build DVD pipeline\n"); 362 DBG("Build DVD pipeline");
361 if (!(emotion_pipeline_dvd_build(ev, NULL))) 363 if (!(emotion_pipeline_dvd_build(ev, NULL)))
362 { 364 {
363 fprintf(stderr, "[Emotion] [gst] error while building DVD pipeline\n"); 365 ERR("Could not build DVD pipeline");
364 gst_object_unref(ev->pipeline); 366 gst_object_unref(ev->pipeline);
365 return 0; 367 return 0;
366 } 368 }
@@ -368,10 +370,10 @@ em_file_open(const char *file,
368 /* http */ 370 /* http */
369 else if (strstr(file, "http://")) 371 else if (strstr(file, "http://"))
370 { 372 {
371 fprintf(stderr, "[Emotion] [gst] build URI pipeline\n"); 373 DBG("Build URI pipeline");
372 if (!(emotion_pipeline_uri_build(ev, file))) 374 if (!(emotion_pipeline_uri_build(ev, file)))
373 { 375 {
374 fprintf(stderr, "[Emotion] [gst] error while building URI pipeline\n"); 376 ERR("Could not build URI pipeline");
375 gst_object_unref(ev->pipeline); 377 gst_object_unref(ev->pipeline);
376 return 0; 378 return 0;
377 } 379 }
@@ -379,10 +381,10 @@ em_file_open(const char *file,
379 /* v4l */ 381 /* v4l */
380 else if (strstr(file, "v4l://")) 382 else if (strstr(file, "v4l://"))
381 { 383 {
382 fprintf(stderr, "[Emotion] [gst] build V4L pipeline\n"); 384 DBG("Build V4L pipeline");
383 if (!(emotion_pipeline_v4l_build(ev, file))) 385 if (!(emotion_pipeline_v4l_build(ev, file)))
384 { 386 {
385 fprintf(stderr, "[Emotion] [gst] error while building V4L pipeline\n"); 387 ERR("Could not build V4L pipeline");
386 gst_object_unref(ev->pipeline); 388 gst_object_unref(ev->pipeline);
387 return 0; 389 return 0;
388 } 390 }
@@ -396,10 +398,10 @@ em_file_open(const char *file,
396 ? file + strlen("file://") 398 ? file + strlen("file://")
397 : file; 399 : file;
398 400
399 fprintf(stderr, "[Emotion] [gst] build file pipeline\n"); 401 DBG("Build file pipeline");
400 if (!(emotion_pipeline_file_build(ev, filename))) 402 if (!(emotion_pipeline_file_build(ev, filename)))
401 { 403 {
402 fprintf(stderr, "[Emotion] [gst] error while building File pipeline\n"); 404 ERR("Could not build File pipeline");
403 gst_object_unref(ev->pipeline); 405 gst_object_unref(ev->pipeline);
404 return 0; 406 return 0;
405 } 407 }
@@ -415,22 +417,19 @@ em_file_open(const char *file,
415 vsink = (Emotion_Video_Sink *)eina_list_data_get(ev->video_sinks); 417 vsink = (Emotion_Video_Sink *)eina_list_data_get(ev->video_sinks);
416 if (vsink) 418 if (vsink)
417 { 419 {
418 fprintf(stderr, "video : \n"); 420 DBG("video size=%dx%d, fps=%d/%d, "
419 fprintf(stderr, " size : %dx%d\n", vsink->width, vsink->height); 421 "fourcc=%"GST_FOURCC_FORMAT", length=%"GST_TIME_FORMAT,
420 fprintf(stderr, " fps : %d/%d\n", vsink->fps_num, vsink->fps_den); 422 vsink->width, vsink->height, vsink->fps_num, vsink->fps_den,
421 fprintf(stderr, " fourcc : %" GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS(vsink->fourcc)); 423 GST_FOURCC_ARGS(vsink->fourcc),
422 fprintf(stderr, " length : %" GST_TIME_FORMAT "\n\n", 424 GST_TIME_ARGS((guint64)(vsink->length_time * GST_SECOND)));
423 GST_TIME_ARGS((guint64)(vsink->length_time * GST_SECOND)));
424 } 425 }
425 426
426 asink = (Emotion_Audio_Sink *)eina_list_data_get(ev->audio_sinks); 427 asink = (Emotion_Audio_Sink *)eina_list_data_get(ev->audio_sinks);
427 if (asink) 428 if (asink)
428 { 429 {
429 fprintf(stderr, "audio : \n"); 430 DBG("audio channels=%d, rate=%d, length=%"GST_TIME_FORMAT,
430 fprintf(stderr, " chan : %d\n", asink->channels); 431 asink->channels, asink->samplerate,
431 fprintf(stderr, " rate : %d\n", asink->samplerate); 432 GST_TIME_ARGS((guint64)(asink->length_time * GST_SECOND)));
432 fprintf(stderr, " length : %" GST_TIME_FORMAT "\n\n",
433 GST_TIME_ARGS((guint64)(asink->length_time * GST_SECOND)));
434 } 433 }
435 } 434 }
436 435
@@ -598,7 +597,7 @@ em_len_get(void *video)
598 597
599 if (fmt != GST_FORMAT_TIME) 598 if (fmt != GST_FORMAT_TIME)
600 { 599 {
601 fprintf(stderr, "requrested duration in time, but got %s instead.", 600 DBG("requrested duration in time, but got %s instead.",
602 gst_format_get_name(fmt)); 601 gst_format_get_name(fmt));
603 goto fallback; 602 goto fallback;
604 } 603 }
@@ -681,8 +680,8 @@ em_pos_get(void *video)
681 680
682 if (fmt != GST_FORMAT_TIME) 681 if (fmt != GST_FORMAT_TIME)
683 { 682 {
684 fprintf(stderr, "requrested position in time, but got %s instead.", 683 ERR("requrested position in time, but got %s instead.",
685 gst_format_get_name(fmt)); 684 gst_format_get_name(fmt));
686 return ev->position; 685 return ev->position;
687 } 686 }
688 687
@@ -1199,6 +1198,19 @@ module_open(Evas_Object *obj,
1199 if (!module) 1198 if (!module)
1200 return EINA_FALSE; 1199 return EINA_FALSE;
1201 1200
1201 if (_emotion_gstreamer_log_domain < 0)
1202 {
1203 eina_threads_init();
1204 eina_log_threads_enable();
1205 _emotion_gstreamer_log_domain = eina_log_domain_register
1206 ("emotion-gstreamer", EINA_COLOR_LIGHTCYAN);
1207 if (_emotion_gstreamer_log_domain < 0)
1208 {
1209 EINA_LOG_CRIT("Could not register log domain 'emotion-gstreamer'");
1210 return EINA_FALSE;
1211 }
1212 }
1213
1202 if (!em_module.init(obj, video, opt)) 1214 if (!em_module.init(obj, video, opt))
1203 return EINA_FALSE; 1215 return EINA_FALSE;
1204 1216
@@ -1404,7 +1416,7 @@ _eos_timer_fct(void *data)
1404 gst_message_parse_error(msg, &err, &debug); 1416 gst_message_parse_error(msg, &err, &debug);
1405 g_free(debug); 1417 g_free(debug);
1406 1418
1407 g_print("Error: %s\n", err->message); 1419 ERR("Error: %s", err->message);
1408 g_error_free(err); 1420 g_error_free(err);
1409 1421
1410 break; 1422 break;
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
index fa59353ad9..4892525513 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.h
@@ -92,4 +92,11 @@ struct _Emotion_Gstreamer_Video
92 unsigned char audio_mute : 1; 92 unsigned char audio_mute : 1;
93}; 93};
94 94
95extern int _emotion_gstreamer_log_domain;
96#define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__)
97#define INF(...) EINA_LOG_DOM_INFO(_emotion_gstreamer_log_domain, __VA_ARGS__)
98#define WRN(...) EINA_LOG_DOM_WARN(_emotion_gstreamer_log_domain, __VA_ARGS__)
99#define ERR(...) EINA_LOG_DOM_ERR(_emotion_gstreamer_log_domain, __VA_ARGS__)
100#define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_gstreamer_log_domain, __VA_ARGS__)
101
95#endif /* __EMOTION_GSTREAMER_H__ */ 102#endif /* __EMOTION_GSTREAMER_H__ */
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c
index 3411172b4e..c71bd11dc6 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline.c
@@ -14,14 +14,14 @@ emotion_pipeline_pause(GstElement *pipeline)
14 res = gst_element_set_state((pipeline), GST_STATE_PAUSED); 14 res = gst_element_set_state((pipeline), GST_STATE_PAUSED);
15 if (res == GST_STATE_CHANGE_FAILURE) 15 if (res == GST_STATE_CHANGE_FAILURE)
16 { 16 {
17 g_print("Emotion-Gstreamer ERROR: could not pause\n"); 17 ERR("could not pause");
18 return 0; 18 return 0;
19 } 19 }
20 20
21 res = gst_element_get_state((pipeline), NULL, NULL, GST_CLOCK_TIME_NONE); 21 res = gst_element_get_state((pipeline), NULL, NULL, GST_CLOCK_TIME_NONE);
22 if (res != GST_STATE_CHANGE_SUCCESS) 22 if (res != GST_STATE_CHANGE_SUCCESS)
23 { 23 {
24 g_print("Emotion-Gstreamer ERROR: could not complete pause\n"); 24 ERR("could not complete pause");
25 return 0; 25 return 0;
26 } 26 }
27 27
@@ -487,7 +487,7 @@ emotion_streams_sinks_get(Emotion_Gstreamer_Video *ev, GstElement *decoder)
487 487
488 caps = gst_pad_get_caps(pad); 488 caps = gst_pad_get_caps(pad);
489 str = gst_caps_to_string(caps); 489 str = gst_caps_to_string(caps);
490 g_print("caps !! %s\n", str); 490 DBG("caps %s", str);
491 491
492 /* video stream */ 492 /* video stream */
493 if (g_str_has_prefix(str, "video/")) 493 if (g_str_has_prefix(str, "video/"))
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_cdda.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_cdda.c
index e0bec27dc4..3bd9db1ece 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_cdda.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_cdda.c
@@ -21,7 +21,7 @@ emotion_pipeline_cdda_build(void *video, const char * device, unsigned int track
21 cdiocddasrc = gst_element_factory_make("cdiocddasrc", "src"); 21 cdiocddasrc = gst_element_factory_make("cdiocddasrc", "src");
22 if (!cdiocddasrc) 22 if (!cdiocddasrc)
23 { 23 {
24 g_print("cdiocddasrc element missing. Install it.\n"); 24 ERR("cdiocddasrc gstreamer element missing. Install it.");
25 goto failure_cdiocddasrc; 25 goto failure_cdiocddasrc;
26 } 26 }
27 27
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c
index 738b93c202..8f5f5a00ec 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c
@@ -9,7 +9,7 @@ static void dvd_pad_added_cb (GstElement *dvddemuxer,
9static void dvd_no_more_pads_cb (GstElement *dvddemuxer, 9static void dvd_no_more_pads_cb (GstElement *dvddemuxer,
10 gpointer user_data); 10 gpointer user_data);
11 11
12static int no_more_pads = 0; 12static volatile int no_more_pads = 0;
13 13
14 14
15int 15int
@@ -47,7 +47,7 @@ emotion_pipeline_dvd_build(void *video, const char *device)
47 47
48 while (no_more_pads == 0) 48 while (no_more_pads == 0)
49 { 49 {
50 g_print("toto\n"); 50 DBG("toto");
51 } 51 }
52 no_more_pads = 0; 52 no_more_pads = 0;
53 53
@@ -70,7 +70,7 @@ emotion_pipeline_dvd_build(void *video, const char *device)
70 70
71 caps = gst_pad_get_caps(pad); 71 caps = gst_pad_get_caps(pad);
72 str = gst_caps_to_string(caps); 72 str = gst_caps_to_string(caps);
73 g_print("caps !! %s\n", str); 73 DBG("caps %s", str);
74 /* video stream */ 74 /* video stream */
75 if (g_str_has_prefix(str, "video/mpeg")) 75 if (g_str_has_prefix(str, "video/mpeg"))
76 { 76 {
@@ -83,7 +83,7 @@ emotion_pipeline_dvd_build(void *video, const char *device)
83 sink_pad = gst_element_get_pad(gst_bin_get_by_name(GST_BIN(ev->pipeline), "mpeg2dec"), "src"); 83 sink_pad = gst_element_get_pad(gst_bin_get_by_name(GST_BIN(ev->pipeline), "mpeg2dec"), "src");
84 sink_caps = gst_pad_get_caps(sink_pad); 84 sink_caps = gst_pad_get_caps(sink_pad);
85 str = gst_caps_to_string(sink_caps); 85 str = gst_caps_to_string(sink_caps);
86 g_print(" ** caps v !! %s\n", str); 86 DBG("caps video %s", str);
87 87
88 emotion_video_sink_fill(vsink, sink_pad, sink_caps); 88 emotion_video_sink_fill(vsink, sink_pad, sink_caps);
89 89
diff --git a/legacy/emotion/src/modules/xine/emotion_xine.c b/legacy/emotion/src/modules/xine/emotion_xine.c
index 0afbde7ae0..874270f621 100644
--- a/legacy/emotion/src/modules/xine/emotion_xine.c
+++ b/legacy/emotion/src/modules/xine/emotion_xine.c
@@ -2,6 +2,8 @@
2#include "emotion_private.h" 2#include "emotion_private.h"
3#include "emotion_xine.h" 3#include "emotion_xine.h"
4 4
5int _emotion_xine_log_domain = -1;
6
5/* module api */ 7/* module api */
6static unsigned char em_init (Evas_Object *obj, void **emotion_video, Emotion_Module_Options *opt); 8static unsigned char em_init (Evas_Object *obj, void **emotion_video, Emotion_Module_Options *opt);
7static int em_shutdown (void *ef); 9static int em_shutdown (void *ef);
@@ -112,11 +114,11 @@ _em_slave(void *par)
112 xine_config_update_entry(ev->decoder, &cf); 114 xine_config_update_entry(ev->decoder, &cf);
113 } 115 }
114 } 116 }
115 printf("OPEN VIDEO PLUGIN...\n"); 117 DBG("OPEN VIDEO PLUGIN...");
116 if (!ev->opt_no_video) 118 if (!ev->opt_no_video)
117 ev->video = xine_open_video_driver(ev->decoder, "emotion", 119 ev->video = xine_open_video_driver(ev->decoder, "emotion",
118 XINE_VISUAL_TYPE_NONE, ev); 120 XINE_VISUAL_TYPE_NONE, ev);
119 printf("RESULT: xine_open_video_driver() = %p\n", ev->video); 121 DBG("RESULT: xine_open_video_driver() = %p", ev->video);
120 // Let xine autodetect the best audio output driver 122 // Let xine autodetect the best audio output driver
121 if (!ev->opt_no_audio) 123 if (!ev->opt_no_audio)
122 ev->audio = xine_open_audio_driver(ev->decoder, NULL, ev); 124 ev->audio = xine_open_audio_driver(ev->decoder, NULL, ev);
@@ -136,31 +138,31 @@ _em_slave(void *par)
136 case 3: /* shutdown */ 138 case 3: /* shutdown */
137 { 139 {
138 _em_module_event(ev, 3); 140 _em_module_event(ev, 3);
139 printf("EX shutdown stop\n"); 141 DBG("shutdown stop");
140 xine_stop(ev->stream); 142 xine_stop(ev->stream);
141 // pthread_mutex_lock(&(ev->get_pos_len_mutex)); 143 // pthread_mutex_lock(&(ev->get_pos_len_mutex));
142 if (!ev->get_pos_thread_deleted) 144 if (!ev->get_pos_thread_deleted)
143 { 145 {
144 printf("closing get_pos thread, %p\n", ev); 146 DBG("closing get_pos thread, %p", ev);
145 pthread_mutex_lock(&(ev->get_pos_len_mutex)); 147 pthread_mutex_lock(&(ev->get_pos_len_mutex));
146 pthread_cond_broadcast(&(ev->get_pos_len_cond)); 148 pthread_cond_broadcast(&(ev->get_pos_len_cond));
147 pthread_mutex_unlock(&(ev->get_pos_len_mutex)); 149 pthread_mutex_unlock(&(ev->get_pos_len_mutex));
148 while (ev->get_poslen); 150 while (ev->get_poslen);
149 } 151 }
150 printf("EX dispose %p\n", ev); 152 DBG("dispose %p", ev);
151 xine_dispose(ev->stream); 153 xine_dispose(ev->stream);
152 printf("EX dispose evq %p\n", ev); 154 DBG("dispose evq %p", ev);
153 xine_event_dispose_queue(ev->queue); 155 xine_event_dispose_queue(ev->queue);
154 printf("EX close video drv %p\n", ev); 156 DBG("close video drv %p", ev);
155 if (ev->video) xine_close_video_driver(ev->decoder, ev->video); 157 if (ev->video) xine_close_video_driver(ev->decoder, ev->video);
156 printf("EX wait for vo to go\n"); 158 DBG("wait for vo to go");
157 while (ev->have_vo); 159 while (ev->have_vo);
158 printf("EX vo gone\n"); 160 DBG("vo gone");
159 printf("EX close audio drv %p\n", ev); 161 DBG("close audio drv %p", ev);
160 if (ev->audio) xine_close_audio_driver(ev->decoder, ev->audio); 162 if (ev->audio) xine_close_audio_driver(ev->decoder, ev->audio);
161 printf("EX xine exit %p\n", ev); 163 DBG("xine exit %p", ev);
162 xine_exit(ev->decoder); 164 xine_exit(ev->decoder);
163 printf("EX DONE %p\n", ev); 165 DBG("DONE %p", ev);
164 close(ev->fd_write); 166 close(ev->fd_write);
165 close(ev->fd_read); 167 close(ev->fd_read);
166 close(ev->fd_ev_write); 168 close(ev->fd_ev_write);
@@ -183,7 +185,7 @@ _em_slave(void *par)
183 char *file; 185 char *file;
184 186
185 file = eev->xine_event; 187 file = eev->xine_event;
186 printf("OPN STREAM %s\n", file); 188 DBG("OPEN STREAM %s", file);
187 if (xine_open(ev->stream, file)) 189 if (xine_open(ev->stream, file))
188 { 190 {
189 if (xine_get_pos_length(ev->stream, &pos_stream, &pos_time, &length_time)) 191 if (xine_get_pos_length(ev->stream, &pos_stream, &pos_time, &length_time))
@@ -222,13 +224,13 @@ _em_slave(void *par)
222 break; 224 break;
223 case 11: /* file close */ 225 case 11: /* file close */
224 { 226 {
225 printf("EX done %p\n", ev); 227 DBG("done %p", ev);
226 em_frame_done(ev); 228 em_frame_done(ev);
227 printf("EX stop %p\n", ev); 229 DBG("stop %p", ev);
228 xine_stop(ev->stream); 230 xine_stop(ev->stream);
229 printf("EX close %p\n", ev); 231 DBG("close %p", ev);
230 xine_close(ev->stream); 232 xine_close(ev->stream);
231 printf("EX close done %p\n", ev); 233 DBG("close done %p", ev);
232 _em_module_event(ev, 11); 234 _em_module_event(ev, 11);
233 } 235 }
234 break; 236 break;
@@ -428,7 +430,7 @@ em_shutdown(void *ef)
428 ev = (Emotion_Xine_Video *)ef; 430 ev = (Emotion_Xine_Video *)ef;
429 ev->closing = 1; 431 ev->closing = 1;
430 ev->delete_me = 1; 432 ev->delete_me = 1;
431 printf("EXM del fds %p\n", ev); 433 DBG("del fds %p", ev);
432 ecore_main_fd_handler_del(ev->fd_handler); 434 ecore_main_fd_handler_del(ev->fd_handler);
433 ev->fd_handler = NULL; 435 ev->fd_handler = NULL;
434 ecore_main_fd_handler_del(ev->fd_ev_handler); 436 ecore_main_fd_handler_del(ev->fd_ev_handler);
@@ -441,7 +443,7 @@ em_shutdown(void *ef)
441 443
442 ev->closing = 1; 444 ev->closing = 1;
443 _em_slave_event(ev, 3, NULL); 445 _em_slave_event(ev, 3, NULL);
444 printf("EXM done %p\n", ev); 446 DBG("done %p", ev);
445 return 1; 447 return 1;
446} 448}
447 449
@@ -1367,7 +1369,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1367 break; 1369 break;
1368 case XINE_EVENT_UI_MESSAGE: 1370 case XINE_EVENT_UI_MESSAGE:
1369 { 1371 {
1370 printf("EV: UI Message [FIXME: break this out to emotion api]\n"); 1372 WRN("UI Message [FIXME: break this out to emotion api]");
1371 // e->type = error type(XINE_MSG_NO_ERROR, XINE_MSG_GENERAL_WARNING, XINE_MSG_UNKNOWN_HOST etc.) 1373 // e->type = error type(XINE_MSG_NO_ERROR, XINE_MSG_GENERAL_WARNING, XINE_MSG_UNKNOWN_HOST etc.)
1372 // e->messages is a list of messages DOUBLE null terminated 1374 // e->messages is a list of messages DOUBLE null terminated
1373 } 1375 }
@@ -1375,7 +1377,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1375 case XINE_EVENT_AUDIO_LEVEL: 1377 case XINE_EVENT_AUDIO_LEVEL:
1376 { 1378 {
1377 _emotion_audio_level_change(ev->obj); 1379 _emotion_audio_level_change(ev->obj);
1378 printf("EV: Audio Level [FIXME: break this out to emotion api]\n"); 1380 WRN("Audio Level [FIXME: break this out to emotion api]");
1379 // e->left (0->100) 1381 // e->left (0->100)
1380 // e->right 1382 // e->right
1381 // e->mute 1383 // e->mute
@@ -1386,7 +1388,7 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1386 xine_progress_data_t *e; 1388 xine_progress_data_t *e;
1387 1389
1388 e = (xine_progress_data_t *)eev->xine_event; 1390 e = (xine_progress_data_t *)eev->xine_event;
1389 printf("PROGRESS: %i\n", e->percent); 1391 DBG("PROGRESS: %i", e->percent);
1390 _emotion_progress_set(ev->obj, (char *)e->description, (double)e->percent / 100.0); 1392 _emotion_progress_set(ev->obj, (char *)e->description, (double)e->percent / 100.0);
1391 } 1393 }
1392 break; 1394 break;
@@ -1422,13 +1424,13 @@ _em_fd_ev_active(void *data, Ecore_Fd_Handler *fdh)
1422 xine_dropped_frames_t *e; 1424 xine_dropped_frames_t *e;
1423 1425
1424 e = (xine_dropped_frames_t *)eev->xine_event; 1426 e = (xine_dropped_frames_t *)eev->xine_event;
1425 printf("EV: Dropped Frames (skipped %i) (discarded %i) [FIXME: break this out to the emotion api]\n", e->skipped_frames, e->discarded_frames); 1427 WRN("Dropped Frames (skipped %i) (discarded %i) [FIXME: break this out to the emotion api]", e->skipped_frames, e->discarded_frames);
1426 // e->skipped_frames = % frames skipped * 10 1428 // e->skipped_frames = % frames skipped * 10
1427 // e->discarded_frames = % frames skipped * 10 1429 // e->discarded_frames = % frames skipped * 10
1428 } 1430 }
1429 break; 1431 break;
1430 default: 1432 default:
1431 // printf("EV: unknown event type %i\n", eev->type); 1433 // DBG("unknown event type %i", eev->type);
1432 break; 1434 break;
1433 } 1435 }
1434 } 1436 }
@@ -1474,7 +1476,7 @@ _em_get_pos_len_th(void *par)
1474 } 1476 }
1475 ev->get_poslen = 0; 1477 ev->get_poslen = 0;
1476 _em_module_event(ev, 15); /* event - getpos done */ 1478 _em_module_event(ev, 15); /* event - getpos done */
1477 //printf("get pos %3.3f\n", ev->pos); 1479 //DBG("get pos %3.3f", ev->pos);
1478 } 1480 }
1479 if (ev->delete_me) 1481 if (ev->delete_me)
1480 { 1482 {
@@ -1563,6 +1565,19 @@ module_open(Evas_Object *obj, const Emotion_Video_Module **module, void **video,
1563 if (!module) 1565 if (!module)
1564 return EINA_FALSE; 1566 return EINA_FALSE;
1565 1567
1568 if (_emotion_xine_log_domain < 0)
1569 {
1570 eina_threads_init();
1571 eina_log_threads_enable();
1572 _emotion_xine_log_domain = eina_log_domain_register
1573 ("emotion-xine", EINA_COLOR_LIGHTCYAN);
1574 if (_emotion_xine_log_domain < 0)
1575 {
1576 EINA_LOG_CRIT("Could not register log domain 'emotion-xine'");
1577 return EINA_FALSE;
1578 }
1579 }
1580
1566 if (!em_module.init(obj, video, opt)) 1581 if (!em_module.init(obj, video, opt))
1567 return EINA_FALSE; 1582 return EINA_FALSE;
1568 1583
@@ -1637,48 +1652,46 @@ em_debug(Emotion_Xine_Video *ev)
1637 spu_channel = xine_get_param(ev->stream, XINE_PARAM_SPU_CHANNEL); 1652 spu_channel = xine_get_param(ev->stream, XINE_PARAM_SPU_CHANNEL);
1638 video_ratio = xine_get_stream_info(ev->stream, XINE_STREAM_INFO_VIDEO_RATIO); 1653 video_ratio = xine_get_stream_info(ev->stream, XINE_STREAM_INFO_VIDEO_RATIO);
1639 audio_mode = xine_get_stream_info(ev->stream, XINE_STREAM_INFO_AUDIO_MODE); 1654 audio_mode = xine_get_stream_info(ev->stream, XINE_STREAM_INFO_AUDIO_MODE);
1640 printf("has_chapters = %i\n", has_chapters); 1655 DBG("has_chapters = %i", has_chapters);
1641 printf("max_spu = %i\n", max_spu); 1656 DBG("max_spu = %i", max_spu);
1642 printf("max_audio = %i\n", max_audio); 1657 DBG("max_audio = %i", max_audio);
1643 printf("video_channels = %i\n", video_channels); 1658 DBG("video_channels = %i", video_channels);
1644 printf("video_streams = %i\n", video_streams); 1659 DBG("video_streams = %i", video_streams);
1645 printf("video_seekable = %i\n", video_seekable); 1660 DBG("video_seekable = %i", video_seekable);
1646 printf("title = %s\n", title); 1661 DBG("title = %s", title);
1647 printf("comment = %s\n", comment); 1662 DBG("comment = %s", comment);
1648 printf("artist = %s\n", artist); 1663 DBG("artist = %s", artist);
1649 printf("genre = %s\n", genre); 1664 DBG("genre = %s", genre);
1650 printf("album = %s\n", album); 1665 DBG("album = %s", album);
1651 printf("year = %s\n", year); 1666 DBG("year = %s", year);
1652 printf("cdindex_discid = %s\n", cdindex_discid); 1667 DBG("cdindex_discid = %s", cdindex_discid);
1653 printf("video_channel = %i\n", video_channel); 1668 DBG("video_channel = %i", video_channel);
1654 printf("audio_channel = %i\n", audio_channel); 1669 DBG("audio_channel = %i", audio_channel);
1655 printf("spu_channels = %i\n", spu_channel); 1670 DBG("spu_channels = %i", spu_channel);
1656 printf("video_ratio = %i\n", video_ratio); 1671 DBG("video_ratio = %i", video_ratio);
1657 printf("audio_mode = %i\n", audio_mode); 1672 DBG("audio_mode = %i", audio_mode);
1658 { 1673 {
1659 int i; 1674 int i;
1660 1675
1661 for (i = 0; i <= max_audio; i++) 1676 for (i = 0; i <= max_audio; i++)
1662 { 1677 {
1663 char lang[XINE_LANG_MAX + 1]; 1678 char lang[XINE_LANG_MAX + 1];
1664 1679 char buf[128] = "NONE";
1680
1665 lang[0] = 0; 1681 lang[0] = 0;
1666 printf(" AUDIO %i = ", i);
1667 if (xine_get_audio_lang(ev->stream, i, lang)) 1682 if (xine_get_audio_lang(ev->stream, i, lang))
1668 printf("%s\n", lang); 1683 eina_strlcpy(buf, lang, sizeof(buf));
1669 else 1684 DBG(" AUDIO %i = %s", i, buf);
1670 printf("NONE\n");
1671 } 1685 }
1672 for (i = 0; i <= max_spu; i++) 1686 for (i = 0; i <= max_spu; i++)
1673 { 1687 {
1674 char lang[XINE_LANG_MAX + 1]; 1688 char lang[XINE_LANG_MAX + 1];
1675 1689 char buf[128] = "NONE";
1690
1676 lang[0] = 0; 1691 lang[0] = 0;
1677 printf(" SPU %i = ", i);
1678 if (xine_get_spu_lang(ev->stream, i, lang)) 1692 if (xine_get_spu_lang(ev->stream, i, lang))
1679 printf("%s\n", lang); 1693 eina_strlcpy(buf, lang, sizeof(buf));
1680 else 1694 DBG(" SPU %i = %s", i, buf);
1681 printf("NONE\n");
1682 } 1695 }
1683 } 1696 }
1684} 1697}
diff --git a/legacy/emotion/src/modules/xine/emotion_xine.h b/legacy/emotion/src/modules/xine/emotion_xine.h
index fa6c082e83..97aed72e80 100644
--- a/legacy/emotion/src/modules/xine/emotion_xine.h
+++ b/legacy/emotion/src/modules/xine/emotion_xine.h
@@ -87,4 +87,11 @@ struct _Emotion_Xine_Event
87 int mtype; 87 int mtype;
88}; 88};
89 89
90extern int _emotion_xine_log_domain;
91#define DBG(...) EINA_LOG_DOM_DBG(_emotion_xine_log_domain, __VA_ARGS__)
92#define INF(...) EINA_LOG_DOM_INFO(_emotion_xine_log_domain, __VA_ARGS__)
93#define WRN(...) EINA_LOG_DOM_WARN(_emotion_xine_log_domain, __VA_ARGS__)
94#define ERR(...) EINA_LOG_DOM_ERR(_emotion_xine_log_domain, __VA_ARGS__)
95#define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_xine_log_domain, __VA_ARGS__)
96
90#endif 97#endif
diff --git a/legacy/emotion/src/modules/xine/emotion_xine_vo_out.c b/legacy/emotion/src/modules/xine/emotion_xine_vo_out.c
index f8741bdf2a..6ecb947bba 100644
--- a/legacy/emotion/src/modules/xine/emotion_xine_vo_out.c
+++ b/legacy/emotion/src/modules/xine/emotion_xine_vo_out.c
@@ -115,7 +115,7 @@ _emotion_class_init(xine_t *xine, void *visual __UNUSED__)
115{ 115{
116 Emotion_Class *cl; 116 Emotion_Class *cl;
117 117
118// printf("emotion: _emotion_class_init()\n"); 118// DBG("");
119 cl = (Emotion_Class *) malloc(sizeof(Emotion_Class)); 119 cl = (Emotion_Class *) malloc(sizeof(Emotion_Class));
120 if (!cl) return NULL; 120 if (!cl) return NULL;
121 cl->driver_class.open_plugin = _emotion_open; 121 cl->driver_class.open_plugin = _emotion_open;
@@ -158,7 +158,7 @@ _emotion_open(video_driver_class_t *driver_class, const void *visual)
158 158
159 cl = (Emotion_Class *)driver_class; 159 cl = (Emotion_Class *)driver_class;
160 /* visual here is the data ptr passed to xine_open_video_driver() */ 160 /* visual here is the data ptr passed to xine_open_video_driver() */
161// printf("emotion: _emotion_open()\n"); 161// DBG("");
162 dv = (Emotion_Driver *)malloc(sizeof(Emotion_Driver)); 162 dv = (Emotion_Driver *)malloc(sizeof(Emotion_Driver));
163 if (!dv) return NULL; 163 if (!dv) return NULL;
164 164
@@ -180,7 +180,7 @@ _emotion_open(video_driver_class_t *driver_class, const void *visual)
180 dv->vo_driver.redraw_needed = _emotion_redraw; 180 dv->vo_driver.redraw_needed = _emotion_redraw;
181 dv->ev = (Emotion_Xine_Video *)visual; 181 dv->ev = (Emotion_Xine_Video *)visual;
182 dv->ev->have_vo = 1; 182 dv->ev->have_vo = 1;
183 printf("emotion: _emotion_open = %p\n", &dv->vo_driver); 183 DBG("vo_driver = %p", &dv->vo_driver);
184 return &dv->vo_driver; 184 return &dv->vo_driver;
185} 185}
186 186
@@ -191,7 +191,7 @@ _emotion_dispose(vo_driver_t *vo_driver)
191 191
192 dv = (Emotion_Driver *)vo_driver; 192 dv = (Emotion_Driver *)vo_driver;
193 dv->ev->have_vo = 0; 193 dv->ev->have_vo = 0;
194 printf("emotion: _emotion_dispose(%p)\n", dv); 194 DBG("vo_driver = %p", dv);
195 free(dv); 195 free(dv);
196} 196}
197 197
@@ -199,7 +199,7 @@ _emotion_dispose(vo_driver_t *vo_driver)
199static int 199static int
200_emotion_redraw(vo_driver_t *vo_driver __UNUSED__) 200_emotion_redraw(vo_driver_t *vo_driver __UNUSED__)
201{ 201{
202// printf("emotion: _emotion_redraw()\n"); 202// DBG("");
203 return 0; 203 return 0;
204} 204}
205 205
@@ -207,7 +207,7 @@ _emotion_redraw(vo_driver_t *vo_driver __UNUSED__)
207static uint32_t 207static uint32_t
208_emotion_capabilities_get(vo_driver_t *vo_driver __UNUSED__) 208_emotion_capabilities_get(vo_driver_t *vo_driver __UNUSED__)
209{ 209{
210// printf("emotion: _emotion_capabilities_get()\n"); 210// DBG("");
211 return VO_CAP_YV12 | VO_CAP_YUY2; 211 return VO_CAP_YV12 | VO_CAP_YUY2;
212} 212}
213 213
@@ -215,7 +215,7 @@ _emotion_capabilities_get(vo_driver_t *vo_driver __UNUSED__)
215static int 215static int
216_emotion_gui_data_exchange(vo_driver_t *vo_driver __UNUSED__, int data_type, void *data __UNUSED__) 216_emotion_gui_data_exchange(vo_driver_t *vo_driver __UNUSED__, int data_type, void *data __UNUSED__)
217{ 217{
218// printf("emotion: _emotion_gui_data_exchange()\n"); 218// DBG("");
219 switch (data_type) 219 switch (data_type)
220 { 220 {
221 case XINE_GUI_SEND_COMPLETION_EVENT: 221 case XINE_GUI_SEND_COMPLETION_EVENT:
@@ -243,13 +243,13 @@ _emotion_property_set(vo_driver_t *vo_driver, int property, int value)
243 Emotion_Driver *dv; 243 Emotion_Driver *dv;
244 244
245 dv = (Emotion_Driver *)vo_driver; 245 dv = (Emotion_Driver *)vo_driver;
246// printf("emotion: _emotion_property_set()\n"); 246// DBG("");
247 switch (property) 247 switch (property)
248 { 248 {
249 case VO_PROP_ASPECT_RATIO: 249 case VO_PROP_ASPECT_RATIO:
250 if (value >= XINE_VO_ASPECT_NUM_RATIOS) 250 if (value >= XINE_VO_ASPECT_NUM_RATIOS)
251 value = XINE_VO_ASPECT_AUTO; 251 value = XINE_VO_ASPECT_AUTO;
252// printf("DRIVER RATIO SET %i!\n", value); 252// DBG("DRIVER RATIO SET %i!", value);
253 dv->ratio = value; 253 dv->ratio = value;
254 break; 254 break;
255 default: 255 default:
@@ -264,7 +264,7 @@ _emotion_property_get(vo_driver_t *vo_driver, int property)
264 Emotion_Driver *dv; 264 Emotion_Driver *dv;
265 265
266 dv = (Emotion_Driver *)vo_driver; 266 dv = (Emotion_Driver *)vo_driver;
267// printf("emotion: _emotion_property_get()\n"); 267// DBG("");
268 switch (property) 268 switch (property)
269 { 269 {
270 case VO_PROP_ASPECT_RATIO: 270 case VO_PROP_ASPECT_RATIO:
@@ -279,7 +279,7 @@ _emotion_property_get(vo_driver_t *vo_driver, int property)
279static void 279static void
280_emotion_property_min_max_get(vo_driver_t *vo_driver __UNUSED__, int property __UNUSED__, int *min, int *max) 280_emotion_property_min_max_get(vo_driver_t *vo_driver __UNUSED__, int property __UNUSED__, int *min, int *max)
281{ 281{
282// printf("emotion: _emotion_property_min_max_get()\n"); 282// DBG("");
283 *min = 0; 283 *min = 0;
284 *max = 0; 284 *max = 0;
285} 285}
@@ -290,7 +290,7 @@ _emotion_frame_alloc(vo_driver_t *vo_driver __UNUSED__)
290{ 290{
291 Emotion_Frame *fr; 291 Emotion_Frame *fr;
292 292
293// printf("emotion: _emotion_frame_alloc()\n"); 293// DBG("");
294 fr = (Emotion_Frame *)calloc(1, sizeof(Emotion_Frame)); 294 fr = (Emotion_Frame *)calloc(1, sizeof(Emotion_Frame));
295 if (!fr) return NULL; 295 if (!fr) return NULL;
296 296
@@ -313,7 +313,7 @@ _emotion_frame_dispose(vo_frame_t *vo_frame)
313 Emotion_Frame *fr; 313 Emotion_Frame *fr;
314 314
315 fr = (Emotion_Frame *)vo_frame; 315 fr = (Emotion_Frame *)vo_frame;
316// printf("emotion: _emotion_frame_dispose()\n"); 316// DBG("");
317 _emotion_frame_data_free(fr); 317 _emotion_frame_data_free(fr);
318 free(fr); 318 free(fr);
319} 319}
@@ -330,7 +330,7 @@ _emotion_frame_format_update(vo_driver_t *vo_driver, vo_frame_t *vo_frame, uint3
330 if ((fr->width != width) || (fr->height != height) || 330 if ((fr->width != width) || (fr->height != height) ||
331 (fr->format != format) || (!fr->vo_frame.base[0])) 331 (fr->format != format) || (!fr->vo_frame.base[0]))
332 { 332 {
333// printf("emotion: _emotion_frame_format_update()\n"); 333// DBG("");
334 _emotion_frame_data_free(fr); 334 _emotion_frame_data_free(fr);
335 335
336 fr->width = width; 336 fr->width = width;
@@ -417,8 +417,7 @@ _emotion_frame_display(vo_driver_t *vo_driver, vo_frame_t *vo_frame)
417 417
418 dv = (Emotion_Driver *)vo_driver; 418 dv = (Emotion_Driver *)vo_driver;
419 fr = (Emotion_Frame *)vo_frame; 419 fr = (Emotion_Frame *)vo_frame;
420// printf("emotion: _emotion_frame_display()\n"); 420// DBG("fq %i %p", dv->ev->fq, dv->ev);
421// printf("EX VO: fq %i %p\n", dv->ev->fq, dv->ev);
422// if my frame queue is too deep ( > 4 frames) simply block and wait for them 421// if my frame queue is too deep ( > 4 frames) simply block and wait for them
423// to drain 422// to drain
424// while (dv->ev->fq > 4) usleep(1); 423// while (dv->ev->fq > 4) usleep(1);
@@ -436,9 +435,9 @@ _emotion_frame_display(vo_driver_t *vo_driver, vo_frame_t *vo_frame)
436 fr->frame.timestamp = (double)fr->vo_frame.vpts / 90000.0; 435 fr->frame.timestamp = (double)fr->vo_frame.vpts / 90000.0;
437 fr->frame.done_func = _emotion_frame_data_unlock; 436 fr->frame.done_func = _emotion_frame_data_unlock;
438 fr->frame.done_data = fr; 437 fr->frame.done_data = fr;
439// printf("FRAME FOR %p\n", dv->ev); 438// DBG("FRAME FOR %p", dv->ev);
440 write(dv->ev->fd_write, &buf, sizeof(void *)); 439 write(dv->ev->fd_write, &buf, sizeof(void *));
441// printf("-- FRAME DEC %p == %i\n", fr->frame.obj, ret); 440// DBG("-- FRAME DEC %p == %i", fr->frame.obj, ret);
442 fr->in_use = 1; 441 fr->in_use = 1;
443 dv->ev->fq++; 442 dv->ev->fq++;
444 } 443 }
@@ -449,7 +448,7 @@ _emotion_frame_display(vo_driver_t *vo_driver, vo_frame_t *vo_frame)
449static void 448static void
450_emotion_frame_field(vo_frame_t *vo_frame __UNUSED__, int which_field __UNUSED__) 449_emotion_frame_field(vo_frame_t *vo_frame __UNUSED__, int which_field __UNUSED__)
451{ 450{
452// printf("emotion: _emotion_frame_field()\n"); 451// DBG("");
453} 452}
454 453
455/***************************************************************************/ 454/***************************************************************************/
@@ -476,7 +475,7 @@ _emotion_frame_data_free(Emotion_Frame *fr)
476static void 475static void
477_emotion_frame_data_unlock(Emotion_Frame *fr) 476_emotion_frame_data_unlock(Emotion_Frame *fr)
478{ 477{
479// printf("emotion: _emotion_frame_data_unlock()\n"); 478// DBG("");
480 if (fr->in_use) 479 if (fr->in_use)
481 { 480 {
482 fr->vo_frame.free(&fr->vo_frame); 481 fr->vo_frame.free(&fr->vo_frame);
@@ -488,13 +487,13 @@ _emotion_frame_data_unlock(Emotion_Frame *fr)
488static void 487static void
489_emotion_overlay_begin(vo_driver_t *vo_driver __UNUSED__, vo_frame_t *vo_frame __UNUSED__, int changed __UNUSED__) 488_emotion_overlay_begin(vo_driver_t *vo_driver __UNUSED__, vo_frame_t *vo_frame __UNUSED__, int changed __UNUSED__)
490{ 489{
491// printf("emotion: _emotion_overlay_begin()\n"); 490// DBG("");
492} 491}
493 492
494static void 493static void
495_emotion_overlay_end(vo_driver_t *vo_driver __UNUSED__, vo_frame_t *vo_frame __UNUSED__) 494_emotion_overlay_end(vo_driver_t *vo_driver __UNUSED__, vo_frame_t *vo_frame __UNUSED__)
496{ 495{
497// printf("emotion: _emotion_overlay_end()\n"); 496// DBG("");
498} 497}
499 498
500static void 499static void
@@ -503,7 +502,7 @@ _emotion_overlay_blend(vo_driver_t *vo_driver __UNUSED__, vo_frame_t *vo_frame,
503 Emotion_Frame *fr; 502 Emotion_Frame *fr;
504 503
505 fr = (Emotion_Frame *)vo_frame; 504 fr = (Emotion_Frame *)vo_frame;
506// printf("emotion: _emotion_overlay_blend()\n"); 505// DBG("");
507 _emotion_overlay_blend_yuv(fr->vo_frame.base, vo_overlay, 506 _emotion_overlay_blend_yuv(fr->vo_frame.base, vo_overlay,
508 fr->width, fr->height, 507 fr->width, fr->height,
509 fr->vo_frame.pitches); 508 fr->vo_frame.pitches);