Example #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;
 }
 public static AviStream ParseStreamList(ByteVector data)
 {
     int num2;
     if (data == null)
     {
         throw new ArgumentNullException("data");
     }
     if (!data.StartsWith("strl"))
     {
         return null;
     }
     AviStream stream = null;
     for (int i = 4; (i + 8) < data.Count; i += num2 + 8)
     {
         ByteVector id = data.Mid(i, 4);
         num2 = (int) data.Mid(i + 4, 4).ToUInt(false);
         if ((id == "strh") && (stream == null))
         {
             AviStreamHeader header = new AviStreamHeader(data, i + 8);
             if (header.Type == "vids")
             {
                 stream = new AviVideoStream(header);
             }
             else if (header.Type == "auds")
             {
                 stream = new AviAudioStream(header);
             }
         }
         else if (stream != null)
         {
             stream.ParseItem(id, data, i + 8, num2);
         }
     }
     return stream;
 }
Example #3
0
        /// <summary>
        ///    Parses a raw AVI stream list and returns the stream
        ///    information.
        /// </summary>
        /// <param name="data">
        ///    A <see cref="ByteVector" /> object containing raw stream
        ///    list.
        /// </param>
        /// <returns>
        ///    A <see cref="AviStream" /> object containing stream
        ///    information.
        /// </returns>
        public static AviStream ParseStreamList(ByteVector data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }


            if (!data.StartsWith("strl"))
            {
                return(null);
            }

            AviStream stream = null;
            int       pos    = 4;

            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);
        }
Example #4
0
 public AviVideoStream (AviStreamHeader stream_header) : base (stream_header)
 {
 }
Example #5
0
 public AviAudioStream (AviStreamHeader stream_header) : base (stream_header)
 {
 }
Example #6
0
 protected AviStream (AviStreamHeader header)
 {
    this.header = header;
 }
Example #7
0
		/// <summary>
		///    Constructs and intializes a new instance of <see
		///    cref="AviVideoStream" /> with a specified stream header.
		/// </summary>
		/// <param name="header">
		///   A <see cref="AviStreamHeader"/> object containing the
		///   stream's header.
		/// </param>
		public AviVideoStream (AviStreamHeader header)
			: base (header)
		{
		}
Example #8
0
		/// <summary>
		///    Constructs and intializes a new instance of <see
		///    cref="AviAudioStream" /> with a specified stream header.
		/// </summary>
		/// <param name="header">
		///   A <see cref="AviStreamHeader"/> object containing the
		///   stream's header.
		/// </param>
		public AviAudioStream (AviStreamHeader header)
			: base (header)
		{
		}
Example #9
0
 public AviAudioStream(AviStreamHeader stream_header) : base(stream_header)
 {
 }
Example #10
0
 protected AviStream(AviStreamHeader header)
 {
     this.header = header;
 }
Example #11
0
 public AviVideoStream(AviStreamHeader stream_header) : base(stream_header)
 {
 }
Example #12
0
 /// <summary>
 ///    Constructs and intializes a new instance of <see
 ///    cref="AviVideoStream" /> with a specified stream header.
 /// </summary>
 /// <param name="header">
 ///   A <see cref="AviStreamHeader"/> object containing the
 ///   stream's header.
 /// </param>
 public AviVideoStream(AviStreamHeader header)
     : base(header)
 {
 }
Example #13
0
 /// <summary>
 ///    Constructs and intializes a new instance of <see
 ///    cref="AviAudioStream" /> with a specified stream header.
 /// </summary>
 /// <param name="header">
 ///   A <see cref="AviStreamHeader"/> object containing the
 ///   stream's header.
 /// </param>
 public AviAudioStream(AviStreamHeader header)
     : base(header)
 {
 }
Example #14
0
 /// <summary>
 ///    Constructs and intializes a new instance of <see
 ///    cref="AviStream" /> with a specified stream header.
 /// </summary>
 /// <param name="header">
 ///   A <see cref="AviStreamHeader"/> object containing the
 ///   stream's header.
 /// </param>
 protected AviStream(AviStreamHeader header)
 {
     Header = header;
 }