[Multimedia] Fix to set window size properly (#5764)
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 21 Nov 2023 08:06:14 +0000 (17:06 +0900)
committerGitHub <noreply@github.com>
Tue, 21 Nov 2023 08:06:14 +0000 (17:06 +0900)
src/Tizen.Multimedia.Camera/Camera/Camera.Properties.cs
src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs
src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroring.cs
src/Tizen.Multimedia.Remoting/WebRTC/MediaSource.cs
src/Tizen.Multimedia.Remoting/WebRTC/MediaStreamTrack.cs
src/Tizen.Multimedia/Common/Display.cs

index 2b49769..3f62ac6 100644 (file)
@@ -116,7 +116,7 @@ namespace Tizen.Multimedia
             return CameraDisplay.SetDisplay(GetHandle(), type, evasObject);
         }
 
-        CameraError IDisplayable<CameraError>.ApplyEcoreWindow(IntPtr windowHandle)
+        CameraError IDisplayable<CameraError>.ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect)
         {
             Debug.Assert(_disposed == false);
 
index 9decb5c..c2bac2f 100644 (file)
@@ -373,12 +373,12 @@ namespace Tizen.Multimedia
                 type == DisplayType.Overlay ? PlayerDisplayType.Overlay : PlayerDisplayType.Evas, evasObject);
         }
 
-        PlayerErrorCode IDisplayable<PlayerErrorCode>.ApplyEcoreWindow(IntPtr windowHandle)
+        PlayerErrorCode IDisplayable<PlayerErrorCode>.ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect)
         {
             Debug.Assert(IsDisposed == false);
 
             return NativeDisplay.SetEcoreDisplay(Handle,
-                _uiSync ? PlayerDisplayType.OverlayUISync : PlayerDisplayType.Overlay, windowHandle);
+                _uiSync ? PlayerDisplayType.OverlayUISync : PlayerDisplayType.Overlay, windowHandle, rect.X, rect.Y, rect.Width, rect.Height);
         }
         #endregion
 
index 900f7e5..a53cd3f 100644 (file)
@@ -134,7 +134,7 @@ namespace Tizen.Multimedia.Remoting
             return Native.SetDisplay(Handle, (int)type, evasObject);
         }
 
-        ScreenMirroringErrorCode IDisplayable<ScreenMirroringErrorCode>.ApplyEcoreWindow(IntPtr windowHandle)
+        ScreenMirroringErrorCode IDisplayable<ScreenMirroringErrorCode>.ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect)
         {
             return Native.SetEcoreDisplay(Handle, windowHandle);
         }
index 7768f69..69bb95d 100755 (executable)
@@ -675,7 +675,7 @@ namespace Tizen.Multimedia.Remoting
             return trackId;
         }
 
-        uint IDisplayable<uint>.ApplyEcoreWindow(IntPtr windowHandle)
+        uint IDisplayable<uint>.ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect)
         {
             NativeWebRTC.SetEcoreVideoLoopback(WebRtc.Handle, SourceId.Value, windowHandle, out uint trackId).
                 ThrowIfFailed("Failed to set ecore video loopback");
@@ -683,4 +683,4 @@ namespace Tizen.Multimedia.Remoting
             return trackId;
         }
     }
-}
\ No newline at end of file
+}
index 1d154e9..2e5e3aa 100755 (executable)
@@ -126,7 +126,7 @@ namespace Tizen.Multimedia.Remoting
                 type == DisplayType.Overlay ? WebRTCDisplayType.Overlay : WebRTCDisplayType.Evas, evasObject);
         }
 
-        WebRTCErrorCode IDisplayable<WebRTCErrorCode>.ApplyEcoreWindow(IntPtr windowHandle)
+        WebRTCErrorCode IDisplayable<WebRTCErrorCode>.ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect)
         {
             return NativeWebRTC.SetEcoreDisplay(_webRtc.Handle, _trackId, windowHandle);
         }
index 0f8357d..a5c81c8 100644 (file)
@@ -39,7 +39,7 @@ namespace Tizen.Multimedia
     internal interface IDisplayable<TError>
     {
         TError ApplyEvasDisplay(DisplayType type, EvasObject evasObject);
-        TError ApplyEcoreWindow(IntPtr windowHandle);
+        TError ApplyEcoreWindow(IntPtr windowHandle, NUI.Rectangle rect);
     }
 
     internal interface IDisplaySetter
@@ -72,15 +72,17 @@ namespace Tizen.Multimedia
     internal class EcoreDisplaySetter : IDisplaySetter
     {
         private readonly IntPtr _windowHandle;
+        private readonly NUI.Rectangle _rect;
 
-        internal EcoreDisplaySetter(IntPtr windowHandle)
+        internal EcoreDisplaySetter(IntPtr windowHandle, NUI.Rectangle rect)
         {
             _windowHandle = windowHandle;
+            _rect = rect;
         }
 
         public TError SetDisplay<TError>(IDisplayable<TError> target)
         {
-            return target.ApplyEcoreWindow(_windowHandle);
+            return target.ApplyEcoreWindow(_windowHandle, _rect);
         }
     }
 
@@ -161,8 +163,7 @@ namespace Tizen.Multimedia
             {
                 throw new ArgumentNullException(nameof(window));
             }
-
-            _setter = new EcoreDisplaySetter(window.GetNativeWindowHandler());
+            _setter = new EcoreDisplaySetter(window.GetNativeWindowHandler(), window.WindowPositionSize);
 
             UiSync = uiSync;
         }