emotion: convert Emotion_Object into Efl.Canvas.Video

Reviewers: singh.amitesh, raster, jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D3994

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Yeshwanth Reddivari 2016-09-21 10:37:59 -07:00 committed by Cedric BAIL
parent cbfcfdf3e9
commit 7b90e11474
10 changed files with 261 additions and 226 deletions

View File

@ -1,7 +1,7 @@
### Library ### Library
emotion_eolian_files = \ emotion_eolian_files = \
lib/emotion/emotion_object.eo lib/emotion/efl_canvas_video.eo
emotion_eolian_c = $(emotion_eolian_files:%.eo=%.eo.c) emotion_eolian_c = $(emotion_eolian_files:%.eo=%.eo.c)
emotion_eolian_h = $(emotion_eolian_files:%.eo=%.eo.h) \ emotion_eolian_h = $(emotion_eolian_files:%.eo=%.eo.h) \

View File

@ -71,7 +71,7 @@ interface Efl.Player {
speed: double; [[The play speed in the [0, infinity) range.]] speed: double; [[The play speed in the [0, infinity) range.]]
} }
} }
@property audio_volume { @property volume {
[[Control the audio volume. [[Control the audio volume.
Controls the audio volume of the stream being played. This has Controls the audio volume of the stream being played. This has
@ -88,7 +88,7 @@ interface Efl.Player {
volume: double; [[The volume level]] volume: double; [[The volume level]]
} }
} }
@property audio_mute { @property mute {
[[This property controls the audio mute state.]] [[This property controls the audio mute state.]]
set { set {
} }

View File

@ -50,12 +50,12 @@ static const Elm_Action key_actions[] = {
}; };
EFL_CALLBACKS_ARRAY_DEFINE(_video_cb, EFL_CALLBACKS_ARRAY_DEFINE(_video_cb,
{ EMOTION_OBJECT_EVENT_OPEN_DONE, _on_open_done }, { EFL_CANVAS_VIDEO_EVENT_OPEN_DONE, _on_open_done },
{ EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _on_playback_started }, { EFL_CANVAS_VIDEO_EVENT_PLAYBACK_START, _on_playback_started },
{ EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _on_playback_finished }, { EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, _on_playback_finished },
{ EMOTION_OBJECT_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated }, { EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated },
{ EMOTION_OBJECT_EVENT_TITLE_CHANGE, _on_title_changed }, { EFL_CANVAS_VIDEO_EVENT_TITLE_CHANGE, _on_title_changed },
{ EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, _on_audio_level_changed } { EFL_CANVAS_VIDEO_EVENT_VOLUME_CHANGE, _on_audio_level_changed }
); );
static Eina_Bool static Eina_Bool
@ -426,25 +426,25 @@ elm_video_file_get(Eo *obj, const char **filename)
EAPI void EAPI void
elm_video_audio_level_set(Evas_Object *obj, double volume) elm_video_audio_level_set(Evas_Object *obj, double volume)
{ {
efl_player_audio_volume_set(obj, volume); efl_player_volume_set(obj, volume);
} }
EAPI double EAPI double
elm_video_audio_level_get(const Evas_Object *obj) elm_video_audio_level_get(const Evas_Object *obj)
{ {
return efl_player_audio_volume_get(obj); return efl_player_volume_get(obj);
} }
EAPI void EAPI void
elm_video_audio_mute_set(Evas_Object *obj, Eina_Bool mute) elm_video_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
{ {
efl_player_audio_mute_set(obj, mute); efl_player_mute_set(obj, mute);
} }
EAPI Eina_Bool EAPI Eina_Bool
elm_video_audio_mute_get(const Evas_Object *obj) elm_video_audio_mute_get(const Evas_Object *obj)
{ {
return efl_player_audio_mute_get(obj); return efl_player_mute_get(obj);
} }
EAPI double EAPI double

View File

@ -78,12 +78,12 @@ static const Elm_Action key_actions[] = {
}; };
EFL_CALLBACKS_ARRAY_DEFINE(_emotion_cb, EFL_CALLBACKS_ARRAY_DEFINE(_emotion_cb,
{ EMOTION_OBJECT_EVENT_FRAME_DECODE, _update_frame }, { EFL_CANVAS_VIDEO_EVENT_FRAME_DECODE, _update_frame },
{ EMOTION_OBJECT_EVENT_FRAME_RESIZE, _update_slider }, { EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _update_slider },
{ EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _update_slider }, { EFL_CANVAS_VIDEO_EVENT_LENGTH_CHANGE, _update_slider },
{ EMOTION_OBJECT_EVENT_POSITION_UPDATE, _update_frame }, { EFL_CANVAS_VIDEO_EVENT_POSITION_CHANGE, _update_frame },
{ EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _play_started }, { EFL_CANVAS_VIDEO_EVENT_PLAYBACK_START, _play_started },
{ EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _play_finished } { EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, _play_finished }
); );
EFL_CALLBACKS_ARRAY_DEFINE(_slider_cb, EFL_CALLBACKS_ARRAY_DEFINE(_slider_cb,

View File

@ -1,3 +1,3 @@
#include "emotion_object.eo.h" #include "efl_canvas_video.eo.h"

View File

@ -1,2 +1,3 @@
#include "emotion_object.eo.legacy.h" #include "efl_canvas_video.eo.legacy.h"

View File

@ -1,7 +1,4 @@
class Emotion.Object (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.Image.Load) { class Efl.Canvas.Video (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.Image.Load) {
legacy_prefix: emotion_object;
eo_prefix: emotion_obj;
event_prefix: emotion_object;
methods { methods {
@property option { @property option {
set { set {
@ -70,10 +67,10 @@ class Emotion.Object (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.Ima
Efl.Player.position.set; Efl.Player.position.set;
Efl.Player.position.get; Efl.Player.position.get;
Efl.Player.progress.get; Efl.Player.progress.get;
Efl.Player.audio_volume.set; Efl.Player.volume.set;
Efl.Player.audio_volume.get; Efl.Player.volume.get;
Efl.Player.audio_mute.set; Efl.Player.mute.set;
Efl.Player.audio_mute.get; Efl.Player.mute.get;
Efl.Player.length.get; Efl.Player.length.get;
Efl.Player.seekable.get; Efl.Player.seekable.get;
Efl.Image.Load.load_size.get; Efl.Image.Load.load_size.get;
@ -82,25 +79,24 @@ class Emotion.Object (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.Ima
Efl.Image.smooth_scale.get; Efl.Image.smooth_scale.get;
} }
events { events {
frame_decode; frame,decode;
position_update; position,change;
length_change; length,change;
frame_resize; frame,resize;
decode_stop; playback,start;
playback_started; playback,stop;
playback_finished; volume,change;
audio_level_change; channels,change;
channels_change; title,change;
title_change; progress,change;
progress_change; ref,change;
ref_change; button,num,change;
button_num_change; button,change;
button_change; open,done;
open_done; position,save,done;
position_save,succeed; position,save,fail;
position_save,failed; position,load,done;
position_load,succeed; position,load,fail;
position_load,failed;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -210,9 +210,9 @@ _finish_thumb_generation(struct _emotion_plugin *_plugin, int success)
{ {
int r = 0; int r = 0;
efl_event_callback_del(_plugin->video, EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin); efl_event_callback_del(_plugin->video, EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin);
efl_event_callback_del(_plugin->video, EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin); efl_event_callback_del(_plugin->video, EFL_CANVAS_VIDEO_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin);
efl_event_callback_del(_plugin->video, EMOTION_OBJECT_EVENT_DECODE_STOP, _video_stopped_cb, _plugin); efl_event_callback_del(_plugin->video, EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, _video_stopped_cb, _plugin);
emotion_object_play_set(_plugin->video, 0); emotion_object_play_set(_plugin->video, 0);
@ -243,8 +243,8 @@ _frame_grab_single(void *data)
if (_plugin->len <= 0) if (_plugin->len <= 0)
{ {
_video_pos_set(_plugin); _video_pos_set(_plugin);
return EINA_TRUE; return EINA_TRUE;
} }
p = emotion_object_position_get(_plugin->video); p = emotion_object_position_get(_plugin->video);
@ -256,7 +256,7 @@ _frame_grab_single(void *data)
ethumb_image_save(e); ethumb_image_save(e);
efl_event_callback_del(_plugin->video, EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin); efl_event_callback_del(_plugin->video, EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin);
emotion_object_play_set(_plugin->video, 0); emotion_object_play_set(_plugin->video, 0);
@ -376,10 +376,10 @@ _thumb_generate(Ethumb *e)
if (!r) if (!r)
{ {
ERR("Could not initialize emotion object."); ERR("Could not initialize emotion object.");
evas_object_del(o); evas_object_del(o);
ethumb_finished_callback_call(e, 0); ethumb_finished_callback_call(e, 0);
free(_plugin); free(_plugin);
return NULL; return NULL;
} }
_plugin->video = o; _plugin->video = o;
@ -400,15 +400,15 @@ _thumb_generate(Ethumb *e)
_resize_movie(_plugin); _resize_movie(_plugin);
efl_event_callback_add efl_event_callback_add
(o, EMOTION_OBJECT_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin); (o, EFL_CANVAS_VIDEO_EVENT_FRAME_DECODE, _frame_decode_cb, _plugin);
efl_event_callback_add efl_event_callback_add
(o, EMOTION_OBJECT_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin); (o, EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin);
efl_event_callback_add efl_event_callback_add
(o, EMOTION_OBJECT_EVENT_DECODE_STOP, _video_stopped_cb, _plugin); (o, EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, _video_stopped_cb, _plugin);
if (f == ETHUMB_THUMB_EET) if (f == ETHUMB_THUMB_EET)
{ {
_generate_animated_thumb(_plugin); _generate_animated_thumb(_plugin);
} }
_video_pos_set(_plugin); _video_pos_set(_plugin);

View File

@ -574,17 +574,17 @@ video_obj_signal_frame_move_cb(void *data EINA_UNUSED, Evas_Object *o, const cha
} }
EFL_CALLBACKS_ARRAY_DEFINE(emotion_object_test_callbacks, EFL_CALLBACKS_ARRAY_DEFINE(emotion_object_test_callbacks,
{ EMOTION_OBJECT_EVENT_FRAME_DECODE, video_obj_frame_decode_cb }, { EFL_CANVAS_VIDEO_EVENT_FRAME_DECODE, video_obj_frame_decode_cb },
{ EMOTION_OBJECT_EVENT_FRAME_RESIZE, video_obj_frame_resize_cb }, { EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, video_obj_frame_resize_cb },
{ EMOTION_OBJECT_EVENT_LENGTH_CHANGE, video_obj_length_change_cb }, { EFL_CANVAS_VIDEO_EVENT_LENGTH_CHANGE, video_obj_length_change_cb },
{ EMOTION_OBJECT_EVENT_POSITION_UPDATE, video_obj_position_update_cb }, { EFL_CANVAS_VIDEO_EVENT_POSITION_CHANGE, video_obj_position_update_cb },
{ EMOTION_OBJECT_EVENT_DECODE_STOP, video_obj_stopped_cb }, { EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, video_obj_stopped_cb },
{ EMOTION_OBJECT_EVENT_CHANNELS_CHANGE, video_obj_channels_cb }, { EFL_CANVAS_VIDEO_EVENT_CHANNELS_CHANGE, video_obj_channels_cb },
{ EMOTION_OBJECT_EVENT_TITLE_CHANGE, video_obj_title_cb }, { EFL_CANVAS_VIDEO_EVENT_TITLE_CHANGE, video_obj_title_cb },
{ EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, video_obj_progress_cb }, { EFL_CANVAS_VIDEO_EVENT_PROGRESS_CHANGE, video_obj_progress_cb },
{ EMOTION_OBJECT_EVENT_REF_CHANGE, video_obj_ref_cb }, { EFL_CANVAS_VIDEO_EVENT_REF_CHANGE, video_obj_ref_cb },
{ EMOTION_OBJECT_EVENT_BUTTON_NUM_CHANGE, video_obj_button_num_cb }, { EFL_CANVAS_VIDEO_EVENT_BUTTON_NUM_CHANGE, video_obj_button_num_cb },
{ EMOTION_OBJECT_EVENT_BUTTON_CHANGE, video_obj_button_cb } { EFL_CANVAS_VIDEO_EVENT_BUTTON_CHANGE, video_obj_button_cb }
); );
static void static void