14 #include "emotion_private.h"
15 #include "emotion_generic.h"
17 static Eina_Prefix *pfx = NULL;
19 static int _emotion_generic_log_domain = -1;
20 #define DBG(...) EINA_LOG_DOM_DBG(_emotion_generic_log_domain, __VA_ARGS__)
21 #define INF(...) EINA_LOG_DOM_INFO(_emotion_generic_log_domain, __VA_ARGS__)
22 #define WRN(...) EINA_LOG_DOM_WARN(_emotion_generic_log_domain, __VA_ARGS__)
23 #define ERR(...) EINA_LOG_DOM_ERR(_emotion_generic_log_domain, __VA_ARGS__)
24 #define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_generic_log_domain, __VA_ARGS__)
27 struct _default_players {
32 static struct _default_players players[] = {
33 #ifdef EMOTION_BUILD_VLC
34 { "vlc", "em_generic_vlc" },
40 _get_player(const char *name)
42 const char *selected_name = NULL;
43 const char *libdir = eina_prefix_lib_get(pfx);
44 static char buf[PATH_MAX];
49 for (i = 0; players[i].name; i++)
51 if (!strcmp(players[i].name, name))
53 selected_name = players[i].cmdline;
59 if ((!selected_name) && (name))
66 if (selected_name[0] == '/') cmd = selected_name;
69 snprintf(buf, sizeof(buf), "%s/emotion/utils/%s",
70 libdir, selected_name);
74 DBG("Try generic player '%s'", cmd);
75 if (access(cmd, R_OK | X_OK) == 0)
77 INF("Using generic player '%s'", cmd);
82 for (i = 0; players[i].name; i++)
84 snprintf(buf, sizeof(buf), "%s/emotion/utils/%s",
85 libdir, players[i].cmdline);
86 DBG("Try generic player '%s'", buf);
87 if (access(buf, R_OK | X_OK) == 0)
89 INF("Using fallback player '%s'", buf);
94 ERR("no generic player found, given name='%s'", name ? name : "");
99 _player_send_cmd(Emotion_Generic_Video *ev, int cmd)
101 if (cmd >= EM_CMD_LAST)
103 ERR("invalid command to player.");
106 ecore_exe_send(ev->player.exe, &cmd, sizeof(cmd));
110 _player_send_int(Emotion_Generic_Video *ev, int number)
112 ecore_exe_send(ev->player.exe, &number, sizeof(number));
116 _player_send_float(Emotion_Generic_Video *ev, float number)
118 ecore_exe_send(ev->player.exe, &number, sizeof(number));
122 _player_send_str(Emotion_Generic_Video *ev, const char *str, Eina_Bool stringshared)
127 len = eina_stringshare_strlen(str) + 1;
129 len = strlen(str) + 1;
130 ecore_exe_send(ev->player.exe, &len, sizeof(len));
131 ecore_exe_send(ev->player.exe, str, len);
135 _create_shm_data(Emotion_Generic_Video *ev, const char *shmname)
140 Emotion_Generic_Video_Shared *vs;
142 shmfd = shm_open(shmname, O_CREAT | O_RDWR | O_TRUNC, 0777);
143 size = 3 * (ev->w * ev->h * DEFAULTPITCH) + sizeof(*vs);
145 npages = (int)(size / getpagesize()) + 1;
146 size = npages * getpagesize();
148 if (ftruncate(shmfd, size))
150 ERR("error when allocating shared memory (size = %zd): "
151 "%s", size, strerror(errno));
154 vs = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, shmfd, 0);
155 if (vs == MAP_FAILED)
157 ERR("error when mapping shared memory.\n");
164 vs->pitch = DEFAULTPITCH;
165 vs->frame.emotion = 0;
166 vs->frame.player = 1;
169 sem_init(&vs->lock, 1, 1);
170 ev->frame.frames[0] = (unsigned char *)vs + sizeof(*vs);
171 ev->frame.frames[1] = (unsigned char *)vs + sizeof(*vs) + vs->height * vs->width * vs->pitch;
172 ev->frame.frames[2] = (unsigned char *)vs + sizeof(*vs) + 2 * vs->height * vs->width * vs->pitch;
175 munmap(ev->shared, ev->shared->size);
182 _player_new_frame(Emotion_Generic_Video *ev)
185 _emotion_frame_new(ev->obj);
189 _player_file_set_done(Emotion_Generic_Video *ev)
191 if (!_create_shm_data(ev, ev->shmname))
193 ERR("could not create shared memory.");
196 _player_send_cmd(ev, EM_CMD_FILE_SET_DONE);
200 _file_open(Emotion_Generic_Video *ev)
202 INF("Opening file: %s", ev->filename);
203 ev->w = DEFAULTWIDTH;
204 ev->h = DEFAULTHEIGHT;
205 ev->ratio = (double)DEFAULTWIDTH / DEFAULTHEIGHT;
212 _player_send_cmd(ev, EM_CMD_FILE_SET);
213 _player_send_str(ev, ev->filename, EINA_TRUE);
217 _player_ready(Emotion_Generic_Video *ev)
219 INF("received: player ready.");
221 ev->initializing = EINA_FALSE;
222 ev->ready = EINA_TRUE;
230 #define RCV_CMD_PARAM(src, param) \
231 memcpy(&(param), (src), sizeof((param))); \
232 (src) = (char *)(src) + sizeof((param));
234 #define RCV_CMD_STR(src, buf, len) \
235 RCV_CMD_PARAM((src), (len)); \
236 memcpy((buf), (src), (len)); \
237 (src) = (char *)(src) + len;
240 _player_int_read(Emotion_Generic_Video *ev __UNUSED__, void **data)
243 memcpy(&number, *data, sizeof(number));
244 *data = (char *)(*data) + sizeof(number);
250 _player_frame_resize(Emotion_Generic_Video *ev, void *line)
253 RCV_CMD_PARAM(line, w);
254 RCV_CMD_PARAM(line, h);
256 INF("received frame resize: %dx%d", w, h);
259 ev->ratio = (float)w / h;
264 _emotion_frame_resize(ev->obj, ev->w, ev->h, ev->ratio);
268 _player_length_changed(Emotion_Generic_Video *ev, void *line)
271 RCV_CMD_PARAM(line, length);
273 INF("received length changed: %0.3f", length);
276 _emotion_video_pos_update(ev->obj, ev->pos, ev->len);
280 _player_position_changed(Emotion_Generic_Video *ev, void *line)
283 RCV_CMD_PARAM(line, position);
285 INF("received position changed: %0.3f", position);
288 _emotion_video_pos_update(ev->obj, ev->pos, ev->len);
293 float progress = ev->pos / ev->len;
295 snprintf(buf, sizeof(buf), "%0.1f%%", progress * 100);
297 _emotion_progress_set(ev->obj, buf, progress);
301 _player_seekable_changed(Emotion_Generic_Video *ev, void *line)
304 RCV_CMD_PARAM(line, seekable);
306 INF("received seekable changed: %d", seekable);
308 seekable = !!seekable;
310 ev->seekable = seekable;
314 _player_volume(Emotion_Generic_Video *ev, void *line)
317 RCV_CMD_PARAM(line, vol);
319 INF("received volume: %0.3f", vol);
323 if (vol != oldvol && !ev->opening)
324 _emotion_audio_level_change(ev->obj);
328 _player_audio_mute(Emotion_Generic_Video *ev, void *line)
331 RCV_CMD_PARAM(line, mute);
333 INF("received audio mute: %d", mute);
335 ev->audio_mute = !!mute;
339 _audio_channels_free(Emotion_Generic_Video *ev)
342 for (i = 0; i < ev->audio_channels_count; i++)
343 eina_stringshare_del(ev->audio_channels[i].name);
344 free(ev->audio_channels);
345 ev->audio_channels_count = 0;
349 _player_audio_tracks_info(Emotion_Generic_Video *ev, void *line)
351 int track_current, tracks_count;
354 if (ev->audio_channels_count)
355 _audio_channels_free(ev);
357 RCV_CMD_PARAM(line, track_current);
358 RCV_CMD_PARAM(line, tracks_count);
359 INF("video with %d audio tracks (current = %d):", tracks_count, track_current);
360 ev->audio_channels = calloc(
361 tracks_count, sizeof(Emotion_Generic_Audio_Channel));
362 ev->audio_channels_count = tracks_count;
363 ev->audio_channel_current = track_current;
364 for (i = 0; i < tracks_count; i++)
368 RCV_CMD_PARAM(line, tid);
369 RCV_CMD_STR(line, buf, len);
370 ev->audio_channels[i].id = tid;
371 ev->audio_channels[i].name = eina_stringshare_add_length(buf, len);
372 INF("\t%d: %s", tid, buf);
377 _player_file_closed(Emotion_Generic_Video *ev)
379 INF("Closed previous file.");
380 sem_destroy(&ev->shared->lock);
382 ev->closing = EINA_FALSE;
389 _player_open_done(Emotion_Generic_Video *ev)
391 ev->opening = EINA_FALSE;
392 shm_unlink(ev->shmname);
393 _emotion_open_done(ev->obj);
397 _player_send_cmd(ev, EM_CMD_PLAY);
398 _player_send_float(ev, ev->pos);
405 _player_read_cmd(Emotion_Generic_Video *ev, void *line, int size __UNUSED__)
408 RCV_CMD_PARAM(line, type);
414 case EM_RESULT_FRAME_NEW:
415 _player_new_frame(ev);
417 case EM_RESULT_FILE_SET:
418 _player_file_set_done(ev);
420 case EM_RESULT_FILE_SET_DONE:
421 _player_open_done(ev);
423 case EM_RESULT_FILE_CLOSE:
424 _player_file_closed(ev);
426 case EM_RESULT_PLAYBACK_STOPPED:
427 _emotion_playback_finished(ev->obj);
429 case EM_RESULT_FRAME_SIZE:
430 _player_frame_resize(ev, line);
432 case EM_RESULT_LENGTH_CHANGED:
433 _player_length_changed(ev, line);
435 case EM_RESULT_POSITION_CHANGED:
436 _player_position_changed(ev, line);
438 case EM_RESULT_SEEKABLE_CHANGED:
439 _player_seekable_changed(ev, line);
441 case EM_RESULT_AUDIO_TRACK_INFO:
442 _player_audio_tracks_info(ev, line);
445 WRN("received wrong command: %d", type);
452 _player_data_cb(void *data, int type __UNUSED__, void *event)
454 Ecore_Exe_Event_Data *ev = event;
455 Emotion_Generic_Video *evideo = data;
458 if (ev->exe != evideo->player.exe)
460 ERR("slave != ev->exe");
461 return ECORE_CALLBACK_DONE;
466 ERR("invalid command: missing bytes.");
467 return ECORE_CALLBACK_DONE;
470 for (i = 0; ev->lines[i].line; i++)
471 _player_read_cmd(evideo, ev->lines[i].line, ev->lines[i].size);
473 return ECORE_CALLBACK_DONE;
477 _player_add_cb(void *data, int type __UNUSED__, void *event)
479 Ecore_Exe_Event_Add *event_add = event;
480 Ecore_Exe *player = event_add->exe;
481 Emotion_Generic_Video *ev = data;
483 if (ev->player.exe != player)
485 ERR("ev->player != player.");
486 return ECORE_CALLBACK_DONE;
489 _player_send_cmd(ev, EM_CMD_INIT);
490 _player_send_str(ev, ev->shmname, EINA_TRUE);
492 return ECORE_CALLBACK_DONE;
496 _player_del_cb(void *data, int type __UNUSED__, void *event __UNUSED__)
498 Emotion_Generic_Video *ev = data;
501 ev->player.exe = NULL;
502 ev->ready = EINA_FALSE;
503 _emotion_decode_stop(ev->obj);
505 return ECORE_CALLBACK_DONE;
509 _fork_and_exec(Evas_Object *obj __UNUSED__, Emotion_Generic_Video *ev)
514 gettimeofday(&tv, NULL);
515 snprintf(shmname, sizeof(shmname), "/em-generic-shm_%d_%d",
516 (int)tv.tv_sec, (int)tv.tv_usec);
518 ev->shmname = eina_stringshare_add(shmname);
520 ev->player_add = ecore_event_handler_add(
521 ECORE_EXE_EVENT_ADD, _player_add_cb, ev);
522 ev->player_del = ecore_event_handler_add(
523 ECORE_EXE_EVENT_DEL, _player_del_cb, ev);
524 ev->player_data = ecore_event_handler_add(
525 ECORE_EXE_EVENT_DATA, _player_data_cb, ev);
527 ev->player.exe = ecore_exe_pipe_run(
529 ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE |
530 ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_NOT_LEADER,
535 ERR("could not start player.");
539 ev->initializing = EINA_TRUE;
545 em_init(Evas_Object *obj, void **emotion_video, Emotion_Module_Options *opt)
547 Emotion_Generic_Video *ev;
550 if (!emotion_video) return 0;
551 player = _get_player(opt ? opt->player : NULL);
552 if (!player) return 0;
554 ev = (Emotion_Generic_Video *)calloc(1, sizeof(*ev));
559 ev->audio_mute = EINA_FALSE;
562 ev->cmdline = eina_stringshare_add(player);
565 return _fork_and_exec(obj, ev);
569 em_shutdown(void *data)
571 Emotion_Generic_Video *ev = data;
577 ecore_exe_terminate(ev->player.exe);
578 ecore_exe_free(ev->player.exe);
579 ev->player.exe = NULL;
583 munmap(ev->shared, ev->shared->size);
585 _audio_channels_free(ev);
587 eina_stringshare_del(ev->cmdline);
588 eina_stringshare_del(ev->shmname);
590 ecore_event_handler_del(ev->player_add);
591 ecore_event_handler_del(ev->player_data);
592 ecore_event_handler_del(ev->player_del);
598 em_file_open(const char *file, Evas_Object *obj __UNUSED__, void *data)
600 Emotion_Generic_Video *ev = data;
601 INF("file set: %s", file);
605 ev->opening = EINA_TRUE;
607 eina_stringshare_replace(&ev->filename, file);
616 em_file_close(void *data)
618 Emotion_Generic_Video *ev = data;
621 INF("file close: %s", ev->filename);
626 _player_send_cmd(ev, EM_CMD_FILE_CLOSE);
627 ev->closing = EINA_TRUE;
630 static Emotion_Format
631 em_format_get(void *ef __UNUSED__)
633 return EMOTION_FORMAT_BGRA;
637 em_video_data_size_get(void *data, int *w, int *h)
639 Emotion_Generic_Video *ev = data;
647 em_play(void *data, double pos)
649 Emotion_Generic_Video *ev = data;
654 ev->play = EINA_TRUE;
655 INF("play: %0.3f", pos);
657 if (ev->initializing || ev->opening)
662 _player_send_cmd(ev, EM_CMD_PLAY);
663 _player_send_float(ev, ev->pos);
667 ev->player.exe = ecore_exe_pipe_run(
669 ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE |
670 ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_NOT_LEADER,
674 ERR("could not start player.");
680 Emotion_Generic_Video *ev = data;
685 ev->play = EINA_FALSE;
690 _player_send_cmd(ev, EM_CMD_STOP);
691 _emotion_decode_stop(ev->obj);
695 em_size_get(void *data, int *w, int *h)
697 Emotion_Generic_Video *ev = data;
703 em_pos_set(void *data, double pos)
705 Emotion_Generic_Video *ev = data;
706 float position = pos;
707 _player_send_cmd(ev, EM_CMD_POSITION_SET);
708 _player_send_float(ev, position);
709 _emotion_seek_done(ev->obj);
713 em_len_get(void *data)
715 Emotion_Generic_Video *ev = data;
720 em_fps_num_get(void *data)
722 Emotion_Generic_Video *ev = data;
723 return (int)(ev->fps * 1000.0);
727 em_fps_den_get(void *ef __UNUSED__)
733 em_fps_get(void *data)
735 Emotion_Generic_Video *ev = data;
740 em_pos_get(void *data)
742 Emotion_Generic_Video *ev = data;
747 em_vis_set(void *ef __UNUSED__, Emotion_Vis vis __UNUSED__)
752 em_vis_get(void *data)
754 Emotion_Generic_Video *ev = data;
759 em_vis_supported(void *ef __UNUSED__, Emotion_Vis vis __UNUSED__)
765 em_ratio_get(void *data)
767 Emotion_Generic_Video *ev = data;
771 static int em_video_handled(void *ef __UNUSED__)
773 fprintf(stderr, "video handled!\n");
777 static int em_audio_handled(void *ef __UNUSED__)
779 fprintf(stderr, "audio handled!\n");
783 static int em_seekable(void *data)
785 Emotion_Generic_Video *ev = data;
789 static void em_frame_done(void *ef __UNUSED__)
794 em_yuv_rows_get(void *data __UNUSED__, int w __UNUSED__, int h __UNUSED__, unsigned char **yrows __UNUSED__, unsigned char **urows __UNUSED__, unsigned char **vrows __UNUSED__)
800 em_bgra_data_get(void *data, unsigned char **bgra_data)
802 Emotion_Generic_Video *ev = data;
804 if (!ev || ev->opening || ev->closing)
808 sem_wait(&ev->shared->lock);
810 // send current frame to emotion
811 if (ev->shared->frame.emotion != ev->shared->frame.last)
813 ev->shared->frame.next = ev->shared->frame.emotion;
814 ev->shared->frame.emotion = ev->shared->frame.last;
816 *bgra_data = ev->frame.frames[ev->shared->frame.emotion];
819 sem_post(&ev->shared->lock);
826 em_event_feed(void *ef __UNUSED__, int event __UNUSED__)
831 em_event_mouse_button_feed(void *ef __UNUSED__, int button __UNUSED__, int x __UNUSED__, int y __UNUSED__)
836 em_event_mouse_move_feed(void *ef __UNUSED__, int x __UNUSED__, int y __UNUSED__)
841 em_video_channel_count(void *ef __UNUSED__)
848 em_video_channel_set(void *ef __UNUSED__, int channel __UNUSED__)
853 em_video_channel_get(void *ef __UNUSED__)
859 em_video_channel_name_get(void *ef __UNUSED__, int channel __UNUSED__)
865 em_video_channel_mute_set(void *ef __UNUSED__, int mute __UNUSED__)
870 em_video_channel_mute_get(void *data)
872 Emotion_Generic_Video *ev = data;
873 return ev->video_mute;
877 em_audio_channel_count(void *data)
879 Emotion_Generic_Video *ev = data;
880 return ev->audio_channels_count;
884 em_audio_channel_set(void *data, int channel)
886 Emotion_Generic_Video *ev = data;
889 for (i = 0; i < ev->audio_channels_count; i++)
891 if (ev->audio_channels[i].id == channel)
893 _player_send_cmd(ev, EM_CMD_AUDIO_TRACK_SET);
894 _player_send_int(ev, channel);
901 em_audio_channel_get(void *data)
903 Emotion_Generic_Video *ev = data;
904 return ev->audio_channel_current;
908 em_audio_channel_name_get(void *data, int channel)
910 Emotion_Generic_Video *ev = data;
913 for (i = 0; i < ev->audio_channels_count; i++)
915 if (ev->audio_channels[i].id == channel)
916 return ev->audio_channels[i].name;
923 em_audio_channel_mute_set(void *data, int mute)
925 Emotion_Generic_Video *ev = data;
926 _player_send_cmd(ev, EM_CMD_AUDIO_MUTE_SET);
927 _player_send_int(ev, mute);
928 ev->audio_mute = !!mute;
932 em_audio_channel_mute_get(void *data)
934 Emotion_Generic_Video *ev = data;
935 return ev->audio_mute;
939 em_audio_channel_volume_set(void *data, double vol)
941 Emotion_Generic_Video *ev = data;
944 if (vol > 1.0) vol = 1.0;
945 if (vol < 0.0) vol = 0.0;
948 _player_send_cmd(ev, EM_CMD_VOLUME_SET);
949 _player_send_float(ev, fvol);
955 em_audio_channel_volume_get(void *data)
957 Emotion_Generic_Video *ev = data;
962 em_spu_channel_count(void *ef __UNUSED__)
968 em_spu_channel_set(void *ef __UNUSED__, int channel __UNUSED__)
973 em_spu_channel_get(void *ef __UNUSED__)
980 em_spu_channel_name_get(void *ef __UNUSED__, int channel __UNUSED__)
986 em_spu_channel_mute_set(void *ef __UNUSED__, int mute __UNUSED__)
992 em_spu_channel_mute_get(void *ef __UNUSED__)
998 em_chapter_count(void *ef __UNUSED__)
1005 em_chapter_set(void *ef __UNUSED__, int chapter __UNUSED__)
1010 em_chapter_get(void *ef __UNUSED__)
1017 em_chapter_name_get(void *ef __UNUSED__, int chapter __UNUSED__)
1023 em_speed_set(void *data, double speed)
1025 Emotion_Generic_Video *ev = data;
1028 _player_send_cmd(ev, EM_CMD_SPEED_SET);
1029 _player_send_float(ev, rate);
1035 em_speed_get(void *data)
1037 Emotion_Generic_Video *ev = data;
1038 return (double)ev->speed;
1042 em_eject(void *ef __UNUSED__)
1048 em_meta_get(void *ef __UNUSED__, int meta __UNUSED__)
1050 char * meta_data = NULL;
1054 static Emotion_Video_Module em_module =
1057 em_shutdown, /* shutdown */
1058 em_file_open, /* file_open */
1059 em_file_close, /* file_close */
1062 em_size_get, /* size_get */
1063 em_pos_set, /* pos_set */
1064 em_len_get, /* len_get */
1065 em_fps_num_get, /* fps_num_get */
1066 em_fps_den_get, /* fps_den_get */
1067 em_fps_get, /* fps_get */
1068 em_pos_get, /* pos_get */
1069 em_vis_set, /* vis_set */
1070 em_vis_get, /* vis_get */
1071 em_vis_supported, /* vis_supported */
1072 em_ratio_get, /* ratio_get */
1073 em_video_handled, /* video_handled */
1074 em_audio_handled, /* audio_handled */
1075 em_seekable, /* seekable */
1076 em_frame_done, /* frame_done */
1077 em_format_get, /* format_get */
1078 em_video_data_size_get, /* video_data_size_get */
1079 em_yuv_rows_get, /* yuv_rows_get */
1080 em_bgra_data_get, /* bgra_data_get */
1081 em_event_feed, /* event_feed */
1082 em_event_mouse_button_feed, /* event_mouse_button_feed */
1083 em_event_mouse_move_feed, /* event_mouse_move_feed */
1084 em_video_channel_count, /* video_channel_count */
1085 em_video_channel_set, /* video_channel_set */
1086 em_video_channel_get, /* video_channel_get */
1087 em_video_channel_name_get, /* video_channel_name_get */
1088 em_video_channel_mute_set, /* video_channel_mute_set */
1089 em_video_channel_mute_get, /* video_channel_mute_get */
1090 em_audio_channel_count, /* audio_channel_count */
1091 em_audio_channel_set, /* audio_channel_set */
1092 em_audio_channel_get, /* audio_channel_get */
1093 em_audio_channel_name_get, /* audio_channel_name_get */
1094 em_audio_channel_mute_set, /* audio_channel_mute_set */
1095 em_audio_channel_mute_get, /* audio_channel_mute_get */
1096 em_audio_channel_volume_set, /* audio_channel_volume_set */
1097 em_audio_channel_volume_get, /* audio_channel_volume_get */
1098 em_spu_channel_count, /* spu_channel_count */
1099 em_spu_channel_set, /* spu_channel_set */
1100 em_spu_channel_get, /* spu_channel_get */
1101 em_spu_channel_name_get, /* spu_channel_name_get */
1102 em_spu_channel_mute_set, /* spu_channel_mute_set */
1103 em_spu_channel_mute_get, /* spu_channel_mute_get */
1104 em_chapter_count, /* chapter_count */
1105 em_chapter_set, /* chapter_set */
1106 em_chapter_get, /* chapter_get */
1107 em_chapter_name_get, /* chapter_name_get */
1108 em_speed_set, /* speed_set */
1109 em_speed_get, /* speed_get */
1110 em_eject, /* eject */
1111 em_meta_get, /* meta_get */
1116 module_open(Evas_Object *obj, const Emotion_Video_Module **module, void **video, Emotion_Module_Options *opt)
1122 if (_emotion_generic_log_domain < 0)
1124 eina_threads_init();
1125 eina_log_threads_enable();
1126 _emotion_generic_log_domain = eina_log_domain_register
1127 ("emotion-generic", EINA_COLOR_LIGHTCYAN);
1128 if (_emotion_generic_log_domain < 0)
1130 EINA_LOG_CRIT("Could not register log domain 'emotion-generic'");
1136 if (!em_module.init(obj, video, opt)) {
1140 *module = &em_module;
1145 static void module_close(Emotion_Video_Module *module __UNUSED__, void *video)
1147 em_module.shutdown(video);
1152 generic_module_init(void)
1156 pfx = eina_prefix_new(NULL, emotion_object_add,
1157 "EMOTION", "emotion", NULL,
1162 if (!pfx) return EINA_FALSE;
1164 return _emotion_module_register("generic", module_open, module_close);
1168 generic_module_shutdown(void)
1172 eina_prefix_free(pfx);
1175 _emotion_module_unregister("generic");
1178 #ifndef EMOTION_STATIC_BUILD_GENERIC
1180 EINA_MODULE_INIT(generic_module_init);
1181 EINA_MODULE_SHUTDOWN(generic_module_shutdown);