From: Haesu Gwon Date: Mon, 17 Aug 2020 07:18:50 +0000 (+0900) Subject: [MediaCodec][TCSACR-344] Add new codec type - Opus X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F241115%2F1;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaCodec][TCSACR-344] Add new codec type - Opus Change-Id: I8b1bde188f6bc849cebd475da6c2f18dca337128 --- diff --git a/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs b/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs index f72c48df9..23decf96e 100644 --- a/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs +++ b/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs @@ -1,7 +1,10 @@ using NUnit.Framework; using System; +using System.Collections; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using System.Linq; namespace Tizen.Multimedia.MediaCodec.Tests { @@ -26,6 +29,58 @@ namespace Tizen.Multimedia.MediaCodec.Tests Assert.DoesNotThrow(() => new MediaCodec()); } + [Test] + [Category("P1")] + [Description("Configure throws nothing with various audio/video mimetype")] + [Property("SPEC", "Tizen.Multimedia.MediaCodec.MediaCodec.Configure M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Configure_CHECK_THROW_NOTHING() + { + int[] supportedBit = { 16, 32 }; + + foreach (MediaFormatAudioMimeType mimetype in Enum.GetValues(typeof(MediaFormatAudioMimeType))) + { + Log.Info("Tizen.MediaCodec.Tests", mimetype.ToString()); + + if (MediaCodec.SupportedAudioCodecs.Contains(mimetype)) + { + foreach (var bit in supportedBit) + { + Log.Info("Tizen.MediaCodec.Tests", + $"{mimetype.ToString()} is supported, test with {bit.ToString()}"); + + try + { + var audioMediaFormat = new AudioMediaFormat(mimetype, 1, 8000, bit, 128); + _codec.Configure(audioMediaFormat, false, MediaCodecTypes.Software); + break; + } + catch (ArgumentException) + { + Log.Info("Tizen.MediaCodec.Tests", "Not supported bit. Try to set another bit."); + continue; + } + catch (Exception) + { + Assert.Fail("Method should not throw exception."); + } + } + } + } + + foreach (MediaFormatVideoMimeType mimetype in Enum.GetValues(typeof(MediaFormatVideoMimeType))) + { + if (MediaCodec.SupportedVideoCodecs.Contains(mimetype)) + { + Log.Info("Tizen.MediaCodec.Tests", $"{mimetype.ToString()} is supported."); + var videoMediaFormat = new VideoMediaFormat(mimetype, 352, 288, 30, 128); + Assert.DoesNotThrow(() => _codec.Configure(videoMediaFormat, false, MediaCodecTypes.Software)); + } + } + } + [Test] [Category("P2")] [Description("Configure throws if the specified format is null")]