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_GENERIC_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 write(ev->fd_write, &cmd, sizeof(cmd));
110 _player_send_int(Emotion_Generic_Video *ev, int number)
112 write(ev->fd_write, &number, sizeof(number));
116 _player_send_float(Emotion_Generic_Video *ev, float number)
118 write(ev->fd_write, &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 write(ev->fd_write, &len, sizeof(len));
131 write(ev->fd_write, 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);
145 ERR("player: could not open shm: %s", shmname);
146 ERR("player: %s", strerror(errno));
149 size = 3 * (ev->w * ev->h * DEFAULTPITCH) + sizeof(*vs);
151 npages = (int)(size / getpagesize()) + 1;
152 size = npages * getpagesize();
154 if (ftruncate(shmfd, size))
156 ERR("error when allocating shared memory (size = %zd): "
157 "%s", size, strerror(errno));
161 vs = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, shmfd, 0);
162 if (vs == MAP_FAILED)
164 ERR("error when mapping shared memory.\n");
171 vs->pitch = DEFAULTPITCH;
172 vs->frame.emotion = 0;
173 vs->frame.player = 1;
176 sem_init(&vs->lock, 1, 1);
177 ev->frame.frames[0] = (unsigned char *)vs + sizeof(*vs);
178 ev->frame.frames[1] = (unsigned char *)vs + sizeof(*vs) + vs->height * vs->width * vs->pitch;
179 ev->frame.frames[2] = (unsigned char *)vs + sizeof(*vs) + 2 * vs->height * vs->width * vs->pitch;
182 munmap(ev->shared, ev->shared->size);
189 _player_new_frame(Emotion_Generic_Video *ev)
192 _emotion_frame_new(ev->obj);
196 _file_open(Emotion_Generic_Video *ev)
198 INF("Opening file: %s", ev->filename);
199 ev->w = DEFAULTWIDTH;
200 ev->h = DEFAULTHEIGHT;
201 ev->ratio = (double)DEFAULTWIDTH / DEFAULTHEIGHT;
208 _player_send_cmd(ev, EM_CMD_FILE_SET);
209 _player_send_str(ev, ev->filename, EINA_TRUE);
213 _player_file_set_done(Emotion_Generic_Video *ev)
215 if (ev->file_changed)
218 ev->file_changed = EINA_FALSE;
222 if (!_create_shm_data(ev, ev->shmname))
224 ERR("could not create shared memory.");
227 _player_send_cmd(ev, EM_CMD_FILE_SET_DONE);
231 _player_ready(Emotion_Generic_Video *ev)
233 INF("received: player ready.");
235 ev->initializing = EINA_FALSE;
236 ev->ready = EINA_TRUE;
245 _em_read_safe(int fd, void *buf, ssize_t size)
257 r = read(fd, p, todo);
267 if (errno == EINTR || errno == EAGAIN)
271 ERR("could not read from fd %d: %s", fd, strerror(errno));
281 _player_int_read(Emotion_Generic_Video *ev, int *i)
284 n = _em_read_safe(ev->fd_read, i, sizeof(*i));
287 ERR("could not read int from fd_read %d\n", ev->fd_read);
295 _player_float_read(Emotion_Generic_Video *ev, float *f)
298 n = _em_read_safe(ev->fd_read, f, sizeof(*f));
301 ERR("could not read float from fd_read %d\n", ev->fd_read);
309 _player_str_read(Emotion_Generic_Video *ev, char *str, int *len)
313 if (!_player_int_read(ev, len))
316 n = _em_read_safe(ev->fd_read, str, *len);
319 ERR("could not read string from fd_read %d\n", ev->fd_read);
327 _player_frame_resize(Emotion_Generic_Video *ev)
330 _player_int_read(ev, &w);
331 _player_int_read(ev, &h);
333 INF("received frame resize: %dx%d", w, h);
336 ev->ratio = (float)w / h;
341 _emotion_frame_resize(ev->obj, ev->w, ev->h, ev->ratio);
345 _player_length_changed(Emotion_Generic_Video *ev)
348 _player_float_read(ev, &length);
350 INF("received length changed: %0.3f", length);
353 _emotion_video_pos_update(ev->obj, ev->pos, ev->len);
357 _player_position_changed(Emotion_Generic_Video *ev)
360 _player_float_read(ev, &position);
362 INF("received position changed: %0.3f", position);
365 _emotion_video_pos_update(ev->obj, ev->pos, ev->len);
370 float progress = ev->pos / ev->len;
372 snprintf(buf, sizeof(buf), "%0.1f%%", progress * 100);
374 _emotion_progress_set(ev->obj, buf, progress);
378 _player_seekable_changed(Emotion_Generic_Video *ev)
381 _player_int_read(ev, &seekable);
383 INF("received seekable changed: %d", seekable);
385 seekable = !!seekable;
387 ev->seekable = seekable;
391 _player_volume(Emotion_Generic_Video *ev)
394 _player_float_read(ev, &vol);
396 INF("received volume: %0.3f", vol);
400 if (vol != oldvol && !ev->opening)
401 _emotion_audio_level_change(ev->obj);
405 _player_audio_mute(Emotion_Generic_Video *ev)
408 _player_int_read(ev, &mute);
410 INF("received audio mute: %d", mute);
412 ev->audio_mute = !!mute;
416 _audio_channels_free(Emotion_Generic_Video *ev)
419 for (i = 0; i < ev->audio_channels_count; i++)
420 eina_stringshare_del(ev->audio_channels[i].name);
421 free(ev->audio_channels);
422 ev->audio_channels_count = 0;
426 _player_audio_tracks_info(Emotion_Generic_Video *ev)
428 int track_current, tracks_count;
431 if (ev->audio_channels_count)
432 _audio_channels_free(ev);
434 _player_int_read(ev, &track_current);
435 _player_int_read(ev, &tracks_count);
436 INF("video with %d audio tracks (current = %d):", tracks_count, track_current);
437 ev->audio_channels = calloc(
438 tracks_count, sizeof(Emotion_Generic_Audio_Channel));
439 ev->audio_channels_count = tracks_count;
440 ev->audio_channel_current = track_current;
441 for (i = 0; i < tracks_count; i++)
445 _player_int_read(ev, &tid);
446 _player_str_read(ev, buf, &len);
447 ev->audio_channels[i].id = tid;
448 ev->audio_channels[i].name = eina_stringshare_add_length(buf, len);
449 INF("\t%d: %s", tid, buf);
454 _player_file_closed(Emotion_Generic_Video *ev)
456 INF("Closed previous file.");
457 sem_destroy(&ev->shared->lock);
459 ev->closing = EINA_FALSE;
466 _player_open_done(Emotion_Generic_Video *ev)
470 _player_int_read(ev, &success);
471 shm_unlink(ev->shmname);
473 if (ev->file_changed)
476 ev->file_changed = EINA_FALSE;
480 ev->opening = EINA_FALSE;
483 ERR("Could not open file.");
487 _emotion_open_done(ev->obj);
491 _player_send_cmd(ev, EM_CMD_PLAY);
492 _player_send_float(ev, ev->pos);
499 _player_read_cmd(Emotion_Generic_Video *ev)
503 if (!_player_int_read(ev, &type))
505 ERR("could not read command\n");
513 case EM_RESULT_FRAME_NEW:
514 _player_new_frame(ev);
516 case EM_RESULT_FILE_SET:
517 _player_file_set_done(ev);
519 case EM_RESULT_FILE_SET_DONE:
520 _player_open_done(ev);
522 case EM_RESULT_FILE_CLOSE:
523 _player_file_closed(ev);
525 case EM_RESULT_PLAYBACK_STOPPED:
526 _emotion_playback_finished(ev->obj);
528 case EM_RESULT_FRAME_SIZE:
529 _player_frame_resize(ev);
531 case EM_RESULT_LENGTH_CHANGED:
532 _player_length_changed(ev);
534 case EM_RESULT_POSITION_CHANGED:
535 _player_position_changed(ev);
537 case EM_RESULT_SEEKABLE_CHANGED:
538 _player_seekable_changed(ev);
540 case EM_RESULT_AUDIO_TRACK_INFO:
541 _player_audio_tracks_info(ev);
544 WRN("received wrong command: %d", type);
549 _player_cmd_handler_cb(void *data, Ecore_Fd_Handler *fd_handler)
551 Emotion_Generic_Video *ev = data;
553 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR))
555 ERR("an error occurred on fd_read %d.", ev->fd_read);
556 return ECORE_CALLBACK_CANCEL;
559 _player_read_cmd(ev);
561 return ECORE_CALLBACK_RENEW;
565 _player_data_cb(void *data, int type __UNUSED__, void *event)
567 Ecore_Exe_Event_Data *ev = event;
568 Emotion_Generic_Video *evideo = data;
571 if (ev->exe != evideo->player.exe)
573 ERR("slave != ev->exe");
574 return ECORE_CALLBACK_DONE;
579 ERR("invalid command: missing bytes.");
580 return ECORE_CALLBACK_DONE;
583 for (i = 0; ev->lines[i].line; i++)
584 INF("received input from player: \"%s\"", ev->lines[i].line);
586 return ECORE_CALLBACK_DONE;
590 _player_add_cb(void *data, int type __UNUSED__, void *event)
592 Ecore_Exe_Event_Add *event_add = event;
593 Ecore_Exe *player = event_add->exe;
594 Emotion_Generic_Video *ev = data;
596 if (ev->player.exe != player)
598 ERR("ev->player != player.");
599 return ECORE_CALLBACK_DONE;
602 _player_send_cmd(ev, EM_CMD_INIT);
603 _player_send_str(ev, ev->shmname, EINA_TRUE);
605 return ECORE_CALLBACK_DONE;
609 _player_del_cb(void *data, int type __UNUSED__, void *event __UNUSED__)
611 Emotion_Generic_Video *ev = data;
614 ev->player.exe = NULL;
615 ev->ready = EINA_FALSE;
616 ecore_main_fd_handler_del(ev->fd_handler);
621 _emotion_decode_stop(ev->obj);
623 return ECORE_CALLBACK_DONE;
627 _player_exec(Emotion_Generic_Video *ev)
633 if (pipe(pipe_out) == -1)
635 ERR("could not create pipe for communication emotion -> player: %s", strerror(errno));
639 if (pipe(pipe_in) == -1)
641 ERR("could not create pipe for communication player -> emotion: %s", strerror(errno));
647 snprintf(buf, sizeof(buf), "%s %d %d\n", ev->cmdline, pipe_out[0], pipe_in[1]);
649 ev->player.exe = ecore_exe_pipe_run(
651 ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE |
652 ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_NOT_LEADER,
655 INF("created pipe emotion -> player: %d -> %d\n", pipe_out[1], pipe_out[0]);
656 INF("created pipe player -> emotion: %d -> %d\n", pipe_in[1], pipe_in[0]);
668 ev->fd_read = pipe_in[0];
669 ev->fd_write = pipe_out[1];
671 ev->fd_handler = ecore_main_fd_handler_add(
672 ev->fd_read, ECORE_FD_READ | ECORE_FD_ERROR, _player_cmd_handler_cb, ev,
679 _fork_and_exec(Evas_Object *obj, Emotion_Generic_Video *ev)
684 gettimeofday(&tv, NULL);
685 snprintf(shmname, sizeof(shmname), "/em-generic-shm_%d_%d",
686 (int)tv.tv_sec, (int)tv.tv_usec);
688 ev->shmname = eina_stringshare_add(shmname);
690 ev->player_add = ecore_event_handler_add(
691 ECORE_EXE_EVENT_ADD, _player_add_cb, ev);
692 ev->player_del = ecore_event_handler_add(
693 ECORE_EXE_EVENT_DEL, _player_del_cb, ev);
694 ev->player_data = ecore_event_handler_add(
695 ECORE_EXE_EVENT_DATA, _player_data_cb, ev);
698 if (!_player_exec(ev))
700 ERR("could not start player.");
704 ev->initializing = EINA_TRUE;
710 em_init(Evas_Object *obj, void **emotion_video, Emotion_Module_Options *opt)
712 Emotion_Generic_Video *ev;
715 if (!emotion_video) return 0;
716 player = _get_player(opt ? opt->player : NULL);
717 if (!player) return 0;
719 ev = (Emotion_Generic_Video *)calloc(1, sizeof(*ev));
726 ev->audio_mute = EINA_FALSE;
729 ev->cmdline = eina_stringshare_add(player);
732 return _fork_and_exec(obj, ev);
736 em_shutdown(void *data)
738 Emotion_Generic_Video *ev = data;
744 ecore_exe_terminate(ev->player.exe);
745 ecore_exe_free(ev->player.exe);
746 ev->player.exe = NULL;
750 munmap(ev->shared, ev->shared->size);
752 if (ev->fd_read >= 0)
754 if (ev->fd_write >= 0)
757 ecore_main_fd_handler_del(ev->fd_handler);
759 _audio_channels_free(ev);
761 eina_stringshare_del(ev->cmdline);
762 eina_stringshare_del(ev->shmname);
764 ecore_event_handler_del(ev->player_add);
765 ecore_event_handler_del(ev->player_data);
766 ecore_event_handler_del(ev->player_del);
772 em_file_open(const char *file, Evas_Object *obj __UNUSED__, void *data)
774 Emotion_Generic_Video *ev = data;
775 INF("file set: %s", file);
778 eina_stringshare_replace(&ev->filename, file);
782 if (ev->ready && ev->opening)
784 INF("file changed while opening.");
785 ev->file_changed = EINA_TRUE;
789 ev->opening = EINA_TRUE;
798 em_file_close(void *data)
800 Emotion_Generic_Video *ev = data;
803 INF("file close: %s", ev->filename);
811 _player_send_cmd(ev, EM_CMD_FILE_CLOSE);
812 ev->closing = EINA_TRUE;
815 static Emotion_Format
816 em_format_get(void *ef __UNUSED__)
818 return EMOTION_FORMAT_BGRA;
822 em_video_data_size_get(void *data, int *w, int *h)
824 Emotion_Generic_Video *ev = data;
832 em_play(void *data, double pos)
834 Emotion_Generic_Video *ev = data;
839 ev->play = EINA_TRUE;
840 INF("play: %0.3f", pos);
842 if (ev->initializing || ev->opening)
847 _player_send_cmd(ev, EM_CMD_PLAY);
848 _player_send_float(ev, ev->pos);
852 if (!_player_exec(ev))
853 ERR("could not start player.");
859 Emotion_Generic_Video *ev = data;
864 ev->play = EINA_FALSE;
869 _player_send_cmd(ev, EM_CMD_STOP);
870 _emotion_decode_stop(ev->obj);
874 em_size_get(void *data, int *w, int *h)
876 Emotion_Generic_Video *ev = data;
882 em_pos_set(void *data, double pos)
884 Emotion_Generic_Video *ev = data;
885 float position = pos;
886 _player_send_cmd(ev, EM_CMD_POSITION_SET);
887 _player_send_float(ev, position);
888 _emotion_seek_done(ev->obj);
892 em_len_get(void *data)
894 Emotion_Generic_Video *ev = data;
899 em_fps_num_get(void *data)
901 Emotion_Generic_Video *ev = data;
902 return (int)(ev->fps * 1000.0);
906 em_fps_den_get(void *ef __UNUSED__)
912 em_fps_get(void *data)
914 Emotion_Generic_Video *ev = data;
919 em_pos_get(void *data)
921 Emotion_Generic_Video *ev = data;
926 em_vis_set(void *ef __UNUSED__, Emotion_Vis vis __UNUSED__)
931 em_vis_get(void *data)
933 Emotion_Generic_Video *ev = data;
938 em_vis_supported(void *ef __UNUSED__, Emotion_Vis vis __UNUSED__)
944 em_ratio_get(void *data)
946 Emotion_Generic_Video *ev = data;
950 static int em_video_handled(void *ef __UNUSED__)
952 fprintf(stderr, "video handled!\n");
956 static int em_audio_handled(void *ef __UNUSED__)
958 fprintf(stderr, "audio handled!\n");
962 static int em_seekable(void *data)
964 Emotion_Generic_Video *ev = data;
968 static void em_frame_done(void *ef __UNUSED__)
973 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__)
979 em_bgra_data_get(void *data, unsigned char **bgra_data)
981 Emotion_Generic_Video *ev = data;
983 if (!ev || ev->opening || ev->closing)
987 sem_wait(&ev->shared->lock);
989 // send current frame to emotion
990 if (ev->shared->frame.emotion != ev->shared->frame.last)
992 ev->shared->frame.next = ev->shared->frame.emotion;
993 ev->shared->frame.emotion = ev->shared->frame.last;
995 *bgra_data = ev->frame.frames[ev->shared->frame.emotion];
998 sem_post(&ev->shared->lock);
1005 em_event_feed(void *ef __UNUSED__, int event __UNUSED__)
1010 em_event_mouse_button_feed(void *ef __UNUSED__, int button __UNUSED__, int x __UNUSED__, int y __UNUSED__)
1015 em_event_mouse_move_feed(void *ef __UNUSED__, int x __UNUSED__, int y __UNUSED__)
1020 em_video_channel_count(void *ef __UNUSED__)
1027 em_video_channel_set(void *ef __UNUSED__, int channel __UNUSED__)
1032 em_video_channel_get(void *ef __UNUSED__)
1038 em_video_channel_name_get(void *ef __UNUSED__, int channel __UNUSED__)
1044 em_video_channel_mute_set(void *ef __UNUSED__, int mute __UNUSED__)
1049 em_video_channel_mute_get(void *data)
1051 Emotion_Generic_Video *ev = data;
1052 return ev->video_mute;
1056 em_audio_channel_count(void *data)
1058 Emotion_Generic_Video *ev = data;
1059 return ev->audio_channels_count;
1063 em_audio_channel_set(void *data, int channel)
1065 Emotion_Generic_Video *ev = data;
1068 for (i = 0; i < ev->audio_channels_count; i++)
1070 if (ev->audio_channels[i].id == channel)
1072 _player_send_cmd(ev, EM_CMD_AUDIO_TRACK_SET);
1073 _player_send_int(ev, channel);
1080 em_audio_channel_get(void *data)
1082 Emotion_Generic_Video *ev = data;
1083 return ev->audio_channel_current;
1087 em_audio_channel_name_get(void *data, int channel)
1089 Emotion_Generic_Video *ev = data;
1092 for (i = 0; i < ev->audio_channels_count; i++)
1094 if (ev->audio_channels[i].id == channel)
1095 return ev->audio_channels[i].name;
1102 em_audio_channel_mute_set(void *data, int mute)
1104 Emotion_Generic_Video *ev = data;
1105 _player_send_cmd(ev, EM_CMD_AUDIO_MUTE_SET);
1106 _player_send_int(ev, mute);
1107 ev->audio_mute = !!mute;
1111 em_audio_channel_mute_get(void *data)
1113 Emotion_Generic_Video *ev = data;
1114 return ev->audio_mute;
1118 em_audio_channel_volume_set(void *data, double vol)
1120 Emotion_Generic_Video *ev = data;
1123 if (vol > 1.0) vol = 1.0;
1124 if (vol < 0.0) vol = 0.0;
1127 _player_send_cmd(ev, EM_CMD_VOLUME_SET);
1128 _player_send_float(ev, fvol);
1134 em_audio_channel_volume_get(void *data)
1136 Emotion_Generic_Video *ev = data;
1141 em_spu_channel_count(void *ef __UNUSED__)
1147 em_spu_channel_set(void *ef __UNUSED__, int channel __UNUSED__)
1152 em_spu_channel_get(void *ef __UNUSED__)
1159 em_spu_channel_name_get(void *ef __UNUSED__, int channel __UNUSED__)
1165 em_spu_channel_mute_set(void *ef __UNUSED__, int mute __UNUSED__)
1171 em_spu_channel_mute_get(void *ef __UNUSED__)
1177 em_chapter_count(void *ef __UNUSED__)
1184 em_chapter_set(void *ef __UNUSED__, int chapter __UNUSED__)
1189 em_chapter_get(void *ef __UNUSED__)
1196 em_chapter_name_get(void *ef __UNUSED__, int chapter __UNUSED__)
1202 em_speed_set(void *data, double speed)
1204 Emotion_Generic_Video *ev = data;
1207 _player_send_cmd(ev, EM_CMD_SPEED_SET);
1208 _player_send_float(ev, rate);
1214 em_speed_get(void *data)
1216 Emotion_Generic_Video *ev = data;
1217 return (double)ev->speed;
1221 em_eject(void *ef __UNUSED__)
1227 em_meta_get(void *ef __UNUSED__, int meta __UNUSED__)
1229 char * meta_data = NULL;
1233 static Emotion_Video_Module em_module =
1236 em_shutdown, /* shutdown */
1237 em_file_open, /* file_open */
1238 em_file_close, /* file_close */
1241 em_size_get, /* size_get */
1242 em_pos_set, /* pos_set */
1243 em_len_get, /* len_get */
1244 em_fps_num_get, /* fps_num_get */
1245 em_fps_den_get, /* fps_den_get */
1246 em_fps_get, /* fps_get */
1247 em_pos_get, /* pos_get */
1248 em_vis_set, /* vis_set */
1249 em_vis_get, /* vis_get */
1250 em_vis_supported, /* vis_supported */
1251 em_ratio_get, /* ratio_get */
1252 em_video_handled, /* video_handled */
1253 em_audio_handled, /* audio_handled */
1254 em_seekable, /* seekable */
1255 em_frame_done, /* frame_done */
1256 em_format_get, /* format_get */
1257 em_video_data_size_get, /* video_data_size_get */
1258 em_yuv_rows_get, /* yuv_rows_get */
1259 em_bgra_data_get, /* bgra_data_get */
1260 em_event_feed, /* event_feed */
1261 em_event_mouse_button_feed, /* event_mouse_button_feed */
1262 em_event_mouse_move_feed, /* event_mouse_move_feed */
1263 em_video_channel_count, /* video_channel_count */
1264 em_video_channel_set, /* video_channel_set */
1265 em_video_channel_get, /* video_channel_get */
1266 em_video_channel_name_get, /* video_channel_name_get */
1267 em_video_channel_mute_set, /* video_channel_mute_set */
1268 em_video_channel_mute_get, /* video_channel_mute_get */
1269 em_audio_channel_count, /* audio_channel_count */
1270 em_audio_channel_set, /* audio_channel_set */
1271 em_audio_channel_get, /* audio_channel_get */
1272 em_audio_channel_name_get, /* audio_channel_name_get */
1273 em_audio_channel_mute_set, /* audio_channel_mute_set */
1274 em_audio_channel_mute_get, /* audio_channel_mute_get */
1275 em_audio_channel_volume_set, /* audio_channel_volume_set */
1276 em_audio_channel_volume_get, /* audio_channel_volume_get */
1277 em_spu_channel_count, /* spu_channel_count */
1278 em_spu_channel_set, /* spu_channel_set */
1279 em_spu_channel_get, /* spu_channel_get */
1280 em_spu_channel_name_get, /* spu_channel_name_get */
1281 em_spu_channel_mute_set, /* spu_channel_mute_set */
1282 em_spu_channel_mute_get, /* spu_channel_mute_get */
1283 em_chapter_count, /* chapter_count */
1284 em_chapter_set, /* chapter_set */
1285 em_chapter_get, /* chapter_get */
1286 em_chapter_name_get, /* chapter_name_get */
1287 em_speed_set, /* speed_set */
1288 em_speed_get, /* speed_get */
1289 em_eject, /* eject */
1290 em_meta_get, /* meta_get */
1295 module_open(Evas_Object *obj, const Emotion_Video_Module **module, void **video, Emotion_Module_Options *opt)
1301 if (_emotion_generic_log_domain < 0)
1303 eina_threads_init();
1304 eina_log_threads_enable();
1305 _emotion_generic_log_domain = eina_log_domain_register
1306 ("emotion-generic", EINA_COLOR_LIGHTCYAN);
1307 if (_emotion_generic_log_domain < 0)
1309 EINA_LOG_CRIT("Could not register log domain 'emotion-generic'");
1315 if (!em_module.init(obj, video, opt)) {
1319 *module = &em_module;
1324 static void module_close(Emotion_Video_Module *module __UNUSED__, void *video)
1326 em_module.shutdown(video);
1331 generic_module_init(void)
1335 pfx = eina_prefix_new(NULL, emotion_object_add,
1336 "EMOTION", "emotion", NULL,
1341 if (!pfx) return EINA_FALSE;
1343 return _emotion_module_register("generic", module_open, module_close);
1347 generic_module_shutdown(void)
1351 eina_prefix_free(pfx);
1354 _emotion_module_unregister("generic");
1357 #ifndef EMOTION_STATIC_BUILD_GENERIC
1359 EINA_MODULE_INIT(generic_module_init);
1360 EINA_MODULE_SHUTDOWN(generic_module_shutdown);