[Camera] Support NUI window for preview (#1753)
authorhsgwon <haesu.gwon@samsung.com>
Fri, 26 Jun 2020 02:38:38 +0000 (11:38 +0900)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2020 02:38:38 +0000 (11:38 +0900)
* [Camera] Support NUI window for preview

src/Tizen.Multimedia.Camera/Camera/Camera.cs
src/Tizen.Multimedia.Camera/Interop/Interop.CameraDisplay.cs

index d37362e..f2d7381 100644 (file)
@@ -399,7 +399,7 @@ namespace Tizen.Multimedia
         {
             if (display == null)
             {
-                return CameraDisplay.SetTarget(GetHandle(), DisplayType.None, IntPtr.Zero);
+                return CameraDisplay.SetDisplay(GetHandle(), DisplayType.None, IntPtr.Zero);
             }
 
             return display.ApplyTo(this);
@@ -457,12 +457,14 @@ namespace Tizen.Multimedia
             Debug.Assert(_disposed == false);
             ValidationUtil.ValidateEnum(typeof(DisplayType), type, nameof(type));
 
-            return CameraDisplay.SetTarget(GetHandle(), type, evasObject);
+            return CameraDisplay.SetDisplay(GetHandle(), type, evasObject);
         }
 
         CameraError IDisplayable<CameraError>.ApplyEcoreWindow(IntPtr windowHandle)
         {
-            throw new NotSupportedException("Camera does not support NUI.Window display.");
+            Debug.Assert(_disposed == false);
+
+            return CameraDisplay.SetEcoreDisplay(GetHandle(), windowHandle);
         }
 
         /// <summary>
index 001aa42..56a85aa 100644 (file)
@@ -53,6 +53,9 @@ internal static partial class Interop
         internal static extern CameraError SetRoiArea(IntPtr handle, int x, int y, int width, int height);
 
         [DllImport(Libraries.Camera, EntryPoint = "camera_set_display")]
-        internal static extern CameraError SetTarget(IntPtr handle, DisplayType displayType, IntPtr displayHandle);
+        internal static extern CameraError SetDisplay(IntPtr handle, DisplayType displayType, IntPtr displayHandle);
+
+        [DllImport(Libraries.Camera, EntryPoint = "camera_set_ecore_wl_display")]
+        internal static extern CameraError SetEcoreDisplay(IntPtr handle, IntPtr ecoreWindow);
     }
 }