src/edje_external/module.la
src/edje_external/module_la-emotion.lo
src/examples/.deps/
+src/examples/.libs/
src/examples/Makefile
src/examples/Makefile.in
+src/examples/emotion_basic_example
+src/examples/emotion_border_example
+src/examples/emotion_generic_example
+src/examples/emotion_generic_subtitle_example
+src/examples/emotion_signals_example
src/generic_players/Makefile
src/generic_players/Makefile.in
src/generic_players/vlc/.deps/
Pierre Le Magourou <pierre.lemagourou@openwide.fr>
Hugo Camboulive <hugo.camboulive@zodiacaerospace.com>
Sohyun Kim <anna1014.kim@samsung.com>
+Leandro Dorileo <dorileo@profusion.mobi>
\ No newline at end of file
2012-10-11 Sohyun Kim
* Fix to call correct render function based on the format.
+
+2013-01-02 Leandro Dorileo (dorileo)
+
+ * Add subtitle file API.
-Emotion 1.7.1
+Emotion 1.7.2
+
+Changes since Emotion 1.7.1:
+-------------------------
+
+Additions:
+ - Add video subtitle file API.
Changes since Emotion 1.7.0:
-------------------------
SRCS = \
emotion_basic_example.c \
emotion_generic_example.c \
+ emotion_generic_subtitle_example.c \
emotion_border_example.c \
emotion_signals_example.c
examples_PROGRAMS += \
emotion_basic_example \
emotion_generic_example \
+ emotion_generic_subtitle_example \
emotion_border_example \
emotion_signals_example
endif
--- /dev/null
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <Evas.h>
+#include <Emotion.h>
+#include <stdio.h>
+
+#define WIDTH (320)
+#define HEIGHT (240)
+
+static void
+_playback_started_cb(void *data, Evas_Object *o, void *event_info)
+{
+ printf("Emotion object started playback.\n");
+}
+
+static void
+_on_delete(Ecore_Evas *ee)
+{
+ ecore_main_loop_quit();
+}
+
+int
+main(int argc, const char *argv[])
+{
+ Ecore_Evas *ee;
+ Evas *e;
+ Evas_Object *bg, *em;
+ const char *filename = NULL;
+ const char *subtitle_filename = NULL;
+
+ if (argc < 2)
+ {
+ printf("At least one argument is necessary. Usage:\n");
+ printf("\t%s <filename> <subtitle filename>\n", argv[0]);
+ return -1;
+ }
+
+ filename = argv[1];
+
+ if (argc > 2)
+ subtitle_filename = argv[2];
+
+ if (!ecore_evas_init())
+ return EXIT_FAILURE;
+
+ /* this will give you a window with an Evas canvas under the first
+ * engine available */
+ ee = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL);
+ if (!ee)
+ goto error;
+
+ ecore_evas_callback_delete_request_set(ee, _on_delete);
+
+ ecore_evas_show(ee);
+
+ /* the canvas pointer, de facto */
+ e = ecore_evas_get(ee);
+
+ /* adding a background to this example */
+ bg = evas_object_rectangle_add(e);
+ evas_object_name_set(bg, "our dear rectangle");
+ evas_object_color_set(bg, 255, 255, 255, 255); /* white bg */
+ evas_object_move(bg, 0, 0); /* at canvas' origin */
+ evas_object_resize(bg, WIDTH, HEIGHT); /* covers full canvas */
+ evas_object_show(bg);
+
+ /* Creating the emotion object */
+ em = emotion_object_add(e);
+ emotion_object_init(em, "generic");
+
+ if (subtitle_filename)
+ emotion_object_video_subtitle_file_set(em, subtitle_filename);
+
+ evas_object_smart_callback_add(
+ em, "playback_started", _playback_started_cb, NULL);
+
+ emotion_object_file_set(em, filename);
+
+ evas_object_move(em, 0, 0);
+ evas_object_resize(em, WIDTH, HEIGHT);
+ evas_object_show(em);
+
+ emotion_object_play_set(em, EINA_TRUE);
+
+ ecore_main_loop_begin();
+
+ ecore_evas_free(ee);
+ ecore_evas_shutdown();
+ return 0;
+
+error:
+ fprintf(stderr, "you got to have at least one evas engine built and linked"
+ " up to ecore-evas for this example to run properly.\n");
+
+ ecore_evas_shutdown();
+ return -1;
+}
libvlc_event_manager_t *event_mgr;
libvlc_event_manager_t *mevent_mgr;
char *filename;
+ char *subtitle_path;
char *shmname;
void *tmpbuffer;
int w, h;
libvlc_time_t new_time = pos * 1000;
libvlc_media_player_set_time(app->mp, new_time);
libvlc_media_player_play(app->mp);
+
+ if (app->subtitle_path)
+ libvlc_video_set_subtitle_file(app->mp, app->subtitle_path);
+
app->playing = 1;
}
}
}
static void
+_subtitle_set(struct _App *app)
+{
+ _em_str_read(app->em_read, &app->subtitle_path);
+}
+
+static void
_file_set(struct _App *app)
{
if (app->opening)
case EM_CMD_FILE_SET_DONE:
_file_set_done(app);
break;
+ case EM_CMD_SUBTITLE_SET:
+ _subtitle_set(app);
+ break;
case EM_CMD_FILE_CLOSE:
_file_close(app);
break;
app.libvlc = libvlc_new(vlc_argc, vlc_argv);
app.mp = NULL;
app.filename = NULL;
+ app.subtitle_path = NULL;
app.w = 0;
app.h = 0;
app.size_sent = 0;
EAPI Eina_Bool emotion_object_video_mute_get (const Evas_Object *obj);
/**
+ * @brief Set the video's subtitle file path.
+ *
+ * @param obj The object which we are setting a subtitle file path.
+ * @param filepath The subtitle file path.
+ *
+ * This function sets a video's subtitle file path(i.e an .srt file) for
+ * supported subtitle formats consult the backend's documentation.
+ *
+ * @see emotion_object_video_subtitle_file_get().
+ *
+ * @ingroup Emotion_Video
+ * @since 1.7.2
+ */
+EAPI void emotion_object_video_subtitle_file_set (Evas_Object *obj, const char *filepath);
+
+/**
+ * @brief Get the video's subtitle file path.
+ *
+ * @param obj The object which we are retrieving the subtitle file path from.
+ * @return The video's subtitle file path previously set, NULL otherwise.
+ *
+ * This function returns the video's subtitle file path, if not previously set
+ * or in error NULL is returned.
+ *
+ * @see emotion_object_video_subtitle_file_set().
+ *
+ * @ingroup Emotion_Video
+ * @since 1.7.2
+ */
+EAPI const char *emotion_object_video_subtitle_file_get (const Evas_Object *obj);
+
+/**
* @brief Get the number of available video channel
*
* @param obj The object which we are retrieving the channel count from
int (*video_channel_count) (void *ef);
void (*video_channel_set) (void *ef, int channel);
int (*video_channel_get) (void *ef);
+ void (*video_subtitle_file_set) (void *ef, const char *filepath);
+ const char * (*video_subtitle_file_get) (void *ef);
const char * (*video_channel_name_get) (void *ef, int channel);
void (*video_channel_mute_set) (void *ef, int mute);
int (*video_channel_mute_get) (void *ef);
return sd->module->video_channel_mute_get(sd->video_data);
}
+EAPI void
+emotion_object_video_subtitle_file_set(Evas_Object *obj, const char *filepath)
+{
+ Smart_Data *sd;
+
+ E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
+ DBG("subtitle=%s", filepath);
+ if (!sd->module) return;
+ if (!sd->video_data) return;
+ sd->module->video_subtitle_file_set(sd->video_data, filepath);
+}
+
+EAPI const char *
+emotion_object_video_subtitle_file_get(const Evas_Object *obj)
+{
+ Smart_Data *sd;
+
+ E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
+ if (!sd->module) return EINA_FALSE;
+ if (!sd->video_data) return EINA_FALSE;
+ return sd->module->video_subtitle_file_get(sd->video_data);
+}
+
EAPI int
emotion_object_video_channel_count(const Evas_Object *obj)
{
EM_CMD_AUDIO_TRACK_SET, // param: track id (int)
EM_CMD_VIDEO_TRACK_SET, // param: track id (int)
EM_CMD_SPU_TRACK_SET, // param: track id (int)
+ EM_CMD_SUBTITLE_SET, // param: subtitle filename (string)
EM_CMD_LAST
};
INF("file close: %s", ev->filename);
eina_stringshare_replace(&ev->filename, NULL);
+ eina_stringshare_replace(&ev->subtitle_path, NULL);
ev->file_ready = EINA_FALSE;
_audio_channels_free(ev);
if (ev->ready)
{
+ if (ev->subtitle_path)
+ {
+ _player_send_cmd(ev, EM_CMD_SUBTITLE_SET);
+ _player_send_str(ev, ev->subtitle_path, EINA_TRUE);
+ }
+
_player_send_cmd(ev, EM_CMD_PLAY);
_player_send_float(ev, ev->pos);
+
return;
}
return ev->video_channel_current;
}
+static void
+em_video_subtitle_file_set(void *data, const char *filepath)
+{
+ Emotion_Generic_Video *ev = data;
+ eina_stringshare_replace(&ev->subtitle_path, filepath);
+}
+
+static const char *
+em_video_subtitle_file_get(void *data)
+{
+ Emotion_Generic_Video *ev = data;
+ return ev->subtitle_path;
+}
+
static const char *
em_video_channel_name_get(void *data, int channel)
{
em_video_channel_count, /* video_channel_count */
em_video_channel_set, /* video_channel_set */
em_video_channel_get, /* video_channel_get */
+ em_video_subtitle_file_set, /* video_subtitle_file_set */
+ em_video_subtitle_file_get, /* video_subtitle_file_get */
em_video_channel_name_get, /* video_channel_name_get */
em_video_channel_mute_set, /* video_channel_mute_set */
em_video_channel_mute_get, /* video_channel_mute_get */
int spu_channel_current;
Emotion_Generic_Channel *spu_channels;
Emotion_Generic_Meta meta;
+ const char *subtitle_path;
};
#endif
static int em_video_channel_get (void *video);
+static void em_video_subtitle_file_set (void *video,
+ const char *filepath);
+
+static const char *em_video_subtitle_file_get (void *video);
+
static const char *em_video_channel_name_get (void *video,
int channel);
em_video_channel_count, /* video_channel_count */
em_video_channel_set, /* video_channel_set */
em_video_channel_get, /* video_channel_get */
+ em_video_subtitle_file_set, /* video_subtitle_file_set */
+ em_video_subtitle_file_get, /* video_subtitle_file_get */
em_video_channel_name_get, /* video_channel_name_get */
em_video_channel_mute_set, /* video_channel_mute_set */
em_video_channel_mute_get, /* video_channel_mute_get */
return ev->video_stream_nbr;
}
+static void
+em_video_subtitle_file_set(void *video __UNUSED__,
+ const char *filepath __UNUSED__)
+{
+ DBG("video_subtitle_file_set not implemented for gstreamer yet.");
+}
+
+static const char *
+em_video_subtitle_file_get(void *video __UNUSED__)
+{
+ DBG("video_subtitle_file_get not implemented for gstreamer yet.");
+ return NULL;
+}
+
static const char *
em_video_channel_name_get(void *video __UNUSED__,
int channel __UNUSED__)