예제 #1
0
        private static int CalculateHeaderSize(RtmpHeader header, RtmpHeader lastHeader)
        {
            int        num;
            HeaderType headerType = GetHeaderType(header, lastHeader);

            if (header.ChannelId > 320)
            {
                num = 2;
            }
            else if (header.ChannelId > 0x3f)
            {
                num = 1;
            }
            else
            {
                num = 0;
            }
            return(RtmpHeader.GetHeaderLength(headerType) + num);
        }
예제 #2
0
        /// <summary>
        /// Calculate number of bytes necessary to encode the header.
        /// </summary>
        /// <param name="header">RTMP message header</param>
        /// <param name="lastHeader">Previous header</param>
        /// <returns>Calculated size</returns>
        private static int CalculateHeaderSize(RtmpHeader header, RtmpHeader lastHeader)
        {
            HeaderType headerType = GetHeaderType(header, lastHeader);
            int        channelIdAdd;

            if (header.ChannelId > 320)
            {
                channelIdAdd = 2;
            }
            else if (header.ChannelId > 63)
            {
                channelIdAdd = 1;
            }
            else
            {
                channelIdAdd = 0;
            }

            return(RtmpHeader.GetHeaderLength(headerType) + channelIdAdd);
        }