Supports to get window native buffer handle. 64/311464/4
authorWonsik Jung <sidein@samsung.com>
Tue, 21 May 2024 10:53:52 +0000 (19:53 +0900)
committerWonsik Jung <sidein@samsung.com>
Mon, 5 Aug 2024 05:29:30 +0000 (14:29 +0900)
Supports to get window native buffer.
It is for synchronization between window buffer and external buffer.
In addition, add the connection of scene in video player.

Change-Id: Id8986d1aa723ce11b21221a9a5a2a435f1a93baa

19 files changed:
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/window-system/android/window-base-android.cpp
dali/internal/window-system/android/window-base-android.h
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/macos/window-base-mac.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/internal/window-system/x11/window-base-x.cpp
dali/internal/window-system/x11/window-base-x.h

index a3efe86..2b96c92 100644 (file)
@@ -389,6 +389,11 @@ bool IsAlwaysOnTop(Window window)
   return GetImplementation(window).IsAlwaysOnTop();
 }
 
+Any GetNativeBuffer(Window window)
+{
+  return GetImplementation(window).GetNativeBuffer();
+}
+
 InterceptKeyEventSignalType& InterceptKeyEventSignal(Window window)
 {
   return GetImplementation(window).InterceptKeyEventSignal();
index 2b28982..39b75ae 100644 (file)
@@ -699,6 +699,14 @@ DALI_ADAPTOR_API void SetAlwaysOnTop(Window window, bool alwaysOnTop);
 DALI_ADAPTOR_API bool IsAlwaysOnTop(Window window);
 
 /**
+ * @brief Gets the native buffer of the window.
+ *
+ * When users call this function, it wraps the actual type used by the underlying window system.
+ * @return The native buffer of the Window or an empty handle
+ */
+DALI_ADAPTOR_API Any GetNativeBuffer(Window window);
+
+/**
  * @brief The user would connect to this signal to intercept a KeyEvent at window.
  *
  * Intercepts KeyEvents in the window before dispatching KeyEvents to the control.
index a537e1e..0d7937f 100644 (file)
@@ -516,6 +516,11 @@ bool WindowBaseAndroid::IsAlwaysOnTop()
   return false;
 }
 
+Any WindowBaseAndroid::GetNativeBuffer() const
+{
+  return 0;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index 3463e3e..e5f8e91 100644 (file)
@@ -539,6 +539,11 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
+   */
+  Any GetNativeBuffer() const override;
+
 private:
   /**
    * Second stage initialization
index 0d87a7e..720c91e 100644 (file)
@@ -593,6 +593,12 @@ public:
    */
   virtual bool IsAlwaysOnTop() = 0;
 
+  /**
+   * @brief Get native buffer of window.
+   * @return The native window buffer handle
+   */
+  virtual Any GetNativeBuffer() const = 0;
+
   // Signals
 
   /**
index 3ad19c8..867abc6 100644 (file)
@@ -1612,6 +1612,10 @@ bool Window::IsAlwaysOnTop()
   return mWindowBase->IsAlwaysOnTop();
 }
 
+Dali::Any Window::GetNativeBuffer() const
+{
+  return mWindowBase->GetNativeBuffer();
+}
 
 } // namespace Adaptor
 
index e8c294e..8bd92ce 100644 (file)
@@ -602,6 +602,11 @@ public: // Dali::Internal::Adaptor::SceneHolder
    */
   bool IsAlwaysOnTop();
 
+  /**
+   * @copydoc Dali::DevelWindow::GetNativeBuffer()
+   */
+  Dali::Any GetNativeBuffer() const;
+
 private:
   /**
    * @brief Enumeration for orietation mode.
index d01c213..4fd0d4b 100644 (file)
@@ -473,6 +473,12 @@ public:
    */
   void SetWindowFrontBufferMode(bool enable) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
+   */
+  Any GetNativeBuffer() const override;
+
+
 private:
   // Undefined
   WindowBaseCocoa(const WindowBaseCocoa&) = delete;
index a9b72ab..e6cf591 100644 (file)
@@ -824,6 +824,11 @@ bool WindowBaseCocoa::IsAlwaysOnTop()
   return false;
 }
 
+Any WindowBaseCocoa::GetNativeBuffer() const
+{
+  return 0;
+}
+
 } // namespace Dali::Internal::Adaptor
 
 @implementation CocoaView
index d226390..e2139bf 100644 (file)
@@ -2238,6 +2238,11 @@ void WindowBaseEcoreWl::SetWindowFrontBufferMode(bool enable)
 {
 }
 
+Any WindowBaseEcoreWl::GetNativeWindow()
+{
+  return mEglWindow;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index cdea929..54729b2 100644 (file)
@@ -575,6 +575,11 @@ public:
    */
   void SetWindowFrontBufferMode(bool enable) override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
+   */
+  Any GetNativeBuffer() const override;
+
 private:
   /**
    * Second stage initialization
index deb8ff6..87f4083 100644 (file)
@@ -3700,6 +3700,12 @@ bool WindowBaseEcoreWl2::IsAlwaysOnTop()
   return ret;
 }
 
+Any WindowBaseEcoreWl2::GetNativeBuffer() const
+{
+  DALI_LOG_RELEASE_INFO("Get wl_egl_window, ecore_window: [%p], wl_egl_window [%p]\n", mEcoreWindow, mEglWindow);
+  return mEglWindow;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index a9817a6..bc3b10e 100644 (file)
@@ -682,6 +682,11 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
+   */
+  Any GetNativeBuffer() const override;
+
 private:
   /**
    * Second stage initialization
index 2225265..282e85f 100644 (file)
@@ -1110,6 +1110,11 @@ bool WindowBaseEcoreX::IsAlwaysOnTop()
   return false;
 }
 
+Any WindowBaseEcoreX::GetNativeBuffer() const
+{
+  return 0;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index a2982aa..ecf6784 100644 (file)
@@ -544,6 +544,11 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
+   */
+  Any GetNativeBuffer() const override;
+
 private:
   /**
    * Second stage initialization
index a5be4e8..6dd4398 100644 (file)
@@ -744,6 +744,11 @@ bool WindowBaseWin::IsAlwaysOnTop()
   return false;
 }
 
+Any WindowBaseWin::GetNativeBuffer() const
+{
+  return 0;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index d5664db..ef82697 100644 (file)
@@ -526,6 +526,11 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
+   */
+  Any GetNativeBuffer() override;
+
 private:
   /**
    * Second stage initialization
index 217d6e8..616b8ce 100644 (file)
@@ -1044,6 +1044,11 @@ bool WindowBaseX::IsAlwaysOnTop()
   return false;
 }
 
+Any WindowBaseX::GetNativeBuffer()
+{
+  return 0;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal
index fe814a4..9c98f7c 100644 (file)
@@ -549,6 +549,11 @@ public:
    */
   bool IsAlwaysOnTop() override;
 
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer()
+   */
+  Any GetNativeBuffer() const override;
+
 private:
   /**
    * Second stage initialization