本文整理汇总了C#中BufferChunk.NextBufferChunkMax方法的典型用法代码示例。如果您正苦于以下问题:C# BufferChunk.NextBufferChunkMax方法的具体用法?C# BufferChunk.NextBufferChunkMax怎么用?C# BufferChunk.NextBufferChunkMax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BufferChunk
的用法示例。
在下文中一共展示了BufferChunk.NextBufferChunkMax方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Packetize
/// <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();
}
示例2: Packetize
/// <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;
}
}