示例#1
0
        public void CheckLengthForSingleBytePicutreIDTest()
        {
            Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);

            byte[] rawHeader = new byte[] { 0x80, 0x80, 0x7F };

            var vp8Header = RTPVP8Header.GetVP8Header(rawHeader);

            Assert.AreEqual(3, vp8Header.PayloadDescriptorLength);
        }
        public void CheckLengthForTwoBytePicutreIDTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            byte[] rawHeader = new byte[] { 0x80, 0x80, 0x80, 0x01 };

            var vp8Header = RTPVP8Header.GetVP8Header(rawHeader);

            Assert.Equal(4, vp8Header.PayloadDescriptorLength);
        }
示例#3
0
        public void ReversePartitionSizeTest()
        {
            Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);

            RTPVP8Header rtpVP8Header = new RTPVP8Header()
            {
                StartOfVP8Partition = true,
                FirstPartitionSize  = 5897
            };

            byte[] headerBuffer = rtpVP8Header.GetBytes();

            var mirroredHeader = RTPVP8Header.GetVP8Header(rtpVP8Header.GetBytes());

            Assert.AreEqual(rtpVP8Header.FirstPartitionSize, mirroredHeader.FirstPartitionSize);
        }
示例#4
0
        public void ParseKnownVP8HeaderTest()
        {
            Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);

            byte[] rawHeader = new byte[] { 0x90, 0x80, 0x00, 0x30, 0xd4, 0x00 };

            var knownHeader = RTPVP8Header.GetVP8Header(rawHeader);
            var outputBytes = knownHeader.GetBytes();

            Assert.AreEqual(knownHeader.FirstPartitionSize, 1697);

            for (int index = 0; index < rawHeader.Length; index++)
            {
                Assert.AreEqual(rawHeader[index], outputBytes[index]);
            }
        }
        public void ReversePartitionSizeTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            RTPVP8Header rtpVP8Header = new RTPVP8Header()
            {
                StartOfVP8Partition = true,
                FirstPartitionSize  = 5897
            };

            byte[] headerBuffer = rtpVP8Header.GetBytes();

            var mirroredHeader = RTPVP8Header.GetVP8Header(rtpVP8Header.GetBytes());

            Assert.Equal(rtpVP8Header.FirstPartitionSize, mirroredHeader.FirstPartitionSize);
        }
        public void ParseKnownVP8HeaderTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            byte[] rawHeader = new byte[] { 0x90, 0x80, 0x00, 0x30, 0xd4, 0x00 };

            var knownHeader = RTPVP8Header.GetVP8Header(rawHeader);
            var outputBytes = knownHeader.GetBytes();

            Assert.Equal(1697, knownHeader.FirstPartitionSize);

            for (int index = 0; index < rawHeader.Length; index++)
            {
                Assert.Equal(rawHeader[index], outputBytes[index]);
            }
        }