using NUnit.Framework;
using System;
+using System.Collections.Generic;
namespace Tizen.Multimedia.Tests
{
private const int VALID_AUDIO_SAMPLE_RATE = 21;
private const int VALID_AUDIO_BIT = 31;
private const int VALID_AUDIO_BIT_RATE = 41;
+ private const int VALID_AUDIO_BIT_DEPTH = 16;
private const int INVALID_AUDIO_CHANNEL = -1;
private const int INVALID_AUDIO_SAMPLE_RATE = -2;
private const int INVALID_AUDIO_BIT = -3;
private const int INVALID_AUDIO_BIT_RATE = -4;
+ private const int INVALID_AUDIO_BIT_DEPTH = -5;
+
+ private const int VALID_PCM_AUDIO_CHANNEL = 2;
+ private const int VALID_PCM_AUDIO_SAMPLE_RATE = 44100;
+ private const int VALID_PCM_AUDIO_BIT = 32;
+ private const int VALID_PCM_AUDIO_BIT_DEPTH = 16;
+ private const int VALID_PCM_AUDIO_BIT_RATE = 128000;
[Test]
[Category("P1")]
[Test]
[Category("P1")]
- [Description("AacType is read only")]
+ [Description("Create AudioMediaFormat instance and check whether instance is created properly.")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_CHECK_CREATE_CONSTRUCTOR()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft,
+ MediaFormatAudioChannelPosition.FrontRight,
+ MediaFormatAudioChannelPosition.FrontCenter,
+ MediaFormatAudioChannelPosition.LFE1,
+ MediaFormatAudioChannelPosition.BackLeft,
+ MediaFormatAudioChannelPosition.BackRight,
+ MediaFormatAudioChannelPosition.FrontLeftOrCenter,
+ MediaFormatAudioChannelPosition.FrontRightOrCenter,
+ MediaFormatAudioChannelPosition.BackCenter,
+ MediaFormatAudioChannelPosition.LFE2,
+ MediaFormatAudioChannelPosition.SideLeft,
+ MediaFormatAudioChannelPosition.SideRight,
+ MediaFormatAudioChannelPosition.TopFrontLeft,
+ MediaFormatAudioChannelPosition.TopFrontRight,
+ MediaFormatAudioChannelPosition.TopFrontCenter,
+ MediaFormatAudioChannelPosition.TopCenter,
+ MediaFormatAudioChannelPosition.TopBackLeft,
+ MediaFormatAudioChannelPosition.TopBackRight,
+ MediaFormatAudioChannelPosition.TopSideLeft,
+ MediaFormatAudioChannelPosition.TopSideRight,
+ MediaFormatAudioChannelPosition.TopBackCenter,
+ MediaFormatAudioChannelPosition.BottomFrontCenter,
+ MediaFormatAudioChannelPosition.BottomFrontLeft,
+ MediaFormatAudioChannelPosition.BottomFrontRight,
+ MediaFormatAudioChannelPosition.WideLeft,
+ MediaFormatAudioChannelPosition.WideRight,
+ MediaFormatAudioChannelPosition.SurroundLeft,
+ MediaFormatAudioChannelPosition.SurroundRight
+ };
+
+ var audioFormat = new AudioMediaFormat(mimeType, 28,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ VALID_PCM_AUDIO_BIT_DEPTH, channelMap);
+
+ Assert.IsNotNull(audioFormat, "Object should not be null after initializing");
+ Assert.IsInstanceOf<AudioMediaFormat>(audioFormat, "Should return AudioMediaFormat instance.");
+ Assert.AreEqual(mimeType, audioFormat.MimeType);
+ Assert.AreEqual(28, audioFormat.Channel);
+ Assert.AreEqual(VALID_PCM_AUDIO_SAMPLE_RATE, audioFormat.SampleRate);
+ Assert.AreEqual(VALID_PCM_AUDIO_BIT, audioFormat.Bit);
+ Assert.AreEqual(VALID_PCM_AUDIO_BIT_RATE, audioFormat.BitRate);
+ Assert.AreEqual(VALID_PCM_AUDIO_BIT_DEPTH, audioFormat.BitDepth);
+
+ AssertHelper.Equals(channelMap, audioFormat.AudioChannelMap);
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if one of the specified parameters is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_THROWS_IF_PARAM_IS_INVALID()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ channel: INVALID_AUDIO_CHANNEL,
+ mimeType: mimeType,
+ sampleRate: VALID_PCM_AUDIO_SAMPLE_RATE,
+ bit: VALID_PCM_AUDIO_BIT,
+ bitRate: VALID_PCM_AUDIO_BIT_RATE,
+ bitDepth: VALID_PCM_AUDIO_BIT_DEPTH,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ sampleRate: INVALID_AUDIO_SAMPLE_RATE,
+ mimeType: mimeType,
+ channel: VALID_PCM_AUDIO_CHANNEL,
+ bit: VALID_PCM_AUDIO_BIT,
+ bitRate: VALID_PCM_AUDIO_BIT_RATE,
+ bitDepth: VALID_PCM_AUDIO_BIT_DEPTH,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ bit: INVALID_AUDIO_BIT,
+ mimeType: mimeType,
+ channel: VALID_PCM_AUDIO_CHANNEL,
+ sampleRate: VALID_PCM_AUDIO_SAMPLE_RATE,
+ bitRate: VALID_PCM_AUDIO_BIT_RATE,
+ bitDepth: VALID_PCM_AUDIO_BIT_DEPTH,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ bitRate: INVALID_AUDIO_BIT_RATE,
+ mimeType: mimeType,
+ sampleRate: VALID_PCM_AUDIO_SAMPLE_RATE,
+ bit: VALID_PCM_AUDIO_BIT,
+ channel: VALID_PCM_AUDIO_CHANNEL,
+ bitDepth: VALID_PCM_AUDIO_BIT_DEPTH,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ bitDepth: INVALID_AUDIO_BIT_DEPTH,
+ mimeType: mimeType,
+ channel: VALID_PCM_AUDIO_CHANNEL,
+ sampleRate: VALID_PCM_AUDIO_SAMPLE_RATE,
+ bit: VALID_PCM_AUDIO_BIT,
+ bitRate: VALID_PCM_AUDIO_BIT_RATE,
+ audioChannelMap: channelMap));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if audio channel map is not matched with channel")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_THROWS_IF_AUDIOCHANNELMAP_IS_NOT_MATCHED_WITH_CHANNEL()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL + 1,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+
+ channelMap.Add(MediaFormatAudioChannelPosition.FrontCenter);
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if mono position set with other position")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_THROWS_IF_MONO_SET_WITH_OTHER_POSITION()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.Mono, MediaFormatAudioChannelPosition.FrontLeft
+ };
+
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if none position set with other position")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_THROWS_IF_NONE_SET_WITH_OTHER_POSITION()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.None, MediaFormatAudioChannelPosition.FrontLeft
+ };
+
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create AudioMediaFormat instance and check whether instance is created properly.")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, MediaFormatAacType, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_AAC_CHECK_CREATE_CONSTRUCTOR()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+
+ var audioFormat = new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ MediaFormatAacType.None, VALID_PCM_AUDIO_BIT_DEPTH, channelMap);
+
+ Assert.IsNotNull(audioFormat, "Object should not be null after initializing");
+ Assert.IsInstanceOf<AudioMediaFormat>(audioFormat, "Should return AudioMediaFormat instance.");
+ Assert.AreEqual(mimeType, audioFormat.MimeType);
+ Assert.AreEqual(VALID_PCM_AUDIO_CHANNEL, audioFormat.Channel);
+ Assert.AreEqual(VALID_PCM_AUDIO_SAMPLE_RATE, audioFormat.SampleRate);
+ Assert.AreEqual(VALID_PCM_AUDIO_BIT, audioFormat.Bit);
+ Assert.AreEqual(VALID_PCM_AUDIO_BIT_RATE, audioFormat.BitRate);
+ Assert.AreEqual(VALID_PCM_AUDIO_BIT_DEPTH, audioFormat.BitDepth);
+ Assert.AreEqual(MediaFormatAacType.None, audioFormat.AacType);
+
+ AssertHelper.Equals(channelMap, audioFormat.AudioChannelMap);
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if one of the specified parameters is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, MediaFormatAacType, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_AAC_THROWS_IF_PARAM_IS_INVALID()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Aac;
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ channel: INVALID_AUDIO_CHANNEL,
+ mimeType: mimeType,
+ sampleRate: VALID_AUDIO_SAMPLE_RATE,
+ bit: VALID_AUDIO_BIT,
+ bitRate: VALID_AUDIO_BIT_RATE,
+ bitDepth: VALID_AUDIO_BIT_DEPTH,
+ aacType: MediaFormatAacType.Adif,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ sampleRate: INVALID_AUDIO_SAMPLE_RATE,
+ mimeType: mimeType,
+ channel: VALID_AUDIO_CHANNEL,
+ bit: VALID_AUDIO_BIT,
+ bitRate: VALID_AUDIO_BIT_RATE,
+ bitDepth: VALID_AUDIO_BIT_DEPTH,
+ aacType: MediaFormatAacType.Adif,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ bit: INVALID_AUDIO_BIT,
+ mimeType: mimeType,
+ channel: VALID_AUDIO_CHANNEL,
+ sampleRate: VALID_AUDIO_SAMPLE_RATE,
+ bitRate: VALID_AUDIO_BIT_RATE,
+ bitDepth: VALID_AUDIO_BIT_DEPTH,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ bitRate: INVALID_AUDIO_BIT_RATE,
+ mimeType: mimeType,
+ sampleRate: VALID_AUDIO_SAMPLE_RATE,
+ bit: VALID_AUDIO_BIT,
+ channel: VALID_AUDIO_CHANNEL,
+ bitDepth: VALID_AUDIO_BIT_DEPTH,
+ aacType: MediaFormatAacType.Adif,
+ audioChannelMap: channelMap));
+
+ Assert.Throws<ArgumentOutOfRangeException>(
+ () => new AudioMediaFormat(
+ bitDepth: INVALID_AUDIO_BIT_DEPTH,
+ mimeType: mimeType,
+ channel: VALID_AUDIO_CHANNEL,
+ sampleRate: VALID_AUDIO_SAMPLE_RATE,
+ bit: VALID_AUDIO_BIT,
+ bitRate: VALID_AUDIO_BIT_RATE,
+ aacType: MediaFormatAacType.Adif,
+ audioChannelMap: channelMap));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if audio channel map is not matched with channel")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, MediaFormatAacType, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_AAC_THROWS_IF_AUDIOCHANNELMAP_IS_NOT_MATCHED_WITH_CHANNEL()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL + 1,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ MediaFormatAacType.None, VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+
+ channelMap.Add(MediaFormatAudioChannelPosition.FrontCenter);
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ MediaFormatAacType.None, VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if mono position set with other position")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, MediaFormatAacType, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_AAC_THROWS_IF_MONO_SET_WITH_OTHER_POSITION()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.Mono, MediaFormatAudioChannelPosition.FrontLeft
+ };
+
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ MediaFormatAacType.None, VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws exception if none position set with other position")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, MediaFormatAacType, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_AAC_THROWS_IF_NONE_SET_WITH_OTHER_POSITION()
+ {
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.None, MediaFormatAudioChannelPosition.FrontLeft
+ };
+
+ Assert.Throws<ArgumentException>(() => new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ MediaFormatAacType.None, VALID_PCM_AUDIO_BIT_DEPTH, channelMap));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Throws if the specified aac type is not none but the mime type is not a aac type")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioMediaFormat C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, MediaFormatAacType, int, IList<Tizen.Multimedia.MediaFormatAudioChannelPosition>")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioMediaFormat_ChannelMap_AAC_THROWS_IF_AAC_SPECIFIED_WITH_NOT_AAC_MIME_TYPE()
+ {
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+
+ Assert.Throws<ArgumentException>(
+ () => new AudioMediaFormat(MediaFormatAudioMimeType.Flac, VALID_AUDIO_CHANNEL,
+ VALID_AUDIO_SAMPLE_RATE, VALID_AUDIO_BIT, VALID_AUDIO_BIT_RATE,
+ MediaFormatAacType.Adif, VALID_AUDIO_BIT_DEPTH, channelMap));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether AacType returns expected value or not.")]
[Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AacType A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void AacType_READONLY()
{
AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.AacType));
[Test]
[Category("P1")]
- [Description("Bit is read only")]
+ [Description("Check whether Bit returns expected value or not.")]
[Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.Bit A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Bit_READONLY()
{
AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.Bit));
[Test]
[Category("P1")]
- [Description("BitRate is read only")]
+ [Description("Check whether BitRate returns expected value or not.")]
[Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.BitRate A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void BitRate_READONLY()
{
AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.BitRate));
[Test]
[Category("P1")]
- [Description("Channel is read only")]
+ [Description("Check whether Channel returns expected value or not.")]
[Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.Channel A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Channel_READONLY()
{
AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.Channel));
[Test]
[Category("P1")]
- [Description("MimeType is read only")]
+ [Description("Check whether MimeType returns expected value or not.")]
[Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.MimeType A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void MimeType_READONLY()
{
AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.MimeType));
[Test]
[Category("P1")]
- [Description("SampleRate is read only")]
+ [Description("Check whether SampleRate returns expected value or not.")]
[Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.SampleRate A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void SampleRate_READONLY()
{
AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.SampleRate));
[Test]
[Category("P1")]
+ [Description("Check whether BitDepth returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.BitDepth A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void BitDepth_READONLY()
+ {
+ AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.BitDepth));
+
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+
+ var audioFormat = new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ VALID_PCM_AUDIO_BIT_DEPTH, channelMap);
+
+ Assert.That(audioFormat.BitDepth, Is.EqualTo(VALID_PCM_AUDIO_BIT_DEPTH));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether AudioChannelMap returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AudioChannelMap A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void AudioChannelMap_READONLY()
+ {
+ AssertHelper.PropertyReadOnly<AudioMediaFormat>(nameof(AudioMediaFormat.AudioChannelMap));
+
+ const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Pcm;
+ var channelMap = new List<MediaFormatAudioChannelPosition>()
+ {
+ MediaFormatAudioChannelPosition.FrontLeft, MediaFormatAudioChannelPosition.FrontRight
+ };
+
+ var audioFormat = new AudioMediaFormat(mimeType, VALID_PCM_AUDIO_CHANNEL,
+ VALID_PCM_AUDIO_SAMPLE_RATE, VALID_PCM_AUDIO_BIT, VALID_PCM_AUDIO_BIT_RATE,
+ VALID_PCM_AUDIO_BIT_DEPTH, channelMap);
+
+ AssertHelper.Equals(channelMap, audioFormat.AudioChannelMap);
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Compares AudioMediaFormat instances with Equals")]
[Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.Equals M")]
[Property("SPEC_URL", "-")]