Esempio n. 1
0
        /// <summary>
        /// Converts frame into packets
        ///
        /// Note: This method does not currently take into account header extensions in the packet
        /// If we re-add support for optional headers, we would need to use the MaxPayloadSize
        /// property of each packet, and header extensions would have to be set before this method
        /// is called. JVE 6/28/2004
        /// </summary>
        private void Packetize(BufferChunk frame)
        {
            // This assumes length member variable has been set already
            ApproximatePacketsInFrame();

            // We'll find out real number of packets as we build them
            packetsInFrame = 0;

            while (frame.Length > 0)
            {
                RtpPacket packet = GetNextPacket();

                // In the event that we re-add support for custom headers, add that data here
                // before making the call to packet.MaxPayloadSize - 9/23/2004 JVE

                // Copy the MaxPayload amount of data
                packet.Payload = frame.NextBufferChunkMax(packet.MaxPayloadSize);
            }

            WritePacketsInFrame();
        }
Esempio n. 2
0
        /// <summary>
        /// Converts frame into packets
        ///
        /// Note: This method does not currently take into account header extensions in the packet
        /// If we re-add support for optional headers, we would need to use the MaxPayloadSize
        /// property of each packet, and header extensions would have to be set before this method
        /// is called. JVE 6/28/2004
        /// </summary>
        private void Packetize(BufferChunk frame)
        {
            RtpPacket packet;
            int       offset = 0;

            // This assumes length member variable has been set already
            ApproximatePacketsInFrame();

            // We'll find out real number of packets as we build them
            packetsInFrame = 0;

            while (frame.Length > 0)
            {
                // packetsInFrame is increase in the GetNextPacket
                packet = GetNextPacket();

                // In the event that we re-add support for custom headers, add that data here
                // before making the call to packet.MaxPayloadSize - 9/23/2004 JVE

                // jpeg
                packet.JpgSpec    = 0;
                packet.JpgOffset  = offset;
                packet.JpgType    = 1;
                packet.JpgQuality = payloadPara["Quality"].GetHashCode();
                packet.JpgWidth   = payloadPara["Width"].GetHashCode();
                packet.JpgHeight  = payloadPara["Height"].GetHashCode();

                // Copy the MaxPayload amount of data
                packet.Payload = frame.NextBufferChunkMax(packet.MaxPayloadSize);
                offset        += packet.MaxPayloadSize;

                // set marker frame
                if (frame.Length <= 0)
                {
                    packet.Marker = true;
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Converts frame into packets
        /// 
        /// Note: This method does not currently take into account header extensions in the packet
        /// If we re-add support for optional headers, we would need to use the MaxPayloadSize
        /// property of each packet, and header extensions would have to be set before this method 
        /// is called. JVE 6/28/2004
        /// </summary>
        private void Packetize(BufferChunk frame)
        {
            // This assumes length member variable has been set already
            ApproximatePacketsInFrame();

            // We'll find out real number of packets as we build them
            packetsInFrame = 0;

            while(frame.Length > 0)
            {
                RtpPacket packet = GetNextPacket();

                // In the event that we re-add support for custom headers, add that data here 
                // before making the call to packet.MaxPayloadSize - 9/23/2004 JVE

                // Copy the MaxPayload amount of data
                packet.Payload = frame.NextBufferChunkMax(packet.MaxPayloadSize);
            }

            WritePacketsInFrame();
        }
Esempio n. 4
0
        /// <summary>
        /// Converts frame into packets
        /// 
        /// Note: This method does not currently take into account header extensions in the packet
        /// If we re-add support for optional headers, we would need to use the MaxPayloadSize
        /// property of each packet, and header extensions would have to be set before this method 
        /// is called. JVE 6/28/2004
        /// </summary>
        private void Packetize(BufferChunk frame)
        {
            RtpPacket packet;
            int offset = 0;
            // This assumes length member variable has been set already
            ApproximatePacketsInFrame();

            // We'll find out real number of packets as we build them
            packetsInFrame = 0;

            while(frame.Length > 0)
            {
                // packetsInFrame is increase in the GetNextPacket
                packet = GetNextPacket();

                // In the event that we re-add support for custom headers, add that data here 
                // before making the call to packet.MaxPayloadSize - 9/23/2004 JVE

                // jpeg                
                packet.JpgSpec = 0;
                packet.JpgOffset = offset;
                packet.JpgType = 1;
                packet.JpgQuality = payloadPara["Quality"].GetHashCode();
                packet.JpgWidth = payloadPara["Width"].GetHashCode();
                packet.JpgHeight = payloadPara["Height"].GetHashCode();

                // Copy the MaxPayload amount of data
                packet.Payload = frame.NextBufferChunkMax(packet.MaxPayloadSize);
                offset += packet.MaxPayloadSize;

                 // set marker frame
                if (frame.Length <= 0)
                    packet.Marker = true;
           }
        }