forked from enlightenment/efl
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:
parent
cbfcfdf3e9
commit
7b90e11474
|
@ -1,7 +1,7 @@
|
|||
### Library
|
||||
|
||||
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_h = $(emotion_eolian_files:%.eo=%.eo.h) \
|
||||
|
|
|
@ -71,7 +71,7 @@ interface Efl.Player {
|
|||
speed: double; [[The play speed in the [0, infinity) range.]]
|
||||
}
|
||||
}
|
||||
@property audio_volume {
|
||||
@property volume {
|
||||
[[Control the audio volume.
|
||||
|
||||
Controls the audio volume of the stream being played. This has
|
||||
|
@ -88,7 +88,7 @@ interface Efl.Player {
|
|||
volume: double; [[The volume level]]
|
||||
}
|
||||
}
|
||||
@property audio_mute {
|
||||
@property mute {
|
||||
[[This property controls the audio mute state.]]
|
||||
set {
|
||||
}
|
||||
|
|
|
@ -50,12 +50,12 @@ static const Elm_Action key_actions[] = {
|
|||
};
|
||||
|
||||
EFL_CALLBACKS_ARRAY_DEFINE(_video_cb,
|
||||
{ EMOTION_OBJECT_EVENT_OPEN_DONE, _on_open_done },
|
||||
{ EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _on_playback_started },
|
||||
{ EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _on_playback_finished },
|
||||
{ EMOTION_OBJECT_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated },
|
||||
{ EMOTION_OBJECT_EVENT_TITLE_CHANGE, _on_title_changed },
|
||||
{ EMOTION_OBJECT_EVENT_AUDIO_LEVEL_CHANGE, _on_audio_level_changed }
|
||||
{ EFL_CANVAS_VIDEO_EVENT_OPEN_DONE, _on_open_done },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_PLAYBACK_START, _on_playback_started },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, _on_playback_finished },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _on_aspect_ratio_updated },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_TITLE_CHANGE, _on_title_changed },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_VOLUME_CHANGE, _on_audio_level_changed }
|
||||
);
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -426,25 +426,25 @@ elm_video_file_get(Eo *obj, const char **filename)
|
|||
EAPI void
|
||||
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
|
||||
elm_video_audio_level_get(const Evas_Object *obj)
|
||||
{
|
||||
return efl_player_audio_volume_get(obj);
|
||||
return efl_player_volume_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
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
|
||||
elm_video_audio_mute_get(const Evas_Object *obj)
|
||||
{
|
||||
return efl_player_audio_mute_get(obj);
|
||||
return efl_player_mute_get(obj);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
|
|
|
@ -78,12 +78,12 @@ static const Elm_Action key_actions[] = {
|
|||
};
|
||||
|
||||
EFL_CALLBACKS_ARRAY_DEFINE(_emotion_cb,
|
||||
{ EMOTION_OBJECT_EVENT_FRAME_DECODE, _update_frame },
|
||||
{ EMOTION_OBJECT_EVENT_FRAME_RESIZE, _update_slider },
|
||||
{ EMOTION_OBJECT_EVENT_LENGTH_CHANGE, _update_slider },
|
||||
{ EMOTION_OBJECT_EVENT_POSITION_UPDATE, _update_frame },
|
||||
{ EMOTION_OBJECT_EVENT_PLAYBACK_STARTED, _play_started },
|
||||
{ EMOTION_OBJECT_EVENT_PLAYBACK_FINISHED, _play_finished }
|
||||
{ EFL_CANVAS_VIDEO_EVENT_FRAME_DECODE, _update_frame },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _update_slider },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_LENGTH_CHANGE, _update_slider },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_POSITION_CHANGE, _update_frame },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_PLAYBACK_START, _play_started },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, _play_finished }
|
||||
);
|
||||
|
||||
EFL_CALLBACKS_ARRAY_DEFINE(_slider_cb,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
#include "emotion_object.eo.h"
|
||||
#include "efl_canvas_video.eo.h"
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
|
||||
#include "emotion_object.eo.legacy.h"
|
||||
#include "efl_canvas_video.eo.legacy.h"
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
class Emotion.Object (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.Image.Load) {
|
||||
legacy_prefix: emotion_object;
|
||||
eo_prefix: emotion_obj;
|
||||
event_prefix: emotion_object;
|
||||
class Efl.Canvas.Video (Efl.Canvas.Group, Efl.File, Efl.Player, Efl.Image, Efl.Image.Load) {
|
||||
methods {
|
||||
@property option {
|
||||
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.get;
|
||||
Efl.Player.progress.get;
|
||||
Efl.Player.audio_volume.set;
|
||||
Efl.Player.audio_volume.get;
|
||||
Efl.Player.audio_mute.set;
|
||||
Efl.Player.audio_mute.get;
|
||||
Efl.Player.volume.set;
|
||||
Efl.Player.volume.get;
|
||||
Efl.Player.mute.set;
|
||||
Efl.Player.mute.get;
|
||||
Efl.Player.length.get;
|
||||
Efl.Player.seekable.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;
|
||||
}
|
||||
events {
|
||||
frame_decode;
|
||||
position_update;
|
||||
length_change;
|
||||
frame_resize;
|
||||
decode_stop;
|
||||
playback_started;
|
||||
playback_finished;
|
||||
audio_level_change;
|
||||
channels_change;
|
||||
title_change;
|
||||
progress_change;
|
||||
ref_change;
|
||||
button_num_change;
|
||||
button_change;
|
||||
open_done;
|
||||
position_save,succeed;
|
||||
position_save,failed;
|
||||
position_load,succeed;
|
||||
position_load,failed;
|
||||
frame,decode;
|
||||
position,change;
|
||||
length,change;
|
||||
frame,resize;
|
||||
playback,start;
|
||||
playback,stop;
|
||||
volume,change;
|
||||
channels,change;
|
||||
title,change;
|
||||
progress,change;
|
||||
ref,change;
|
||||
button,num,change;
|
||||
button,change;
|
||||
open,done;
|
||||
position,save,done;
|
||||
position,save,fail;
|
||||
position,load,done;
|
||||
position,load,fail;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -210,9 +210,9 @@ _finish_thumb_generation(struct _emotion_plugin *_plugin, int success)
|
|||
{
|
||||
int r = 0;
|
||||
|
||||
efl_event_callback_del(_plugin->video, EMOTION_OBJECT_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, EMOTION_OBJECT_EVENT_DECODE_STOP, _video_stopped_cb, _plugin);
|
||||
efl_event_callback_del(_plugin->video, EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, _frame_resized_cb, _plugin);
|
||||
efl_event_callback_del(_plugin->video, EFL_CANVAS_VIDEO_EVENT_FRAME_DECODE, _frame_decode_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);
|
||||
|
||||
|
@ -243,8 +243,8 @@ _frame_grab_single(void *data)
|
|||
|
||||
if (_plugin->len <= 0)
|
||||
{
|
||||
_video_pos_set(_plugin);
|
||||
return EINA_TRUE;
|
||||
_video_pos_set(_plugin);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
p = emotion_object_position_get(_plugin->video);
|
||||
|
@ -256,7 +256,7 @@ _frame_grab_single(void *data)
|
|||
|
||||
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);
|
||||
|
||||
|
@ -376,10 +376,10 @@ _thumb_generate(Ethumb *e)
|
|||
if (!r)
|
||||
{
|
||||
ERR("Could not initialize emotion object.");
|
||||
evas_object_del(o);
|
||||
ethumb_finished_callback_call(e, 0);
|
||||
free(_plugin);
|
||||
return NULL;
|
||||
evas_object_del(o);
|
||||
ethumb_finished_callback_call(e, 0);
|
||||
free(_plugin);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_plugin->video = o;
|
||||
|
@ -400,15 +400,15 @@ _thumb_generate(Ethumb *e)
|
|||
|
||||
_resize_movie(_plugin);
|
||||
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
|
||||
(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
|
||||
(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)
|
||||
{
|
||||
_generate_animated_thumb(_plugin);
|
||||
_generate_animated_thumb(_plugin);
|
||||
}
|
||||
|
||||
_video_pos_set(_plugin);
|
||||
|
|
|
@ -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,
|
||||
{ EMOTION_OBJECT_EVENT_FRAME_DECODE, video_obj_frame_decode_cb },
|
||||
{ EMOTION_OBJECT_EVENT_FRAME_RESIZE, video_obj_frame_resize_cb },
|
||||
{ EMOTION_OBJECT_EVENT_LENGTH_CHANGE, video_obj_length_change_cb },
|
||||
{ EMOTION_OBJECT_EVENT_POSITION_UPDATE, video_obj_position_update_cb },
|
||||
{ EMOTION_OBJECT_EVENT_DECODE_STOP, video_obj_stopped_cb },
|
||||
{ EMOTION_OBJECT_EVENT_CHANNELS_CHANGE, video_obj_channels_cb },
|
||||
{ EMOTION_OBJECT_EVENT_TITLE_CHANGE, video_obj_title_cb },
|
||||
{ EMOTION_OBJECT_EVENT_PROGRESS_CHANGE, video_obj_progress_cb },
|
||||
{ EMOTION_OBJECT_EVENT_REF_CHANGE, video_obj_ref_cb },
|
||||
{ EMOTION_OBJECT_EVENT_BUTTON_NUM_CHANGE, video_obj_button_num_cb },
|
||||
{ EMOTION_OBJECT_EVENT_BUTTON_CHANGE, video_obj_button_cb }
|
||||
{ EFL_CANVAS_VIDEO_EVENT_FRAME_DECODE, video_obj_frame_decode_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_FRAME_RESIZE, video_obj_frame_resize_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_LENGTH_CHANGE, video_obj_length_change_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_POSITION_CHANGE, video_obj_position_update_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_PLAYBACK_STOP, video_obj_stopped_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_CHANNELS_CHANGE, video_obj_channels_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_TITLE_CHANGE, video_obj_title_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_PROGRESS_CHANGE, video_obj_progress_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_REF_CHANGE, video_obj_ref_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_BUTTON_NUM_CHANGE, video_obj_button_num_cb },
|
||||
{ EFL_CANVAS_VIDEO_EVENT_BUTTON_CHANGE, video_obj_button_cb }
|
||||
);
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue