Exemplo n.º 1
0
 public static AviStream ParseStreamList (ByteVector data)
 {
    if (data == null)
       throw new ArgumentNullException ("data");
    
    AviStream stream = null;
    int pos = 4;
    
    if (data.StartsWith ("strl"))
       while (pos + 8 < data.Count)
       {
          ByteVector id = data.Mid (pos, 4);
          int block_length = (int) data.Mid (pos + 4, 4).ToUInt (false);
          
          if (id == "strh" && stream == null)
          {
             AviStreamHeader stream_header = new AviStreamHeader (data, pos + 8);
             if (stream_header.Type == "vids")
                stream = new AviVideoStream (stream_header);
             else if (stream_header.Type == "auds")
                stream = new AviAudioStream (stream_header);
          }
          else if (stream != null)
             stream.ParseItem (id, data, pos + 8, block_length);
          
          pos += block_length + 8;
       }
    
    return stream;
 }
Exemplo n.º 2
0
        public static AviStream ParseStreamList(ByteVector data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            AviStream stream = null;
            int       pos    = 4;

            if (data.StartsWith("strl"))
            {
                while (pos + 8 < data.Count)
                {
                    ByteVector id           = data.Mid(pos, 4);
                    int        block_length = (int)data.Mid(pos + 4, 4).ToUInt(false);

                    if (id == "strh" && stream == null)
                    {
                        AviStreamHeader stream_header = new AviStreamHeader(data, pos + 8);
                        if (stream_header.Type == "vids")
                        {
                            stream = new AviVideoStream(stream_header);
                        }
                        else if (stream_header.Type == "auds")
                        {
                            stream = new AviAudioStream(stream_header);
                        }
                    }
                    else if (stream != null)
                    {
                        stream.ParseItem(id, data, pos + 8, block_length);
                    }

                    pos += block_length + 8;
                }
            }

            return(stream);
        }
Exemplo n.º 3
0
 public AviAudioStream(AviStreamHeader stream_header) : base(stream_header)
 {
 }
Exemplo n.º 4
0
 protected AviStream(AviStreamHeader header)
 {
     this.header = header;
 }
Exemplo n.º 5
0
 public AviVideoStream(AviStreamHeader stream_header) : base(stream_header)
 {
 }
Exemplo n.º 6
0
 public AviVideoStream (AviStreamHeader stream_header) : base (stream_header)
 {
 }
Exemplo n.º 7
0
 public AviAudioStream (AviStreamHeader stream_header) : base (stream_header)
 {
 }
Exemplo n.º 8
0
 protected AviStream (AviStreamHeader header)
 {
    this.header = header;
 }