From c360f5edb699ed5a4a5b24c9091a596d1a0db46f Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Wed, 4 Dec 2019 15:30:17 +0100 Subject: [PATCH 01/33] eolian: account for entire inheritance trees when compositing When a class composites an interface, we need to ignore all of its extends (and extends of those) as well as the main interface when doing API checks, as composites essentially provides a guarantee that this *will* be implemented at runtime, which further extends to the whole inheritance tree of that interface. Fixes T8491. --- src/lib/eolian/database_validate.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 4e51718ecd..b1af2185ef 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -1247,6 +1247,17 @@ _add_composite(Eolian_Class *cl, const Eolian_Class *icl, Eina_Hash *ch) } } +static void +_add_implicit_composite(Eolian_Class *icl, Eina_Hash *ch, Eina_Bool try_tree) +{ + eina_hash_set(ch, &icl, icl); + if (!try_tree) + return; + Eina_List *l; + EINA_LIST_FOREACH(icl->extends, l, icl) + _add_implicit_composite(icl, ch, try_tree); +} + static Eina_Bool _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash, Eina_Hash *errh) @@ -1325,7 +1336,12 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash, cl->composite = eina_list_append(cl->composite, out_cl); succ = _db_fill_inherits(vals, out_cl, fhash, errh); ++ncomp; - eina_hash_set(ch, &out_cl, out_cl); + /* for each thing that is composited, we need to add the entire + * inheritance tree of it into composite hash to check, so e.g. + * class A -> composites B -> extends C does not complain about + * A not implementing C + */ + _add_implicit_composite(out_cl, ch, out_cl->type == EOLIAN_CLASS_INTERFACE); } /* parent can be abstract, those are not checked for unimplemented, From e242a05d73c0fd7142c0d8c7804d5f60ffb80748 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Wed, 4 Dec 2019 15:58:04 +0100 Subject: [PATCH 02/33] docs: slight improvement for Efl.Decelerate_Interpolator --- src/lib/ecore/efl_decelerate_interpolator.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore/efl_decelerate_interpolator.eo b/src/lib/ecore/efl_decelerate_interpolator.eo index 42011694a5..eef3b3a71e 100644 --- a/src/lib/ecore/efl_decelerate_interpolator.eo +++ b/src/lib/ecore/efl_decelerate_interpolator.eo @@ -4,7 +4,7 @@ class @beta Efl.Decelerate_Interpolator extends Efl.Object implements Efl.Interp it reaches $[1.0]. Internally it uses the second half of a sinus rise (from 0.5 to 1.0) and the steepness - can be customized. + can be customized through the @.slope property. ]] data: Efl_Decelerate_Interpolator_Data; methods { From c601944a13d63d2b4228aeca1cd680c5d092e58b Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Wed, 4 Dec 2019 16:04:19 +0100 Subject: [PATCH 03/33] eolian: fix a parse bug where composites was treated as implements In the specific case where you had "class A extends B composites C" the correct composites branch was ignored and instead the implements branch was used. This was entirely wrong/an oversight that did not appear until now. Other combinations were handled correctly. --- src/lib/eolian/eo_parser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 8316c4f3bc..96de7a77ec 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -2301,8 +2301,11 @@ tags_done: { /* regular class can have a parent, but just one */ _inherit_dep(ls, ibuf, EINA_TRUE); + /* followed by composites */ + if (ls->t.kw == KW_composites) + goto noimp_comp; /* if not followed by implements, we're done */ - if ((ls->t.kw != KW_implements) && (ls->t.kw != KW_composites)) + if (ls->t.kw != KW_implements) { eo_lexer_dtor_pop(ls); goto inherit_done; @@ -2314,6 +2317,7 @@ tags_done: while (test_next(ls, ',')); } +noimp_comp: if (ls->t.kw == KW_composites) { if (type == EOLIAN_CLASS_INTERFACE) From 10b631e7cb94b674446888aabaac09972af4382d Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 4 Dec 2019 10:51:04 +0100 Subject: [PATCH 04/33] efl_canvas_animation_group: use @property instead of method this also refreshes the documentation of all this. Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D10795 --- src/lib/evas/canvas/efl_canvas_animation_group.eo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_animation_group.eo b/src/lib/evas/canvas/efl_canvas_animation_group.eo index 07daa8f554..7b9f19cf61 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_group.eo @@ -21,9 +21,12 @@ abstract @beta Efl.Canvas.Animation_Group extends Efl.Canvas.Animation @in animation: Efl.Canvas.Animation; [[Animation to remove from the group.]] } } - animations_get @const { - [[Gets the list of animations currently in the animation group.]] - return: iterator @move; [[List of animations in the group.]] + @property animations { + [[All animations that are currently part of this group.]] + get { } + values { + animations : iterator @move; [[The iterator carrying all animations of this group]] + } } } implements { From a29be18b5f6f94d8b4e6e7738ced1ae502159fbc Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 4 Dec 2019 10:14:09 +0100 Subject: [PATCH 05/33] efl_canvas_animation: add a standard value for duration of animations before this commit the standard time was 0, which results in no animation played at all. Now its 0.2 and a app that does not like it can adjust it. ref T8436 Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D10796 --- src/lib/evas/canvas/efl_canvas_animation.c | 22 +++++++++++++++++++++ src/lib/evas/canvas/efl_canvas_animation.eo | 9 +++++++++ src/tests/evas/efl_canvas_animation.c | 9 +++++++++ 3 files changed, 40 insertions(+) diff --git a/src/lib/evas/canvas/efl_canvas_animation.c b/src/lib/evas/canvas/efl_canvas_animation.c index 33ffa035ac..772fb41b18 100644 --- a/src/lib/evas/canvas/efl_canvas_animation.c +++ b/src/lib/evas/canvas/efl_canvas_animation.c @@ -2,6 +2,8 @@ #define MY_CLASS EFL_CANVAS_ANIMATION_CLASS +static double _default_animation_time = 0.2; //in seconds + EOLIAN static void _efl_canvas_animation_duration_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd, @@ -134,4 +136,24 @@ _efl_canvas_animation_efl_playable_seekable_get(const Eo *eo_obj EINA_UNUSED, Ef return EINA_TRUE; } +EOLIAN static Efl_Object* +_efl_canvas_animation_efl_object_constructor(Eo *obj, Efl_Canvas_Animation_Data *pd) +{ + pd->duration = _default_animation_time; + return efl_constructor(efl_super(obj, MY_CLASS)); +} + +EOLIAN static void +_efl_canvas_animation_default_duration_set(double animation_time) +{ + EINA_SAFETY_ON_FALSE_RETURN(animation_time > 0.0); + _default_animation_time = animation_time; +} + +EOLIAN static double +_efl_canvas_animation_default_duration_get(void) +{ + return _default_animation_time; +} + #include "efl_canvas_animation.eo.c" diff --git a/src/lib/evas/canvas/efl_canvas_animation.eo b/src/lib/evas/canvas/efl_canvas_animation.eo index 3640cd2234..a55cf73bbd 100644 --- a/src/lib/evas/canvas/efl_canvas_animation.eo +++ b/src/lib/evas/canvas/efl_canvas_animation.eo @@ -110,8 +110,17 @@ class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable } return: double; [[Final applied progress, after possible adjustments. See @.interpolator.]] } + @property default_duration @static { + [[Duration that will be used by default on all animations unless another value + is set per object using @.duration. + ]] + values { + animation_time : double; [[Default animation duration, in seconds.]] + } + } } implements { + Efl.Object.constructor; Efl.Playable.length { get; } Efl.Playable.seekable { get; } Efl.Playable.playable { get; } diff --git a/src/tests/evas/efl_canvas_animation.c b/src/tests/evas/efl_canvas_animation.c index cef036341c..e7d0b16ff9 100644 --- a/src/tests/evas/efl_canvas_animation.c +++ b/src/tests/evas/efl_canvas_animation.c @@ -34,7 +34,16 @@ EFL_START_TEST(efl_canvas_animation_negative_double_checking) } EFL_END_TEST +EFL_START_TEST(efl_canvas_animation_default_value) +{ + Efl_Canvas_Animation *animation = efl_new(EFL_CANVAS_ANIMATION_CLASS); + + fail_if(efl_animation_duration_get(animation) == 0.0); +} +EFL_END_TEST + void efl_test_canvas_animation(TCase *tc) { tcase_add_test(tc, efl_canvas_animation_negative_double_checking); + tcase_add_test(tc, efl_canvas_animation_default_value); } From fc7d398e07af857e67d8e7038f2bc989a9086ee6 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 4 Dec 2019 10:20:38 +0100 Subject: [PATCH 06/33] efl_canvas_animation: use floating point infinite instead of macro the floating point infinite builtin should also work cross languages (so this is better for bindings). ref T8437 Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D10797 --- src/lib/evas/canvas/efl_canvas_animation.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_animation.c b/src/lib/evas/canvas/efl_canvas_animation.c index 772fb41b18..001dca7892 100644 --- a/src/lib/evas/canvas/efl_canvas_animation.c +++ b/src/lib/evas/canvas/efl_canvas_animation.c @@ -1,5 +1,5 @@ #include "efl_canvas_animation_private.h" - +#include #define MY_CLASS EFL_CANVAS_ANIMATION_CLASS static double _default_animation_time = 0.2; //in seconds @@ -117,8 +117,7 @@ _efl_canvas_animation_efl_playable_length_get(const Eo *eo_obj, Efl_Canvas_Anima { if (efl_animation_repeat_count_get(eo_obj) == EFL_ANIMATION_REPEAT_INFINITE) { - //TODO: what's correct? - return (double)EFL_ANIMATION_REPEAT_INFINITE; + return INFINITY; } return (efl_animation_duration_get(eo_obj) * (efl_animation_repeat_count_get(eo_obj) + 1)); From 752855825ddad2d3f9df11f52280ed11b5038317 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 4 Dec 2019 10:23:23 +0100 Subject: [PATCH 07/33] remove unsued macros Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D10798 --- src/lib/evas/Evas_Common.h | 3 --- src/lib/evas/Evas_Eo.h | 4 ---- 2 files changed, 7 deletions(-) diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 23a481bf80..32cf83b60d 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -3483,10 +3483,7 @@ typedef Eo Efl_Animation_Group_Sequential; #endif #define EFL_ANIMATION_GROUP_DURATION_NONE -1 -#define EFL_ANIMATION_PLAYER_GROUP_DURATION_NONE -1 - #define EFL_ANIMATION_REPEAT_INFINITE -1 -#define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1 // The below type are necessary for legacy API and need to be manually kept in sync with .eo file. #ifndef _EFL_INPUT_DEVICE_EO_CLASS_TYPE diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 56971d0a14..58a1f01b6c 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -123,11 +123,7 @@ typedef Eo Efl_Canvas_Animation_Group_Sequential; #endif #define EFL_ANIMATION_GROUP_DURATION_NONE -1 -#define EFL_ANIMATION_PLAYER_GROUP_DURATION_NONE -1 - #define EFL_ANIMATION_REPEAT_INFINITE -1 -#define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1 - struct _Efl_Canvas_Animation_Player_Event_Running { From a6c102df1f1cb8cb4c51da7e743d00dea859aa83 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 4 Dec 2019 14:20:43 +0100 Subject: [PATCH 08/33] efl_canvas_animation_group: remove implicit children behaviour you could set the duration of the group to all children, however, the default behaviour was to not do that. This is however a bit probeblatic, and needs to be more expclicit. If this is needed again, then this can be reintroduced, however, not in this form. ref T8437 Depends on D10798 Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D10799 --- src/lib/evas/Evas_Common.h | 1 - src/lib/evas/Evas_Eo.h | 1 - src/lib/evas/canvas/efl_canvas_animation_group.c | 16 +++------------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 32cf83b60d..d7fa681094 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -3482,7 +3482,6 @@ typedef Eo Efl_Animation_Group_Sequential; #endif -#define EFL_ANIMATION_GROUP_DURATION_NONE -1 #define EFL_ANIMATION_REPEAT_INFINITE -1 // The below type are necessary for legacy API and need to be manually kept in sync with .eo file. diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 58a1f01b6c..f156ec50a8 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -122,7 +122,6 @@ typedef Eo Efl_Canvas_Animation_Group_Sequential; #endif -#define EFL_ANIMATION_GROUP_DURATION_NONE -1 #define EFL_ANIMATION_REPEAT_INFINITE -1 struct _Efl_Canvas_Animation_Player_Event_Running diff --git a/src/lib/evas/canvas/efl_canvas_animation_group.c b/src/lib/evas/canvas/efl_canvas_animation_group.c index 8673efd01e..b6a771501f 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group.c +++ b/src/lib/evas/canvas/efl_canvas_animation_group.c @@ -8,10 +8,7 @@ _efl_canvas_animation_group_animation_add(Eo *eo_obj, if (!animation) return; double duration = efl_animation_duration_get(efl_super(eo_obj, MY_CLASS)); - /* if group animation duration is available value, then the duration is - * propagated to its child. */ - if (duration != EFL_ANIMATION_GROUP_DURATION_NONE) - efl_animation_duration_set(animation, duration); + efl_animation_duration_set(animation, duration); Eina_Bool keep_final_state = efl_animation_final_state_keep_get(eo_obj); efl_animation_final_state_keep_set(animation, keep_final_state); @@ -53,9 +50,8 @@ _efl_canvas_animation_group_efl_canvas_animation_duration_set(Eo *eo_obj, Efl_Canvas_Animation_Group_Data *pd, double duration) { - if (duration == EFL_ANIMATION_GROUP_DURATION_NONE) goto end; - - if (duration < 0.0) return; + efl_animation_duration_set(efl_super(eo_obj, MY_CLASS), duration); + duration = efl_animation_duration_get(eo_obj); Eina_List *l; Efl_Canvas_Animation *anim; @@ -63,9 +59,6 @@ _efl_canvas_animation_group_efl_canvas_animation_duration_set(Eo *eo_obj, { efl_animation_duration_set(anim, duration); } - -end: - efl_animation_duration_set(efl_super(eo_obj, MY_CLASS), duration); } EOLIAN static void @@ -106,9 +99,6 @@ _efl_canvas_animation_group_efl_object_constructor(Eo *eo_obj, pd->animations = NULL; - //group animation does not affect its child duration by default. - efl_animation_duration_set(eo_obj, EFL_ANIMATION_GROUP_DURATION_NONE); - return eo_obj; } From 655472d9c9afd0ce27b53410b4c17cce90e9306b Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 25 Nov 2019 13:33:44 +0100 Subject: [PATCH 09/33] efl_ui_mutli_selectable: stabelize interfaces these classes are after a long naming discussion stable. fixes T7871 fixes T8265 fixes T7922 Reviewed-by: Daniel Kolesa Differential Revision: https://phab.enlightenment.org/D10734 --- src/lib/elementary/efl_ui.eot | 2 +- src/lib/elementary/efl_ui_multi_selectable.eo | 2 +- src/lib/elementary/efl_ui_multi_selectable_index_range.eo | 2 +- src/lib/elementary/efl_ui_multi_selectable_object_range.eo | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui.eot b/src/lib/elementary/efl_ui.eot index 3c186c913e..6b0b10eff5 100644 --- a/src/lib/elementary/efl_ui.eot +++ b/src/lib/elementary/efl_ui.eot @@ -88,7 +88,7 @@ enum @beta Efl.Ui.Widget_Orientation_Mode not change according to the window or screen orientation.]] } -enum @beta Efl.Ui.Select_Mode { +enum Efl.Ui.Select_Mode { [[Type of multi selectable object.]] single, [[Only single child is selected. If a child is selected, previous selected child will be unselected.]] diff --git a/src/lib/elementary/efl_ui_multi_selectable.eo b/src/lib/elementary/efl_ui_multi_selectable.eo index c5237c8118..57e5389386 100644 --- a/src/lib/elementary/efl_ui_multi_selectable.eo +++ b/src/lib/elementary/efl_ui_multi_selectable.eo @@ -1,6 +1,6 @@ import efl_ui; -interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable +interface Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable { [[Interface for getting access to a range of selected items. diff --git a/src/lib/elementary/efl_ui_multi_selectable_index_range.eo b/src/lib/elementary/efl_ui_multi_selectable_index_range.eo index 39747ab8b4..dce9a4e847 100644 --- a/src/lib/elementary/efl_ui_multi_selectable_index_range.eo +++ b/src/lib/elementary/efl_ui_multi_selectable_index_range.eo @@ -1,6 +1,6 @@ import efl_ui; -interface @beta Efl.Ui.Multi_Selectable_Index_Range extends Efl.Ui.Multi_Selectable +interface Efl.Ui.Multi_Selectable_Index_Range extends Efl.Ui.Multi_Selectable { [[Interface for getting access to a range of selected items through their indices. diff --git a/src/lib/elementary/efl_ui_multi_selectable_object_range.eo b/src/lib/elementary/efl_ui_multi_selectable_object_range.eo index f88beb9efa..889afe10f9 100644 --- a/src/lib/elementary/efl_ui_multi_selectable_object_range.eo +++ b/src/lib/elementary/efl_ui_multi_selectable_object_range.eo @@ -1,6 +1,6 @@ import efl_ui; -interface @beta Efl.Ui.Multi_Selectable_Object_Range extends Efl.Ui.Multi_Selectable +interface Efl.Ui.Multi_Selectable_Object_Range extends Efl.Ui.Multi_Selectable { [[Interface for getting access to a range of selected items. From 20699d7f616032f2ec6ccb0972eff2491fd9c538 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 3 Dec 2019 14:47:31 +0100 Subject: [PATCH 10/33] efl_ui_radio_box: declare stable this was forgotten, the task for it (T8026) was even closed. Differential Revision: https://phab.enlightenment.org/D10786 --- src/lib/elementary/efl_ui_radio_box.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_radio_box.eo b/src/lib/elementary/efl_ui_radio_box.eo index e6b2259376..9aa0d87ab2 100644 --- a/src/lib/elementary/efl_ui_radio_box.eo +++ b/src/lib/elementary/efl_ui_radio_box.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box composites Efl.Ui.Radio_Group +class Efl.Ui.Radio_Box extends Efl.Ui.Box composites Efl.Ui.Radio_Group { [[A standard @Efl.Ui.Box container which automatically handles grouping of any @Efl.Ui.Radio widget added to it in addition to regular widgets. From e9281cf124b2b973e1a0d97eef1c3d85ee684903 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 26 Nov 2019 10:48:42 -0500 Subject: [PATCH 11/33] efl_ui/layout: fix typo in theme,changed event checking and fix this event this was a copy/paste error ref 7ad8acc290f078aa9d2bfd32ec15a4e5677ab01f Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10737 --- src/lib/elementary/efl_ui_layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 28e99a1c84..f4e3c0579f 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -2975,7 +2975,7 @@ _efl_ui_layout_base_theme_rotation_apply(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UN EOLIAN static Eina_Bool _efl_ui_layout_base_efl_object_event_callback_priority_add(Eo *obj, Efl_Ui_Layout_Data *pd, const Efl_Event_Description *desc, Efl_Callback_Priority priority, Efl_Event_Cb func, const void *user_data) { - if (desc == EFL_CANVAS_GROUP_EVENT_MEMBER_ADDED) + if (desc == EFL_UI_LAYOUT_EVENT_THEME_CHANGED) { pd->cb_theme_changed = EINA_TRUE; } @@ -2988,7 +2988,7 @@ _efl_ui_layout_base_efl_object_event_callback_array_priority_add(Eo *obj, Efl_Ui { for (int i = 0; array[i].desc; ++i) { - if (array[i].desc == EFL_CANVAS_GROUP_EVENT_MEMBER_ADDED) + if (array[i].desc == EFL_UI_LAYOUT_EVENT_THEME_CHANGED) { pd->cb_theme_changed = EINA_TRUE; } From 3f7a63149a74abc26822e35530914654d7a60c4f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 26 Nov 2019 10:49:55 -0500 Subject: [PATCH 12/33] efl_ui/layout: fix multiple emissions of theme,changed during construction in the case where a layout object was created and had a theme manually set with efl_ui_layout_theme_set() during construction, the layout would then call theme_apply() a second time internally during finalize which, if the theme has not changed (as can only be the case if this flag is unset), results in a repeated theme_apply for the existing theme @fix Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10738 --- src/lib/elementary/efl_ui_layout.c | 12 ++++++++++-- src/lib/elementary/elm_widget_layout.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index f4e3c0579f..e540f4201d 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -557,6 +557,8 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) char buf[64]; static unsigned int version = 0; + sd->needs_theme_apply = EINA_FALSE; + theme_apply_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return EFL_UI_THEME_APPLY_ERROR_GENERIC; @@ -2699,6 +2701,7 @@ EOLIAN static Eo * _efl_ui_layout_base_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) { sd->obj = obj; + sd->needs_theme_apply = EINA_TRUE; sd->finger_size_multiplier_x = sd->finger_size_multiplier_y = 1; obj = efl_constructor(efl_super(obj, MY_CLASS)); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); @@ -2708,12 +2711,17 @@ _efl_ui_layout_base_efl_object_constructor(Eo *obj, Efl_Ui_Layout_Data *sd) } EOLIAN static Efl_Object* -_efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED) +_efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd) { Eo *eo, *win; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); eo = efl_finalize(efl_super(obj, MY_CLASS)); - efl_ui_widget_theme_apply(eo); + if (pd->needs_theme_apply) + { + efl_ui_widget_theme_apply(eo); + /* handle case where subclass does not call into layout */ + pd->needs_theme_apply = EINA_FALSE; + } efl_canvas_group_change(obj); Elm_Layout_Data *ld = efl_data_scope_safe_get(obj, ELM_LAYOUT_MIXIN); diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h index 839bb06131..69565b6fd9 100644 --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h @@ -75,6 +75,7 @@ typedef struct _Efl_Ui_Layout_Data Eina_Bool model_watch : 1; /**< Set to true once we do watch for model change*/ Eina_Bool calc_subobjs : 1; /**< Set to true if group_calc should also handle subobjs during manual calc */ Eina_Bool cb_theme_changed : 1; /**< if theme,changed event subscriber has been added */ + Eina_Bool needs_theme_apply : 1; /**< if theme has not been manually set during construction */ } Efl_Ui_Layout_Data; typedef struct _Elm_Layout_Data From 8729c4b0b5f99e1ca1d4e616a06cad687a08c758 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 26 Nov 2019 10:52:31 -0500 Subject: [PATCH 13/33] tests/layout: fix theme apply test for layout object the group previously used (efl/win/background) no longer exists, and this test never verified that the theme_set call succeeded so this has been failing silently for a long time now we check and verify that the call succeeds in addition to using a valid group Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10739 --- src/tests/elementary/efl_ui_test_layout.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c index 5aa64e0688..6a1763f620 100644 --- a/src/tests/elementary/efl_ui_test_layout.c +++ b/src/tests/elementary/efl_ui_test_layout.c @@ -153,15 +153,17 @@ EFL_START_TEST(efl_ui_layout_test_layout_theme) { Evas_Object *win; const char *klass, *group, *style; + Eina_Error err; win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win, - efl_ui_layout_theme_set(efl_added, "win", "background", NULL) + err = efl_ui_layout_theme_set(efl_added, "button", NULL, "anchor") ); + ck_assert_int_eq(err, 0); efl_ui_layout_theme_get(layout, &klass, &group, &style); - ck_assert_str_eq(klass, "win"); - ck_assert_str_eq(group, "background"); - ck_assert(!style); + ck_assert_str_eq(klass, "button"); + ck_assert(!group); + ck_assert_str_eq(style, "anchor"); } EFL_END_TEST From d54ba9421431912f4b08a843584ac7584a477f1d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 26 Nov 2019 10:54:36 -0500 Subject: [PATCH 14/33] tests/layout: validate EFL_UI_LAYOUT_EVENT_THEME_CHANGED emission in theme test ensure that this callback is emitted exactly one time if the theme is set during construction Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10740 --- src/tests/elementary/efl_ui_test_layout.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c index 6a1763f620..fc7a3b969c 100644 --- a/src/tests/elementary/efl_ui_test_layout.c +++ b/src/tests/elementary/efl_ui_test_layout.c @@ -154,9 +154,11 @@ EFL_START_TEST(efl_ui_layout_test_layout_theme) Evas_Object *win; const char *klass, *group, *style; Eina_Error err; + int called = 0; win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win, + efl_event_callback_add(efl_added, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, (void*)event_callback_single_call_int_data, &called), err = efl_ui_layout_theme_set(efl_added, "button", NULL, "anchor") ); ck_assert_int_eq(err, 0); @@ -164,6 +166,7 @@ EFL_START_TEST(efl_ui_layout_test_layout_theme) ck_assert_str_eq(klass, "button"); ck_assert(!group); ck_assert_str_eq(style, "anchor"); + ck_assert_int_eq(called, 1); } EFL_END_TEST From d434bee31b5c7165eaecc1d93fb772acc564c95a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 26 Nov 2019 10:59:21 -0500 Subject: [PATCH 15/33] tests/layout: add explicit test for implicit theme,changed emission this must be emitted automatically during finalize if theme_set is not directly called during construction Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10741 --- src/tests/elementary/efl_ui_test_layout.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c index fc7a3b969c..387bf9aa68 100644 --- a/src/tests/elementary/efl_ui_test_layout.c +++ b/src/tests/elementary/efl_ui_test_layout.c @@ -149,6 +149,28 @@ EFL_START_TEST(efl_ui_layout_test_layout_force) } EFL_END_TEST +/* private */ +EAPI Eina_Bool elm_widget_theme_klass_set(Evas_Object *obj, const char *name); +EAPI Eina_Bool elm_widget_theme_style_set(Evas_Object *obj, const char *name); + +EFL_START_TEST(efl_ui_layout_test_callback) +{ + Evas_Object *win; + int called = 0; + Eina_Bool klass, style; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + efl_add(EFL_UI_LAYOUT_CLASS, win, + efl_event_callback_add(efl_added, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, (void*)event_callback_single_call_int_data, &called), + klass = elm_widget_theme_klass_set(efl_added, "button"), + style = elm_widget_theme_style_set(efl_added, "anchor") + ); + ck_assert_int_eq(klass, 1); + ck_assert_int_eq(style, 1); + ck_assert_int_eq(called, 1); +} +EFL_END_TEST + EFL_START_TEST(efl_ui_layout_test_layout_theme) { Evas_Object *win; @@ -194,5 +216,6 @@ void efl_ui_test_layout(TCase *tc) tcase_add_test(tc, efl_ui_layout_test_layout_force); tcase_add_test(tc, efl_ui_layout_test_layout_theme); tcase_add_test(tc, efl_ui_layout_test_api_ordering); + tcase_add_test(tc, efl_ui_layout_test_callback); tcase_add_test(tc, efl_ui_layout_test_property_bind_provider); } From 22b005ea8a8f0774de3b34f54eaed9b60e712bc2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 27 Nov 2019 08:12:52 -0500 Subject: [PATCH 16/33] efl_ui/layout: unconditionally emit theme,changed event for legacy layouts this will automatically be optimized by smart callback internals and fix emission of this event Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10750 --- src/lib/elementary/efl_ui_layout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index e540f4201d..941b5f9512 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -540,7 +540,9 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd, Elm_Widget_Smart_ if (ret != EFL_UI_THEME_APPLY_ERROR_GENERIC) { if (sd->cb_theme_changed) - efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL); + efl_event_callback_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL); + if (elm_widget_is_legacy(obj)) + evas_object_smart_callback_call(obj, "theme,changed", NULL); } if (!_visuals_refresh(obj, sd)) From a8417668bcf17f2df642dadbe4f2699c13756063 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Wed, 27 Nov 2019 08:23:12 -0500 Subject: [PATCH 17/33] tests/layout: add unit test for legacy layout theme,changed signal split from D10744 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10751 --- src/tests/elementary/elm_test_layout.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/tests/elementary/elm_test_layout.c b/src/tests/elementary/elm_test_layout.c index 7ddffc9345..d08b9cb0d8 100644 --- a/src/tests/elementary/elm_test_layout.c +++ b/src/tests/elementary/elm_test_layout.c @@ -114,10 +114,27 @@ EFL_START_TEST(elm_layout_test_sizing) } EFL_END_TEST +EFL_START_TEST(elm_layout_test_theme_changed_callback) +{ + Evas_Object *win, *ly; + int called = 0; + + win = win_add(NULL, "layout", ELM_WIN_BASIC); + evas_object_show(win); + + ly = elm_button_add(win); + evas_object_smart_callback_add(ly, "theme,changed", event_callback_single_call_int_data, &called); + evas_object_show(ly); + elm_object_style_set(ly, "anchor"); + ck_assert_int_eq(called, 1); +} +EFL_END_TEST + void elm_test_layout(TCase *tc) { tcase_add_test(tc, elm_layout_test_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); tcase_add_test(tc, elm_layout_test_swallows); tcase_add_test(tc, elm_layout_test_sizing); + tcase_add_test(tc, elm_layout_test_theme_changed_callback); } From 44b532425915aeaf97637db96053e03b2b97bfa7 Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Wed, 6 Nov 2019 18:41:13 +0000 Subject: [PATCH 18/33] charp: Require mono bindings when using dotnet Allow using `-Ddotnet=true` to automatically pull `bindings=mono`. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10610 --- src/bindings/meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bindings/meson.build b/src/bindings/meson.build index e6a59d1559..b59e084d8a 100644 --- a/src/bindings/meson.build +++ b/src/bindings/meson.build @@ -2,6 +2,11 @@ bindings = get_option('bindings') bindings_order = ['luajit', 'cxx', 'mono'] +if (get_option('dotnet') and not bindings.contains('mono')) + message('dotnet support requires the C# bindings') + bindings += ['mono'] +endif + if (bindings.contains('cxx') == false and bindings.contains('mono')) subdirs = ['eina_cxx', 'eolian_cxx'] subdir(join_paths('cxx', 'eina_cxx')) From b179e397d66c29712a7c38254b8c67daa6a77dc0 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Wed, 4 Dec 2019 17:25:45 +0100 Subject: [PATCH 19/33] Efl.Canvas.Animation: Rename repeat_count to play_count Summary: play_count is a tad simpler to understand, since it means the TOTAL number of times the animation will play. The default value is now 1, and 0 means INFINITE (instead of -1). This allows removing yet another constant from header files. Depends on D10799 Test Plan: Everything builds and passes tests. Elm_test Animation.Repeat has been adjusted accordingly. Reviewers: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10800 --- src/bin/elementary/test_efl_anim_repeat.c | 38 +++++++++---------- src/examples/evas/efl-canvas-animation.c | 8 ++-- src/lib/evas/Evas_Common.h | 2 - src/lib/evas/Evas_Eo.h | 2 - src/lib/evas/canvas/efl_canvas_animation.c | 15 ++++---- src/lib/evas/canvas/efl_canvas_animation.eo | 14 ++++--- .../canvas/efl_canvas_animation_private.h | 4 +- .../canvas/efl_canvas_animation_types.eot | 8 ++-- .../evas/canvas/efl_canvas_object_animation.c | 4 +- 9 files changed, 48 insertions(+), 47 deletions(-) diff --git a/src/bin/elementary/test_efl_anim_repeat.c b/src/bin/elementary/test_efl_anim_repeat.c index 0f72882207..b3dddcd0e3 100644 --- a/src/bin/elementary/test_efl_anim_repeat.c +++ b/src/bin/elementary/test_efl_anim_repeat.c @@ -10,7 +10,7 @@ typedef struct _App_Data Elm_Button *button; Evas_Object *start_btn; - Evas_Object *repeat_count_spin; + Evas_Object *play_count_spin; Evas_Object *repeat_mode_spin; Eina_Bool is_btn_visible; @@ -44,8 +44,8 @@ _anim_changed_cb(void *data, const Efl_Event *event EINA_UNUSED) Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin); if (repeat_mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE) { - int repeat_count = elm_spinner_value_get(ad->repeat_count_spin); - if (repeat_count % 2 == 1) + int play_count = elm_spinner_value_get(ad->play_count_spin); + if (play_count % 2 == 0) { ad->is_btn_visible = !(ad->is_btn_visible); if (ad->is_btn_visible) @@ -54,7 +54,7 @@ _anim_changed_cb(void *data, const Efl_Event *event EINA_UNUSED) elm_object_text_set(ad->start_btn, "Start Alpha Animation from 0.0 to 1.0"); } } - elm_object_disabled_set(ad->repeat_count_spin, EINA_FALSE); + elm_object_disabled_set(ad->play_count_spin, EINA_FALSE); elm_object_disabled_set(ad->repeat_mode_spin, EINA_FALSE); } } @@ -78,16 +78,16 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED ad->is_btn_visible = !(ad->is_btn_visible); - int repeat_count = elm_spinner_value_get(ad->repeat_count_spin); - elm_object_disabled_set(ad->repeat_count_spin, EINA_TRUE); + int play_count = elm_spinner_value_get(ad->play_count_spin); + elm_object_disabled_set(ad->play_count_spin, EINA_TRUE); Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin); elm_object_disabled_set(ad->repeat_mode_spin, EINA_TRUE); if (ad->is_btn_visible) { - //Set animation repeat count - efl_animation_repeat_count_set(ad->show_anim, repeat_count); + //Set animation play count + efl_animation_play_count_set(ad->show_anim, play_count); //Set animation repeat mode efl_animation_repeat_mode_set(ad->show_anim, repeat_mode); @@ -99,7 +99,7 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED else { //Set animation repeat count - efl_animation_repeat_count_set(ad->hide_anim, repeat_count); + efl_animation_play_count_set(ad->hide_anim, play_count); //Set animation repeat mode efl_animation_repeat_mode_set(ad->hide_anim, repeat_mode); @@ -158,15 +158,15 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void evas_object_move(start_btn, 100, 300); evas_object_show(start_btn); - //Spinner to set animation repeat count - Evas_Object *repeat_count_spin = elm_spinner_add(win); - elm_spinner_label_format_set(repeat_count_spin, "Repeat Count: %d"); - elm_spinner_editable_set(repeat_count_spin, EINA_FALSE); - elm_spinner_min_max_set(repeat_count_spin, 0, 3); - elm_spinner_value_set(repeat_count_spin, 0); - evas_object_resize(repeat_count_spin, 200, 50); - evas_object_move(repeat_count_spin, 100, 350); - evas_object_show(repeat_count_spin); + //Spinner to set animation play count + Evas_Object *play_count_spin = elm_spinner_add(win); + elm_spinner_label_format_set(play_count_spin, "Play Count (0 is infinite): %d"); + elm_spinner_editable_set(play_count_spin, EINA_FALSE); + elm_spinner_min_max_set(play_count_spin, 0, 3); + elm_spinner_value_set(play_count_spin, 1); + evas_object_resize(play_count_spin, 200, 50); + evas_object_move(play_count_spin, 100, 350); + evas_object_show(play_count_spin); //Spinner to set animation repeat mode Evas_Object *repeat_mode_spin = elm_spinner_add(win); @@ -184,7 +184,7 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void ad->show_anim = show_anim; ad->hide_anim = hide_anim; ad->start_btn = start_btn; - ad->repeat_count_spin = repeat_count_spin; + ad->play_count_spin = play_count_spin; ad->repeat_mode_spin = repeat_mode_spin; ad->is_btn_visible = EINA_TRUE; ad->button = btn; diff --git a/src/examples/evas/efl-canvas-animation.c b/src/examples/evas/efl-canvas-animation.c index 2cc2355956..cc24550dea 100644 --- a/src/examples/evas/efl-canvas-animation.c +++ b/src/examples/evas/efl-canvas-animation.c @@ -118,7 +118,7 @@ main(void) efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(3.0, 3.0), scale_rect, EINA_VECTOR2(0.5, 0.5)), efl_animation_start_delay_set(efl_added, 5.0), efl_animation_duration_set(efl_added, 2.0), - efl_animation_repeat_count_set(efl_added, EFL_ANIMATION_REPEAT_INFINITE) + efl_animation_play_count_set(efl_added, 0) ), 1.0, 0.0); @@ -128,7 +128,7 @@ main(void) efl_new(EFL_CANVAS_ANIMATION_SCALE_CLASS, efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(3.0, 3.0), scale_rect2, EINA_VECTOR2(0.5, 0.5)), efl_animation_duration_set(efl_added, 2.0), - efl_animation_repeat_count_set(efl_added, EFL_ANIMATION_REPEAT_INFINITE), + efl_animation_play_count_set(efl_added, 0), efl_animation_repeat_mode_set(efl_added, EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE) ), 1.0, 0.0); @@ -139,7 +139,7 @@ main(void) efl_new(EFL_CANVAS_ANIMATION_SCALE_CLASS, efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(3.0, 3.0), scale_rect3, EINA_VECTOR2(0.5, 0.5)), efl_animation_duration_set(efl_added, 2.0), - efl_animation_repeat_count_set(efl_added, 3), + efl_animation_play_count_set(efl_added, 4), efl_animation_repeat_mode_set(efl_added, EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE) ), 1.0, 0.0); @@ -162,7 +162,7 @@ main(void) efl_new(EFL_CANVAS_ANIMATION_SCALE_CLASS, efl_animation_scale_set(efl_added, EINA_VECTOR2(1.0, 1.0), EINA_VECTOR2(5.0, 5.0), scale_rect5, EINA_VECTOR2(0.5, 0.5)), efl_animation_duration_set(efl_added, 5.0), - efl_animation_repeat_count_set(efl_added, EFL_ANIMATION_REPEAT_INFINITE) + efl_animation_play_count_set(efl_added, 0) ), 1.0, 0.0); d.current_speed = 1.0; diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index d7fa681094..d75cc1a6aa 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -3482,8 +3482,6 @@ typedef Eo Efl_Animation_Group_Sequential; #endif -#define EFL_ANIMATION_REPEAT_INFINITE -1 - // The below type are necessary for legacy API and need to be manually kept in sync with .eo file. #ifndef _EFL_INPUT_DEVICE_EO_CLASS_TYPE #define _EFL_INPUT_DEVICE_EO_CLASS_TYPE diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index f156ec50a8..9d873d565d 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -122,8 +122,6 @@ typedef Eo Efl_Canvas_Animation_Group_Sequential; #endif -#define EFL_ANIMATION_REPEAT_INFINITE -1 - struct _Efl_Canvas_Animation_Player_Event_Running { double progress; diff --git a/src/lib/evas/canvas/efl_canvas_animation.c b/src/lib/evas/canvas/efl_canvas_animation.c index 001dca7892..53d006fd20 100644 --- a/src/lib/evas/canvas/efl_canvas_animation.c +++ b/src/lib/evas/canvas/efl_canvas_animation.c @@ -52,19 +52,19 @@ _efl_canvas_animation_repeat_mode_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_A } EOLIAN static void -_efl_canvas_animation_repeat_count_set(Eo *eo_obj EINA_UNUSED, +_efl_canvas_animation_play_count_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd, int count) { - EINA_SAFETY_ON_FALSE_RETURN(count >= EFL_ANIMATION_REPEAT_INFINITE); + EINA_SAFETY_ON_FALSE_RETURN(count >= 0); - pd->repeat_count = count; + pd->play_count = count; } EOLIAN static int -_efl_canvas_animation_repeat_count_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd) +_efl_canvas_animation_play_count_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Data *pd) { - return pd->repeat_count; + return pd->play_count; } EOLIAN static void @@ -115,12 +115,12 @@ _efl_canvas_animation_animation_apply(Eo *eo_obj, EOLIAN static double _efl_canvas_animation_efl_playable_length_get(const Eo *eo_obj, Efl_Canvas_Animation_Data *pd EINA_UNUSED) { - if (efl_animation_repeat_count_get(eo_obj) == EFL_ANIMATION_REPEAT_INFINITE) + if (efl_animation_play_count_get(eo_obj) == 0) { return INFINITY; } - return (efl_animation_duration_get(eo_obj) * (efl_animation_repeat_count_get(eo_obj) + 1)); + return (efl_animation_duration_get(eo_obj) * efl_animation_play_count_get(eo_obj)); } EOLIAN static Eina_Bool @@ -139,6 +139,7 @@ EOLIAN static Efl_Object* _efl_canvas_animation_efl_object_constructor(Eo *obj, Efl_Canvas_Animation_Data *pd) { pd->duration = _default_animation_time; + pd->play_count = 1; return efl_constructor(efl_super(obj, MY_CLASS)); } diff --git a/src/lib/evas/canvas/efl_canvas_animation.eo b/src/lib/evas/canvas/efl_canvas_animation.eo index a55cf73bbd..49bd1cb9b4 100644 --- a/src/lib/evas/canvas/efl_canvas_animation.eo +++ b/src/lib/evas/canvas/efl_canvas_animation.eo @@ -40,7 +40,7 @@ class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable @property duration { [[The duration of a single animation "run". The @Efl.Playable.length implementation will return this duration adjusted by @.repeat_mode and - @.repeat_count. + @.play_count. ]] set { } @@ -61,13 +61,15 @@ class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable mode: Efl.Canvas.Animation_Repeat_Mode(Efl.Canvas.Animation_Repeat_Mode.restart); [[Repeat mode.]] } } - @property repeat_count { - [[How many times to repeat an animation once it finishes. - $[0] means that the animation only plays once (it is not repeated) and is the default value. - $[-1] means that the animation is repeated forever. + @property play_count { + [[How many times to play an animation. + $[1] means that the animation only plays once (it is not repeated), whereas $[2] will play it + again once it finishes the first time and then stop. + $[0] means that the animation is repeated forever. + @.repeat_mode controls the direction in which subsequent playbacks will run. ]] values { - count: int(0); [[Repeat count.]] + count: int(1); [[Play count.]] } } @property start_delay { diff --git a/src/lib/evas/canvas/efl_canvas_animation_private.h b/src/lib/evas/canvas/efl_canvas_animation_private.h index c8f0609103..9995d23589 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_private.h +++ b/src/lib/evas/canvas/efl_canvas_animation_private.h @@ -10,7 +10,7 @@ typedef struct _Efl_Canvas_Animation_Data double start_delay_time; Efl_Canvas_Animation_Repeat_Mode repeat_mode; - int repeat_count; + int play_count; Efl_Interpolator *interpolator; @@ -25,4 +25,4 @@ typedef struct _Efl_Canvas_Animation_Data #define FINAL_STATE_IS_REVERSE(anim) \ ((efl_animation_repeat_mode_get(anim) == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE) && \ - (efl_animation_repeat_count_get(anim) & 1)) + (efl_animation_play_count_get(anim) & 1)) diff --git a/src/lib/evas/canvas/efl_canvas_animation_types.eot b/src/lib/evas/canvas/efl_canvas_animation_types.eot index cfdda2d490..bb44fe4dd1 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_types.eot +++ b/src/lib/evas/canvas/efl_canvas_animation_types.eot @@ -5,9 +5,11 @@ struct @beta Efl.Canvas.Animation_Player_Event_Running; [[Information of event r enum @beta Efl.Canvas.Animation_Repeat_Mode { - [[Animation repeat mode]] + [[Animation repeat mode.]] - restart = 0, [[Restart animation when the animation ends.]] - reverse = 1, [[Reverse animation when the animation ends.]] + restart = 0, [[Restart animation when the animation ends: The animation will play again from the beginning to the + end.]] + reverse = 1, [[Reverse animation when the animation ends: The animation will continue playing from the end to the + beginning.]] last } diff --git a/src/lib/evas/canvas/efl_canvas_object_animation.c b/src/lib/evas/canvas/efl_canvas_object_animation.c index 5663833a26..3fbc0e94f4 100644 --- a/src/lib/evas/canvas/efl_canvas_object_animation.c +++ b/src/lib/evas/canvas/efl_canvas_object_animation.c @@ -70,7 +70,7 @@ _animator_cb(void *data, const Efl_Event *ev EINA_UNUSED) (pd->in->speed > 0 && EINA_DBL_EQ(pd->in->progress, 1.0))) { //Repeat animation - if ((efl_animation_repeat_count_get(pd->in->animation) == EFL_ANIMATION_REPEAT_INFINITE) || + if ((efl_animation_play_count_get(pd->in->animation) == 0) || (pd->in->remaining_repeats > 0)) { pd->in->remaining_repeats--; @@ -167,7 +167,7 @@ _efl_canvas_object_animation_animation_start(Eo *obj, Efl_Canvas_Object_Animatio in->pause_state = EINA_FALSE; in->animation = efl_ref(animation); - in->remaining_repeats = efl_animation_repeat_count_get(animation); // -1 because one run is already going on + in->remaining_repeats = efl_animation_play_count_get(animation) - 1; // -1 because one run is already going on in->speed = speed; in->start_pos = start_pos; efl_event_callback_call(obj, EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_CHANGED, in->animation); From 76fa7184a4a4568dabdd76fa44e287415c18c11f Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 4 Dec 2019 17:45:25 +0100 Subject: [PATCH 20/33] efl_canvas_animation_group: show that playing backwards is also working Summary: playing backwards is also working, this is simply shown here, the handcrafted backwards animation wasnt showing the correct animation either. Depends on D10799 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10802 --- .../elementary/test_efl_anim_group_parallel.c | 27 +-------------- .../test_efl_anim_group_sequential.c | 33 +------------------ 2 files changed, 2 insertions(+), 58 deletions(-) diff --git a/src/bin/elementary/test_efl_anim_group_parallel.c b/src/bin/elementary/test_efl_anim_group_parallel.c index ed319e588c..728c54ea4e 100644 --- a/src/bin/elementary/test_efl_anim_group_parallel.c +++ b/src/bin/elementary/test_efl_anim_group_parallel.c @@ -5,7 +5,6 @@ typedef struct _App_Data { - Efl_Canvas_Animation *parallel_show_anim; Efl_Canvas_Animation *parallel_hide_anim; Elm_Button *button; @@ -49,7 +48,7 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) if (ad->is_btn_visible) { //Create Animation Object from Animation - efl_canvas_object_animation_start(ad->button, ad->parallel_show_anim, 1.0, 0.0); + efl_canvas_object_animation_start(ad->button, ad->parallel_hide_anim, -1.0, 0.0); efl_text_set(obj, "Start Parallel Group Animation to hide button"); } else @@ -88,29 +87,6 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE evas_object_show(btn); efl_event_callback_array_add(btn, animation_stats_cb(), ad); - //Show Animation - Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win); - efl_animation_alpha_set(show_anim, 0.0, 1.0); - - //Rotate from 45 to 0 degrees Animation - Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win); - efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, EINA_VECTOR2(0.5, 0.5)); - - //Scale Animation to zoom out - Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win); - efl_animation_scale_set(scale_half_anim, EINA_VECTOR2(2.0, 2.0), EINA_VECTOR2(1.0, 1.0), NULL, EINA_VECTOR2(0.5, 0.5)); - - //Show Parallel Group Animation - Efl_Canvas_Animation *parallel_show_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_PARALLEL_CLASS, win); - efl_animation_duration_set(parallel_show_anim, 1.0); - efl_animation_final_state_keep_set(parallel_show_anim, EINA_TRUE); - - //Add animations to group animation - efl_animation_group_animation_add(parallel_show_anim, show_anim); - efl_animation_group_animation_add(parallel_show_anim, ccw_45_degrees_anim); - efl_animation_group_animation_add(parallel_show_anim, scale_half_anim); - - //Hide Animation Efl_Canvas_Animation *hide_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win); efl_animation_alpha_set(hide_anim, 1.0, 0.0); @@ -135,7 +111,6 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE //Initialize App Data - ad->parallel_show_anim = parallel_show_anim; ad->parallel_hide_anim = parallel_hide_anim; ad->button = btn; diff --git a/src/bin/elementary/test_efl_anim_group_sequential.c b/src/bin/elementary/test_efl_anim_group_sequential.c index 37b4e53434..60b3a836a1 100644 --- a/src/bin/elementary/test_efl_anim_group_sequential.c +++ b/src/bin/elementary/test_efl_anim_group_sequential.c @@ -5,7 +5,6 @@ typedef struct _App_Data { - Efl_Canvas_Animation *sequential_show_anim; Efl_Canvas_Animation *sequential_hide_anim; Elm_Button *button; @@ -49,7 +48,7 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) if (ad->is_btn_visible) { //Create Animation Object from Animation - efl_canvas_object_animation_start(ad->button, ad->sequential_show_anim, 1.0, 0.0); + efl_canvas_object_animation_start(ad->button, ad->sequential_hide_anim, -1.0, 0.0); efl_text_set(obj, "Start Sequential Group Animation to hide button"); } else @@ -111,37 +110,7 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU efl_animation_group_animation_add(sequential_hide_anim, scale_double_anim); efl_animation_group_animation_add(sequential_hide_anim, hide_anim); - - /* Animations to show button */ - //Show Animation - Efl_Canvas_Animation *show_anim = efl_add(EFL_CANVAS_ANIMATION_ALPHA_CLASS, win); - efl_animation_alpha_set(show_anim, 0.0, 1.0); - efl_animation_duration_set(show_anim, 1.0); - - //Scale Animation to zoom out - Efl_Canvas_Animation *scale_half_anim = efl_add(EFL_CANVAS_ANIMATION_SCALE_CLASS, win); - efl_animation_scale_set(scale_half_anim, EINA_VECTOR2(2.0, 2.0), EINA_VECTOR2(1.0, 1.0), NULL, EINA_VECTOR2(0.5, 0.5)); - efl_animation_duration_set(scale_half_anim, 1.0); - - //Rotate from 45 to 0 degrees Animation - Efl_Canvas_Animation *ccw_45_degrees_anim = efl_add(EFL_CANVAS_ANIMATION_ROTATE_CLASS, win); - efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, EINA_VECTOR2(0.5, 0.5)); - efl_animation_duration_set(ccw_45_degrees_anim, 1.0); - - //Show Sequential Group Animation - Efl_Canvas_Animation *sequential_show_anim = efl_add(EFL_CANVAS_ANIMATION_GROUP_SEQUENTIAL_CLASS, win); - efl_animation_final_state_keep_set(sequential_show_anim, EINA_TRUE); - //efl_animation_duration_set() is called for each animation not to set the same duration - - //Add animations to group animation - //First, parallel_hide_anim is added with duration 0 to set the initial state - efl_animation_group_animation_add(sequential_show_anim, show_anim); - efl_animation_group_animation_add(sequential_show_anim, scale_half_anim); - efl_animation_group_animation_add(sequential_show_anim, ccw_45_degrees_anim); - - //Initialize App Data - ad->sequential_show_anim = sequential_show_anim; ad->sequential_hide_anim = sequential_hide_anim; ad->button = btn; From b04a7ed4f4d031ef92d028b5fe84ec9150da2e15 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Wed, 4 Dec 2019 18:22:25 +0100 Subject: [PATCH 21/33] code comments: annoying typos --- src/lib/elementary/efl_ui_view_model.c | 2 +- src/lib/elementary/efl_ui_view_model.eo | 4 ++-- src/lib/elementary/efl_ui_widget.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_view_model.c b/src/lib/elementary/efl_ui_view_model.c index 0194e47a87..85e8e33694 100644 --- a/src/lib/elementary/efl_ui_view_model.c +++ b/src/lib/elementary/efl_ui_view_model.c @@ -30,7 +30,7 @@ struct _Efl_Ui_View_Model_Data Eina_Bool child_removed : 1; } propagating; // Boolean to prevent reentrance event emission on the same object Eina_Bool finalized : 1; - Eina_Bool children_bind : 1; // Define if child object should be automatically binded + Eina_Bool children_bind : 1; // Define if child object should be automatically bound }; struct _Efl_Ui_View_Model_Text diff --git a/src/lib/elementary/efl_ui_view_model.eo b/src/lib/elementary/efl_ui_view_model.eo index d5dcdbeaf8..6d07f8d101 100644 --- a/src/lib/elementary/efl_ui_view_model.eo +++ b/src/lib/elementary/efl_ui_view_model.eo @@ -76,8 +76,8 @@ class Efl.Ui.View_Model extends Efl.Composite_Model with the above property name.]] set: EflUiViewModelPropertySet; [[Define the set callback called when the @Efl.Model.property.set is called with the above property name.]] - binded: iterator @move; [[Iterator of property name to bind with this defined property see - @.property_bind.]] + bound: iterator @move; [[Iterator of property name to bind with this defined property see + @.property_bind.]] } return: Eina.Error; } diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 96cecc68c7..370bf4e045 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -5981,7 +5981,7 @@ _efl_ui_property_bind(Eo *widget, Eo *target, Efl_Ui_Widget_Data *pd, { Efl_Ui_Property_Bound *prop; - // Always check for a model and fetch a provider in case a binded property + // Always check for a model and fetch a provider in case a bound property // is provided by a class down the hierarchy, but they still need to be notified // when a model change _efl_ui_widget_model_register(widget, pd); From 003ce06e85ba0f1597a26405ead92f2e01607177 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Sat, 23 Nov 2019 01:09:13 -0800 Subject: [PATCH 22/33] elementary: small improvement on example migrating them to newer unified API. --- .../elementary/layout_property_bind.c | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/examples/elementary/layout_property_bind.c b/src/examples/elementary/layout_property_bind.c index f9c5cf979e..8dc68a564a 100644 --- a/src/examples/elementary/layout_property_bind.c +++ b/src/examples/elementary/layout_property_bind.c @@ -27,6 +27,8 @@ struct _Layout_Model_Data }; typedef struct _Layout_Model_Data Layout_Model_Data; +static Evas_Object *win = NULL; + static Eina_Value _wait_for_image(Eo *o EINA_UNUSED, void *data, const Eina_Value v) { @@ -50,22 +52,32 @@ _cleanup_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void } static void -_list_selected_cb(void *data EINA_UNUSED, const Efl_Event *event) +_list_pressed_item_cb(void *data EINA_UNUSED, const Efl_Event *event) { Layout_Model_Data *priv = data; - Eo *child = event->info; + Efl_Ui_Item_Clickable_Pressed *pressed = event->info; + Efl_Ui_Item *item = pressed->item; + Efl_Model *model = efl_ui_view_model_get(item); - printf("LIST selected model\n"); - efl_ui_view_model_set(priv->provider, child); + printf("LIST pressed model `%s` from item `%s`.\n", + efl_debug_name_get(model), + efl_debug_name_get(item)); + efl_ui_view_model_set(priv->provider, model); } static void _update_cb(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED) { Layout_Model_Data *priv = data; + Efl_Model *newone; const char *text = elm_object_text_get(priv->entry); - elm_layout_text_set(priv->label, "default", text); + newone = efl_add(EFL_IO_MODEL_CLASS, win, + efl_io_model_path_set(efl_added, text)); + efl_ui_view_model_set(priv->fileview, newone); + efl_del(priv->model); + priv->model = newone; + } static void @@ -103,7 +115,8 @@ EAPI_MAIN int elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { Layout_Model_Data *priv; - Evas_Object *win, *panes, *bxr, *genlist; + Evas_Object *panes, *bxr; + Efl_Ui_Factory *factory; Eo *img_factory; char *dirname; @@ -122,16 +135,19 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) if (argv[1] != NULL) dirname = argv[1]; else dirname = EFL_MODEL_TEST_FILENAME_PATH; - priv->model = efl_add_ref(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname)); + priv->model = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname)); - genlist = elm_genlist_add(win); - priv->fileview = efl_add_ref(ELM_VIEW_LIST_CLASS, win, elm_view_list_genlist_set(efl_added, genlist, ELM_GENLIST_ITEM_NONE, NULL)); - elm_view_list_property_connect(priv->fileview, "filename", "elm.text"); - elm_view_list_model_set(priv->fileview, priv->model); - _widget_init(genlist); - elm_object_part_content_set(panes, "left", genlist); + factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win); + efl_ui_widget_factory_item_class_set(factory, EFL_UI_LIST_DEFAULT_ITEM_CLASS); + efl_ui_property_bind(factory, "efl.text", "filename"); + + priv->fileview = efl_add(EFL_UI_LIST_VIEW_CLASS, panes, + efl_ui_collection_view_factory_set(efl_added, factory), + efl_ui_view_model_set(efl_added, priv->model)); + _widget_init(priv->fileview); + elm_object_part_content_set(panes, "left", priv->fileview); elm_panes_content_left_size_set(panes, 0.3); - efl_event_callback_add(priv->fileview, ELM_VIEW_LIST_EVENT_MODEL_SELECTED, _list_selected_cb, priv); + efl_event_callback_add(priv->fileview, EFL_UI_EVENT_ITEM_PRESSED, _list_pressed_item_cb, priv); bxr = elm_box_add(win); priv->bxr = bxr; From f3d9b8ee703621cfbb52a03d346335148318af7a Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 1 Nov 2019 09:35:09 +0100 Subject: [PATCH 23/33] esacpe: remove library from tree This has not been used for a while and is not even buildable after our switch to meson. It was a niche to start with given that it needed the PS3 OS to run on. I asked for any remaining users at EDD and on the list but heard nothing. Time to remove. Signed-off-by: Stefan Schmidt Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10778 --- COMPLIANCE | 4 +- README | 10 - doc/main.dox | 6 - old/README.escape | 4 - src/lib/ecore/ecore_exe_ps3.c | 20 -- src/lib/ecore/ecore_pipe.c | 4 - src/lib/ecore_con/ecore_con_url_curl.c | 4 - src/lib/ecore_con/efl_net_ssl_conn-openssl.c | 4 - src/lib/ecore_file/ecore_file_private.h | 4 - src/lib/eina/eina_counter.c | 4 - src/lib/eina/eina_file.c | 4 - src/lib/eina/eina_file_common.c | 4 - src/lib/eina/eina_module.c | 4 - src/lib/eina/eina_prefix.c | 4 - src/lib/escape/Escape.h | 83 --------- src/lib/escape/escape_libgen.c | 90 --------- src/lib/escape/escape_libgen.h | 33 ---- src/lib/escape/escape_mman.c | 67 ------- src/lib/escape/escape_unistd.c | 184 ------------------- src/lib/escape/escape_unistd.h | 108 ----------- src/lib/escape/sys/mman.h | 180 ------------------ src/lib/evas/include/evas_common_private.h | 4 - 22 files changed, 1 insertion(+), 828 deletions(-) delete mode 100644 old/README.escape delete mode 100644 src/lib/ecore/ecore_exe_ps3.c delete mode 100644 src/lib/escape/Escape.h delete mode 100644 src/lib/escape/escape_libgen.c delete mode 100644 src/lib/escape/escape_libgen.h delete mode 100644 src/lib/escape/escape_mman.c delete mode 100644 src/lib/escape/escape_unistd.c delete mode 100644 src/lib/escape/escape_unistd.h delete mode 100644 src/lib/escape/sys/mman.h diff --git a/COMPLIANCE b/COMPLIANCE index ecd0c343ec..1df68cfb01 100644 --- a/COMPLIANCE +++ b/COMPLIANCE @@ -39,9 +39,7 @@ pieces of information you will need. Q. Do I need to make the source public of libraries or applications that I build on top of EFL? -A. No, UNLESS you use the escape library. Escape is GPL. This is ONLY -needed for PS3 development, so unless you are doing this, it is not -relevant. +A. No Q. Do I need to provide the source for EFL? A. Yes. In general you do. If you are shipping any of the binaries or diff --git a/README b/README index de08b78e9a..5fd277ede7 100644 --- a/README +++ b/README @@ -365,16 +365,6 @@ their behavior as if they were real physical objects. -**Escape:** - -//GPL v2 license// - -This library is used as a compatibility library to provide missing -libc APIs for porting to the Playstation 3 (PS3) native runtime -environment. - - - **Ethumb:** //LGPL v2 license// diff --git a/doc/main.dox b/doc/main.dox index d9e50bcb79..a0e32886e4 100644 --- a/doc/main.dox +++ b/doc/main.dox @@ -209,12 +209,6 @@ * @brief Microsoft Windows portability layer. */ -/** - * @defgroup Escape Escape - * - * @brief PlayStation3 portability layer. - */ - /** * @defgroup Ecore Ecore * diff --git a/old/README.escape b/old/README.escape deleted file mode 100644 index d45099f00d..0000000000 --- a/old/README.escape +++ /dev/null @@ -1,4 +0,0 @@ - The Escape library is a library that acts implements some of the missing - function from the PS3 GameOS system that are needed for the proper - functioning of the EFL. - diff --git a/src/lib/ecore/ecore_exe_ps3.c b/src/lib/ecore/ecore_exe_ps3.c deleted file mode 100644 index 1ef1e81fcb..0000000000 --- a/src/lib/ecore/ecore_exe_ps3.c +++ /dev/null @@ -1,20 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef HAVE_ESCAPE -# include -#endif - -#include "Ecore.h" -#include "ecore_private.h" - -void -_ecore_exe_init(void) -{ -} - -void -_ecore_exe_shutdown(void) -{ -} diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c index d352853c4b..702f19cbca 100644 --- a/src/lib/ecore/ecore_pipe.c +++ b/src/lib/ecore/ecore_pipe.c @@ -26,10 +26,6 @@ # endif #endif -#ifdef HAVE_ESCAPE -# include -#endif - #ifdef HAVE_EXOTIC # include #endif diff --git a/src/lib/ecore_con/ecore_con_url_curl.c b/src/lib/ecore_con/ecore_con_url_curl.c index 4217f914d8..f4fe730cdd 100644 --- a/src/lib/ecore_con/ecore_con_url_curl.c +++ b/src/lib/ecore_con/ecore_con_url_curl.c @@ -12,10 +12,6 @@ # include #endif -#ifdef HAVE_ESCAPE -# include -#endif - #include "Ecore.h" #include "ecore_private.h" #include "Ecore_Con.h" diff --git a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c index 3f88c20237..451fd242ae 100644 --- a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c +++ b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c @@ -21,10 +21,6 @@ # include /* dlsym */ #endif -#ifdef HAVE_ESCAPE -# include -#endif - #ifdef HAVE_EXOTIC # include #endif diff --git a/src/lib/ecore_file/ecore_file_private.h b/src/lib/ecore_file/ecore_file_private.h index 01ea0a4f11..4c8561d6f7 100644 --- a/src/lib/ecore_file/ecore_file_private.h +++ b/src/lib/ecore_file/ecore_file_private.h @@ -5,10 +5,6 @@ # include #endif -#ifdef HAVE_ESCAPE -# include -#endif - #include #include diff --git a/src/lib/eina/eina_counter.c b/src/lib/eina/eina_counter.c index 08c6583475..1143c566fa 100644 --- a/src/lib/eina/eina_counter.c +++ b/src/lib/eina/eina_counter.c @@ -33,10 +33,6 @@ #include "eina_safety_checks.h" #include "eina_counter.h" -#ifdef HAVE_ESCAPE -# include -#endif - #include "eina_private.h" /*============================================================================* diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c index 6277ad6a3e..bc656233ac 100644 --- a/src/lib/eina/eina_file.c +++ b/src/lib/eina/eina_file.c @@ -59,10 +59,6 @@ #include "eina_xattr.h" #include "eina_file_common.h" -#ifdef HAVE_ESCAPE -# include -#endif - /*============================================================================* * Local * *============================================================================*/ diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c index 7fdf491654..c1517d5874 100644 --- a/src/lib/eina/eina_file_common.c +++ b/src/lib/eina/eina_file_common.c @@ -41,10 +41,6 @@ #include "eina_file_common.h" #include "eina_xattr.h" -#ifdef HAVE_ESCAPE -# include -#endif - #ifndef O_BINARY # define O_BINARY 0 #endif diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index bff6e3f317..674da6aeb5 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -35,10 +35,6 @@ # include #endif -#ifdef HAVE_ESCAPE -# include -#endif - #ifdef HAVE_EXOTIC # include #endif diff --git a/src/lib/eina/eina_prefix.c b/src/lib/eina/eina_prefix.c index 56737adb50..dd483a085a 100644 --- a/src/lib/eina/eina_prefix.c +++ b/src/lib/eina/eina_prefix.c @@ -46,10 +46,6 @@ # include /* path_is_absolute realpath dladdr */ #endif -#ifdef HAVE_ESCAPE -# include -#endif - #include "eina_config.h" #include "eina_private.h" #include "eina_alloca.h" diff --git a/src/lib/escape/Escape.h b/src/lib/escape/Escape.h deleted file mode 100644 index 210bc872a1..0000000000 --- a/src/lib/escape/Escape.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef __ESCAPE_H__ -#define __ESCAPE_H__ - -#ifndef EAPI -#define EAPI -#endif /* EAPI */ -#define __UNUSED__ __attribute__((unused)) - -#include - -#ifdef CLOCK_REALTIME -#undef CLOCK_REALTIME -#endif -#ifdef CLOCK_PROF -#undef CLOCK_PROF -#endif -#ifdef CLOCK_PROCESS_CPUTIME_ID -#undef CLOCK_PROCESS_CPUTIME_ID -#endif - -/** - * @page escape_main Escape - * @date 2011 (created) - * - * @section toc Table of Contents - * - * @li @ref escape_main_intro - * @li @ref escape_main_compiling - * @li @ref escape_main_next_steps - * - * @section escape_main_intro Introduction - * - * The Escape library is a library that acts implements some of the missing - * function from the PS3 GameOS system that are needed for the proper - * functioning of the EFL. - * - * @section escape_main_compiling How to compile - * - * Escape is a library your application links to. The procedure for - * this is very simple. You simply have to compile your application - * with the appropriate compiler flags that the @p pkg-config script - * outputs. For example: - * - * Compiling C or C++ files into object files: - * - * @verbatim - gcc -c -o main.o main.c `pkg-config --cflags escape` - @endverbatim - * - * Linking object files into a binary executable: - * - * @verbatim - gcc -o my_application main.o `pkg-config --libs escape` - @endverbatim - * - * See @ref pkgconfig - * - * @section escape_main_next_steps Next Steps - * - * After you understood what Escape is and installed it in your system - * you should proceed understanding the programming interface. - * - * Recommended reading: - * - * @li @ref Escape_Libgen_Group - * @li @ref Escape_Unistd_Group - * @li @ref Escape_Mman - */ - -#include "escape_libgen.h" -#include "escape_unistd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Nothing to see here */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ESCAPE_H__ */ diff --git a/src/lib/escape/escape_libgen.c b/src/lib/escape/escape_libgen.c deleted file mode 100644 index 796708978e..0000000000 --- a/src/lib/escape/escape_libgen.c +++ /dev/null @@ -1,90 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ - -#include -#include - -#include "Escape.h" - -static char _escape_basename_buf[PATH_MAX]; -static char _escape_dirname_buf[PATH_MAX]; - -char * -escape_basename(char *path) -{ - char *p1; - char *p2; - size_t length; - - /* path must begin by "?:\" or "?:/" */ - if (!path || strlen(path) <= 1) - { - memcpy(_escape_basename_buf, path, PATH_MAX); - return _escape_basename_buf; - } - - length = strlen(path); - p1 = strdup(path); - if (!p1) - { - memcpy(_escape_basename_buf, path, PATH_MAX); - return _escape_basename_buf; - } - - /* remove trailing backslashes */ - p2 = p1 + (length - 1); - if (*p2 == '/') - { - while (*p2 == '/') - p2--; - } - *(p2 + 1) = '\0'; - - p2 = strrchr(p1, '/'); - memcpy(_escape_basename_buf, p2 + 1, (p1 + length + 1) - p2); - - free(p1); - - return _escape_basename_buf; -} - -char * -escape_dirname(char *path) -{ - char *p1; - char *p2; - size_t length; - - /* path must begin by "?:\" or "?:/" */ - if (!path || strlen(path) <= 1) - { - memcpy(_escape_dirname_buf, path, PATH_MAX); - return _escape_dirname_buf; - } - - length = strlen(path); - p1 = strdup(path); - if (!p1) - { - memcpy(_escape_dirname_buf, path, PATH_MAX); - return _escape_dirname_buf; - } - /* remove trailing backslashes */ - p2 = p1 + (length - 1); - if (*p2 == '/') - { - while (*p2 == '/') - p2--; - } - *(p2 + 1) = '\0'; - - p2 = strrchr(p1, '/'); - *p2 = '\0'; - memcpy(_escape_dirname_buf, p1, strlen(p1) + 1); - - free(p1); - - return _escape_dirname_buf; -} - diff --git a/src/lib/escape/escape_libgen.h b/src/lib/escape/escape_libgen.h deleted file mode 100644 index 4b636740f7..0000000000 --- a/src/lib/escape/escape_libgen.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __ESCAPE_LIBGEN_H__ -#define __ESCAPE_LIBGEN_H__ - -/** - * @file escape_libgen.h - * @brief The file that provides functions ported from Unix in libgen.h. - * @defgroup Escape_Libgen_Group Libgen.h functions. - * @ingroup Escape - * - * This header provides functions ported from Unix in libgen.h. - * - * @{ - */ - -EAPI char *escape_basename(char *path); - -#ifdef basename -#undef basename -#endif -#define basename(p) escape_basename(p) - -EAPI char *escape_dirname(char *path); - -#ifdef dirname -#undef dirname -#endif -#define dirname(p) escape_dirname(p) - -/** - * @} - */ - -#endif /* __ESCAPE_LIBGEN_H__ */ diff --git a/src/lib/escape/escape_mman.c b/src/lib/escape/escape_mman.c deleted file mode 100644 index 995c72e7f4..0000000000 --- a/src/lib/escape/escape_mman.c +++ /dev/null @@ -1,67 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ - -#include -#include -#include -#include - -#include "sys/mman.h" - -/***** API *****/ - -void * -mmap(void *addr __UNUSED__, - size_t len, - int prot, - int flags, - int fd, - off_t offset) -{ - void *data; - size_t size; - - data = malloc(len); - if (!data) - { - fprintf (stderr, "[Escape] [mmap] malloc failed\n"); - return MAP_FAILED; - } - - size = read(fd, data, len); - if (size != len) - { - fprintf (stderr, "[Escape] [mmap] read failed\n"); - free(data); - return MAP_FAILED; - } - - if (lseek(fd, -len, SEEK_CUR) == -1) - { - fprintf (stderr, "[Escape] [mmap] lseek failed\n"); - free(data); - return MAP_FAILED; - } - - return data; -} - -int -munmap(void *addr, - size_t len __UNUSED__) -{ - if (addr && (addr != MAP_FAILED)) - free(addr); - - return 0; -} - -int -madvise(void *addr __UNUSED__, - size_t length __UNUSED__, - int advice __UNUSED__) -{ - return 0; -} - diff --git a/src/lib/escape/escape_unistd.c b/src/lib/escape/escape_unistd.c deleted file mode 100644 index 3ac3ee7bf0..0000000000 --- a/src/lib/escape/escape_unistd.c +++ /dev/null @@ -1,184 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ - -#include - -#include /* See NOTES */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Escape.h" - -char * -escape_realpath(const char *path, char *resolved_path) -{ - char *real = lrealpath (path); - - if (real) - { - if (resolved_path) - { - memcpy (resolved_path, real, PATH_MAX); - free (real); - return resolved_path; - } - else - { - return real; - } - } - - return NULL; -} - -int -escape_access(const char *pathname, int mode) -{ - struct stat stat_buf; - - if (stat(pathname, &stat_buf) != 0) - return -1; - - if (mode == F_OK) - return 0; - if (mode == R_OK) - { - if (stat_buf.st_mode & S_IRUSR) - return 0; - errno = EACCES; - return -1; - } - if (mode == W_OK) - { - if (stat_buf.st_mode & S_IWUSR) - return 0; - errno = EROFS; - return -1; - } - if (mode == X_OK) - { - if (stat_buf.st_mode & S_IXUSR) - return 0; - errno = EACCES; - return -1; - } - - return 0; -} - -EAPI ssize_t -escape_readlink(const char *path, - char *buf, - size_t bufsize) -{ - errno = EINVAL; - return -1; -} - -EAPI int -escape_symlink(const char *path1, const char *path2) -{ - errno = EINVAL; - return -1; -} - -/* - * The code of the following functions has been kindly offered - * by Tor Lillqvist. - */ -int -escape_pipe(int *fds) -{ - struct sockaddr_in saddr; - int temp; - int socket1 = -1; - int socket2 = -1; - fd_set read_set; - fd_set write_set; - int len; - - temp = socket (AF_INET, SOCK_STREAM, 0); - - if (temp == -1) - goto out0; - - memset (&saddr, 0, sizeof (saddr)); - saddr.sin_family = AF_INET; - saddr.sin_port = 0; - saddr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); - - if (bind (temp, (struct sockaddr *)&saddr, sizeof (saddr))) - goto out0; - - if (listen (temp, 1) == -1) - goto out0; - - len = sizeof (saddr); - if (getsockname (temp, (struct sockaddr *)&saddr, &len)) - goto out0; - - socket1 = socket (AF_INET, SOCK_STREAM, 0); - - if (socket1 == -1) - goto out0; - - if ((connect (socket1, (struct sockaddr *)&saddr, len) == -1) && - (errno != EAGAIN)) - goto out1; - - FD_ZERO (&read_set); - FD_SET (temp, &read_set); - - if (select (0, &read_set, NULL, NULL, NULL) == -1) - goto out1; - - if (!FD_ISSET (temp, &read_set)) - goto out1; - - socket2 = accept (temp, (struct sockaddr *)&saddr, &len); - if (socket2 == -1) - goto out1; - - FD_ZERO (&write_set); - FD_SET (socket1, &write_set); - - if (select (0, NULL, &write_set, NULL, NULL) == -1) - goto out2; - - if (!FD_ISSET (socket1, &write_set)) - goto out2; - - fds[0] = socket1; - fds[1] = socket2; - - closesocket (temp); - - return 0; - -out2: - closesocket (socket2); -out1: - closesocket (socket1); -out0: - closesocket (temp); - - fds[0] = -1; - fds[1] = -1; - - return -1; -} - -#undef access -int -access(const char *pathname, int mode) -{ - return escape_access (pathname, mode); -} - diff --git a/src/lib/escape/escape_unistd.h b/src/lib/escape/escape_unistd.h deleted file mode 100644 index 1ed1b5abce..0000000000 --- a/src/lib/escape/escape_unistd.h +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef __ESCAPE_UNISTD_H__ -#define __ESCAPE_UNISTD_H__ - -/** - * @file escape_unistd.h - * @brief The file that provides functions ported from Unix in unistd.h. - * @defgroup Escape_Unistd_Group Unistd.h functions - * @ingroup Escape - * - * This header provides functions ported from Unix in unistd.h. - * - * @{ - */ - -#include - -/* Path function */ -/** - * @brief return the canonicalized absolute pathname - * - * @param path A path to canonicalize - * @param resolved_path A pointer of size PATH_MAX where to store the result - * - * realpath() expands all symbolic links and resolves references to /./, /../ - * and extra '/' characters in the null-terminated string named by path to - * produce a canonicalized absolute pathname. The resulting pathname is - * stored as a null-terminated string, up to a maximum of PATH_MAX bytes, - * in the buffer pointed to by resolved_path. The resulting path will have - * no symbolic link, /./ or /../ components. - * - * If resolved_path is specified as NULL, then realpath() uses malloc(3) - * to allocate a buffer of up to PATH_MAX bytes to hold the resolved pathname, - * and returns a pointer to this buffer. - * The caller should deallocate this buffer using free(3). - * - */ -EAPI char *escape_realpath(const char *path, char *resolved_path); -#ifdef realpath -#undef realpath -#endif -#define realpath escape_realpath - -EAPI ssize_t -escape_readlink(const char *path, - char *buf, - size_t bufsize); -#ifdef readlink -#undef readlink -#endif -#define readlink escape_readlink - -EAPI int -escape_symlink(const char *path1, const char *path2); -#ifdef symlink -#undef symlink -#endif -#define symlink escape_symlink - -/** - * @brief check real user's permissions for a file - * - * @param pathname The path to check - * @param mode the permission to check - * - * access() checks whether the calling process can access the file pathname. - * If pathname is a symbolic link, it is dereferenced. - * The mode specifies the accessibility check(s) to be performed, and is either - * the value F_OK, or a mask consisting of the bitwise OR of one or more - * of R_OK, W_OK, and X_OK. F_OK tests for the existence of the file. - * R_OK, W_OK, and X_OK test whether the file exists and grants read, write, - * and execute permissions, respectively. - * - */ -EAPI int -escape_access(const char *pathname, int mode); -#ifdef access -#undef access -#endif -#define access escape_access - -/** - * @brief Create a pair of sockets. - * - * @param fds A pointer that contains two sockets. - * - * Create a pair of sockets that can be use with select(). - * Contrary to Unix, that functions does not - * create a pair of file descriptors. - * - * Conformity: Not applicable. - */ -EAPI int -escape_pipe(int *fds); - -/** - * @def pipe(fds) - * - * Wrapper around escape_pipe(). - */ -#define pipe(fds) escape_pipe(fds) - -//#define sync() - -/** - * @} - */ - -#endif /* __ESCAPE_UNISTD_H__ */ diff --git a/src/lib/escape/sys/mman.h b/src/lib/escape/sys/mman.h deleted file mode 100644 index 6c328c4add..0000000000 --- a/src/lib/escape/sys/mman.h +++ /dev/null @@ -1,180 +0,0 @@ -#ifndef __ESCAPE_SYS_MMAN_H__ -#define __ESCAPE_SYS_MMAN_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @def PROT_NONE - * Data can not be accessed. - */ - -/** - * @def PROT_READ - * Data can be read. - */ - -/** - * @def PROT_WRITE - * Data can be written. - */ - -/** - * @def PROT_EXEC - * Data can be executed. - */ - -#define PROT_NONE 0x00 -#define PROT_READ 0x01 -#define PROT_WRITE 0x02 -#define PROT_EXEC 0x04 - -/** - * @def MAP_SHARED - * Changes are shared. - */ - -/** - * @def MAP_PRIVATE - * Changes are private. - */ - -/** - * @def MAP_FIXED - * Interpret the address (addr) exactly. - */ - -/** - * @def MAP_FAILED - * Error return from mmap(). - */ - -#define MAP_SHARED 0x0001 -#define MAP_PRIVATE 0x0002 -#define MAP_FIXED 0x0010 - -#define MAP_FAILED ((void *)-1) - -/** - * @file mman.h - * @brief The file that provides the memory map functions - * @defgroup Escape_Mman Functions that manage memory mappping. - * @ingroup Escape - * - * This header provides the meomry map functions mmap and munmap. - * - */ - -/** - * Creates or opens a named or unnamed file mapping object for a - * specified file and maps a view of a file mapping into the - * address space of a calling process. - * - * @param addr Unused - * @param len Number of bytes to be mapped. - * @param prot Protections. - * @param flags Type of the mapped object. - * @param fd File descriptor that describes the object to map. - * @param offset Number of bytes from which to start the mapping. - * @return The starting address of the mapped view on success, -1 otherwise. - * - * Create or open an unnamed file mapping object for a specified - * file described by the file descriptor @p fd. The number of - * bytes that are mapped is given by @p len and start after - * @p offset bytes. The parameter @p addr is unused. - * - * The only type of the mapped object that is supported is - * @c MAP_SHARED. If another value if given, -1 is returned. - * - * @p prot specifies the protection of the mapped region. If - * PROT_EXEC is used, it set the execute access. If PROT_READ - * is used, it sets the read access. If PROT_WRITE is used, it - * sets the write access. - * - * If the map view of file can not be created, -1 is returned. - * If the mappping can not be done, -1 is returned. - * - * If no error occurred, the starting address of the mapped view - * is returned. - * - * Conformity: None. - * - * @ingroup Escape_Mman - */ -EAPI void *mmap(void *addr, - size_t len, - int prot, - int flags, - int fd, - off_t offset); - -/** - * Unmaps a mapped view of a file from the calling process's - * address space. - * - * @param addr Pointer to the base address. - * @param len Unused. - * @return 0 on success, -1 otherwise. - * - * Unmaps a mapped view of a file from the calling process's - * address space. @p addr is the pointer to the base address. - * This value must be identical to the value returned by a - * previous call to mmap(). The parameter @p len is unused. - * - * Conformity: None. - * - * @ingroup Escape_Mman - */ -EAPI int -munmap(void *addr, - size_t len); - -# define MADV_NORMAL 0 /* No further special treatment. */ -# define MADV_RANDOM 1 /* Expect random page references. */ -# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ -# define MADV_WILLNEED 3 /* Will need these pages. */ -# define MADV_DONTNEED 4 /* Don't need these pages. */ -# define MADV_REMOVE 9 /* Remove these pages and resources. */ -# define MADV_DONTFORK 10 /* Do not inherit across fork. */ -# define MADV_DOFORK 11 /* Do inherit across fork. */ -# define MADV_MERGEABLE 12 /* KSM may merge identical pages. */ -# define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages. */ -# define MADV_HUGEPAGE 14 /* Worth backing with hugepages. */ -# define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages. */ -# define MADV_HWPOISON 100 /* Poison a page for testing. */ - -/** - * give advice about use of memory - * - * @param addr Unused. - * @param length Unused. - * @param advice Unused. - * @return 0 on success, -1 otherwise. - * - * The madvise() system call advises the kernel about how to handle - * paging input/output in the address range beginning at address addr and - * with size length bytes. It allows an application to tell the kernel - * how it expects to use some mapped or shared memory areas, so that - * the kernel can choose appropriate read-ahead and caching techniques. - * This call does not influence the semantics of the application (except - * in the case of MADV_DONTNEED), but may influence its performance. - * The kernel is free to ignore the advice. - - * Conformity: None. - * - * @ingroup Escape_Mman - */ -EAPI int -madvise(void *addr, - size_t length, - int advice); - -#ifdef __cplusplus -} -#endif - -#endif /* __ESCAPE_SYS_MMAN_H__ */ - diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h index 5fecf3f157..91a2d98165 100644 --- a/src/lib/evas/include/evas_common_private.h +++ b/src/lib/evas/include/evas_common_private.h @@ -24,10 +24,6 @@ #include #include -#ifdef HAVE_ESCAPE -# include -#endif - #ifdef HAVE_PIXMAN #include #endif From b8dc80c144fec54a521987535c57b995748ccece Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Wed, 30 Oct 2019 17:09:20 +0100 Subject: [PATCH 24/33] emotion & evas: remove gstreamer 0.10 support We have Gstreamer 1.x support for a long time already. We used to keep this around as fallback. By now Linux distributions start to actually no longer ship the Gstreamer 0.10.x packages and upstream has not seen a release in in 5 years. Time to remove it on our side as well. Signed-off-by: Stefan Schmidt Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10779 --- .ci/ci-configure.sh | 6 +- README | 2 +- meson_options.txt | 4 +- src/generic/evas/gst/main_0_10.c | 281 --- src/generic/evas/gst/meson.build | 10 +- src/lib/emotion/emotion_modules.c | 3 - src/modules/emotion/gstreamer/emotion_alloc.c | 90 - .../emotion/gstreamer/emotion_convert.c | 251 -- .../emotion/gstreamer/emotion_fakeeos.c | 70 - .../emotion/gstreamer/emotion_gstreamer.c | 2018 ----------------- .../emotion/gstreamer/emotion_gstreamer.h | 352 --- src/modules/emotion/gstreamer/emotion_sink.c | 1461 ------------ src/modules/emotion/gstreamer/meson.build | 18 - src/modules/emotion/meson.build | 1 - 14 files changed, 7 insertions(+), 4560 deletions(-) delete mode 100644 src/generic/evas/gst/main_0_10.c delete mode 100644 src/modules/emotion/gstreamer/emotion_alloc.c delete mode 100644 src/modules/emotion/gstreamer/emotion_convert.c delete mode 100644 src/modules/emotion/gstreamer/emotion_fakeeos.c delete mode 100644 src/modules/emotion/gstreamer/emotion_gstreamer.c delete mode 100644 src/modules/emotion/gstreamer/emotion_gstreamer.h delete mode 100644 src/modules/emotion/gstreamer/emotion_sink.c delete mode 100644 src/modules/emotion/gstreamer/meson.build diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh index 88c7f414e3..06478d1960 100755 --- a/.ci/ci-configure.sh +++ b/.ci/ci-configure.sh @@ -19,7 +19,7 @@ if [ "$DISTRO" != "" ] ; then # - RPM fusion repo for xine and libvlc ENABLED_LINUX_COPTS=" -Dfb=true -Dsdl=true -Dbuffer=true -Dbuild-id=travis-build \ -Ddebug-threads=true -Dglib=true -Dg-mainloop=true -Dxpresent=true -Dxgesture=false -Dxinput22=true \ - -Devas-loaders-disabler=json -Decore-imf-loaders-disabler= -Demotion-loaders-disabler=gstreamer,libvlc,xine \ + -Devas-loaders-disabler=json -Decore-imf-loaders-disabler= -Demotion-loaders-disabler=libvlc,xine \ -Demotion-generic-loaders-disabler=vlc -Dharfbuzz=true -Dpixman=true -Dhyphen=true \ -Dvnc-server=true -Dbindings=luajit -Delogind=false -Dinstall-eo-files=true -Dphysics=true" @@ -29,7 +29,7 @@ if [ "$DISTRO" != "" ] ; then -Dcrypto=gnutls -Dglib=false -Dgstreamer=false -Dsystemd=false -Dpulseaudio=false \ -Dnetwork-backend=connman -Dxinput2=false -Dtslib=false \ -Devas-loaders-disabler=gst,pdf,ps,raw,svg,xcf,bmp,dds,eet,generic,gif,ico,jp2k,json,pmaps,psd,tga,tgv,tiff,wbmp,webp,xpm \ - -Decore-imf-loaders-disabler=xim,ibus,scim -Demotion-loaders-disabler=gstreamer,gstreamer1,libvlc,xine \ + -Decore-imf-loaders-disabler=xim,ibus,scim -Demotion-loaders-disabler=gstreamer1,libvlc,xine \ -Demotion-generic-loaders-disabler=vlc -Dfribidi=false -Dfontconfig=false \ -Dedje-sound-and-video=false -Dembedded-lz4=false -Dlibmount=false -Dv4l2=false \ -Delua=true -Dnls=false -Dbindings= -Dlua-interpreter=luajit -Dnative-arch-optimization=false" @@ -109,6 +109,6 @@ else export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/Cellar/libffi/$LIBFFI_VER/lib/pkgconfig" export CC="ccache gcc" travis_fold meson meson - mkdir build && meson build -Dopengl=full -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Dbindings=luajit -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Demotion-loaders-disabler=gstreamer,gstreamer1,libvlc,xine + mkdir build && meson build -Dopengl=full -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Dbindings=luajit -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Demotion-loaders-disabler=gstreamer1,libvlc,xine travis_endfold meson fi diff --git a/README b/README index 5fd277ede7..83ef671d29 100644 --- a/README +++ b/README @@ -426,7 +426,7 @@ Required by default: * bullet * libpng * libjpeg - * gstreamer (1.x, 0.10 support optional. Ensure all codecs you want are installed.) + * gstreamer (Ensure all codecs you want are installed.) * zlib * luajit (lua 5.1 or 5.2 support optional) * libtiff diff --git a/meson_options.txt b/meson_options.txt index 784bdf9a27..be7f8addad 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -209,8 +209,8 @@ option('ecore-imf-loaders-disabler', option('emotion-loaders-disabler', type : 'array', description : 'List of video back-ends to disable in efl', - choices : ['gstreamer', 'gstreamer1', 'libvlc', 'xine'], - value : ['gstreamer', 'libvlc', 'xine'] + choices : ['gstreamer1', 'libvlc', 'xine'], + value : ['libvlc', 'xine'] ) option('emotion-generic-loaders-disabler', diff --git a/src/generic/evas/gst/main_0_10.c b/src/generic/evas/gst/main_0_10.c deleted file mode 100644 index 8a197c4208..0000000000 --- a/src/generic/evas/gst/main_0_10.c +++ /dev/null @@ -1,281 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include - -#include - -#include - -#include "shmfile.h" -#include "timeout.h" - -#define DATA32 unsigned int - -//#define GST_DBG - -#ifdef GST_DBG -#define D(fmt, args...) fprintf(stderr, fmt, ## args) -#else -#define D(fmt, args...) -#endif - -#define CAPS "video/x-raw-rgb,bpp=(int)32,depth=(int)32,endianness=(int)4321,red_mask=(int)0x0000ff00, green_mask=(int)0x00ff0000, blue_mask=(int)0xff000000" - -static GstElement *pipeline = NULL; -static GstElement *sink = NULL; -static gint64 duration = -1; - -int width = 0; -int height = 0; -void *data = NULL; - - -static Eina_Bool -_gst_init(const char *filename) -{ - GstPad *pad; - GstCaps *caps; - GstStructure *structure; - gchar *descr; - gchar *uri; - GError *error = NULL; - GstFormat format; - GstStateChangeReturn ret; -// int vidstr = 0; - - if (!filename || !*filename) - return EINA_FALSE; - - if (!gst_init_check(NULL, NULL, &error)) - return EINA_FALSE; - - if ((*filename == '/') || (*filename == '~')) - { - uri = g_filename_to_uri(filename, NULL, NULL); - if (!uri) - { - D("could not create new uri from %s", filename); - goto unref_pipeline; - } - } - else - uri = strdup(filename); - - D("Setting file %s\n", uri); - - descr = g_strdup_printf("uridecodebin uri=%s ! typefind ! ffmpegcolorspace ! " - " appsink name=sink caps=\"" CAPS "\"", uri); - pipeline = gst_parse_launch(descr, &error); - free(uri); - - if (error != NULL) - { - D("could not construct pipeline: %s\n", error->message); - g_error_free (error); - goto gst_shutdown; - } -/* needs gst 1.0+ - * also only works on playbin objects!!! this is a uridecodebin! - g_object_get(G_OBJECT(pipeline), - "n-video", &vidstr, - NULL); - if (vidstr <= 0) - { - D("no video stream\n"); - goto gst_shutdown; - } -*/ - sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink"); - - ret = gst_element_set_state (pipeline, GST_STATE_PAUSED); - switch (ret) - { - case GST_STATE_CHANGE_FAILURE: - D("failed to play the file\n"); - goto unref_pipeline; - case GST_STATE_CHANGE_NO_PREROLL: - D("live sources not supported yet\n"); - goto unref_pipeline; - default: - break; - } - - ret = gst_element_get_state((pipeline), NULL, NULL, GST_CLOCK_TIME_NONE); - if (ret == GST_STATE_CHANGE_FAILURE) - { - D("could not complete pause\n"); - goto unref_pipeline; - } - - format = GST_FORMAT_TIME; - gst_element_query_duration (pipeline, &format, &duration); - if (duration == -1) - { - D("could not retrieve the duration, set it to 1s\n"); - duration = 1 * GST_SECOND; - } - - pad = gst_element_get_static_pad(sink, "sink"); - if (!pad) - { - D("could not retrieve the sink pad\n"); - goto unref_pipeline; - } - - caps = gst_pad_get_negotiated_caps(pad); - if (!caps) - goto unref_pad; - - structure = gst_caps_get_structure(caps, 0); - - if (!gst_structure_get_int(structure, "width", &width)) - goto unref_caps; - if (!gst_structure_get_int(structure, "height", &height)) - goto unref_caps; - - gst_caps_unref(caps); - gst_object_unref(pad); - - return EINA_TRUE; - - unref_caps: - gst_caps_unref(caps); - unref_pad: - gst_object_unref(pad); - unref_pipeline: - gst_element_set_state (pipeline, GST_STATE_NULL); - gst_object_unref(pipeline); - gst_shutdown: - gst_deinit(); - - return EINA_FALSE; -} - -static void -_gst_shutdown() -{ - gst_element_set_state (pipeline, GST_STATE_NULL); - gst_object_unref(pipeline); - gst_deinit(); -} - -static void -_gst_load_image(int size_w EINA_UNUSED, int size_h EINA_UNUSED, double pos) -{ - GstBuffer *buffer; - - D("load image\n"); - if (pos >= 0.0) - gst_element_seek_simple(pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, - pos * 1000000000.0); - else - gst_element_seek_simple(pipeline, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, - duration / 2); - g_signal_emit_by_name(sink, "pull-preroll", &buffer, NULL); - D("load image : %p %d\n", GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer)); - - shm_alloc(width * height * sizeof(DATA32)); - if (!shm_addr) return; - data = shm_addr; - - memcpy(data, GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer)); -} - -int -main(int argc, char **argv) -{ - char *file, *p; - int i, numonly; - int size_w = 0, size_h = 0; - int head_only = 0; - long long pos = -1.0; - - if (argc < 2) return -1; - // file is ALWAYS first arg, other options come after - file = argv[1]; - for (i = 2; i < argc; i++) - { - if (!strcmp(argv[i], "-head")) - // asked to only load header, not body/data - head_only = 1; - else if (!strcmp(argv[i], "-key")) - { - i++; - numonly = 1; - for (p = argv[i]; *p; p++) - { - if ((!*p < '0') || (*p > 9)) - { - numonly = 0; - break; - } - } - if (numonly) pos = (double)(atoll(argv[i])) / 1000.0; - i++; - } - else if (!strcmp(argv[i], "-opt-scale-down-by")) - { // not used by ps loader - i++; - // int scale_down = atoi(argv[i]); - } - else if (!strcmp(argv[i], "-opt-dpi")) - { - i++; - } - else if (!strcmp(argv[i], "-opt-size")) - { // not used by ps loader - i++; - size_w = atoi(argv[i]); - i++; - size_h = atoi(argv[i]); - } - } - - timeout_init(10); - - D("_gst_init_file\n"); - - if (!_gst_init(file)) - return -1; - D("_gst_init done\n"); - - if (!head_only) - { - _gst_load_image(size_w, size_h, pos); - } - - D("size...: %ix%i\n", width, height); - D("alpha..: 0\n"); - - printf("size %i %i\n", width, height); - printf("alpha 0\n"); - - if (!head_only) - { - if (shm_fd >= 0) - { - printf("shmfile %s\n", shmfile); - } - else - { - // could also to "tmpfile %s\n" like shmfile but just - // a mmaped tmp file on the system - printf("data\n"); - if (fwrite(data, width * height * sizeof(DATA32), 1, stdout) != 1) - { - shm_free(); - return -1; - } - } - shm_free(); - } - else - printf("done\n"); - - _gst_shutdown(); - fflush(stdout); - return 0; -} diff --git a/src/generic/evas/gst/meson.build b/src/generic/evas/gst/meson.build index aa10f7e513..c324ef4702 100644 --- a/src/generic/evas/gst/meson.build +++ b/src/generic/evas/gst/meson.build @@ -1,11 +1,3 @@ - -# gstreamer 0.1 support -#generic_deps = [dependency('gstreamer')] -#generic_src = files([ -# 'main_0_10.c' -#]) - - generic_src = files([ 'main.c' ]) @@ -14,4 +6,4 @@ generic_deps = [] if get_option('gstreamer') == true generic_deps += dependency('gstreamer-1.0') endif -generic_support = ['264','3g2','3gp','3gp2','3gpp','3gpp2','3p2','asf','avi','bdm','bdmv','clpi','cpi','dv','fla','flv','m1v','m2t','m2v','m4v','mkv','mov','mp2','mp2ts','mp4','mpe','mpeg','mpg','mpl','mpls','mts','mxf','nut','nuv','ogg','ogm','ogv','qt','rm','rmj','rmm','rms','rmx','rmvb','rv','swf','ts','webm','weba','wmv'] \ No newline at end of file +generic_support = ['264','3g2','3gp','3gp2','3gpp','3gpp2','3p2','asf','avi','bdm','bdmv','clpi','cpi','dv','fla','flv','m1v','m2t','m2v','m4v','mkv','mov','mp2','mp2ts','mp4','mpe','mpeg','mpg','mpl','mpls','mts','mxf','nut','nuv','ogg','ogm','ogv','qt','rm','rmj','rmm','rms','rmx','rmvb','rv','swf','ts','webm','weba','wmv'] diff --git a/src/lib/emotion/emotion_modules.c b/src/lib/emotion/emotion_modules.c index 22e6994e4b..c23d0bb69d 100644 --- a/src/lib/emotion/emotion_modules.c +++ b/src/lib/emotion/emotion_modules.c @@ -81,9 +81,6 @@ _emotion_modules_load(void) if (stat(buf, &st) == 0) { const char *built_modules[] = { -#ifdef EMOTION_BUILD_GSTREAMER - "gstreamer", -#endif #ifdef EMOTION_BUILD_GSTREAMER1 "gstreamer1", #endif diff --git a/src/modules/emotion/gstreamer/emotion_alloc.c b/src/modules/emotion/gstreamer/emotion_alloc.c deleted file mode 100644 index c4aae047b7..0000000000 --- a/src/modules/emotion/gstreamer/emotion_alloc.c +++ /dev/null @@ -1,90 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include - -#include -#include -#include -#include - -#ifdef HAVE_ECORE_X -# include -# ifdef HAVE_XOVERLAY_H -# include -# endif -#endif - -#include "Emotion.h" -#include "emotion_gstreamer.h" - -Emotion_Gstreamer_Buffer * -emotion_gstreamer_buffer_alloc(EvasVideoSinkPrivate *sink, - GstBuffer *buffer, - Eina_Bool preroll) -{ - Emotion_Gstreamer_Buffer *send; - - if (!sink->ev) return NULL; - - send = malloc(sizeof (Emotion_Gstreamer_Buffer)); - if (!send) return NULL; - - send->sink = sink; - send->frame = gst_buffer_ref(buffer); - send->preroll = preroll; - send->force = EINA_FALSE; - sink->ev->out++; - send->ev = sink->ev; - - return send; -} - -void -emotion_gstreamer_buffer_free(Emotion_Gstreamer_Buffer *send) -{ - send->ev->in++; - - if (send->ev->in == send->ev->out - && send->ev->threads == NULL - && send->ev->delete_me) - send->ev->api->del(send->ev); - - gst_buffer_unref(send->frame); - free(send); -} - -Emotion_Gstreamer_Message * -emotion_gstreamer_message_alloc(Emotion_Gstreamer_Video *ev, - GstMessage *msg) -{ - Emotion_Gstreamer_Message *send; - - if (!ev) return NULL; - - send = malloc(sizeof (Emotion_Gstreamer_Message)); - if (!send) return NULL; - - ev->out++; - send->ev = ev; - send->msg = gst_message_ref(msg); - - return send; -} - -void -emotion_gstreamer_message_free(Emotion_Gstreamer_Message *send) -{ - send->ev->in++; - - if (send->ev->in == send->ev->out - && send->ev->threads == NULL - && send->ev->delete_me) - send->ev->api->del(send->ev); - - gst_message_unref(send->msg); - free(send); -} diff --git a/src/modules/emotion/gstreamer/emotion_convert.c b/src/modules/emotion/gstreamer/emotion_convert.c deleted file mode 100644 index 2664d28be6..0000000000 --- a/src/modules/emotion/gstreamer/emotion_convert.c +++ /dev/null @@ -1,251 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -#ifdef HAVE_ECORE_X -# include -# ifdef HAVE_XOVERLAY_H -# include -# endif -#endif - -#include "Emotion.h" -#include "emotion_gstreamer.h" - -static inline void -_evas_video_bgrx_step(unsigned char *evas_data, const unsigned char *gst_data, - unsigned int w, unsigned int h EINA_UNUSED, unsigned int output_height, unsigned int step) -{ - unsigned int x; - unsigned int y; - - for (y = 0; y < output_height; ++y) - { - for (x = 0; x < w; x++) - { - evas_data[0] = gst_data[0]; - evas_data[1] = gst_data[1]; - evas_data[2] = gst_data[2]; - evas_data[3] = 255; - gst_data += step; - evas_data += 4; - } - } -} - -static void -_evas_video_bgr(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height) -{ - _evas_video_bgrx_step(evas_data, gst_data, w, h, output_height, 3); -} - -static void -_evas_video_bgrx(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height) -{ - _evas_video_bgrx_step(evas_data, gst_data, w, h, output_height, 4); -} - -static void -_evas_video_bgra(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h EINA_UNUSED, unsigned int output_height) -{ - unsigned int x; - unsigned int y; - - for (y = 0; y < output_height; ++y) - { - unsigned char alpha; - - for (x = 0; x < w; ++x) - { - alpha = gst_data[3]; - evas_data[0] = (gst_data[0] * alpha) / 255; - evas_data[1] = (gst_data[1] * alpha) / 255; - evas_data[2] = (gst_data[2] * alpha) / 255; - evas_data[3] = alpha; - gst_data += 4; - evas_data += 4; - } - } -} - -static void -_evas_video_i420(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height) -{ - const unsigned char **rows; - unsigned int i, j; - unsigned int rh; - unsigned int stride_y, stride_uv; - - rh = output_height; - - rows = (const unsigned char **)evas_data; - - stride_y = GST_ROUND_UP_4(w); - stride_uv = GST_ROUND_UP_8(w) / 2; - - for (i = 0; i < rh; i++) - rows[i] = &gst_data[i * stride_y]; - - for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * stride_y + j * stride_uv]; - - for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * stride_y + - (rh / 2) * stride_uv + - j * stride_uv]; -} - -static void -_evas_video_yv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height) -{ - const unsigned char **rows; - unsigned int i, j; - unsigned int rh; - unsigned int stride_y, stride_uv; - - rh = output_height; - - rows = (const unsigned char **)evas_data; - - stride_y = GST_ROUND_UP_4(w); - stride_uv = GST_ROUND_UP_8(w) / 2; - - for (i = 0; i < rh; i++) - rows[i] = &gst_data[i * stride_y]; - - for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * stride_y + - (rh / 2) * stride_uv + - j * stride_uv]; - - for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[h * stride_y + j * stride_uv]; -} - -static void -_evas_video_yuy2(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h EINA_UNUSED, unsigned int output_height) -{ - const unsigned char **rows; - unsigned int i; - unsigned int stride; - - rows = (const unsigned char **)evas_data; - - stride = GST_ROUND_UP_4(w * 2); - - for (i = 0; i < output_height; i++) - rows[i] = &gst_data[i * stride]; -} - -static void -_evas_video_nv12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h EINA_UNUSED, unsigned int output_height) -{ - const unsigned char **rows; - unsigned int i, j; - unsigned int rh; - - rh = output_height; - - rows = (const unsigned char **)evas_data; - - for (i = 0; i < rh; i++) - rows[i] = &gst_data[i * w]; - - for (j = 0; j < (rh / 2); j++, i++) - rows[i] = &gst_data[rh * w + j * w]; -} - -static void -_evas_video_mt12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height EINA_UNUSED) -{ - const unsigned char **rows; - unsigned int i; - unsigned int j; - - rows = (const unsigned char **)evas_data; - - for (i = 0; i < (h / 32) / 2; i++) - rows[i] = &gst_data[i * w * 2 * 32]; - - if ((h / 32) % 2) - { - rows[i] = &gst_data[i * w * 2 * 32]; - i++; - } - - for (j = 0; j < ((h / 2) / 32) / 2; ++j, ++i) - rows[i] = &gst_data[h * w + j * (w / 2) * 2 * 16]; -} - -void -_evas_video_st12_multiplane(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height EINA_UNUSED) -{ - const GstMultiPlaneImageBuffer *mp_buf = (const GstMultiPlaneImageBuffer *) gst_data; - const unsigned char **rows; - unsigned int i; - unsigned int j; - - rows = (const unsigned char **)evas_data; - - for (i = 0; i < (h / 32) / 2; i++) - rows[i] = mp_buf->uaddr[0] + i * w * 2 * 32; - if ((h / 32) % 2) - { - rows[i] = mp_buf->uaddr[0] + i * w * 2 * 32; - i++; - } - - for (j = 0; j < ((h / 2) / 16) / 2; j++, i++) - { - rows[i] = mp_buf->uaddr[1] + j * w * 2 * 16 * 2; - } - if (((h / 2) / 16) % 2) - rows[i] = mp_buf->uaddr[1] + j * w * 2 * 16 * 2; -} - -void -_evas_video_st12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w EINA_UNUSED, unsigned int h, unsigned int output_height EINA_UNUSED) -{ - const SCMN_IMGB *imgb = (const SCMN_IMGB *) gst_data; - const unsigned char **rows; - unsigned int i, j; - - rows = (const unsigned char **)evas_data; - - for (i = 0; i < (h / 32) / 2; i++) - rows[i] = imgb->uaddr[0] + i * imgb->stride[0] * 2 * 32; - if ((h / 32) % 2) - { - rows[i] = imgb->uaddr[0] + i * imgb->stride[0] * 2 * 32; - i++; - } - - for (j = 0; j < (unsigned int) imgb->elevation[1] / 32 / 2; j++, i++) - rows[i] = imgb->uaddr[1] + j * imgb->stride[1] * 32 * 2; - if ((imgb->elevation[1] / 32) % 2) - rows[i++] = imgb->uaddr[1] + j * imgb->stride[1] * 32 * 2; -} - -const ColorSpace_FourCC_Convertion colorspace_fourcc_convertion[] = { - { "I420", GST_MAKE_FOURCC('I', '4', '2', '0'), EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE }, - { "YV12", GST_MAKE_FOURCC('Y', 'V', '1', '2'), EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE }, - { "YUY2", GST_MAKE_FOURCC('Y', 'U', 'Y', '2'), EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE }, - { "NV12", GST_MAKE_FOURCC('N', 'V', '1', '2'), EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE }, - { "TM12", GST_MAKE_FOURCC('T', 'M', '1', '2'), EVAS_COLORSPACE_YCBCR420TM12601_PL, _evas_video_mt12, EINA_TRUE }, - { NULL, 0, 0, NULL, 0 } -}; - -const ColorSpace_Format_Convertion colorspace_format_convertion[] = { - { "BGR", GST_VIDEO_FORMAT_BGR, EVAS_COLORSPACE_ARGB8888, _evas_video_bgr }, - { "BGRx", GST_VIDEO_FORMAT_BGRx, EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx }, - { "BGRA", GST_VIDEO_FORMAT_BGRA, EVAS_COLORSPACE_ARGB8888, _evas_video_bgra }, - { NULL, 0, 0, NULL } -}; diff --git a/src/modules/emotion/gstreamer/emotion_fakeeos.c b/src/modules/emotion/gstreamer/emotion_fakeeos.c deleted file mode 100644 index fc6dc0f989..0000000000 --- a/src/modules/emotion/gstreamer/emotion_fakeeos.c +++ /dev/null @@ -1,70 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include - -#ifdef HAVE_ECORE_X -# include -# ifdef HAVE_XOVERLAY_H -# include -# endif -#endif - -#include "Emotion.h" -#include "emotion_gstreamer.h" - -typedef struct _FakeEOSBin -{ - GstBin parent; -} FakeEOSBin; - -typedef struct _FakeEOSBinClass -{ - GstBinClass parent; -} FakeEOSBinClass; - -GST_BOILERPLATE(FakeEOSBin, fakeeos_bin, GstBin, - GST_TYPE_BIN); - -static void -fakeeos_bin_handle_message(GstBin * bin, GstMessage * message) -{ - /* FakeEOSBin *fakeeos = (FakeEOSBin *)(bin); */ - - switch (GST_MESSAGE_TYPE(message)) { - case GST_MESSAGE_EOS: - /* what to do here ? just returning at the moment */ - return; - default: - break; - } - - GST_BIN_CLASS(parent_class)->handle_message(bin, message); -} - -static void -fakeeos_bin_base_init(gpointer g_class EINA_UNUSED) -{ -} - -static void -fakeeos_bin_class_init(FakeEOSBinClass * klass) -{ - GstBinClass *gstbin_class = GST_BIN_CLASS(klass); - - gstbin_class->handle_message = - GST_DEBUG_FUNCPTR (fakeeos_bin_handle_message); -} - -static void -fakeeos_bin_init(FakeEOSBin *src EINA_UNUSED, - FakeEOSBinClass *klass EINA_UNUSED) -{ -} diff --git a/src/modules/emotion/gstreamer/emotion_gstreamer.c b/src/modules/emotion/gstreamer/emotion_gstreamer.c deleted file mode 100644 index b37f5ce639..0000000000 --- a/src/modules/emotion/gstreamer/emotion_gstreamer.c +++ /dev/null @@ -1,2018 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - -#ifdef _WIN32 -# include /* getcwd */ -#endif - -#include -#include -#include - -#define HTTP_STREAM 0 -#define RTSP_STREAM 1 -#include -#include -#include -#include -#include - -// forcibly disable x overlay window.. broken badly. -#undef HAVE_ECORE_X - -#ifdef HAVE_ECORE_X -# include -# ifdef HAVE_XOVERLAY_H -# include -# endif -#endif - -#include "emotion_modules.h" -#include "emotion_gstreamer.h" - -Eina_Bool window_manager_video = EINA_FALSE; -int _emotion_gstreamer_log_domain = -1; -Eina_Bool debug_fps = EINA_FALSE; -Eina_Bool _ecore_x_available = EINA_FALSE; - -static Ecore_Idler *restart_idler; -static int _emotion_init_count = 0; - -/* Callbacks to get the eos */ -static void _for_each_tag (GstTagList const* list, gchar const* tag, void *data); -static void _free_metadata (Emotion_Gstreamer_Metadata *m); - -static GstBusSyncReply _eos_sync_fct(GstBus *bus, - GstMessage *message, - gpointer data); - -static Eina_Bool _em_restart_stream(void *data); - -/* Module interface */ - - -static int priority_overide = 0; - -static Emotion_Video_Stream * -emotion_video_stream_new(Emotion_Gstreamer_Video *ev) -{ - Emotion_Video_Stream *vstream; - - if (!ev) return NULL; - - vstream = (Emotion_Video_Stream *)calloc(1, sizeof(Emotion_Video_Stream)); - if (!vstream) return NULL; - - ev->video_streams = eina_list_append(ev->video_streams, vstream); - return vstream; -} - -static const char * -emotion_visualization_element_name_get(Emotion_Vis visualisation) -{ - switch (visualisation) - { - case EMOTION_VIS_NONE: - return NULL; - case EMOTION_VIS_GOOM: - return "goom"; - case EMOTION_VIS_LIBVISUAL_BUMPSCOPE: - return "libvisual_bumpscope"; - case EMOTION_VIS_LIBVISUAL_CORONA: - return "libvisual_corona"; - case EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES: - return "libvisual_dancingparticles"; - case EMOTION_VIS_LIBVISUAL_GDKPIXBUF: - return "libvisual_gdkpixbuf"; - case EMOTION_VIS_LIBVISUAL_G_FORCE: - return "libvisual_G-Force"; - case EMOTION_VIS_LIBVISUAL_GOOM: - return "libvisual_goom"; - case EMOTION_VIS_LIBVISUAL_INFINITE: - return "libvisual_infinite"; - case EMOTION_VIS_LIBVISUAL_JAKDAW: - return "libvisual_jakdaw"; - case EMOTION_VIS_LIBVISUAL_JESS: - return "libvisual_jess"; - case EMOTION_VIS_LIBVISUAL_LV_ANALYSER: - return "libvisual_lv_analyzer"; - case EMOTION_VIS_LIBVISUAL_LV_FLOWER: - return "libvisual_lv_flower"; - case EMOTION_VIS_LIBVISUAL_LV_GLTEST: - return "libvisual_lv_gltest"; - case EMOTION_VIS_LIBVISUAL_LV_SCOPE: - return "libvisual_lv_scope"; - case EMOTION_VIS_LIBVISUAL_MADSPIN: - return "libvisual_madspin"; - case EMOTION_VIS_LIBVISUAL_NEBULUS: - return "libvisual_nebulus"; - case EMOTION_VIS_LIBVISUAL_OINKSIE: - return "libvisual_oinksie"; - case EMOTION_VIS_LIBVISUAL_PLASMA: - return "libvisual_plazma"; - default: - return "goom"; - } -} - -static void -em_cleanup(Emotion_Gstreamer_Video *ev) -{ - Emotion_Audio_Stream *astream; - Emotion_Video_Stream *vstream; - - if (ev->send) - { - emotion_gstreamer_buffer_free(ev->send); - ev->send = NULL; - } - - if (ev->eos_bus) - { - gst_object_unref(GST_OBJECT(ev->eos_bus)); - ev->eos_bus = NULL; - } - - if (ev->metadata) - { - _free_metadata(ev->metadata); - ev->metadata = NULL; - } - - if (ev->last_buffer) - { - gst_buffer_unref(ev->last_buffer); - ev->last_buffer = NULL; - } - - if (!ev->stream) - { - evas_object_image_video_surface_set(emotion_object_image_get(ev->obj), NULL); - ev->stream = EINA_TRUE; - } - - if (ev->pipeline) - { - gstreamer_video_sink_new(ev, ev->obj, NULL); - - g_object_set(G_OBJECT(ev->esink), "ev", NULL, NULL); - g_object_set(G_OBJECT(ev->esink), "evas-object", NULL, NULL); - gst_element_set_state(ev->pipeline, GST_STATE_NULL); - gst_object_unref(ev->pipeline); - - ev->pipeline = NULL; - ev->sink = NULL; - - if (ev->eteepad) gst_object_unref(ev->eteepad); - ev->eteepad = NULL; - if (ev->xvteepad) gst_object_unref(ev->xvteepad); - ev->xvteepad = NULL; - if (ev->xvpad) gst_object_unref(ev->xvpad); - ev->xvpad = NULL; - - ev->src_width = 0; - ev->src_height = 0; - -#ifdef HAVE_ECORE_X - INF("destroying window: %i", ev->win); - if (ev->win) ecore_x_window_free(ev->win); - ev->win = 0; -#endif - } - - if (restart_idler) - { - ecore_idler_del(restart_idler); - restart_idler = NULL; - } - - EINA_LIST_FREE(ev->audio_streams, astream) - free(astream); - EINA_LIST_FREE(ev->video_streams, vstream) - free(vstream); -} - -static void -em_del(void *video) -{ - Emotion_Gstreamer_Video *ev = video; - - if (ev->threads) - { - Ecore_Thread *t; - - EINA_LIST_FREE(ev->threads, t) - ecore_thread_cancel(t); - - ev->delete_me = EINA_TRUE; - return; - } - - if (ev->in != ev->out) - { - ev->delete_me = EINA_TRUE; - return; - } - - em_cleanup(ev); - - free(ev); -} - -static Eina_Bool -em_file_open(void *video, - const char *file) -{ - Emotion_Gstreamer_Video *ev = video; - Eina_Strbuf *sbuf = NULL; - const char *uri; - - if (!file) return EINA_FALSE; - if (strstr(file, "://") == NULL) - { - sbuf = eina_strbuf_new(); - eina_strbuf_append(sbuf, "file://"); - if (strncmp(file, "./", 2) == 0) - file += 2; - if (strstr(file, ":/") != NULL) - { /* We absolutely need file:///C:/ under Windows, so adding it here */ - eina_strbuf_append(sbuf, "/"); - } - else if (*file != '/') - { - char tmp[PATH_MAX]; - - if (getcwd(tmp, PATH_MAX)) - { - eina_strbuf_append(sbuf, tmp); - eina_strbuf_append(sbuf, "/"); - } - } - eina_strbuf_append(sbuf, file); - } - - ev->play_started = 0; - ev->pipeline_parsed = 0; - - uri = sbuf ? eina_strbuf_string_get(sbuf) : file; - DBG("setting file to '%s'", uri); - ev->pipeline = gstreamer_video_sink_new(ev, ev->obj, uri); - if (sbuf) eina_strbuf_free(sbuf); - - if (!ev->pipeline) - return EINA_FALSE; - - ev->eos_bus = gst_pipeline_get_bus(GST_PIPELINE(ev->pipeline)); - if (!ev->eos_bus) - { - ERR("could not get the bus"); - return EINA_FALSE; - } - - gst_bus_set_sync_handler(ev->eos_bus, _eos_sync_fct, ev); - - ev->position = 0.0; - - return 1; -} - -static void -em_file_close(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - if (!ev) - return; - - if (ev->threads) - { - Ecore_Thread *t; - - EINA_LIST_FREE(ev->threads, t) - ecore_thread_cancel(t); - } - - em_cleanup(ev); - - ev->pipeline_parsed = EINA_FALSE; - ev->play_started = 0; -} - -static void -em_play(void *video, - double pos EINA_UNUSED) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - if (!ev->pipeline) return; - - if (ev->pipeline_parsed) - gst_element_set_state(ev->pipeline, GST_STATE_PLAYING); - ev->play = 1; - ev->play_started = 1; -} - -static void -em_stop(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!ev->pipeline) return; - - if (ev->pipeline_parsed) - gst_element_set_state(ev->pipeline, GST_STATE_PAUSED); - ev->play = 0; -} - -static void -em_size_get(void *video, - int *width, - int *height) -{ - Emotion_Gstreamer_Video *ev; - Emotion_Video_Stream *vstream; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) - goto on_error; - - vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); - if (vstream) - { - if (width) *width = vstream->width; - if (height) *height = vstream->height; - - return; - } - - on_error: - if (width) *width = 0; - if (height) *height = 0; -} - -static void -em_pos_set(void *video, - double pos) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!ev->pipeline) return; - - if (ev->play) - gst_element_set_state(ev->pipeline, GST_STATE_PAUSED); - - gst_element_seek(ev->pipeline, 1.0, - GST_FORMAT_TIME, - GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH, - GST_SEEK_TYPE_SET, - (gint64)(pos * (double)GST_SECOND), - GST_SEEK_TYPE_NONE, -1); - - if (ev->play) - gst_element_set_state(ev->pipeline, GST_STATE_PLAYING); -} - -/** - * Returns stream duration in seconds - */ -static double -em_len_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - Emotion_Video_Stream *vstream; - Emotion_Audio_Stream *astream; - Eina_List *l; - GstFormat fmt; - gint64 val; - gboolean ret; - - ev = video; - fmt = GST_FORMAT_TIME; - - if (!ev->pipeline) return 0.0; - - ret = gst_element_query_duration(ev->pipeline, &fmt, &val); - if (!ret) - goto fallback; - - if (fmt != GST_FORMAT_TIME) - { - DBG("requested duration in time, but got %s instead.", - gst_format_get_name(fmt)); - goto fallback; - } - - if (val <= 0.0) - goto fallback; - - return GST_TIME_AS_SECONDS(val); - - fallback: - if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) - return 0.0; - - EINA_LIST_FOREACH(ev->audio_streams, l, astream) - if (astream->length_time >= 0) - return astream->length_time; - - EINA_LIST_FOREACH(ev->video_streams, l, vstream) - if (vstream->length_time >= 0) - return vstream->length_time; - - return 0.0; -} - -static double -em_buffer_size_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - GstQuery *query; - gboolean busy; - gint percent; - - ev = video; - - if (!ev->pipeline) return 0.0; - - query = gst_query_new_buffering(GST_FORMAT_DEFAULT); - if (gst_element_query(ev->pipeline, query)) - gst_query_parse_buffering_percent(query, &busy, &percent); - else - percent = 100; - - gst_query_unref(query); - return ((float)(percent)) / 100.0; -} - -static int -em_fps_num_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - Emotion_Video_Stream *vstream; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) - return 0; - - vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); - if (vstream) - return vstream->fps_num; - - return 0; -} - -static int -em_fps_den_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - Emotion_Video_Stream *vstream; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) - return 1; - - vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); - if (vstream) - return vstream->fps_den; - - return 1; -} - -static double -em_fps_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - Emotion_Video_Stream *vstream; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) - return 0.0; - - vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); - if (vstream) - return (double)vstream->fps_num / (double)vstream->fps_den; - - return 0.0; -} - -/** - * Returns stream position in seconds - */ -static double -em_pos_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - GstFormat fmt; - gint64 val; - gboolean ret; - - ev = video; - fmt = GST_FORMAT_TIME; - - if (!ev->pipeline) return 0.0; - - ret = gst_element_query_position(ev->pipeline, &fmt, &val); - if (!ret) - return ev->position; - - if (fmt != GST_FORMAT_TIME) - { - ERR("requested position in time, but got %s instead.", - gst_format_get_name(fmt)); - return ev->position; - } - - ev->position = GST_TIME_AS_SECONDS(val); - return ev->position; -} - -static void -em_vis_set(void *video, - Emotion_Vis vis) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - ev->vis = vis; -} - -static Emotion_Vis -em_vis_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - return ev->vis; -} - -static Eina_Bool -em_vis_supported(void *ef EINA_UNUSED, Emotion_Vis vis) -{ - const char *name; - GstElementFactory *factory; - - if (vis == EMOTION_VIS_NONE) - return EINA_TRUE; - - name = emotion_visualization_element_name_get(vis); - if (!name) - return EINA_FALSE; - - factory = gst_element_factory_find(name); - if (!factory) - return EINA_FALSE; - - gst_object_unref(factory); - return EINA_TRUE; -} - -static double -em_ratio_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - return ev->ratio; -} - -static int -em_video_handled(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - _emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE); - - if (!eina_list_count(ev->video_streams)) - return 0; - - return 1; -} - -static int -em_audio_handled(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - _emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE); - - if (!eina_list_count(ev->audio_streams)) - return 0; - - return 1; -} - -static int -em_seekable(void *video EINA_UNUSED) -{ - return 1; -} - -static void -em_frame_done(void *video EINA_UNUSED) -{ -} - -static Emotion_Format -em_format_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - Emotion_Video_Stream *vstream; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) - return EMOTION_FORMAT_NONE; - - vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); - if (vstream) - { - switch (vstream->fourcc) - { - case GST_MAKE_FOURCC('I', '4', '2', '0'): - return EMOTION_FORMAT_I420; - case GST_MAKE_FOURCC('Y', 'V', '1', '2'): - return EMOTION_FORMAT_YV12; - case GST_MAKE_FOURCC('Y', 'U', 'Y', '2'): - return EMOTION_FORMAT_YUY2; - case GST_MAKE_FOURCC('A', 'R', 'G', 'B'): - return EMOTION_FORMAT_BGRA; - default: - return EMOTION_FORMAT_NONE; - } - } - return EMOTION_FORMAT_NONE; -} - -static void -em_video_data_size_get(void *video, int *w, int *h) -{ - Emotion_Gstreamer_Video *ev; - Emotion_Video_Stream *vstream; - - ev = (Emotion_Gstreamer_Video *)video; - - if (ev->pipeline && (!ev->video_stream_nbr || !ev->video_streams)) - if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) - goto on_error; - - vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); - if (vstream) - { - *w = vstream->width; - *h = vstream->height; - - return; - } - - on_error: - *w = 0; - *h = 0; -} - -static int -em_yuv_rows_get(void *video EINA_UNUSED, - int w EINA_UNUSED, - int h EINA_UNUSED, - unsigned char **yrows EINA_UNUSED, - unsigned char **urows EINA_UNUSED, - unsigned char **vrows EINA_UNUSED) -{ - return 0; -} - -static int -em_bgra_data_get(void *video EINA_UNUSED, unsigned char **bgra_data EINA_UNUSED) -{ - return 0; -} - -static void -em_event_feed(void *video EINA_UNUSED, int event EINA_UNUSED) -{ -} - -static void -em_event_mouse_button_feed(void *video EINA_UNUSED, int button EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED) -{ -} - -static void -em_event_mouse_move_feed(void *video EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED) -{ -} - -/* Video channels */ -static int -em_video_channel_count(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - _emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE); - - return eina_list_count(ev->video_streams); -} - -static void -em_video_channel_set(void *video EINA_UNUSED, - int channel EINA_UNUSED) -{ -#if 0 - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - if (channel < 0) channel = 0; -#endif - /* FIXME: a faire... */ -} - -static int -em_video_channel_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - _emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE); - - return ev->video_stream_nbr; -} - -static void -em_video_subtitle_file_set(void *video EINA_UNUSED, - const char *filepath EINA_UNUSED) -{ - DBG("video_subtitle_file_set not implemented for gstreamer yet."); -} - -static const char * -em_video_subtitle_file_get(void *video EINA_UNUSED) -{ - DBG("video_subtitle_file_get not implemented for gstreamer yet."); - return NULL; -} - -static const char * -em_video_channel_name_get(void *video EINA_UNUSED, - int channel EINA_UNUSED) -{ - return NULL; -} - -static void -em_video_channel_mute_set(void *video, - int mute) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - ev->video_mute = mute; -} - -static int -em_video_channel_mute_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - return ev->video_mute; -} - -/* Audio channels */ - -static int -em_audio_channel_count(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - _emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE); - - return eina_list_count(ev->audio_streams); -} - -static void -em_audio_channel_set(void *video EINA_UNUSED, - int channel EINA_UNUSED) -{ -#if 0 - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - if (channel < -1) channel = -1; -#endif - /* FIXME: a faire... */ -} - -static int -em_audio_channel_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - _emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE); - - return ev->audio_stream_nbr; -} - -static const char * -em_audio_channel_name_get(void *video EINA_UNUSED, - int channel EINA_UNUSED) -{ - return NULL; -} - -#define GST_PLAY_FLAG_AUDIO (1 << 1) - -static void -em_audio_channel_mute_set(void *video, - int mute) -{ - /* NOTE: at first I wanted to completly shutdown the audio path on mute, - but that's not possible as the audio sink could be the clock source - for the pipeline (at least that's the case on some of the hardware - I have been tested emotion on. - */ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!ev->pipeline) return; - - ev->audio_mute = mute; - - g_object_set(G_OBJECT(ev->pipeline), "mute", !!mute, NULL); -} - -static int -em_audio_channel_mute_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - return ev->audio_mute; -} - -static void -em_audio_channel_volume_set(void *video, - double vol) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!ev->pipeline) return; - - if (vol < 0.0) - vol = 0.0; - if (vol > 1.0) - vol = 1.0; - ev->volume = vol; - g_object_set(G_OBJECT(ev->pipeline), "volume", vol, NULL); -} - -static double -em_audio_channel_volume_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = (Emotion_Gstreamer_Video *)video; - - return ev->volume; -} - -/* spu stuff */ - -static int -em_spu_channel_count(void *video EINA_UNUSED) -{ - return 0; -} - -static void -em_spu_channel_set(void *video EINA_UNUSED, int channel EINA_UNUSED) -{ -} - -static int -em_spu_channel_get(void *video EINA_UNUSED) -{ - return 1; -} - -static const char * -em_spu_channel_name_get(void *video EINA_UNUSED, int channel EINA_UNUSED) -{ - return NULL; -} - -static void -em_spu_channel_mute_set(void *video EINA_UNUSED, int mute EINA_UNUSED) -{ -} - -static int -em_spu_channel_mute_get(void *video EINA_UNUSED) -{ - return 0; -} - -static int -em_chapter_count(void *video EINA_UNUSED) -{ - return 0; -} - -static void -em_chapter_set(void *video EINA_UNUSED, int chapter EINA_UNUSED) -{ -} - -static int -em_chapter_get(void *video EINA_UNUSED) -{ - return 0; -} - -static const char * -em_chapter_name_get(void *video EINA_UNUSED, int chapter EINA_UNUSED) -{ - return NULL; -} - -static void -em_speed_set(void *video EINA_UNUSED, double speed EINA_UNUSED) -{ -} - -static double -em_speed_get(void *video EINA_UNUSED) -{ - return 1.0; -} - -static int -em_eject(void *video EINA_UNUSED) -{ - return 1; -} - -static const char * -em_meta_get(void *video, int meta) -{ - Emotion_Gstreamer_Video *ev; - const char *str = NULL; - - ev = (Emotion_Gstreamer_Video *)video; - - if (!ev || !ev->metadata) return NULL; - switch (meta) - { - case META_TRACK_TITLE: - str = ev->metadata->title; - break; - case META_TRACK_ARTIST: - str = ev->metadata->artist; - break; - case META_TRACK_ALBUM: - str = ev->metadata->album; - break; - case META_TRACK_YEAR: - str = ev->metadata->year; - break; - case META_TRACK_GENRE: - str = ev->metadata->genre; - break; - case META_TRACK_COMMENT: - str = ev->metadata->comment; - break; - case META_TRACK_DISCID: - str = ev->metadata->disc_id; - break; - default: - break; - } - - return str; -} - -static void -em_priority_set(void *video, Eina_Bool pri) -{ - Emotion_Gstreamer_Video *ev; - - ev = video; - if (priority_overide > 3) return; /* If we failed to much to create that pipeline, let's don't wast our time anymore */ - - if (ev->priority != pri && ev->pipeline) - { - if (ev->threads) - { - Ecore_Thread *t; - - EINA_LIST_FREE(ev->threads, t) - ecore_thread_cancel(t); - } - em_cleanup(ev); - restart_idler = ecore_idler_add(_em_restart_stream, ev); - } - ev->priority = pri; -} - -static Eina_Bool -em_priority_get(void *video) -{ - Emotion_Gstreamer_Video *ev; - - ev = video; - return !ev->stream; -} - -#ifdef HAVE_ECORE_X -static Eina_Bool -_ecore_event_x_destroy(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED) -{ - Ecore_X_Event_Window_Destroy *ev = event; - - INF("killed window: %x (%x).", ev->win, ev->event_win); - - return EINA_TRUE; -} - -static void -gstreamer_ecore_x_check(void) -{ - Ecore_X_Window *roots; - int num; - - ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_event_x_destroy, NULL); - - /* Check if the window manager is able to handle our special Xv window. */ - roots = ecore_x_window_root_list(&num); - if (roots && num > 0) - { - Ecore_X_Window win, twin; - int nwins; - - nwins = ecore_x_window_prop_window_get(roots[0], - ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, - &win, 1); - if (nwins > 0) - { - nwins = ecore_x_window_prop_window_get(win, - ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, - &twin, 1); - if (nwins > 0 && twin == win) - { - Ecore_X_Atom *supported; - int supported_num; - int i; - - if (ecore_x_netwm_supported_get(roots[0], &supported, &supported_num)) - { - Eina_Bool parent = EINA_FALSE; - Eina_Bool video_position = EINA_FALSE; - - for (i = 0; i < supported_num; ++i) - { - if (supported[i] == ECORE_X_ATOM_E_VIDEO_PARENT) - parent = EINA_TRUE; - else if (supported[i] == ECORE_X_ATOM_E_VIDEO_POSITION) - video_position = EINA_TRUE; - if (parent && video_position) - break; - } - - if (parent && video_position) - { - window_manager_video = EINA_TRUE; - } - } - free(supported); - } - } - } - free(roots); -} -#endif - -static void * -em_add(const Emotion_Engine *api, - Evas_Object *obj, - const Emotion_Module_Options *opt EINA_UNUSED) -{ - Emotion_Gstreamer_Video *ev; - - ev = calloc(1, sizeof(Emotion_Gstreamer_Video)); - EINA_SAFETY_ON_NULL_RETURN_VAL(ev, NULL); - - ev->api = api; - ev->obj = obj; - - /* Default values */ - ev->ratio = 1.0; - ev->vis = EMOTION_VIS_NONE; - ev->volume = 0.8; - ev->play_started = 0; - ev->delete_me = EINA_FALSE; - ev->threads = NULL; - - return ev; -} - -static const Emotion_Engine em_engine = -{ - EMOTION_ENGINE_API_VERSION, - EMOTION_ENGINE_PRIORITY_DEFAULT, - "gstreamer", - em_add, /* add */ - em_del, /* del */ - em_file_open, /* file_open */ - em_file_close, /* file_close */ - em_play, /* play */ - em_stop, /* stop */ - em_size_get, /* size_get */ - em_pos_set, /* pos_set */ - em_len_get, /* len_get */ - em_buffer_size_get, /* buffer_size_get */ - em_fps_num_get, /* fps_num_get */ - em_fps_den_get, /* fps_den_get */ - em_fps_get, /* fps_get */ - em_pos_get, /* pos_get */ - em_vis_set, /* vis_set */ - em_vis_get, /* vis_get */ - em_vis_supported, /* vis_supported */ - em_ratio_get, /* ratio_get */ - em_video_handled, /* video_handled */ - em_audio_handled, /* audio_handled */ - em_seekable, /* seekable */ - em_frame_done, /* frame_done */ - em_format_get, /* format_get */ - em_video_data_size_get, /* video_data_size_get */ - em_yuv_rows_get, /* yuv_rows_get */ - em_bgra_data_get, /* bgra_data_get */ - em_event_feed, /* event_feed */ - em_event_mouse_button_feed, /* event_mouse_button_feed */ - em_event_mouse_move_feed, /* event_mouse_move_feed */ - 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 */ - em_audio_channel_count, /* audio_channel_count */ - em_audio_channel_set, /* audio_channel_set */ - em_audio_channel_get, /* audio_channel_get */ - em_audio_channel_name_get, /* audio_channel_name_get */ - em_audio_channel_mute_set, /* audio_channel_mute_set */ - em_audio_channel_mute_get, /* audio_channel_mute_get */ - em_audio_channel_volume_set, /* audio_channel_volume_set */ - em_audio_channel_volume_get, /* audio_channel_volume_get */ - em_spu_channel_count, /* spu_channel_count */ - em_spu_channel_set, /* spu_channel_set */ - em_spu_channel_get, /* spu_channel_get */ - em_spu_channel_name_get, /* spu_channel_name_get */ - em_spu_channel_mute_set, /* spu_channel_mute_set */ - em_spu_channel_mute_get, /* spu_channel_mute_get */ - em_chapter_count, /* chapter_count */ - em_chapter_set, /* chapter_set */ - em_chapter_get, /* chapter_get */ - em_chapter_name_get, /* chapter_name_get */ - em_speed_set, /* speed_set */ - em_speed_get, /* speed_get */ - em_eject, /* eject */ - em_meta_get, /* meta_get */ - em_priority_set, /* priority_set */ - em_priority_get, /* priority_get */ - NULL /* em_meta_artwork_get */ -}; - -Eina_Bool -gstreamer_module_init(void) -{ - GError *error; - - if (_emotion_init_count > 0) - { - _emotion_pending_ecore_begin(); - return EINA_TRUE; - } - - if (getenv("EMOTION_FPS_DEBUG")) debug_fps = EINA_TRUE; - - eina_threads_init(); - eina_log_threads_enable(); - _emotion_gstreamer_log_domain = eina_log_domain_register - ("emotion-gstreamer", EINA_COLOR_LIGHTCYAN); - if (_emotion_gstreamer_log_domain < 0) - { - EINA_LOG_CRIT("Could not register log domain 'emotion-gstreamer'"); - return EINA_FALSE; - } - - if (!gst_init_check(0, NULL, &error)) - { - EINA_LOG_CRIT("Could not init GStreamer"); - goto error_gst_init; - } - -#ifdef HAVE_ECORE_X - if (ecore_x_init(NULL) > 0) - { - _ecore_x_available = EINA_TRUE; - gstreamer_ecore_x_check(); - } -#endif - - if (gst_plugin_register_static(GST_VERSION_MAJOR, GST_VERSION_MINOR, - "emotion-sink", - "video sink plugin for Emotion", - gstreamer_plugin_init, - VERSION, - "LGPL", - "Enlightenment", - PACKAGE, - "http://www.enlightenment.org/") == FALSE) - { - EINA_LOG_CRIT("Could not load static gstreamer video sink for Emotion."); - goto error_gst_plugin; - } - - if (!_emotion_module_register(&em_engine)) - { - ERR("Could not register module %p", &em_engine); - goto error_register; - } - - _emotion_init_count = 1; - return EINA_TRUE; - - error_register: - error_gst_plugin: -#ifdef HAVE_ECORE_X - if (_ecore_x_available) - { - ecore_x_shutdown(); - _ecore_x_available = EINA_FALSE; - window_manager_video = EINA_FALSE; - } -#endif - - gst_deinit(); - - error_gst_init: - eina_log_domain_unregister(_emotion_gstreamer_log_domain); - _emotion_gstreamer_log_domain = -1; - - return EINA_FALSE; -} - -void -gstreamer_module_shutdown(void) -{ - if (_emotion_init_count > 1) - { - _emotion_init_count--; - return; - } - else if (_emotion_init_count == 0) - { - EINA_LOG_ERR("too many gstreamer_module_shutdown()"); - return; - } - _emotion_init_count = 0; - - _emotion_module_unregister(&em_engine); - -#ifdef HAVE_ECORE_X - if (_ecore_x_available) - { - ecore_x_shutdown(); - _ecore_x_available = EINA_FALSE; - window_manager_video = EINA_FALSE; - } -#endif - - eina_log_domain_unregister(_emotion_gstreamer_log_domain); - _emotion_gstreamer_log_domain = -1; - - gst_deinit(); -} - -#ifndef EMOTION_STATIC_BUILD_GSTREAMER - -EINA_MODULE_INIT(gstreamer_module_init); -EINA_MODULE_SHUTDOWN(gstreamer_module_shutdown); - -#endif - -static void -_for_each_tag(GstTagList const* list, - gchar const* tag, - void *data) -{ - Emotion_Gstreamer_Video *ev; - int i; - int count; - - - ev = (Emotion_Gstreamer_Video*)data; - - if (!ev || !ev->metadata) return; - - count = gst_tag_list_get_tag_size(list, tag); - - for (i = 0; i < count; i++) - { - if (!strcmp(tag, GST_TAG_TITLE)) - { - char *str; - g_free(ev->metadata->title); - if (gst_tag_list_get_string(list, GST_TAG_TITLE, &str)) - ev->metadata->title = str; - else - ev->metadata->title = NULL; - break; - } - if (!strcmp(tag, GST_TAG_ALBUM)) - { - gchar *str; - g_free(ev->metadata->album); - if (gst_tag_list_get_string(list, GST_TAG_ALBUM, &str)) - ev->metadata->album = str; - else - ev->metadata->album = NULL; - break; - } - if (!strcmp(tag, GST_TAG_ARTIST)) - { - gchar *str; - g_free(ev->metadata->artist); - if (gst_tag_list_get_string(list, GST_TAG_ARTIST, &str)) - ev->metadata->artist = str; - else - ev->metadata->artist = NULL; - break; - } - if (!strcmp(tag, GST_TAG_GENRE)) - { - gchar *str; - g_free(ev->metadata->genre); - if (gst_tag_list_get_string(list, GST_TAG_GENRE, &str)) - ev->metadata->genre = str; - else - ev->metadata->genre = NULL; - break; - } - if (!strcmp(tag, GST_TAG_COMMENT)) - { - gchar *str; - g_free(ev->metadata->comment); - if (gst_tag_list_get_string(list, GST_TAG_COMMENT, &str)) - ev->metadata->comment = str; - else - ev->metadata->comment = NULL; - break; - } - if (!strcmp(tag, GST_TAG_DATE)) - { - gchar *str; - const GValue *date; - g_free(ev->metadata->year); - date = gst_tag_list_get_value_index(list, GST_TAG_DATE, 0); - if (date) - str = g_strdup_value_contents(date); - else - str = NULL; - ev->metadata->year = str; - break; - } - - if (!strcmp(tag, GST_TAG_TRACK_NUMBER)) - { - gchar *str; - const GValue *track; - g_free(ev->metadata->count); - track = gst_tag_list_get_value_index(list, GST_TAG_TRACK_NUMBER, 0); - if (track) - str = g_strdup_value_contents(track); - else - str = NULL; - ev->metadata->count = str; - break; - } - -#ifdef GST_TAG_CDDA_CDDB_DISCID - if (!strcmp(tag, GST_TAG_CDDA_CDDB_DISCID)) - { - gchar *str; - const GValue *discid; - g_free(ev->metadata->disc_id); - discid = gst_tag_list_get_value_index(list, GST_TAG_CDDA_CDDB_DISCID, 0); - if (discid) - str = g_strdup_value_contents(discid); - else - str = NULL; - ev->metadata->disc_id = str; - break; - } -#endif - } - -} - -static void -_free_metadata(Emotion_Gstreamer_Metadata *m) -{ - if (!m) return; - - g_free(m->title); - g_free(m->album); - g_free(m->artist); - g_free(m->genre); - g_free(m->comment); - g_free(m->year); - g_free(m->count); - g_free(m->disc_id); - - free(m); -} - -static Eina_Bool -_em_restart_stream(void *data) -{ - Emotion_Gstreamer_Video *ev; - - ev = data; - - ev->pipeline = gstreamer_video_sink_new(ev, ev->obj, ev->uri); - - if (ev->pipeline) - { - ev->eos_bus = gst_pipeline_get_bus(GST_PIPELINE(ev->pipeline)); - if (!ev->eos_bus) - { - ERR("could not get the bus"); - return EINA_FALSE; - } - - gst_bus_set_sync_handler(ev->eos_bus, _eos_sync_fct, ev); - } - - restart_idler = NULL; - - return ECORE_CALLBACK_CANCEL; -} - -static Eina_Bool -_video_size_get(GstElement *elem, int *width, int *height) -{ - GstIterator *itr = NULL; - GstCaps *caps; - GstStructure *str; - gpointer pad; - Eina_Bool ret = EINA_FALSE; - - itr = gst_element_iterate_src_pads(elem); - while(gst_iterator_next(itr, &pad) && !ret) - { - caps = gst_pad_get_caps(GST_PAD(pad)); - str = gst_caps_get_structure(caps, 0); - if (g_strrstr(gst_structure_get_name(str), "video")) - { - if (gst_structure_get_int(str, "width", width) && gst_structure_get_int(str, "height", height)) - ret = EINA_TRUE; - } - gst_caps_unref(caps); - gst_object_unref(pad); - } - gst_iterator_free(itr); - - return ret; -} - -static void -_main_frame_resize(void *data) -{ - Emotion_Gstreamer_Video *ev = data; - double ratio; - - ratio = (double)ev->src_width / (double)ev->src_height; - _emotion_frame_resize(ev->obj, ev->src_width, ev->src_height, ratio); - _emotion_pending_ecore_end(); -} - -static void -_no_more_pads(GstElement *decodebin, gpointer data) -{ - GstIterator *itr = NULL; - gpointer elem; - Emotion_Gstreamer_Video *ev = data; - - itr = gst_bin_iterate_elements(GST_BIN(decodebin)); - while(gst_iterator_next(itr, &elem)) - { - if(_video_size_get(GST_ELEMENT(elem), &ev->src_width, &ev->src_height)) - { - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(_main_frame_resize, ev); - gst_object_unref(elem); - break; - } - gst_object_unref(elem); - } - gst_iterator_free(itr); -} - -static void -_eos_main_fct(void *data) -{ - Emotion_Gstreamer_Message *send; - Emotion_Gstreamer_Video *ev; - GstMessage *msg; - - send = data; - ev = send->ev; - msg = send->msg; - - if (ev->play_started && !ev->delete_me) - { - _emotion_playback_started(ev->obj); - ev->play_started = 0; - } - - switch (GST_MESSAGE_TYPE(msg)) - { - case GST_MESSAGE_EOS: - if (!ev->delete_me) - { - ev->play = 0; - _emotion_decode_stop(ev->obj); - _emotion_playback_finished(ev->obj); - } - break; - case GST_MESSAGE_TAG: - if (!ev->delete_me) - { - GstTagList *new_tags; - gst_message_parse_tag(msg, &new_tags); - if (new_tags) - { - gst_tag_list_foreach(new_tags, - (GstTagForeachFunc)_for_each_tag, - ev); - gst_tag_list_free(new_tags); - } - } - break; - case GST_MESSAGE_ASYNC_DONE: - if (!ev->delete_me) _emotion_seek_done(ev->obj); - break; - case GST_MESSAGE_STREAM_STATUS: - break; - case GST_MESSAGE_STATE_CHANGED: - if (!ev->delete_me) - { - if (!g_signal_handlers_disconnect_by_func(msg->src, _no_more_pads, ev)) - g_signal_connect(msg->src, "no-more-pads", G_CALLBACK(_no_more_pads), ev); - } - break; - case GST_MESSAGE_ERROR: - em_cleanup(ev); - - if (ev->priority) - { - ERR("Switching back to canvas rendering."); - ev->priority = EINA_FALSE; - priority_overide++; - - restart_idler = ecore_idler_add(_em_restart_stream, ev); - } - break; - default: - ERR("bus say: %s [%i - %s]", - GST_MESSAGE_SRC_NAME(msg), - GST_MESSAGE_TYPE(msg), - GST_MESSAGE_TYPE_NAME(msg)); - break; - } - - emotion_gstreamer_message_free(send); - _emotion_pending_ecore_end(); -} - -static GstBusSyncReply -_eos_sync_fct(GstBus *bus EINA_UNUSED, GstMessage *msg, gpointer data) -{ - Emotion_Gstreamer_Video *ev = data; - Emotion_Gstreamer_Message *send; - - switch (GST_MESSAGE_TYPE(msg)) - { - case GST_MESSAGE_EOS: - case GST_MESSAGE_TAG: - case GST_MESSAGE_ASYNC_DONE: - case GST_MESSAGE_STREAM_STATUS: - INF("bus say: %s [%i - %s]", - GST_MESSAGE_SRC_NAME(msg), - GST_MESSAGE_TYPE(msg), - GST_MESSAGE_TYPE_NAME(msg)); - send = emotion_gstreamer_message_alloc(ev, msg); - - if (send) - { - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(_eos_main_fct, send); - } - - break; - - case GST_MESSAGE_STATE_CHANGED: - { - GstState old_state, new_state; - - gst_message_parse_state_changed(msg, &old_state, &new_state, NULL); - INF("Element %s changed state from %s to %s.", - GST_OBJECT_NAME(msg->src), - gst_element_state_get_name(old_state), - gst_element_state_get_name(new_state)); - - if (!strncmp(GST_OBJECT_NAME(msg->src), "decodebin", 9) && !strcmp(gst_element_state_get_name(new_state), "READY")) - { - send = emotion_gstreamer_message_alloc(ev, msg); - - if (send) - { - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(_eos_main_fct, send); - } - } - break; - } - case GST_MESSAGE_ERROR: - { - GError *error; - gchar *debug; - - gst_message_parse_error(msg, &error, &debug); - ERR("ERROR from element %s: %s", GST_OBJECT_NAME(msg->src), error->message); - ERR("Debugging info: %s", (debug) ? debug : "none"); - g_error_free(error); - g_free(debug); - - if (strncmp(GST_OBJECT_NAME(msg->src), "xvimagesink", 11) == 0) - { - send = emotion_gstreamer_message_alloc(ev, msg); - - if (send) - { - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(_eos_main_fct, send); - } - } - break; - } - case GST_MESSAGE_WARNING: - { - GError *error; - gchar *debug; - - gst_message_parse_warning(msg, &error, &debug); - WRN("WARNING from element %s: %s", GST_OBJECT_NAME(msg->src), error->message); - WRN("Debugging info: %s", (debug) ? debug : "none"); - g_error_free(error); - g_free(debug); - break; - } - default: - WRN("bus say: %s [%i - %s]", - GST_MESSAGE_SRC_NAME(msg), - GST_MESSAGE_TYPE(msg), - GST_MESSAGE_TYPE_NAME(msg)); - break; - } - - gst_message_unref(msg); - - return GST_BUS_DROP; -} - -Eina_Bool -_emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev, - Eina_Bool force) -{ - gboolean mute = 0; - gdouble vol = 0.0; - gboolean res; - int i; - - if (ev->pipeline_parsed) - return EINA_TRUE; - - if (force && ev->threads) - { - Ecore_Thread *t; - - EINA_LIST_FREE(ev->threads, t) - ecore_thread_cancel(t); - } - - if (ev->threads) - return EINA_FALSE; - - res = gst_element_get_state(ev->pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); - if (res == GST_STATE_CHANGE_NO_PREROLL) - { - gst_element_set_state(ev->pipeline, GST_STATE_PLAYING); - - res = gst_element_get_state(ev->pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); - } - - /** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */ - /** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */ -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - if (getuid() == geteuid()) -#endif - { - if (getenv("EMOTION_GSTREAMER_DOT")) - GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), - GST_DEBUG_GRAPH_SHOW_ALL, - getenv("EMOTION_GSTREAMER_DOT")); - } - - if (!(res == GST_STATE_CHANGE_SUCCESS - || res == GST_STATE_CHANGE_NO_PREROLL)) - { - ERR("Unable to get GST_CLOCK_TIME_NONE."); - return EINA_FALSE; - } - - g_object_get(G_OBJECT(ev->pipeline), - "n-audio", &ev->audio_stream_nbr, - "n-video", &ev->video_stream_nbr, - NULL); - - if ((ev->video_stream_nbr == 0) && (ev->audio_stream_nbr == 0)) - { - ERR("No audio nor video stream found"); - return EINA_FALSE; - } - - /* video stream */ - for (i = 0; i < ev->video_stream_nbr; i++) - { - Emotion_Video_Stream *vstream; - GstPad *pad = NULL; - GstCaps *caps; - GstStructure *structure; - GstQuery *query; - const GValue *val; - gchar *str = NULL; - - gdouble length_time = 0.0; - gint width; - gint height; - gint fps_num; - gint fps_den; - guint32 fourcc = 0; - - g_signal_emit_by_name(ev->pipeline, "get-video-pad", i, &pad); - if (!pad) - continue; - - caps = gst_pad_get_negotiated_caps(pad); - if (!caps) - goto unref_pad_v; - structure = gst_caps_get_structure(caps, 0); - str = gst_caps_to_string(caps); - - if (!gst_structure_get_int(structure, "width", &width)) - goto unref_caps_v; - if (!gst_structure_get_int(structure, "height", &height)) - goto unref_caps_v; - if (!gst_structure_get_fraction(structure, "framerate", &fps_num, &fps_den)) - goto unref_caps_v; - - if (g_str_has_prefix(str, "video/x-raw-yuv")) - { - val = gst_structure_get_value(structure, "format"); - fourcc = gst_value_get_fourcc(val); - } - else if (g_str_has_prefix(str, "video/x-raw-rgb")) - fourcc = GST_MAKE_FOURCC('A', 'R', 'G', 'B'); - else - goto unref_caps_v; - - query = gst_query_new_duration(GST_FORMAT_TIME); - if (gst_pad_peer_query(pad, query)) - { - gint64 t; - - gst_query_parse_duration(query, NULL, &t); - length_time = (double)t / (double)GST_SECOND; - } - else - goto unref_query_v; - - vstream = emotion_video_stream_new(ev); - if (!vstream) goto unref_query_v; - - vstream->length_time = length_time; - vstream->width = width; - vstream->height = height; - vstream->fps_num = fps_num; - vstream->fps_den = fps_den; - vstream->fourcc = fourcc; - vstream->index = i; - - unref_query_v: - gst_query_unref(query); - unref_caps_v: - gst_caps_unref(caps); - g_free(str); - unref_pad_v: - gst_object_unref(pad); - } - - /* Audio streams */ - for (i = 0; i < ev->audio_stream_nbr; i++) - { - Emotion_Audio_Stream *astream; - GstPad *pad; - GstCaps *caps; - GstStructure *structure; - GstQuery *query; - - gdouble length_time = 0.0; - gint channels; - gint samplerate; - - g_signal_emit_by_name(ev->pipeline, "get-audio-pad", i, &pad); - if (!pad) - continue; - - caps = gst_pad_get_negotiated_caps(pad); - if (!caps) - goto unref_pad_a; - structure = gst_caps_get_structure(caps, 0); - - if (!gst_structure_get_int(structure, "channels", &channels)) - goto unref_caps_a; - if (!gst_structure_get_int(structure, "rate", &samplerate)) - goto unref_caps_a; - - query = gst_query_new_duration(GST_FORMAT_TIME); - if (gst_pad_peer_query(pad, query)) - { - gint64 t; - - gst_query_parse_duration(query, NULL, &t); - length_time = (double)t / (double)GST_SECOND; - } - else - goto unref_query_a; - - astream = calloc(1, sizeof(Emotion_Audio_Stream)); - if (!astream) continue; - ev->audio_streams = eina_list_append(ev->audio_streams, astream); - - astream->length_time = length_time; - astream->channels = channels; - astream->samplerate = samplerate; - - unref_query_a: - gst_query_unref(query); - unref_caps_a: - gst_caps_unref(caps); - unref_pad_a: - gst_object_unref(pad); - } - - /* Visualization sink */ - if (ev->video_stream_nbr == 0) - { - GstElement *vis = NULL; - Emotion_Video_Stream *vstream; - Emotion_Audio_Stream *astream; - gint flags; - const char *vis_name; - - if (!(vis_name = emotion_visualization_element_name_get(ev->vis))) - { - WRN("pb vis name %d", ev->vis); - goto finalize; - } - - astream = eina_list_data_get(ev->audio_streams); - - vis = gst_element_factory_make(vis_name, "vissink"); - vstream = emotion_video_stream_new(ev); - if (!vstream) - goto finalize; - else - DBG("could not create visualization stream"); - - vstream->length_time = astream->length_time; - vstream->width = 320; - vstream->height = 200; - vstream->fps_num = 25; - vstream->fps_den = 1; - vstream->fourcc = GST_MAKE_FOURCC('A', 'R', 'G', 'B'); - - g_object_set(G_OBJECT(ev->pipeline), "vis-plugin", vis, NULL); - g_object_get(G_OBJECT(ev->pipeline), "flags", &flags, NULL); - flags |= 0x00000008; - g_object_set(G_OBJECT(ev->pipeline), "flags", flags, NULL); - } - - finalize: - - ev->video_stream_nbr = eina_list_count(ev->video_streams); - ev->audio_stream_nbr = eina_list_count(ev->audio_streams); - - if (ev->video_stream_nbr == 1) - { - Emotion_Video_Stream *vstream; - - vstream = eina_list_data_get(ev->video_streams); - ev->ratio = (double)vstream->width / (double)vstream->height; - _emotion_frame_resize(ev->obj, vstream->width, vstream->height, ev->ratio); - } - - { - /* on recapitule : */ - Emotion_Video_Stream *vstream; - Emotion_Audio_Stream *astream; - - vstream = eina_list_data_get(ev->video_streams); - if (vstream) - { - DBG("video size=%dx%d, fps=%d/%d, " - "fourcc=%"GST_FOURCC_FORMAT", length=%"GST_TIME_FORMAT, - vstream->width, vstream->height, vstream->fps_num, vstream->fps_den, - GST_FOURCC_ARGS(vstream->fourcc), - GST_TIME_ARGS((guint64)(vstream->length_time * GST_SECOND))); - } - - astream = eina_list_data_get(ev->audio_streams); - if (astream) - { - DBG("audio channels=%d, rate=%d, length=%"GST_TIME_FORMAT, - astream->channels, astream->samplerate, - GST_TIME_ARGS((guint64)(astream->length_time * GST_SECOND))); - } - } - - if (ev->metadata) - _free_metadata(ev->metadata); - ev->metadata = calloc(1, sizeof(Emotion_Gstreamer_Metadata)); - - ev->pipeline_parsed = EINA_TRUE; - - g_object_get(ev->pipeline, "volume", &vol, NULL); - g_object_get(ev->pipeline, "mute", &mute, NULL); - ev->volume = vol; - ev->audio_mute = mute; - - if (ev->play_started) - { - _emotion_playback_started(ev->obj); - ev->play_started = 0; - } - - _emotion_open_done(ev->obj); - - return EINA_TRUE; -} diff --git a/src/modules/emotion/gstreamer/emotion_gstreamer.h b/src/modules/emotion/gstreamer/emotion_gstreamer.h deleted file mode 100644 index 4b15ae5777..0000000000 --- a/src/modules/emotion/gstreamer/emotion_gstreamer.h +++ /dev/null @@ -1,352 +0,0 @@ -#ifndef __EMOTION_GSTREAMER_H__ -#define __EMOTION_GSTREAMER_H__ - -#include "emotion_modules.h" - -typedef void (*Evas_Video_Convert_Cb)(unsigned char *evas_data, - const unsigned char *gst_data, - unsigned int w, - unsigned int h, - unsigned int output_height); - -typedef struct _EvasVideoSinkPrivate EvasVideoSinkPrivate; -typedef struct _EvasVideoSink EvasVideoSink; -typedef struct _EvasVideoSinkClass EvasVideoSinkClass; -typedef struct _Emotion_Gstreamer_Video Emotion_Gstreamer_Video; -typedef struct _Emotion_Audio_Stream Emotion_Audio_Stream; -typedef struct _Emotion_Gstreamer_Metadata Emotion_Gstreamer_Metadata; -typedef struct _Emotion_Gstreamer_Buffer Emotion_Gstreamer_Buffer; -typedef struct _Emotion_Gstreamer_Message Emotion_Gstreamer_Message; -typedef struct _Emotion_Video_Stream Emotion_Video_Stream; - -struct _Emotion_Video_Stream -{ - gdouble length_time; - gint width; - gint height; - gint fps_num; - gint fps_den; - guint32 fourcc; - int index; -}; - -struct _Emotion_Audio_Stream -{ - gdouble length_time; - gint channels; - gint samplerate; -}; - -struct _Emotion_Gstreamer_Metadata -{ - char *title; - char *album; - char *artist; - char *genre; - char *comment; - char *year; - char *count; - char *disc_id; -}; - -struct _Emotion_Gstreamer_Video -{ - const Emotion_Engine *api; - - /* Gstreamer elements */ - GstElement *pipeline; - GstElement *sink; - GstElement *esink; - GstElement *xvsink; - GstElement *tee; - GstElement *convert; - - GstPad *eteepad; - GstPad *xvteepad; - GstPad *xvpad; - Eina_List *threads; - - /* eos */ - GstBus *eos_bus; - - /* Strams */ - Eina_List *video_streams; - Eina_List *audio_streams; - - int video_stream_nbr; - int audio_stream_nbr; - - /* We need to keep a copy of the last inserted buffer as evas doesn't copy YUV data around */ - GstBuffer *last_buffer; - - /* Evas object */ - Evas_Object *obj; - - /* Characteristics of stream */ - double position; - double ratio; - double volume; - - volatile int seek_to; - volatile int get_poslen; - - Emotion_Gstreamer_Metadata *metadata; - -#ifdef HAVE_ECORE_X - Ecore_X_Window win; -#endif - - const char *uri; - - Emotion_Gstreamer_Buffer *send; - - EvasVideoSinkPrivate *sink_data; - - Emotion_Vis vis; - - int in; - int out; - - int frames; - int flapse; - double rtime; - double rlapse; - - struct - { - double width; - double height; - } fill; - - Eina_Bool play : 1; - Eina_Bool play_started : 1; - Eina_Bool video_mute : 1; - Eina_Bool audio_mute : 1; - Eina_Bool pipeline_parsed : 1; - Eina_Bool delete_me : 1; - Eina_Bool samsung : 1; - Eina_Bool kill_buffer : 1; - Eina_Bool stream : 1; - Eina_Bool priority : 1; - - int src_width; - int src_height; -}; - -struct _EvasVideoSink { - /*< private >*/ - GstVideoSink parent; - EvasVideoSinkPrivate *priv; -}; - -struct _EvasVideoSinkClass { - /*< private >*/ - GstVideoSinkClass parent_class; -}; - -struct _EvasVideoSinkPrivate { - EINA_REFCOUNT; - - Evas_Object *o; - - Emotion_Gstreamer_Video *ev; - - Evas_Video_Convert_Cb func; - - unsigned int width; - unsigned int height; - unsigned int source_height; - Evas_Colorspace eformat; - - Eina_Lock m; - Eina_Condition c; - - // If this is TRUE all processing should finish ASAP - // This is necessary because there could be a race between - // unlock() and render(), where unlock() wins, signals the - // GCond, then render() tries to render a frame although - // everything else isn't running anymore. This will lead - // to deadlocks because render() holds the stream lock. - // - // Protected by the buffer mutex - Eina_Bool unlocked : 1; - Eina_Bool samsung : 1; /** ST12 will only define a Samsung specific GstBuffer */ -}; - -struct _Emotion_Gstreamer_Buffer -{ - Emotion_Gstreamer_Video *ev; - EvasVideoSinkPrivate *sink; - - GstBuffer *frame; - - Eina_Bool preroll : 1; - Eina_Bool force : 1; -}; - -struct _Emotion_Gstreamer_Message -{ - Emotion_Gstreamer_Video *ev; - - GstMessage *msg; -}; - -extern Eina_Bool window_manager_video; -extern Eina_Bool debug_fps; -extern int _emotion_gstreamer_log_domain; -extern Eina_Bool _ecore_x_available; - -#ifdef DBG -#undef DBG -#endif -#define DBG(...) EINA_LOG_DOM_DBG(_emotion_gstreamer_log_domain, __VA_ARGS__) - -#ifdef INF -#undef INF -#endif -#define INF(...) EINA_LOG_DOM_INFO(_emotion_gstreamer_log_domain, __VA_ARGS__) - -#ifdef WRN -#undef WRN -#endif -#define WRN(...) EINA_LOG_DOM_WARN(_emotion_gstreamer_log_domain, __VA_ARGS__) - -#ifdef ERR -#undef ERR -#endif -#define ERR(...) EINA_LOG_DOM_ERR(_emotion_gstreamer_log_domain, __VA_ARGS__) - -#ifdef CRI -#undef CRI -#endif -#define CRI(...) EINA_LOG_DOM_CRIT(_emotion_gstreamer_log_domain, __VA_ARGS__) - -#define EVAS_TYPE_VIDEO_SINK evas_video_sink_get_type() - -GType fakeeos_bin_get_type(void); - -#define EVAS_VIDEO_SINK(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - EVAS_TYPE_VIDEO_SINK, EvasVideoSink)) - -#define EVAS_VIDEO_SINK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), \ - EVAS_TYPE_VIDEO_SINK, EvasVideoSinkClass)) - -#define EVAS_IS_VIDEO_SINK(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - EVAS_TYPE_VIDEO_SINK)) - -#define EVAS_IS_VIDEO_SINK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), \ - EVAS_TYPE_VIDEO_SINK)) - -#define EVAS_VIDEO_SINK_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), \ - EVAS_TYPE_VIDEO_SINK, EvasVideoSinkClass)) - -#define GST_TYPE_FAKEEOS_BIN fakeeos_bin_get_type() - -GstElement *gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev, - Evas_Object *obj, - const char *uri); - -gboolean gstreamer_plugin_init(GstPlugin *plugin); - -Emotion_Gstreamer_Buffer *emotion_gstreamer_buffer_alloc(EvasVideoSinkPrivate *sink, - GstBuffer *buffer, - Eina_Bool preroll); -void emotion_gstreamer_buffer_free(Emotion_Gstreamer_Buffer *send); - -Emotion_Gstreamer_Message *emotion_gstreamer_message_alloc(Emotion_Gstreamer_Video *ev, - GstMessage *msg); -void emotion_gstreamer_message_free(Emotion_Gstreamer_Message *send); -Eina_Bool _emotion_gstreamer_video_pipeline_parse(Emotion_Gstreamer_Video *ev, - Eina_Bool force); - -typedef struct _ColorSpace_FourCC_Convertion ColorSpace_FourCC_Convertion; -typedef struct _ColorSpace_Format_Convertion ColorSpace_Format_Convertion; - -struct _ColorSpace_FourCC_Convertion -{ - const char *name; - guint32 fourcc; - Evas_Colorspace eformat; - Evas_Video_Convert_Cb func; - Eina_Bool force_height; -}; - -struct _ColorSpace_Format_Convertion -{ - const char *name; - GstVideoFormat format; - Evas_Colorspace eformat; - Evas_Video_Convert_Cb func; -}; - -extern const ColorSpace_FourCC_Convertion colorspace_fourcc_convertion[]; -extern const ColorSpace_Format_Convertion colorspace_format_convertion[]; - -/** Samsung specific infrastructure - do not touch, do not modify */ -#define MPLANE_IMGB_MAX_COUNT 4 -#define SCMN_IMGB_MAX_PLANE 4 - -typedef struct _GstMultiPlaneImageBuffer GstMultiPlaneImageBuffer; -typedef struct _SCMN_IMGB SCMN_IMGB; - -struct _GstMultiPlaneImageBuffer -{ - GstBuffer buffer; - - /* width of each image plane */ - gint width[MPLANE_IMGB_MAX_COUNT]; - /* height of each image plane */ - gint height[MPLANE_IMGB_MAX_COUNT]; - /* stride of each image plane */ - gint stride[MPLANE_IMGB_MAX_COUNT]; - /* elevation of each image plane */ - gint elevation[MPLANE_IMGB_MAX_COUNT]; - /* user space address of each image plane */ - guchar *uaddr[MPLANE_IMGB_MAX_COUNT]; - /* Index of real address of each image plane, if needs */ - guchar *index[MPLANE_IMGB_MAX_COUNT]; - /* left postion, if needs */ - gint x; - /* top position, if needs */ - gint y; - /* to align memory */ - gint __dummy2; - /* arbitrary data */ - gint data[16]; -}; - -struct _SCMN_IMGB -{ - /* width of each image plane */ - int width[SCMN_IMGB_MAX_PLANE]; - /* height of each image plane */ - int height[SCMN_IMGB_MAX_PLANE]; - /* stride of each image plane */ - int stride[SCMN_IMGB_MAX_PLANE]; - /* elevation of each image plane */ - int elevation[SCMN_IMGB_MAX_PLANE]; - /* user space address of each image plane */ - guchar *uaddr[SCMN_IMGB_MAX_PLANE]; - /* physical address of each image plane, if needs */ - guchar *p[SCMN_IMGB_MAX_PLANE]; - /* color space type of image */ - int cs; - /* left postion, if needs */ - int x; - /* top position, if needs */ - int y; - /* to align memory */ - int __dummy2; - /* arbitrary data */ - int data[16]; -}; - -void _evas_video_st12_multiplane(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w, unsigned int h, unsigned int output_height EINA_UNUSED); -void _evas_video_st12(unsigned char *evas_data, const unsigned char *gst_data, unsigned int w EINA_UNUSED, unsigned int h, unsigned int output_height EINA_UNUSED); - -#endif /* __EMOTION_GSTREAMER_H__ */ diff --git a/src/modules/emotion/gstreamer/emotion_sink.c b/src/modules/emotion/gstreamer/emotion_sink.c deleted file mode 100644 index 63fcbeeea7..0000000000 --- a/src/modules/emotion/gstreamer/emotion_sink.c +++ /dev/null @@ -1,1461 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include - -#define HTTP_STREAM 0 -#define RTSP_STREAM 1 -#include -#include -#include -#include -#include - -// forcibly disable x overlay window.. broken badly. -#undef HAVE_ECORE_X - -#ifdef HAVE_ECORE_X -# include -# include -# ifdef HAVE_XOVERLAY_H -# include -# endif -#endif - -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) -# include -# include -#endif - -#include "emotion_modules.h" -#include "emotion_gstreamer.h" - -static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink", - GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS(GST_VIDEO_CAPS_YUV("{ I420, YV12, YUY2, NV12, ST12, TM12 }") ";" - GST_VIDEO_CAPS_BGRx ";" GST_VIDEO_CAPS_BGR ";" GST_VIDEO_CAPS_BGRA)); - -GST_DEBUG_CATEGORY_STATIC(evas_video_sink_debug); -#define GST_CAT_DEFAULT evas_video_sink_debug - -enum { - REPAINT_REQUESTED, - LAST_SIGNAL -}; - -enum { - PROP_0, - PROP_EVAS_OBJECT, - PROP_WIDTH, - PROP_HEIGHT, - PROP_EV, - PROP_LAST -}; - -static guint evas_video_sink_signals[LAST_SIGNAL] = { 0, }; - -#define _do_init(bla) \ - GST_DEBUG_CATEGORY_INIT(evas_video_sink_debug, \ - "emotion-sink", \ - 0, \ - "emotion video sink") - -GST_BOILERPLATE_FULL(EvasVideoSink, - evas_video_sink, - GstVideoSink, - GST_TYPE_VIDEO_SINK, - _do_init); - - -static void unlock_buffer_mutex(EvasVideoSinkPrivate* priv); -static void evas_video_sink_main_render(void *data); -static void evas_video_sink_samsung_main_render(void *data); - -static void -evas_video_sink_base_init(gpointer g_class) -{ - GstElementClass* element_class; - - element_class = GST_ELEMENT_CLASS(g_class); - gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&sinktemplate)); - gst_element_class_set_details_simple(element_class, "Evas video sink", - "Sink/Video", "Sends video data from a GStreamer pipeline to an Evas object", - "Vincent Torri "); -} - -static void -evas_video_sink_init(EvasVideoSink* sink, EvasVideoSinkClass* klass EINA_UNUSED) -{ - EvasVideoSinkPrivate* priv; - - INF("sink init"); - sink->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE(sink, EVAS_TYPE_VIDEO_SINK, EvasVideoSinkPrivate); - priv->o = NULL; - priv->width = 0; - priv->height = 0; - priv->func = NULL; - priv->eformat = EVAS_COLORSPACE_ARGB8888; - priv->samsung = EINA_FALSE; - eina_lock_new(&priv->m); - eina_condition_new(&priv->c, &priv->m); - priv->unlocked = EINA_FALSE; -} - -/**** Object methods ****/ -static void -_cleanup_priv(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - EvasVideoSinkPrivate* priv; - - priv = data; - - eina_lock_take(&priv->m); - if (priv->o == obj) - priv->o = NULL; - eina_lock_release(&priv->m); -} - -static void -evas_video_sink_set_property(GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - EvasVideoSink* sink; - EvasVideoSinkPrivate* priv; - - sink = EVAS_VIDEO_SINK (object); - priv = sink->priv; - - switch (prop_id) { - case PROP_EVAS_OBJECT: - eina_lock_take(&priv->m); - if (priv->o) - evas_object_event_callback_del(priv->o, EVAS_CALLBACK_DEL, _cleanup_priv); - priv->o = g_value_get_pointer (value); - INF("sink set Evas_Object %p.", priv->o); - if (priv->o) - evas_object_event_callback_add(priv->o, EVAS_CALLBACK_DEL, _cleanup_priv, priv); - eina_lock_release(&priv->m); - break; - case PROP_EV: - INF("sink set ev."); - eina_lock_take(&priv->m); - priv->ev = g_value_get_pointer (value); - if (priv->ev) - priv->ev->samsung = EINA_TRUE; - eina_lock_release(&priv->m); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - ERR("invalid property"); - break; - } -} - -static void -evas_video_sink_get_property(GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec) -{ - EvasVideoSink* sink; - EvasVideoSinkPrivate* priv; - - sink = EVAS_VIDEO_SINK (object); - priv = sink->priv; - - switch (prop_id) { - case PROP_EVAS_OBJECT: - INF("sink get property."); - eina_lock_take(&priv->m); - g_value_set_pointer(value, priv->o); - eina_lock_release(&priv->m); - break; - case PROP_WIDTH: - INF("sink get width."); - eina_lock_take(&priv->m); - g_value_set_int(value, priv->width); - eina_lock_release(&priv->m); - break; - case PROP_HEIGHT: - INF("sink get height."); - eina_lock_take(&priv->m); - g_value_set_int (value, priv->height); - eina_lock_release(&priv->m); - break; - case PROP_EV: - INF("sink get ev."); - eina_lock_take(&priv->m); - g_value_set_pointer (value, priv->ev); - eina_lock_release(&priv->m); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - ERR("invalid property"); - break; - } -} - -static void -evas_video_sink_dispose(GObject* object) -{ - EvasVideoSink* sink; - EvasVideoSinkPrivate* priv; - - INF("dispose."); - - sink = EVAS_VIDEO_SINK(object); - priv = sink->priv; - - eina_lock_free(&priv->m); - eina_condition_free(&priv->c); - - G_OBJECT_CLASS(parent_class)->dispose(object); -} - - -/**** BaseSink methods ****/ - -gboolean evas_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps) -{ - EvasVideoSink* sink; - EvasVideoSinkPrivate* priv; - GstStructure *structure; - GstVideoFormat format; - guint32 fourcc; - unsigned int i; - - sink = EVAS_VIDEO_SINK(bsink); - priv = sink->priv; - - structure = gst_caps_get_structure(caps, 0); - - if (gst_structure_get_int(structure, "width", (int*) &priv->width) - && gst_structure_get_int(structure, "height", (int*) &priv->height) - && gst_structure_get_fourcc(structure, "format", &fourcc)) - { - priv->source_height = priv->height; - - for (i = 0; colorspace_fourcc_convertion[i].name != NULL; ++i) - if (fourcc == colorspace_fourcc_convertion[i].fourcc) - { - DBG("Found '%s'", colorspace_fourcc_convertion[i].name); - priv->eformat = colorspace_fourcc_convertion[i].eformat; - priv->func = colorspace_fourcc_convertion[i].func; - if (colorspace_fourcc_convertion[i].force_height) - { - priv->height = (priv->height >> 1) << 1; - } - if (priv->ev) - priv->ev->kill_buffer = EINA_TRUE; - return TRUE; - } - - if (fourcc == GST_MAKE_FOURCC('S', 'T', '1', '2')) - { - DBG("Found '%s'", "ST12"); - priv->eformat = EVAS_COLORSPACE_YCBCR420TM12601_PL; - priv->samsung = EINA_TRUE; - priv->func = NULL; - if (priv->ev) - { - priv->ev->samsung = EINA_TRUE; - priv->ev->kill_buffer = EINA_TRUE; - } - return TRUE; - } - } - - INF("fallback code !"); - if (!gst_video_format_parse_caps(caps, &format, (int*) &priv->width, (int*) &priv->height)) - { - ERR("Unable to parse caps."); - return FALSE; - } - - priv->source_height = priv->height; - - for (i = 0; colorspace_format_convertion[i].name != NULL; ++i) - if (format == colorspace_format_convertion[i].format) - { - DBG("Found '%s'", colorspace_format_convertion[i].name); - priv->eformat = colorspace_format_convertion[i].eformat; - priv->func = colorspace_format_convertion[i].func; - if (priv->ev) - priv->ev->kill_buffer = EINA_FALSE; - return TRUE; - } - - ERR("unsupported : %d\n", format); - return FALSE; -} - -static gboolean -evas_video_sink_start(GstBaseSink* base_sink) -{ - EvasVideoSinkPrivate* priv; - gboolean res = TRUE; - - INF("sink start"); - - priv = EVAS_VIDEO_SINK(base_sink)->priv; - eina_lock_take(&priv->m); - if (!priv->o) - res = FALSE; - else - priv->unlocked = EINA_FALSE; - eina_lock_release(&priv->m); - return res; -} - -static gboolean -evas_video_sink_stop(GstBaseSink* base_sink) -{ - EvasVideoSinkPrivate* priv = EVAS_VIDEO_SINK(base_sink)->priv; - - INF("sink stop"); - - unlock_buffer_mutex(priv); - return TRUE; -} - -static gboolean -evas_video_sink_unlock(GstBaseSink* object) -{ - EvasVideoSink* sink; - - INF("sink unlock"); - - sink = EVAS_VIDEO_SINK(object); - - unlock_buffer_mutex(sink->priv); - - return GST_CALL_PARENT_WITH_DEFAULT(GST_BASE_SINK_CLASS, unlock, - (object), TRUE); -} - -static gboolean -evas_video_sink_unlock_stop(GstBaseSink* object) -{ - EvasVideoSink* sink; - EvasVideoSinkPrivate* priv; - - sink = EVAS_VIDEO_SINK(object); - priv = sink->priv; - - INF("sink unlock stop"); - - eina_lock_take(&priv->m); - priv->unlocked = FALSE; - eina_lock_release(&priv->m); - - return GST_CALL_PARENT_WITH_DEFAULT(GST_BASE_SINK_CLASS, unlock_stop, - (object), TRUE); -} - -static GstFlowReturn -evas_video_sink_preroll(GstBaseSink* bsink, GstBuffer* buffer) -{ - Emotion_Gstreamer_Buffer *send; - EvasVideoSinkPrivate *priv; - EvasVideoSink *sink; - - INF("sink preroll %p [%i]", GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer)); - - sink = EVAS_VIDEO_SINK(bsink); - priv = sink->priv; - - if (GST_BUFFER_SIZE(buffer) <= 0 && !priv->samsung) - { - WRN("empty buffer"); - return GST_FLOW_OK; - } - - send = emotion_gstreamer_buffer_alloc(priv, buffer, EINA_TRUE); - - if (send) - { - if (priv->samsung) - { - if (!priv->func) - { - GstStructure *structure; - GstCaps *caps; - gboolean is_multiplane = FALSE; - - caps = GST_BUFFER_CAPS(buffer); - structure = gst_caps_get_structure (caps, 0); - gst_structure_get_boolean(structure, "multiplane", &is_multiplane); - gst_caps_unref(caps); - - if (is_multiplane) - priv->func = _evas_video_st12_multiplane; - else - priv->func = _evas_video_st12; - } - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(evas_video_sink_samsung_main_render, send); - } - else - { - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(evas_video_sink_main_render, send); - } - } - - return GST_FLOW_OK; -} - -static GstFlowReturn -evas_video_sink_render(GstBaseSink* bsink, GstBuffer* buffer) -{ - Emotion_Gstreamer_Buffer *send; - EvasVideoSinkPrivate *priv; - EvasVideoSink *sink; - - INF("sink render %p", buffer); - - sink = EVAS_VIDEO_SINK(bsink); - priv = sink->priv; - - eina_lock_take(&priv->m); - - if (priv->unlocked) { - ERR("LOCKED"); - eina_lock_release(&priv->m); - return GST_FLOW_OK; - } - - send = emotion_gstreamer_buffer_alloc(priv, buffer, EINA_FALSE); - if (!send) { - eina_lock_release(&priv->m); - return GST_FLOW_ERROR; - } - - if (priv->samsung) - { - if (!priv->func) - { - GstStructure *structure; - GstCaps *caps; - gboolean is_multiplane = FALSE; - - caps = GST_BUFFER_CAPS(buffer); - structure = gst_caps_get_structure (caps, 0); - gst_structure_get_boolean(structure, "multiplane", &is_multiplane); - gst_caps_unref(caps); - - if (is_multiplane) - priv->func = _evas_video_st12_multiplane; - else - priv->func = _evas_video_st12; - } - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(evas_video_sink_samsung_main_render, send); - } - else - { - _emotion_pending_ecore_begin(); - ecore_main_loop_thread_safe_call_async(evas_video_sink_main_render, send); - } - - eina_condition_wait(&priv->c); - eina_lock_release(&priv->m); - - return GST_FLOW_OK; -} - -static void -_update_emotion_fps(Emotion_Gstreamer_Video *ev) -{ - double tim; - - if (!debug_fps) return; - - tim = ecore_time_get(); - ev->frames++; - - if (ev->rlapse == 0.0) - { - ev->rlapse = tim; - ev->flapse = ev->frames; - } - else if ((tim - ev->rlapse) >= 0.5) - { - printf("FRAME: %i, FPS: %3.1f\n", - ev->frames, - (ev->frames - ev->flapse) / (tim - ev->rlapse)); - ev->rlapse = tim; - ev->flapse = ev->frames; - } -} - -static void -evas_video_sink_samsung_main_render(void *data) -{ - Emotion_Gstreamer_Buffer *send; - Emotion_Video_Stream *vstream; - EvasVideoSinkPrivate *priv = NULL; - GstBuffer* buffer; - unsigned char *evas_data; - const guint8 *gst_data; - GstFormat fmt = GST_FORMAT_TIME; - gint64 pos; - Eina_Bool preroll = EINA_FALSE; - int stride, elevation; - Evas_Coord w, h; - - send = data; - - if (!send) goto exit_point; - - priv = send->sink; - buffer = send->frame; - preroll = send->preroll; - - /* frame after cleanup */ - if (!preroll && !send->ev->last_buffer) - { - priv = NULL; - goto exit_point; - } - - if (!priv || !priv->o || priv->unlocked) - goto exit_point; - - if (send->ev->send) - { - emotion_gstreamer_buffer_free(send->ev->send); - send->ev->send = NULL; - } - - if (!send->ev->stream && !send->force) - { - send->ev->send = send; - _emotion_frame_new(send->ev->obj); - goto exit_stream; - } - - _emotion_gstreamer_video_pipeline_parse(send->ev, EINA_TRUE); - - /* Getting stride to compute the right size and then fill the object properly */ - /* Y => [0] and UV in [1] */ - if (priv->func == _evas_video_st12_multiplane) - { - const GstMultiPlaneImageBuffer *mp_buf = (const GstMultiPlaneImageBuffer *) buffer; - - stride = mp_buf->stride[0]; - elevation = mp_buf->elevation[0]; - priv->width = mp_buf->width[0]; - priv->height = mp_buf->height[0]; - - gst_data = (const guint8 *) mp_buf; - } - else - { - const SCMN_IMGB *imgb = (const SCMN_IMGB *) GST_BUFFER_MALLOCDATA(buffer); - - stride = imgb->stride[0]; - elevation = imgb->elevation[0]; - priv->width = imgb->width[0]; - priv->height = imgb->height[0]; - - gst_data = (const guint8 *) imgb; - } - - evas_object_geometry_get(priv->o, NULL, NULL, &w, &h); - - send->ev->fill.width = (double) stride / priv->width; - send->ev->fill.height = (double) elevation / priv->height; - - evas_object_image_alpha_set(priv->o, 0); - evas_object_image_colorspace_set(priv->o, priv->eformat); - evas_object_image_size_set(priv->o, stride, elevation); - - _update_emotion_fps(send->ev); - - evas_data = evas_object_image_data_get(priv->o, 1); - - if (priv->func) - priv->func(evas_data, gst_data, stride, elevation, elevation); - else - WRN("No way to decode colorspace '%x'!", priv->eformat); - - evas_object_image_data_set(priv->o, evas_data); - evas_object_image_data_update_add(priv->o, 0, 0, priv->width, priv->height); - evas_object_image_pixels_dirty_set(priv->o, 0); - - if (!preroll && send->ev->play_started) - { - _emotion_playback_started(send->ev->obj); - send->ev->play_started = 0; - } - - if (!send->force) - { - _emotion_frame_new(send->ev->obj); - } - - vstream = eina_list_nth(send->ev->video_streams, send->ev->video_stream_nbr - 1); - - gst_element_query_position(send->ev->pipeline, &fmt, &pos); - send->ev->position = (double)pos / (double)GST_SECOND; - - if (vstream) - { - vstream->width = priv->width; - vstream->height = priv->height; - - _emotion_video_pos_update(send->ev->obj, send->ev->position, vstream->length_time); - } - - send->ev->ratio = (double) priv->width / (double) priv->height; - _emotion_frame_refill(send->ev->obj, send->ev->fill.width, send->ev->fill.height); - _emotion_frame_resize(send->ev->obj, priv->width, priv->height, send->ev->ratio); - - buffer = gst_buffer_ref(buffer); - if (send->ev->last_buffer) gst_buffer_unref(send->ev->last_buffer); - send->ev->last_buffer = buffer; - - exit_point: - if (send) emotion_gstreamer_buffer_free(send); - - exit_stream: - if (priv) - { - if (preroll || !priv->o) - { - _emotion_pending_ecore_end(); - return; - } - - if (!priv->unlocked) - eina_condition_signal(&priv->c); - } - _emotion_pending_ecore_end(); -} - -static void -evas_video_sink_main_render(void *data) -{ - Emotion_Gstreamer_Buffer *send; - Emotion_Gstreamer_Video *ev = NULL; - Emotion_Video_Stream *vstream; - EvasVideoSinkPrivate *priv = NULL; - GstBuffer *buffer; - unsigned char *evas_data; - GstFormat fmt = GST_FORMAT_TIME; - gint64 pos; - Eina_Bool preroll = EINA_FALSE; - - send = data; - - if (!send) goto exit_point; - - priv = send->sink; - buffer = send->frame; - preroll = send->preroll; - ev = send->ev; - - /* frame after cleanup */ - if (!preroll && !ev->last_buffer) - { - priv = NULL; - goto exit_point; - } - - if (!priv || !priv->o || priv->unlocked) - goto exit_point; - - if (ev->send && send != ev->send) - { - emotion_gstreamer_buffer_free(ev->send); - ev->send = NULL; - } - - if (!ev->stream && !send->force) - { - ev->send = send; - _emotion_frame_new(ev->obj); - evas_object_image_data_update_add(priv->o, 0, 0, priv->width, priv->height); - goto exit_stream; - } - - _emotion_gstreamer_video_pipeline_parse(ev, EINA_TRUE); - - INF("sink main render [%i, %i] (source height: %i)", priv->width, priv->height, priv->source_height); - - evas_object_image_alpha_set(priv->o, 0); - evas_object_image_colorspace_set(priv->o, priv->eformat); - evas_object_image_size_set(priv->o, priv->width, priv->height); - - evas_data = evas_object_image_data_get(priv->o, 1); - - if (priv->func) - priv->func(evas_data, GST_BUFFER_DATA(buffer), priv->width, priv->source_height, priv->height); - else - WRN("No way to decode colorspace '%x'!", priv->eformat); - - evas_object_image_data_set(priv->o, evas_data); - evas_object_image_data_update_add(priv->o, 0, 0, priv->width, priv->height); - evas_object_image_pixels_dirty_set(priv->o, 0); - - _update_emotion_fps(ev); - - if (!preroll && ev->play_started) - { - _emotion_playback_started(ev->obj); - ev->play_started = 0; - } - - if (!send->force) - { - _emotion_frame_new(ev->obj); - } - - gst_element_query_position(ev->pipeline, &fmt, &pos); - ev->position = (double)pos / (double)GST_SECOND; - - vstream = eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); - - if (vstream) - { - vstream->width = priv->width; - vstream->height = priv->height; - _emotion_video_pos_update(ev->obj, ev->position, vstream->length_time); - } - - ev->ratio = (double) priv->width / (double) priv->height; - - _emotion_frame_resize(ev->obj, priv->width, priv->height, ev->ratio); - - buffer = gst_buffer_ref(buffer); - if (ev->last_buffer) gst_buffer_unref(ev->last_buffer); - ev->last_buffer = buffer; - - exit_point: - if (send) emotion_gstreamer_buffer_free(send); - - exit_stream: - if (priv) - { - if (preroll || !priv->o) - { - _emotion_pending_ecore_end(); - return; - } - - if (!priv->unlocked) - eina_condition_signal(&priv->c); - } - _emotion_pending_ecore_end(); -} - -static void -unlock_buffer_mutex(EvasVideoSinkPrivate* priv) -{ - priv->unlocked = EINA_TRUE; - - eina_condition_signal(&priv->c); -} - -static void -marshal_VOID__MINIOBJECT(GClosure * closure, GValue * return_value EINA_UNUSED, - guint n_param_values, const GValue * param_values, - gpointer invocation_hint EINA_UNUSED, gpointer marshal_data) -{ - typedef void (*marshalfunc_VOID__MINIOBJECT) (gpointer obj, gpointer arg1, gpointer data2); - marshalfunc_VOID__MINIOBJECT callback; - GCClosure *cc; - gpointer data1, data2; - - cc = (GCClosure *) closure; - - g_return_if_fail(n_param_values == 2); - - if (G_CCLOSURE_SWAP_DATA(closure)) { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } else { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } - callback = (marshalfunc_VOID__MINIOBJECT) (marshal_data ? marshal_data : cc->callback); - - callback(data1, gst_value_get_mini_object(param_values + 1), data2); -} - -static void -evas_video_sink_class_init(EvasVideoSinkClass* klass) -{ - GObjectClass* gobject_class; - GstBaseSinkClass* gstbase_sink_class; - - gobject_class = G_OBJECT_CLASS(klass); - gstbase_sink_class = GST_BASE_SINK_CLASS(klass); - - g_type_class_add_private(klass, sizeof(EvasVideoSinkPrivate)); - - gobject_class->set_property = evas_video_sink_set_property; - gobject_class->get_property = evas_video_sink_get_property; - - g_object_class_install_property (gobject_class, PROP_EVAS_OBJECT, - g_param_spec_pointer ("evas-object", "Evas Object", - "The Evas object where the display of the video will be done", - G_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, PROP_WIDTH, - g_param_spec_int ("width", "Width", - "The width of the video", - 0, 65536, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property (gobject_class, PROP_HEIGHT, - g_param_spec_int ("height", "Height", - "The height of the video", - 0, 65536, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_EV, - g_param_spec_pointer ("ev", "Emotion_Gstreamer_Video", - "THe internal data of the emotion object", - G_PARAM_READWRITE)); - - gobject_class->dispose = evas_video_sink_dispose; - - gstbase_sink_class->set_caps = evas_video_sink_set_caps; - gstbase_sink_class->stop = evas_video_sink_stop; - gstbase_sink_class->start = evas_video_sink_start; - gstbase_sink_class->unlock = evas_video_sink_unlock; - gstbase_sink_class->unlock_stop = evas_video_sink_unlock_stop; - gstbase_sink_class->render = evas_video_sink_render; - gstbase_sink_class->preroll = evas_video_sink_preroll; - - evas_video_sink_signals[REPAINT_REQUESTED] = g_signal_new("repaint-requested", - G_TYPE_FROM_CLASS(klass), - (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), - 0, - 0, - 0, - marshal_VOID__MINIOBJECT, - G_TYPE_NONE, 1, GST_TYPE_BUFFER); -} - -gboolean -gstreamer_plugin_init (GstPlugin * plugin) -{ - return gst_element_register (plugin, - "emotion-sink", - GST_RANK_NONE, - EVAS_TYPE_VIDEO_SINK); -} - -static void -_emotion_gstreamer_pause(void *data, Ecore_Thread *thread) -{ - Emotion_Gstreamer_Video *ev = data; - gboolean res; - - if (ecore_thread_check(thread) || !ev->pipeline) return; - - gst_element_set_state(ev->pipeline, GST_STATE_PAUSED); - res = gst_element_get_state(ev->pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); - if (res == GST_STATE_CHANGE_NO_PREROLL) - { - gst_element_set_state(ev->pipeline, GST_STATE_PLAYING); - gst_element_get_state(ev->pipeline, NULL, NULL, GST_CLOCK_TIME_NONE); - } -} - -static void -_emotion_gstreamer_cancel(void *data, Ecore_Thread *thread) -{ - Emotion_Gstreamer_Video *ev = data; - - ev->threads = eina_list_remove(ev->threads, thread); - -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - if (getuid() == geteuid()) -#endif - { - if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT")); - } - - if (ev->in == ev->out && ev->delete_me) - ev->api->del(ev); -} - -static void -_emotion_gstreamer_end(void *data, Ecore_Thread *thread) -{ - Emotion_Gstreamer_Video *ev = data; - - ev->threads = eina_list_remove(ev->threads, thread); - - if (ev->play) - { - gst_element_set_state(ev->pipeline, GST_STATE_PLAYING); - ev->play_started = 1; - } - -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - if (getuid() == geteuid()) -#endif - { - if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(ev->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT")); - } - - if (ev->in == ev->out && ev->delete_me) - ev->api->del(ev); - else - _emotion_gstreamer_video_pipeline_parse(data, EINA_TRUE); -} - -static void -_video_resize(void *data, Evas_Object *obj EINA_UNUSED, const Evas_Video_Surface *surface EINA_UNUSED, - Evas_Coord w, Evas_Coord h) -{ -#ifdef HAVE_ECORE_X - Emotion_Gstreamer_Video *ev = data; - - ecore_x_window_resize(ev->win, w, h); - DBG("resize: %i, %i", w, h); -#else - if (data) - { - DBG("resize: %i, %i (fake)", w, h); - } -#endif -} - -static void -_video_move(void *data, Evas_Object *obj EINA_UNUSED, const Evas_Video_Surface *surface EINA_UNUSED, - Evas_Coord x, Evas_Coord y) -{ -#ifdef HAVE_ECORE_X - Emotion_Gstreamer_Video *ev = data; - unsigned int pos[2]; - - DBG("move: %i, %i", x, y); - pos[0] = x; pos[1] = y; - ecore_x_window_prop_card32_set(ev->win, ECORE_X_ATOM_E_VIDEO_POSITION, pos, 2); -#else - if (data) - { - DBG("move: %i, %i (fake)", x, y); - } -#endif -} - -#if 0 -/* Much better idea to always feed the XvImageSink and let him handle optimizing the rendering as we do */ -static void -_block_pad_unlink_cb(GstPad *pad, gboolean blocked, gpointer user_data) -{ - if (blocked) - { - Emotion_Gstreamer_Video *ev = user_data; - GstEvent *gev; - - gst_pad_unlink(ev->xvteepad, ev->xvpad); - gev = gst_event_new_eos(); - gst_pad_send_event(ev->xvpad, gev); - gst_pad_set_blocked_async(pad, FALSE, _block_pad_unlink_cb, NULL); - } -} - -static void -_block_pad_link_cb(GstPad *pad, gboolean blocked, gpointer user_data) -{ - if (blocked) - { - Emotion_Gstreamer_Video *ev = user_data; - - gst_pad_link(ev->xvteepad, ev->xvpad); - if (ev->play) - gst_element_set_state(ev->xvsink, GST_STATE_PLAYING); - else - gst_element_set_state(ev->xvsink, GST_STATE_PAUSED); - gst_pad_set_blocked_async(pad, FALSE, _block_pad_link_cb, NULL); - } -} -#endif - -static void -_video_show(void *data, Evas_Object *obj EINA_UNUSED, const Evas_Video_Surface *surface EINA_UNUSED) -{ -#ifdef HAVE_ECORE_X - Emotion_Gstreamer_Video *ev = data; - - DBG("show xv"); - ecore_x_window_show(ev->win); -#else - if (data) - { - DBG("show xv (fake)"); - } -#endif - /* gst_pad_set_blocked_async(ev->xvteepad, TRUE, _block_pad_link_cb, ev); */ -} - -static void -_video_hide(void *data, Evas_Object *obj EINA_UNUSED, const Evas_Video_Surface *surface EINA_UNUSED) -{ -#ifdef HAVE_ECORE_X - Emotion_Gstreamer_Video *ev = data; - - DBG("hide xv"); - ecore_x_window_hide(ev->win); -#else - if (data) - { - DBG("hide xv (fake)"); - } -#endif - /* gst_pad_set_blocked_async(ev->xvteepad, TRUE, _block_pad_unlink_cb, ev); */ -} - -static void -_video_update_pixels(void *data, Evas_Object *obj EINA_UNUSED, const Evas_Video_Surface *surface EINA_UNUSED) -{ - Emotion_Gstreamer_Video *ev = data; - Emotion_Gstreamer_Buffer *send; - EvasVideoSinkPrivate *priv = NULL; - - if (!ev->send) return; - - send = ev->send; - priv = send->sink; - send->force = EINA_TRUE; - ev->send = NULL; - - if (priv->samsung) - { - _emotion_pending_ecore_begin(); - evas_video_sink_samsung_main_render(send); - } - else - { - _emotion_pending_ecore_begin(); - evas_video_sink_main_render(send); - } -} - -static void -_image_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - Emotion_Gstreamer_Video *ev = data; - Evas_Coord width, height; - int image_area, src_area; - double ratio; - - GstElementFactory *cfactory = NULL; - GstElement *convert = NULL, *filter = NULL, *queue = NULL; - GstPad *pad = NULL, *teepad = NULL; - GstCaps *caps = NULL; - Eina_List *l, *engines; - const char *ename, *engine = NULL; - - evas_object_geometry_get(obj, NULL, NULL, &width, &height); - image_area = width * height; - src_area = ev->src_width * ev->src_height; - ratio = (double)image_area / (double)src_area; - - // when an image is much smaller than original video size, - // add fimcconvert element to the pipeline - if (ratio < 0.8 && ev->stream && !ev->convert) - { - cfactory = gst_element_factory_find("fimcconvert"); - if (!cfactory) return; - - convert = gst_element_factory_create(cfactory, NULL); - if (!convert) return; - - // add capsfilter to limit size and formats based on the backend - filter = gst_element_factory_make("capsfilter", "fimccapsfilter"); - if (!filter) - { - gst_object_unref(convert); - return; - } - - engines = evas_render_method_list(); - EINA_LIST_FOREACH(engines, l, ename) - { - if (evas_render_method_lookup(ename) == - evas_output_method_get(evas_object_evas_get(obj))) - { - engine = ename; - break; - } - } - - if (!engine) return; - - if (strstr(engine, "software") != NULL) - { - caps = gst_caps_new_simple("video/x-raw-rgb", - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, - NULL); - } - else if (strstr(engine, "gl") != NULL) - { - caps = gst_caps_new_simple("video/x-raw-yuv", - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, - NULL); - } - g_object_set(G_OBJECT(filter), "caps", caps, NULL); - gst_caps_unref(caps); - - // add new elements to the pipeline - queue = gst_bin_get_by_name(GST_BIN(ev->sink), "equeue"); - gst_element_unlink(ev->tee, queue); - gst_element_release_request_pad(ev->tee, ev->eteepad); - gst_object_unref(ev->eteepad); - - gst_bin_add_many(GST_BIN(ev->sink), convert, filter, NULL); - gst_element_link_many(ev->tee, convert, filter, queue, NULL); - - pad = gst_element_get_pad(convert, "sink"); - teepad = gst_element_get_request_pad(ev->tee, "src%d"); - gst_pad_link(teepad, pad); - gst_object_unref(pad); - - gst_element_sync_state_with_parent(convert); - gst_element_sync_state_with_parent(filter); - - ev->eteepad = teepad; - ev->convert = convert; - evas_render_method_list_free(engines); - - INF("add fimcconvert element. video size: %dx%d. emotion object size: %dx%d", - ev->src_width, ev->src_height, width, height); - } - // set size again to the capsfilter when the image is resized - else if (ev->convert) - { - filter = gst_bin_get_by_name(GST_BIN(ev->sink), "fimccapsfilter"); - - engines = evas_render_method_list(); - EINA_LIST_FOREACH(engines, l, ename) - { - if (evas_render_method_lookup(ename) == - evas_output_method_get(evas_object_evas_get(obj))) - { - engine = ename; - break; - } - } - - if (!engine) return; - - if (strstr(engine, "software") != NULL) - { - caps = gst_caps_new_simple("video/x-raw-rgb", - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, - NULL); - } - else if (strstr(engine, "gl") != NULL) - { - caps = gst_caps_new_simple("video/x-raw-yuv", - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, - NULL); - } - - g_object_set(G_OBJECT(filter), "caps", caps, NULL); - gst_caps_unref(caps); - evas_render_method_list_free(engines); - - INF("set capsfilter size again:. video size: %dx%d. emotion object size: %dx%d", - ev->src_width, ev->src_height, width, height); - } -} - -GstElement * -gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev, - Evas_Object *o, - const char *uri) -{ - GstElement *playbin; - GstElement *bin = NULL; - GstElement *esink = NULL; - GstElement *xvsink = NULL; - GstElement *tee = NULL; - GstElement *queue = NULL; - Evas_Object *obj; - GstPad *pad; - GstPad *teepad; - int flags; - const char *launch; -#if defined HAVE_ECORE_X && defined HAVE_XOVERLAY_H - const char *engine = NULL; - Eina_List *engines; -#endif - - obj = emotion_object_image_get(o); - if (!obj) - { -// ERR("Not Evas_Object specified"); - return NULL; - } - - if (!uri) - return NULL; - - launch = emotion_webcam_custom_get(uri); - if (launch) - { - GError *error = NULL; - - playbin = gst_parse_bin_from_description(launch, 1, &error); - if (!playbin) - { - ERR("Unable to setup command : '%s' got error '%s'.", launch, error->message); - g_error_free(error); - return NULL; - } - if (error) - { - WRN("got recoverable error '%s' for command : '%s'.", error->message, launch); - g_error_free(error); - } - } - else - { - playbin = gst_element_factory_make("playbin2", "playbin"); - if (!playbin) - { - ERR("Unable to create 'playbin' GstElement."); - return NULL; - } - } - - bin = gst_bin_new(NULL); - if (!bin) - { - ERR("Unable to create GstBin !"); - goto unref_pipeline; - } - - tee = gst_element_factory_make("tee", NULL); - if (!tee) - { - ERR("Unable to create 'tee' GstElement."); - goto unref_pipeline; - } - -#if defined HAVE_ECORE_X && defined HAVE_XOVERLAY_H - if (window_manager_video) - { - Eina_List *l; - const char *ename; - - engines = evas_render_method_list(); - - EINA_LIST_FOREACH(engines, l, ename) - { - if (evas_render_method_lookup(ename) == - evas_output_method_get(evas_object_evas_get(obj))) - { - engine = ename; - break; - } - } - - if (ev->priority && engine && strstr(engine, "_x11") != NULL) - { - Ecore_Evas *ee; - Evas_Coord x, y, w, h; - Ecore_X_Window win; - Ecore_X_Window parent; - - evas_object_geometry_get(obj, &x, &y, &w, &h); - - ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj)); - - if (w < 4) w = 4; - if (h < 2) h = 2; - - /* Here we really need to have the help of the window manager, this code will change when we update E17. */ - parent = (Ecore_X_Window) ecore_evas_window_get(ee); - DBG("parent: %x", parent); - - win = ecore_x_window_new(0, x, y, w, h); - DBG("creating window: %x [%i, %i, %i, %i]", win, x, y, w, h); - if (win) - { - Ecore_X_Window_State state[] = { ECORE_X_WINDOW_STATE_SKIP_TASKBAR, ECORE_X_WINDOW_STATE_SKIP_PAGER }; - - ecore_x_netwm_window_state_set(win, state, 2); - ecore_x_window_hide(win); - xvsink = gst_element_factory_make("xvimagesink", NULL); - if (xvsink) - { - unsigned int pos[2]; - -#ifdef HAVE_X_OVERLAY_SET - gst_x_overlay_set_window_handle(GST_X_OVERLAY(xvsink), win); -#else - gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvsink), win); -#endif - ev->win = win; - - ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIDEO_PARENT, &parent, 1); - - pos[0] = x; pos[1] = y; - ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIDEO_POSITION, pos, 2); - } - else - { - DBG("destroying win: %x", win); - ecore_x_window_free(win); - } - } - } - evas_render_method_list_free(engines); - } -#else -//# warning "missing: ecore_x OR xoverlay" -#endif - - esink = gst_element_factory_make("emotion-sink", "sink"); - if (!esink) - { - ERR("Unable to create 'emotion-sink' GstElement."); - goto unref_pipeline; - } - - g_object_set(G_OBJECT(esink), "evas-object", obj, NULL); - g_object_set(G_OBJECT(esink), "ev", ev, NULL); - - evas_object_image_pixels_get_callback_set(obj, NULL, NULL); - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _image_resize, ev); - - /* We need queue to force each video sink to be in its own thread */ - queue = gst_element_factory_make("queue", "equeue"); - if (!queue) - { - ERR("Unable to create 'queue' GstElement."); - goto unref_pipeline; - } - - gst_bin_add_many(GST_BIN(bin), tee, queue, esink, NULL); - gst_element_link_many(queue, esink, NULL); - - /* link both sink to GstTee */ - pad = gst_element_get_pad(queue, "sink"); - teepad = gst_element_get_request_pad(tee, "src%d"); - gst_pad_link(teepad, pad); - gst_object_unref(pad); - - ev->eteepad = teepad; - - if (xvsink) - { - GstElement *fakeeos; - - queue = gst_element_factory_make("queue", "xvqueue"); - fakeeos = GST_ELEMENT(GST_BIN(g_object_new(GST_TYPE_FAKEEOS_BIN, "name", "eosbin", NULL))); - if (queue && fakeeos) - { - GstPad *queue_pad; - - gst_bin_add_many(GST_BIN(bin), fakeeos, NULL); - - gst_bin_add_many(GST_BIN(fakeeos), queue, xvsink, NULL); - gst_element_link_many(queue, xvsink, NULL); - queue_pad = gst_element_get_pad(queue, "sink"); - gst_element_add_pad(fakeeos, gst_ghost_pad_new("sink", queue_pad)); - - pad = gst_element_get_pad(fakeeos, "sink"); - teepad = gst_element_get_request_pad(tee, "src%d"); - gst_pad_link(teepad, pad); - - xvsink = fakeeos; - - ev->xvteepad = teepad; - ev->xvpad = pad; - } - else - { - if (fakeeos) gst_object_unref(fakeeos); - if (queue) gst_object_unref(queue); - gst_object_unref(xvsink); - xvsink = NULL; - } - } - - teepad = gst_element_get_pad(tee, "sink"); - gst_element_add_pad(bin, gst_ghost_pad_new("sink", teepad)); - gst_object_unref(teepad); - -#define GST_PLAY_FLAG_NATIVE_VIDEO (1 << 6) -#define GST_PLAY_FLAG_DOWNLOAD (1 << 7) -#define GST_PLAY_FLAG_AUDIO (1 << 1) -#define GST_PLAY_FLAG_NATIVE_AUDIO (1 << 5) - - if (launch) - { - g_object_set(G_OBJECT(playbin), "sink", bin, NULL); - } - else - { - g_object_get(G_OBJECT(playbin), "flags", &flags, NULL); - g_object_set(G_OBJECT(playbin), "flags", flags | GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_DOWNLOAD | GST_PLAY_FLAG_NATIVE_AUDIO, NULL); - g_object_set(G_OBJECT(playbin), "video-sink", bin, NULL); - g_object_set(G_OBJECT(playbin), "uri", uri, NULL); - } - - evas_object_image_pixels_get_callback_set(obj, NULL, NULL); - - ev->stream = EINA_TRUE; - - if (xvsink) - { - Evas_Video_Surface video; - - video.version = EVAS_VIDEO_SURFACE_VERSION; - video.data = ev; - video.parent = NULL; - video.move = _video_move; - video.resize = _video_resize; - video.show = _video_show; - video.hide = _video_hide; - video.update_pixels = _video_update_pixels; - - evas_object_image_video_surface_set(obj, &video); - ev->stream = EINA_FALSE; - } - - eina_stringshare_replace(&ev->uri, uri); - ev->pipeline = playbin; - ev->sink = bin; - ev->esink = esink; - ev->xvsink = xvsink; - ev->tee = tee; - ev->threads = eina_list_append(ev->threads, - ecore_thread_run(_emotion_gstreamer_pause, - _emotion_gstreamer_end, - _emotion_gstreamer_cancel, - ev)); - - /** NOTE: you need to set: GST_DEBUG_DUMP_DOT_DIR=/tmp EMOTION_ENGINE=gstreamer to save the $EMOTION_GSTREAMER_DOT file in '/tmp' */ - /** then call dot -Tpng -oemotion_pipeline.png /tmp/$TIMESTAMP-$EMOTION_GSTREAMER_DOT.dot */ -#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - if (getuid() == geteuid()) -#endif - { - if (getenv("EMOTION_GSTREAMER_DOT")) GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(playbin), GST_DEBUG_GRAPH_SHOW_ALL, getenv("EMOTION_GSTREAMER_DOT")); - } - - return playbin; - - unref_pipeline: - gst_object_unref(xvsink); - gst_object_unref(esink); - gst_object_unref(tee); - gst_object_unref(bin); - gst_object_unref(playbin); - return NULL; -} diff --git a/src/modules/emotion/gstreamer/meson.build b/src/modules/emotion/gstreamer/meson.build deleted file mode 100644 index e3e69e5746..0000000000 --- a/src/modules/emotion/gstreamer/meson.build +++ /dev/null @@ -1,18 +0,0 @@ -generic_src = files([ - 'emotion_gstreamer.h', - 'emotion_gstreamer.c', - 'emotion_alloc.c', - 'emotion_convert.c', - 'emotion_sink.c' -]) - -generic_deps = [dependency('gstreamer-0.10')] - -shared_module(emotion_loader, - generic_src, - include_directories : config_dir, - dependencies: [eina, ecore_x, evas, emotion, generic_deps], - install: true, - install_dir : mod_install_dir, - c_args : package_c_args, -) diff --git a/src/modules/emotion/meson.build b/src/modules/emotion/meson.build index 0090ea7492..e20729ad22 100644 --- a/src/modules/emotion/meson.build +++ b/src/modules/emotion/meson.build @@ -1,5 +1,4 @@ emotion_loaders = [ -'gstreamer', 'gstreamer1', 'libvlc', 'xine' From f86dbae7e3621ce8766a1fc782f4304fde0f45e3 Mon Sep 17 00:00:00 2001 From: Subodh Kumar Date: Tue, 3 Dec 2019 10:56:00 +0000 Subject: [PATCH 25/33] edje: Add text change signal There is no way to know about text changes in edc. This signal will help developer to know about text changes and do some operation based on that. @feature Co-authored-by: Cedric BAIL Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10780 --- src/lib/edje/edje_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 2acfce3282..f699f835ff 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -2043,6 +2043,8 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par _edje_recalc(ed); if (ed->text_change.func) ed->text_change.func(ed->text_change.data, obj, part); + edje_object_signal_emit(ed->obj, "edje,text,changed", "edje"); + return EINA_TRUE; } From d0f69cf2e2771c2a7895de0a2a437110783cc8dc Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Thu, 28 Nov 2019 09:59:41 +0100 Subject: [PATCH 26/33] exotic: remove left-overs from Exotic support This seems to have been gone a long time ago and only references left that have not been disturbing the build. Time to clean up! Signed-off-by: Stefan Schmidt Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10793 --- header_checks/meson.build | 1 - src/bin/ecore_evas/ecore_evas_convert.c | 2 +- src/lib/ecore/Ecore.h | 4 +--- src/lib/ecore/Ecore_Common.h | 12 ++++++------ src/lib/ecore/Efl_Core.h | 4 +--- src/lib/ecore/ecore.c | 4 ---- src/lib/ecore/ecore_getopt.c | 4 ---- src/lib/ecore/ecore_pipe.c | 4 ---- src/lib/ecore/ecore_private.h | 2 +- src/lib/ecore/ecore_time.c | 6 +++--- src/lib/ecore_con/efl_net_ssl_conn-openssl.c | 4 ---- src/lib/eina/eina_evlog.c | 6 +++--- src/lib/eina/eina_module.c | 4 ---- src/lib/elementary/Efl_Ui.h | 4 +--- src/lib/embryo/embryo_amx.c | 4 ---- src/lib/embryo/embryo_str.c | 4 ---- src/lib/embryo/embryo_time.c | 4 ---- src/lib/eo/eo.c | 2 +- src/lib/evas/include/evas_common_private.h | 4 ---- 19 files changed, 18 insertions(+), 61 deletions(-) diff --git a/header_checks/meson.build b/header_checks/meson.build index c83f48b897..3aaf3776c6 100644 --- a/header_checks/meson.build +++ b/header_checks/meson.build @@ -48,7 +48,6 @@ header_checks = [ 'sys/resource.h', 'sys/times.h', 'longinfo.h', - 'exotic.h', 'ieeefp.h', 'node/uv.h', 'sys/timerfd.h', diff --git a/src/bin/ecore_evas/ecore_evas_convert.c b/src/bin/ecore_evas/ecore_evas_convert.c index 4ec1cabbf1..8b4f19ab2f 100644 --- a/src/bin/ecore_evas/ecore_evas_convert.c +++ b/src/bin/ecore_evas/ecore_evas_convert.c @@ -8,7 +8,7 @@ #include #include -#if defined(_WIN32) || defined(EXOTIC_NO_SIGNAL) +#if defined(_WIN32) # define NO_SIGNAL #else # include diff --git a/src/lib/ecore/Ecore.h b/src/lib/ecore/Ecore.h index cfc6dd7660..7818faf907 100644 --- a/src/lib/ecore/Ecore.h +++ b/src/lib/ecore/Ecore.h @@ -315,9 +315,7 @@ # include #else # include -# if !defined (EXOTIC_NO_SIGNAL) -# include -# endif +# include #endif #include diff --git a/src/lib/ecore/Ecore_Common.h b/src/lib/ecore/Ecore_Common.h index 8f1a99bc04..443a05880c 100644 --- a/src/lib/ecore/Ecore_Common.h +++ b/src/lib/ecore/Ecore_Common.h @@ -611,7 +611,7 @@ struct _Ecore_Event_Signal_User int number; /**< The signal number. Either 1 or 2 */ void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) +#if !defined (_WIN32) && !defined (__lv2ppu__) siginfo_t data; /**< Signal info */ #endif }; @@ -624,7 +624,7 @@ struct _Ecore_Event_Signal_Hup { void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) +#if !defined (_WIN32) && !defined (__lv2ppu__) siginfo_t data; /**< Signal info */ #endif }; @@ -640,7 +640,7 @@ struct _Ecore_Event_Signal_Exit Eina_Bool terminate : 1; /**< Set if the exit request was a terminate signal */ void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) +#if !defined (_WIN32) && !defined (__lv2ppu__) siginfo_t data; /**< Signal info */ #endif }; @@ -653,7 +653,7 @@ struct _Ecore_Event_Signal_Power { void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) +#if !defined (_WIN32) && !defined (__lv2ppu__) siginfo_t data; /**< Signal info */ #endif }; @@ -666,7 +666,7 @@ struct _Ecore_Event_Signal_Realtime { int num; /**< The realtime signal's number */ -#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) +#if !defined (_WIN32) && !defined (__lv2ppu__) siginfo_t data; /**< Signal info */ #endif }; @@ -1071,7 +1071,7 @@ struct _Ecore_Exe_Event_Del Eina_Bool exited : 1; /**< Set to 1 if the process exited of its own accord */ Eina_Bool signalled : 1; /**< Set to 1 if the process exited due to uncaught signal */ void *ext_data; /**< Extension data - not used */ -#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL) +#if !defined (_WIN32) && !defined (__lv2ppu__) siginfo_t data; /**< Signal info */ #endif }; diff --git a/src/lib/ecore/Efl_Core.h b/src/lib/ecore/Efl_Core.h index c735b333fc..0178299379 100644 --- a/src/lib/ecore/Efl_Core.h +++ b/src/lib/ecore/Efl_Core.h @@ -45,9 +45,7 @@ # include #else # include -# if !defined (EXOTIC_NO_SIGNAL) -# include -# endif +# include #endif #include diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index b2ca8aa649..3110c5ef54 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -275,9 +275,7 @@ ecore_init(void) if (!_ecore_event_init()) goto shutdown_event; _ecore_signal_init(); -#ifndef HAVE_EXOTIC _ecore_exe_init(); -#endif _ecore_thread_init(); _ecore_job_init(); _ecore_time_init(); @@ -434,9 +432,7 @@ ecore_shutdown(void) eina_lock_free(&_thread_feedback_mutex); eina_lock_free(&_thread_id_lock); -#ifndef HAVE_EXOTIC _ecore_exe_shutdown(); -#endif _ecore_event_shutdown(); _ecore_main_shutdown(); _ecore_signal_shutdown(); diff --git a/src/lib/ecore/ecore_getopt.c b/src/lib/ecore/ecore_getopt.c index f81df25105..8dc1981ba8 100644 --- a/src/lib/ecore/ecore_getopt.c +++ b/src/lib/ecore/ecore_getopt.c @@ -26,10 +26,6 @@ #define _(x) dgettext("ecore", x) -#ifdef HAVE_EXOTIC -# include -#endif - #include "Ecore.h" #include "Ecore_Getopt.h" diff --git a/src/lib/ecore/ecore_pipe.c b/src/lib/ecore/ecore_pipe.c index 702f19cbca..4023bfa70f 100644 --- a/src/lib/ecore/ecore_pipe.c +++ b/src/lib/ecore/ecore_pipe.c @@ -26,10 +26,6 @@ # endif #endif -#ifdef HAVE_EXOTIC -# include -#endif - /* * On Windows, pipe() is implemented with sockets. * Contrary to Linux, Windows uses different functions diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index d772e8c99c..e60c191a21 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -356,7 +356,7 @@ _ecore_main_win32_handler_del(Eo *obj, void _ecore_main_content_clear(Eo *obj, Efl_Loop_Data *pd); void _ecore_main_shutdown(void); -#if defined (_WIN32) || defined (__lv2ppu__) || defined (HAVE_EXOTIC) +#if defined (_WIN32) || defined (__lv2ppu__) static inline void _ecore_signal_shutdown(void) { } static inline void _ecore_signal_init(void) { } diff --git a/src/lib/ecore/ecore_time.c b/src/lib/ecore/ecore_time.c index 31ffa717c8..f2afe0e860 100644 --- a/src/lib/ecore/ecore_time.c +++ b/src/lib/ecore/ecore_time.c @@ -16,7 +16,7 @@ #include "Ecore.h" #include "ecore_private.h" -#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) +#if defined (HAVE_CLOCK_GETTIME) static clockid_t _ecore_time_clock_id; static Eina_Bool _ecore_time_got_clock_id = EINA_FALSE; #elif defined(__APPLE__) && defined(__MACH__) @@ -26,7 +26,7 @@ static double _ecore_time_clock_conversion = 1e-9; EAPI double ecore_time_get(void) { -#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) +#if defined (HAVE_CLOCK_GETTIME) struct timespec t; if (EINA_UNLIKELY(!_ecore_time_got_clock_id)) @@ -82,7 +82,7 @@ ecore_loop_time_set(double t) void _ecore_time_init(void) { -#if defined(HAVE_CLOCK_GETTIME) || defined(EXOTIC_PROVIDE_CLOCK_GETTIME) +#if defined(HAVE_CLOCK_GETTIME) struct timespec t; if (_ecore_time_got_clock_id) return; diff --git a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c index 451fd242ae..fc8fb2e95f 100644 --- a/src/lib/ecore_con/efl_net_ssl_conn-openssl.c +++ b/src/lib/ecore_con/efl_net_ssl_conn-openssl.c @@ -21,10 +21,6 @@ # include /* dlsym */ #endif -#ifdef HAVE_EXOTIC -# include -#endif - #include "ecore_con_private.h" /* OpenSSL's BIO is the abstraction for I/O, provide one for Efl.Io.* */ diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c index 4dba784ff1..eb32dfc27b 100644 --- a/src/lib/eina/eina_evlog.c +++ b/src/lib/eina/eina_evlog.c @@ -62,7 +62,7 @@ static int _evlog_go = 0; static Eina_Evlog_Buf *buf; // current event log we are writing events to static Eina_Evlog_Buf buffers[2]; // double-buffer our event log buffers -#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) +#if defined (HAVE_CLOCK_GETTIME) static clockid_t _eina_evlog_time_clock_id = -1; #elif defined(__APPLE__) && defined(__MACH__) static double _eina_evlog_time_clock_conversion = 1e-9; @@ -73,7 +73,7 @@ static int _evlog_get_opcode = EINA_DEBUG_OPCODE_INVALID; static inline double get_time(void) { -#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) +#if defined (HAVE_CLOCK_GETTIME) struct timespec t; if (EINA_UNLIKELY(clock_gettime(_eina_evlog_time_clock_id, &t))) @@ -288,7 +288,7 @@ eina_evlog_init(void) { eina_spinlock_new(&_evlog_lock); buf = &(buffers[0]); -#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) +#if defined (HAVE_CLOCK_GETTIME) { struct timespec t; diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index 674da6aeb5..171b71afad 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -35,10 +35,6 @@ # include #endif -#ifdef HAVE_EXOTIC -# include -#endif - #include "eina_config.h" #include "eina_private.h" #include "eina_alloca.h" diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 9bcac0b509..377f63bd68 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -60,9 +60,7 @@ # include #else # include -# if !defined (EXOTIC_NO_SIGNAL) -# include -# endif +# include #endif #include diff --git a/src/lib/embryo/embryo_amx.c b/src/lib/embryo/embryo_amx.c index e8df24dd97..6ee674de67 100644 --- a/src/lib/embryo/embryo_amx.c +++ b/src/lib/embryo/embryo_amx.c @@ -28,10 +28,6 @@ #include #include -#ifdef HAVE_EXOTIC -# include -#endif - #include #include "Embryo.h" diff --git a/src/lib/embryo/embryo_str.c b/src/lib/embryo/embryo_str.c index de39437058..d7da4e0dd3 100644 --- a/src/lib/embryo/embryo_str.c +++ b/src/lib/embryo/embryo_str.c @@ -11,10 +11,6 @@ # endif #endif -#ifdef HAVE_EXOTIC -# include -#endif - #include #include #include diff --git a/src/lib/embryo/embryo_time.c b/src/lib/embryo/embryo_time.c index ac4a71754d..20553618af 100644 --- a/src/lib/embryo/embryo_time.c +++ b/src/lib/embryo/embryo_time.c @@ -9,10 +9,6 @@ # include /* setenv unsetenv */ #endif -#ifdef HAVE_EXOTIC -# include -#endif - #include #include "Embryo.h" diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index d2e190df3d..55479009c8 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -2793,7 +2793,7 @@ _eo_log_time_now(void) return clk_conv * mach_absolute_time(); #else -#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME) +#if defined (HAVE_CLOCK_GETTIME) struct timespec t; static int clk_id = -1; diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h index 91a2d98165..b2d63476a2 100644 --- a/src/lib/evas/include/evas_common_private.h +++ b/src/lib/evas/include/evas_common_private.h @@ -32,10 +32,6 @@ #include #include -#ifdef HAVE_EXOTIC -# include -#endif - #include #include #include From d8fb0b049ae6a6abbd7daef60de1a7f7c05d5691 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 27 Nov 2019 09:09:27 -0500 Subject: [PATCH 27/33] elm/genlist: trigger pan recalcs in update_job and item del functions in cases where the pan may change as a result of item size recalcs, it's necessary to ensure that the pan object is recalculated ref D10663 Differential Revision: https://phab.enlightenment.org/D10752 --- src/lib/elementary/elm_genlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c index 65bc5182b5..b84e830545 100644 --- a/src/lib/elementary/elm_genlist.c +++ b/src/lib/elementary/elm_genlist.c @@ -3701,6 +3701,7 @@ _item_block_del(Elm_Gen_Item *it) itb->items = eina_list_remove(itb->items, it); itb->count--; itb->changed = EINA_TRUE; + efl_canvas_group_change(sd->pan_obj); efl_canvas_group_change(sd->obj); if (itb->realized) efl_ui_focus_manager_calc_unregister(itb->sd->obj, EO_OBJ(it)); if (itb->count < 1) @@ -3848,6 +3849,7 @@ _elm_genlist_item_del_serious(Elm_Gen_Item *it) sd->group_items = eina_list_remove(sd->group_items, it); ELM_SAFE_FREE(sd->state, eina_inlist_sorted_state_free); + efl_canvas_group_change(sd->pan_obj); efl_canvas_group_change(sd->obj); ELM_SAFE_FREE(it->item, free); @@ -5546,6 +5548,7 @@ _update_job(void *data) } if (position) { + efl_canvas_group_change(sd->pan_obj); efl_canvas_group_change(sd->obj); } evas_event_thaw(e); From a5837cb4ed0d9dabde8d92dbb69dfbdcaa891a71 Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Thu, 5 Dec 2019 10:37:57 +0100 Subject: [PATCH 28/33] efl_text_attribute_factory: update documention Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10806 --- src/lib/evas/canvas/efl_text_attribute_factory.eo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/efl_text_attribute_factory.eo b/src/lib/evas/canvas/efl_text_attribute_factory.eo index 52bc871880..6ff08c3b71 100644 --- a/src/lib/evas/canvas/efl_text_attribute_factory.eo +++ b/src/lib/evas/canvas/efl_text_attribute_factory.eo @@ -6,7 +6,7 @@ abstract @beta Efl.Text.Attribute.Factory extends Efl.Object { Attributes can be assigned to character ranges, selected using two @Efl.Text.Cursor instances. Cursor instances are already bound to a text object so there's no need to provide it to this class. - Style is specified using format strings as described in Efl.Canvas.Text.style_set. + Style is specified using format strings as described in @Efl.Canvas.Text.style_apply. There is no need to instantiate this class. Use directly the @.attribute_insert and @.attribute_clear static methods.]] methods { @@ -15,7 +15,7 @@ abstract @beta Efl.Text.Attribute.Factory extends Efl.Object { The $format will be applied to the given range. The passed cursors must belong to same textObject, else insertion will be ignored. - Passed format parameter uses same format as style in Efl.Canvas.Text.style_set. + Passed format parameter uses same format as style in @Efl.Canvas.Text.style_apply. ]] params { start: const(Efl.Text.Cursor); [[Start of range.]] From c1f3ad86dfa30f968c1fbf2e065bbe370435ee66 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 5 Dec 2019 20:25:25 +0900 Subject: [PATCH 29/33] Ector: Prevent access to NULL Summary: ector thread can called *data(task) after deleting task object. Test Plan: N/A Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10804 --- src/lib/ector/software/ector_renderer_software_shape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c index 601d03cf9f..573774d561 100644 --- a/src/lib/ector/software/ector_renderer_software_shape.c +++ b/src/lib/ector/software/ector_renderer_software_shape.c @@ -570,8 +570,8 @@ static void _done_rle(void *data) { Ector_Software_Shape_Task *task = data; - - task->pd->done = EINA_TRUE; + if (task && task->pd) + task->pd->done = EINA_TRUE; } static void From cfec50e9cfbc16dedeb3aa78950dc69cc68754ff Mon Sep 17 00:00:00 2001 From: maxerba Date: Thu, 5 Dec 2019 18:06:12 +0100 Subject: [PATCH 30/33] Updating french translation --- data/elementary/config/default/profile.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/elementary/config/default/profile.desktop b/data/elementary/config/default/profile.desktop index be4045df0b..d8ffa4a60b 100644 --- a/data/elementary/config/default/profile.desktop +++ b/data/elementary/config/default/profile.desktop @@ -31,7 +31,7 @@ Comment[el]=Επιλέξτε αυτό για να ξεκινήσετε την α Comment[eo]=Elektu tion por restartigi la pravalorizan agordon. Comment[es]=Seleccione esto para reestablecer la configuración inicial. Comment[fi]=Valitse tämä käynnistääksesi alkuasetusvelhon. -Comment[fr]=Sélectionnez ceci pour retrouver la configuration par défaut et reprendre le paramétrage initial. +Comment[fr]=Sélectionnez ceci pour recommencer la configuration initiale. Comment[gl]=Seleccione isto para volverr á configuración inicial. Comment[hu]=Válaszd ezt az alap beállítáok megismétléséhez. Comment[it]=Selezionare questo per riprendere la configurazione iniziale. From 6e49a94c0e20a22866550c5f187cdd6ec32642f8 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Fri, 6 Dec 2019 10:21:35 +0900 Subject: [PATCH 31/33] evas_events: fix wrong condition of proxy event behavior. Summary: If source_events is false, Evas object doesn't repeat events to source. But events is always repeated to source in multi touch case. Reviewers: Hermet, raster, cedric Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10807 --- src/lib/evas/canvas/evas_events.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index bb8c9346fb..12b38f1621 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -3042,7 +3042,7 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_DOWN, evt, event_id, EFL_EVENT_FINGER_DOWN); - if ((obj->proxy->is_proxy) || (obj->proxy->src_events)) + if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) _evas_event_source_multi_down_events(obj, e, evt, pdata, event_id); if (e->delete_me || e->is_frozen) break; } @@ -3126,7 +3126,7 @@ _canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data } evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_UP, evt, event_id, EFL_EVENT_FINGER_UP); - if ((obj->proxy->is_proxy) || (obj->proxy->src_events)) + if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) _evas_event_source_multi_up_events(obj, e, evt, pdata, event_id); if (e->delete_me || e->is_frozen) break; } @@ -3308,7 +3308,7 @@ _canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _evas_event_havemap_adjust_f(obj, &ev->cur, &ev->prev, obj_pdata->mouse_grabbed); evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, evt, event_id, EFL_EVENT_FINGER_MOVE); - if ((obj->proxy->is_proxy) || (obj->proxy->src_events)) + if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) _evas_event_source_multi_move_events(obj, e, evt, pdata, event_id); if (e->delete_me || e->is_frozen) break; @@ -3352,7 +3352,7 @@ _canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da { evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MULTI_MOVE, evt, event_id, EFL_EVENT_FINGER_MOVE); - if ((obj->proxy->is_proxy) || (obj->proxy->src_events)) + if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) _evas_event_source_multi_move_events(obj, e, evt, pdata, event_id); } if (e->delete_me || e->is_frozen) break; From c86f77ff6e700d96f7ba3634ba6c1116c1dc1941 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 6 Dec 2019 10:30:34 +0900 Subject: [PATCH 32/33] elm_label: Emit click signal on acivate action on label Summary: In accessibility enabled case click signal of legacy label is not triggered. Test Plan: N/A Reviewers: Hermet, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10803 --- src/lib/elementary/elm_label.c | 18 ++++++++++++++++++ src/lib/elementary/elm_label_eo.c | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c index 3d3e2a6af4..2279955f01 100644 --- a/src/lib/elementary/elm_label.c +++ b/src/lib/elementary/elm_label.c @@ -5,6 +5,7 @@ #define EFL_ACCESS_OBJECT_PROTECTED #define ELM_LAYOUT_PROTECTED #define EFL_PART_PROTECTED +#define EFL_ACCESS_WIDGET_ACTION_PROTECTED #include @@ -28,6 +29,13 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {NULL, NULL} }; +static Eina_Bool +_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) +{ + efl_event_callback_legacy_call(obj, EFL_INPUT_EVENT_CLICKED, NULL); + return EINA_TRUE; +} + static void _recalc(void *data) { @@ -416,6 +424,16 @@ elm_label_add(Evas_Object *parent) return elm_legacy_add(MY_CLASS, parent); } +EOLIAN const Efl_Access_Action_Data * +_elm_label_efl_access_widget_action_elm_actions_get(const Eo *obj EINA_UNUSED, Elm_Label_Data *pd EINA_UNUSED) +{ + static Efl_Access_Action_Data access_actions[] = { + { "activate", "activate", NULL, _action_activate }, + { NULL, NULL, NULL, NULL }, + }; + return &access_actions[0]; +} + EOLIAN static Eo * _elm_label_efl_object_constructor(Eo *obj, Elm_Label_Data *_pd EINA_UNUSED) { diff --git a/src/lib/elementary/elm_label_eo.c b/src/lib/elementary/elm_label_eo.c index 0ec366bad0..de24d9b94f 100644 --- a/src/lib/elementary/elm_label_eo.c +++ b/src/lib/elementary/elm_label_eo.c @@ -157,6 +157,7 @@ Eina_Error _elm_label_efl_ui_widget_theme_apply(Eo *obj, Elm_Label_Data *pd); Efl_Object *_elm_label_efl_part_part_get(const Eo *obj, Elm_Label_Data *pd, const char *name); +const Efl_Access_Action_Data *_elm_label_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Label_Data *pd); static Eina_Bool _elm_label_class_initializer(Efl_Class *klass) @@ -186,6 +187,7 @@ _elm_label_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_constructor, _elm_label_efl_object_constructor), EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_label_efl_ui_widget_theme_apply), EFL_OBJECT_OP_FUNC(efl_part_get, _elm_label_efl_part_part_get), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_label_efl_access_widget_action_elm_actions_get), ELM_LABEL_EXTRA_OPS ); opsp = &ops; From 562ae738ccafbe1d876cc1a90de79fe97ad3ba79 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 6 Dec 2019 10:37:31 +0900 Subject: [PATCH 33/33] ector_software_rasterizer: use dynamic array by span size. Summary: When use with intersect mask, if span_count over span array size, composition is to be wrong. So, In this case, we use dynamic array by span_count. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: vtorri, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10748 --- .../software/ector_software_rasterizer.c | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index fd59686131..bbaba4802d 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -522,12 +522,29 @@ _span_fill_clipRect(int span_count, const SW_FT_Span *spans, void *user_data) { const int NSPANS = 256; int clip_count, i; - SW_FT_Span cspans[NSPANS]; Span_Data *fill_data = (Span_Data *) user_data; Clip_Data clip = fill_data->clip; SW_FT_Span *clipped; Eina_Rectangle *rect; Eina_Rectangle tmp_rect; + SW_FT_Span *cspans = NULL; + Eina_Bool intersect = EINA_FALSE; + + //Note: Uses same span_count sized heap memory in intersect mask case. + if (fill_data->comp_method == EFL_GFX_VG_COMPOSITE_METHOD_MASK_INTERSECT) + { + intersect = EINA_TRUE; + cspans = malloc(sizeof(SW_FT_Span) * (span_count)); + if (!cspans) + { + ERR("OOM: Failed malloc()"); + return ; + } + } + else + { + cspans = alloca(sizeof(SW_FT_Span) * (NSPANS)); + } clip_count = eina_array_count(clip.clips); @@ -545,11 +562,12 @@ _span_fill_clipRect(int span_count, const SW_FT_Span *spans, void *user_data) while (spans < end) { clipped = cspans; - spans = _intersect_spans_rect(&tmp_rect, spans, end, &clipped, NSPANS); + spans = _intersect_spans_rect(&tmp_rect, spans, end, &clipped, intersect ? span_count : NSPANS); if (clipped - cspans) fill_data->unclipped_blend(clipped - cspans, cspans, fill_data); } } + if (intersect && cspans) free(cspans); } static void @@ -557,20 +575,38 @@ _span_fill_clipPath(int span_count, const SW_FT_Span *spans, void *user_data) { const int NSPANS = 256; int current_clip = 0; - SW_FT_Span cspans[NSPANS]; Span_Data *fill_data = (Span_Data *) user_data; Clip_Data clip = fill_data->clip; SW_FT_Span *clipped; + SW_FT_Span *cspans = NULL; + Eina_Bool intersect = EINA_FALSE; + + //Note: Uses same span_count sized heap memory in intersect mask case. + if (fill_data->comp_method == EFL_GFX_VG_COMPOSITE_METHOD_MASK_INTERSECT) + { + intersect = EINA_TRUE; + cspans = malloc(sizeof(SW_FT_Span) * (span_count)); + if (!cspans) + { + ERR("OOM: Failed malloc()"); + return ; + } + } + else + { + cspans = alloca(sizeof(SW_FT_Span) * (NSPANS)); + } // FIXME: Take clip path offset into account. const SW_FT_Span *end = spans + span_count; while (spans < end) { clipped = cspans; - spans = _intersect_spans_region(clip.path, ¤t_clip, spans, end, &clipped, NSPANS); + spans = _intersect_spans_region(clip.path, ¤t_clip, spans, end, &clipped, intersect ? span_count : NSPANS); if (clipped - cspans) fill_data->unclipped_blend(clipped - cspans, cspans, fill_data); } + if (intersect && cspans) free(cspans); } static void