Make NativeImageQueue generate valid url
authorEunki Hong <eunkiki.hong@samsung.com>
Thu, 26 Oct 2023 10:42:44 +0000 (19:42 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Tue, 31 Oct 2023 14:07:28 +0000 (23:07 +0900)
Previously NativeImageQueue.GenerateUrl() binded to
invalid csharp API.

It will make some crash. So let we use valid bind API instead.

Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/internal/Common/NativeImageInterface.cs
src/Tizen.NUI/src/internal/Interop/Interop.NativeImageInterface.cs
src/Tizen.NUI/src/internal/Interop/Interop.NativeImageQueue.cs
src/Tizen.NUI/src/public/Images/NativeImageQueue.cs
src/Tizen.NUI/src/public/Images/NativeImageSource.cs

index be32543..dce8180 100755 (executable)
@@ -77,5 +77,12 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
+
+        public virtual ImageUrl GenerateUrl()
+        {
+            ImageUrl ret = new ImageUrl(Interop.NativeImageInterface.GenerateUrl(SwigCPtr), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
     }
 }
index ab0eb4e..dddf062 100755 (executable)
@@ -44,6 +44,9 @@ namespace Tizen.NUI
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool RequiresBlending(global::System.Runtime.InteropServices.HandleRef jarg1);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageInterface_GenerateUrl")]
+            public static extern global::System.IntPtr GenerateUrl(global::System.Runtime.InteropServices.HandleRef jarg1);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageInterface_SWIGUpcast")]
             public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1);
         }
index f62344d..0ded636 100644 (file)
@@ -40,6 +40,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_EnqueueBuffer")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool EnqueueBuffer(IntPtr queue, IntPtr buffer);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageQueue_GenerateUrl")]
+            public static extern IntPtr GenerateUrl(IntPtr queue);
         }
     }
 }
index 11153d4..4057e45 100644 (file)
@@ -105,10 +105,10 @@ namespace Tizen.NUI
         /// </remarks>
         /// <returns>The ImageUrl of NativeImageQueue.</returns>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ImageUrl GenerateUrl()
+        public override ImageUrl GenerateUrl()
         {
-            ImageUrl ret = new ImageUrl(Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+            ImageUrl ret = new ImageUrl(Interop.NativeImageQueue.GenerateUrl(this.SwigCPtr.Handle), true);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
index 4e3bfe9..ea4df30 100644 (file)
@@ -44,10 +44,10 @@ namespace Tizen.NUI
         /// This API should not be called at worker thread.
         /// </remarks>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ImageUrl GenerateUrl()
+        public override ImageUrl GenerateUrl()
         {
             ImageUrl ret = new ImageUrl(Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle), true);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }