Ejemplo n.º 1
0
 private void writeToVideoStream(DateTime time, DataType type, byte[] buffer)
 {
     if (type != DataType.StopSign)
     {
         StreamPacket data  = new StreamPacket(time, type, buffer);
         byte[]       block = StreamPacket.Encode(data);
         writeBuffer(_fsStream, block);
     }
 }
Ejemplo n.º 2
0
 public static byte[] Encode(VideoStreamsPacket packet)
 {
     using (MemoryStream ms = new MemoryStream())
     {
         PacketBase.WriteBytes(ms, TimePeriodPacket.Encode(packet.TimePeriod));
         PacketBase.WriteBytes(ms, packet.VideoStreams.Length);
         for (int i = 0; i < packet.VideoStreams.Length; i++)
         {
             PacketBase.WriteBytes(ms, StreamPacket.Encode(packet.VideoStreams[i]));
         }
         return(ms.ToArray());
     }
 }