video: Support setting video property synchronously. 23/216923/4
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 24 Oct 2019 08:45:45 +0000 (17:45 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 5 Nov 2019 04:10:26 +0000 (04:10 +0000)
This patch is to support setting property synchronously regardless
E_Client is visible or not, plus even if E_Client is in destroy process.
A property will be passed to tdm directly when associated function is
called.

Change-Id: I575e2ae1e8ca3a7a43991a654fb12b2446eb76e4

src/bin/video/e_client_video.c
src/bin/video/e_client_video.h
src/bin/video/e_comp_wl_video.c
src/bin/video/e_video_internal.h
src/bin/video/iface/e_video_hwc.c
src/bin/video/iface/e_video_hwc.h
src/bin/video/iface/e_video_hwc_planes.c
src/bin/video/iface/e_video_hwc_windows.c

index b91e7cc0b5fdc223cb9711636061f39536c409db..6960554a5098986e370487e498317b3ac0b2ca31 100644 (file)
@@ -424,11 +424,11 @@ e_client_video_property_get(E_Client *ec, unsigned int id, tdm_value *value)
 }
 
 E_API Eina_Bool
-e_client_video_property_set(E_Client *ec, unsigned int id, tdm_value value)
+e_client_video_property_set(E_Client *ec, unsigned int id, tdm_value value, Eina_Bool sync)
 {
    IFACE_CHECK_RET(property_set, EINA_FALSE);
 
-   return ecv->iface->property_set(ecv->iface, id, value);
+   return ecv->iface->property_set(ecv->iface, id, value, sync);
 }
 
 EINTERN Eina_Bool
index bc21ec697d8a6bb3d80aa0f6efb0805381cbc40e..a68933935b2de8c2e80f8af7aaf215ca9085c3b8 100644 (file)
@@ -26,7 +26,21 @@ EINTERN Eina_Bool    e_client_video_property_disallow(E_Client *ec);
 
 E_API   Eina_Bool    e_client_video_available_properties_get(E_Client *ec, const tdm_prop **props, int *count);
 E_API   Eina_Bool    e_client_video_property_get(E_Client *ec, unsigned int id, tdm_value *value);
-E_API   Eina_Bool    e_client_video_property_set(E_Client *ec, unsigned int id, tdm_value value);
+
+/** Set tdm_value of property of given id for E_Client.
+ *
+ * This function sets tdm_value of property of given id for tdm instance
+ * associated with E_Client.
+ *
+ * @in  ec  The E_Client instance to be used.
+ *      id  The property id which tdm_value will be set to.
+ *      value   The tdm_value to be set.
+ *      sync   If EINA_FALSE is given, the property will be set when
+ *      wl_surface.commit happened, otherwise, it will be set immediately
+ *      regardless this E_Client is visible or not.
+ * @return EINA_TRUE if success. Otherwise, EINA_FALSE.
+ */
+E_API   Eina_Bool    e_client_video_property_set(E_Client *ec, unsigned int id, tdm_value value, Eina_Bool sync);
 EINTERN Eina_Bool    e_client_video_property_delay_set(E_Client *ec, unsigned int id, tdm_value value);
 
 EINTERN Eina_Bool    e_client_video_info_get(E_Client *ec, E_Client_Video_Info *info);
index be8151c6803a66acb378e617201524972c80f2d5..1fc7b5faee7dba6d12d564916fd0e9f14a593c06 100644 (file)
@@ -196,7 +196,7 @@ _e_comp_wl_video_object_cb_set_attribute(struct wl_client *client,
      }
 
    v.u32 = value;
-   e_client_video_property_set(video->ec, id, v);
+   e_client_video_property_set(video->ec, id, v, EINA_FALSE);
 }
 
 static Eina_Bool
index 69842182c8f9b4dd4e47adb7e40ece030e4f350f..34ae748bc00634585c339c6781740fa61f1a31f7 100644 (file)
@@ -44,7 +44,7 @@ struct _E_Video_Comp_Iface
 {
    void            (*destroy)(E_Video_Comp_Iface *iface);
    Eina_Bool       (*property_get)(E_Video_Comp_Iface *iface, unsigned int id, tdm_value *value);
-   Eina_Bool       (*property_set)(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value);
+   Eina_Bool       (*property_set)(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value, Eina_Bool sync);
    Eina_Bool       (*property_delay_set)(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value);
    Eina_Bool       (*available_properties_get)(E_Video_Comp_Iface *iface, const tdm_prop **props, int *count);
    /* FIXME for hwc windows mode */
index 0d3a011c55c8c3ac98dd0bdbd951a23b01eb514c..8ee62981b661c9bcf1b75b4555f7083d00e53967 100644 (file)
@@ -1707,11 +1707,11 @@ _e_video_hwc_iface_property_get(E_Video_Comp_Iface *iface, unsigned int id, tdm_
 }
 
 static Eina_Bool
-_e_video_hwc_iface_property_set(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value)
+_e_video_hwc_iface_property_set(E_Video_Comp_Iface *iface, unsigned int id, tdm_value value, Eina_Bool sync)
 {
    IFACE_ENTRY;
 
-   return evh->backend.property_set(evh, id, value);
+   return evh->backend.property_set(evh, id, value, sync);
 }
 
 static Eina_Bool
index 74fa3fafab1a63f56a543304570e1e48774881c9..ea36e6e2bc0d7ecbaf4223b9e1fcae28e1277025 100644 (file)
@@ -21,7 +21,7 @@ struct _E_Video_Hwc_Iface
 {
    void           (*destroy)(E_Video_Hwc *evh);
    Eina_Bool      (*property_get)(E_Video_Hwc *evh, unsigned int id, tdm_value *value);
-   Eina_Bool      (*property_set)(E_Video_Hwc *evh, unsigned int id, tdm_value value);
+   Eina_Bool      (*property_set)(E_Video_Hwc *evh, unsigned int id, tdm_value value, Eina_Bool sync);
    Eina_Bool      (*available_properties_get)(E_Video_Hwc *evh, const tdm_prop **props, int *count);
    Eina_Bool      (*buffer_commit)(E_Video_Hwc *evh, E_Comp_Wl_Video_Buf *vbuf);
    Eina_Bool      (*check_if_pp_needed)(E_Video_Hwc *evh);
index 18745dbc3d559146bca776be74f045bc15f20a5c..8247e8e4fd5e496f1b7224c1ec0f280a873dc9a7 100644 (file)
@@ -761,7 +761,7 @@ _e_video_hwc_planes_iface_property_get(E_Video_Hwc *evh, unsigned int id, tdm_va
 }
 
 static Eina_Bool
-_e_video_hwc_planes_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_value value)
+_e_video_hwc_planes_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_value value, Eina_Bool sync)
 {
    E_Video_Hwc_Planes *evhp;
    Tdm_Prop_Value prop;
@@ -778,7 +778,8 @@ _e_video_hwc_planes_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_va
          * Set property with assigning layer right away if allowed_attribute
          * flag is set. The reason why we have to do like this isn't figured
          * yet. It's for backward compatibility. */
-        if (e_client_video_property_allow_get(evhp->base.ecv))
+        if ((e_client_video_property_allow_get(evhp->base.ecv)) ||
+            (sync == EINA_TRUE))
           {
              if (!_e_video_hwc_planes_tdm_layer_set(evhp))
                {
index eaae358dd57f4127ea5ea7ae009d8d276ff363cf..fc2057f049c510553e97111af6fef920f57e2401 100644 (file)
@@ -122,7 +122,7 @@ _e_video_hwc_windows_iface_property_get(E_Video_Hwc *evh, unsigned int id, tdm_v
 }
 
 static Eina_Bool
-_e_video_hwc_windows_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_value value)
+_e_video_hwc_windows_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_value value, Eina_Bool sync)
 {
    E_Video_Hwc_Windows *evhw;
    const char *name;
@@ -137,7 +137,8 @@ _e_video_hwc_windows_iface_property_set(E_Video_Hwc *evh, unsigned int id, tdm_v
       return EINA_FALSE;
    }
 
-   if (e_client_video_property_allow_get(evhw->base.ecv))
+   if ((e_client_video_property_allow_get(evhw->base.ecv)) ||
+       (sync == EINA_TRUE))
      {
         VIN("set_attribute now : property(%s), value(%d)", evhw->base.ec, name, value.u32);