예제 #1
0
 public void WriteAvcVideoPacke(AvcVideoPacke videoPacke)
 {
     WriteByte((byte)videoPacke.AvcPacketType);
     if (videoPacke.AvcPacketType == AvcPacketType.SequenceHeader)
     {
         //videoPacke.CompositionTime = 0;
         WriteUInt24(0);
         //AVCDecoderConfigurationRecord
         WriteAVCDecoderConfigurationRecord(videoPacke.AVCDecoderConfiguration);
     }
     else if (videoPacke.AvcPacketType == AvcPacketType.Raw)
     {
         WriteUInt24(videoPacke.CompositionTime);
         if (videoPacke.MultiData != null && videoPacke.MultiData.Count > 0)
         {
             foreach (var item in videoPacke.MultiData)
             {
                 WriteInt32(item.Length);
                 WriteArray(item);
             }
         }
     }
     else
     {
         videoPacke.CompositionTime = 0;
         WriteUInt24(videoPacke.CompositionTime);
         //Empty
     }
 }
예제 #2
0
 public void WriteAvcVideoPacke(AvcVideoPacke videoPacke)
 {
     WriteByte((byte)videoPacke.AvcPacketType);
     if (videoPacke.AvcPacketType == AvcPacketType.SequenceHeader)
     {
         //videoPacke.CompositionTime = 0;
         WriteUInt24(0);
         //AVCDecoderConfigurationRecord
         WriteAVCDecoderConfigurationRecord(videoPacke.AVCDecoderConfiguration);
     }
     else if (videoPacke.AvcPacketType == AvcPacketType.Raw)
     {
         WriteUInt24(videoPacke.CompositionTime);
         //One or more NALUs
         //WriteArray(new byte[] {0,0,0,1});
         WriteInt32(videoPacke.Data.Length);
         WriteArray(videoPacke.Data);
     }
     else
     {
         videoPacke.CompositionTime = 0;
         WriteUInt24(videoPacke.CompositionTime);
         //Empty
     }
 }