[Camera][TCSACR-427] Add new CameraPixelFormat - Vp8, Vp9 41/263541/1
authorHaesu Gwon <haesu.gwon@samsung.com>
Mon, 6 Sep 2021 06:32:13 +0000 (15:32 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Mon, 6 Sep 2021 06:32:13 +0000 (15:32 +0900)
Change-Id: Ib20e7a386e8af4401e0ea623834a394c65e238f8

tct-suite-vs/Tizen.Camera.Tests/testcase/TSPreviewFrame.cs
tct-suite-vs/Tizen.Multimedia.Support.Library/EventAwaiter.cs

index 846605f..b47c809 100644 (file)
@@ -272,6 +272,78 @@ namespace Tizen.Multimedia.Tests
 
         [Test]
         [Category("P1")]
+        [Description("Test Type property for Encoded plane with Vp8.")]
+        [Property("SPEC", "Tizen.Multimedia.PreviewFrame.PlaneType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRE")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public async Task PlaneType_PROPERTY_GET_ENUM_PLANETYPE_ENCODEDPLANE_WITH_Vp8()
+        {
+            bool isSupportEncodedPlane = TestCamera.Capabilities.SupportedPreviewPixelFormats
+                .Contains(CameraPixelFormat.Vp8);
+            if (isSupportEncodedPlane == false)
+            {
+                Assert.Pass("EncodedPlane format(Vp8)is not supported.");
+            }
+
+            TestCamera.Settings.PreviewPixelFormat = CameraPixelFormat.Vp8;
+
+            using (var eventWaiter = EventAwaiter<PreviewEventArgs>.Create())
+            {
+                TestCamera.Preview += eventWaiter;
+
+                try
+                {
+                    TestCamera.StartPreview();
+
+                    var eventArgs = await eventWaiter.GetResultAsync();
+                    Assert.That(eventArgs.Preview.PlaneType, Is.EqualTo(PlaneType.EncodedPlane));
+                }
+                finally
+                {
+                    TestCamera.Preview -= eventWaiter;
+                }
+            }
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Type property for Encoded plane with Vp9.")]
+        [Property("SPEC", "Tizen.Multimedia.PreviewFrame.PlaneType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRE")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public async Task PlaneType_PROPERTY_GET_ENUM_PLANETYPE_ENCODEDPLANE_WITH_Vp9()
+        {
+            bool isSupportEncodedPlane = TestCamera.Capabilities.SupportedPreviewPixelFormats
+                .Contains(CameraPixelFormat.Vp9);
+            if (isSupportEncodedPlane == false)
+            {
+                Assert.Pass("EncodedPlane format(Vp9) is not supported.");
+            }
+
+            TestCamera.Settings.PreviewPixelFormat = CameraPixelFormat.Vp9;
+
+            using (var eventWaiter = EventAwaiter<PreviewEventArgs>.Create())
+            {
+                TestCamera.Preview += eventWaiter;
+
+                try
+                {
+                    TestCamera.StartPreview();
+
+                    var eventArgs = await eventWaiter.GetResultAsync();
+                    Assert.That(eventArgs.Preview.PlaneType, Is.EqualTo(PlaneType.EncodedPlane));
+                }
+                finally
+                {
+                    TestCamera.Preview -= eventWaiter;
+                }
+            }
+        }
+
+        [Test]
+        [Category("P1")]
         [Description("Test Type property for Depth plane.")]
         [Property("SPEC", "Tizen.Multimedia.PreviewFrame.PlaneType A")]
         [Property("SPEC_URL", "-")]
index 6cc0c32..72a42c0 100644 (file)
@@ -45,6 +45,7 @@ public class EventAwaiter<T> : IDisposable
         {
             if (_countdownEvent.Wait(timeout))
             {
+                Tizen.Log.Info("Multimedia.Support", "Invoked eventArgs : " + typeof(T).ToString());
                 return _result;
             }
             return null;