コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WaveFormatEx"/> class.
 /// </summary>
 /// <param name="reader">The binary stream reader.</param>
 public WaveFormatEx(BoxBinaryReader reader)
 {
     this.FormatTag      = reader.ReadInt16();
     this.Channels       = reader.ReadInt16();
     this.SamplesPerSec  = reader.ReadInt32();
     this.AvgBytesPerSec = reader.ReadInt32();;
     this.BlockAlign     = reader.ReadInt16();
     this.BitsPerSample  = reader.ReadInt16();
     this.Size           = reader.ReadInt16();
     if (this.Size > 0)
     {
         this.ExtendedData = reader.ReadBytes(this.Size);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WaveFormatEx"/> class.
 /// </summary>
 /// <param name="reader">The binary stream reader.</param>
 public WaveFormatEx(BoxBinaryReader reader)
 {
     this.FormatTag = reader.ReadInt16();
     this.Channels = reader.ReadInt16();
     this.SamplesPerSec = reader.ReadInt32();
     this.AvgBytesPerSec = reader.ReadInt32(); ;
     this.BlockAlign = reader.ReadInt16();
     this.BitsPerSample = reader.ReadInt16();
     this.Size = reader.ReadInt16();
     if (this.Size > 0)
     {
         this.ExtendedData = reader.ReadBytes(this.Size);
     }
 }
 /// <summary>
 /// Reads the full box properties from stream.
 /// </summary>
 /// <param name="reader">The binary reader with the stream.</param>
 protected override void ReadFullBoxPropertiesFromStream(BoxBinaryReader reader)
 {
     switch (this.Version)
     {
         case 1:
             this.BaseMediaDecodeTime = reader.ReadInt64();
             break;
         case 0:
             this.BaseMediaDecodeTime = reader.ReadInt32();
             break;
     }
 }
        /// <summary>
        /// Reads the full box properties from stream.
        /// </summary>
        /// <param name="reader">The binary reader with the stream.</param>
        protected override void ReadFullBoxPropertiesFromStream(BoxBinaryReader reader)
        {
            switch (this.Version)
            {
            case 1:
                this.BaseMediaDecodeTime = reader.ReadInt64();
                break;

            case 0:
                this.BaseMediaDecodeTime = reader.ReadInt32();
                break;
            }
        }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VideoInfoHeader2"/> class.
        /// </summary>
        /// <param name="reader">The box binary reader.</param>
        public VideoInfoHeader2(BoxBinaryReader reader)
        {
            this.SourceRectangle = new Rectangle(reader);
            this.TargetRectangle = new Rectangle(reader);

            this.BitRate             = reader.ReadInt32();
            this.BitErrorRate        = reader.ReadInt32();
            this.AverageTimePerFrame = reader.ReadInt64();
            this.Interlace           = (InterlaceFlags)reader.ReadInt32();
            this.CopyProtect         = (CopyProtectFlags)reader.ReadInt32();
            this.PictureAspectRatioX = reader.ReadInt32();
            this.PictureAspectRatioY = reader.ReadInt32();
            this.Control             = (ControlFlags)reader.ReadInt32();
            this.Reserved2           = reader.ReadInt32();

            this.BitmapInformationHeader = new BitmapInfonHeader(reader);
        }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BitmapInfonHeader"/> class.
        /// </summary>
        /// <param name="reader">The box binary reader.</param>
        public BitmapInfonHeader(BoxBinaryReader reader)
        {
            var initialOffset = reader.Offset;

            this.Size            = reader.ReadInt32();
            this.Width           = reader.ReadInt32();
            this.Height          = reader.ReadInt32();
            this.Planes          = reader.ReadInt16();
            this.BitCount        = reader.ReadInt16();
            this.Compression     = reader.ReadString(4);
            this.ImageSize       = reader.ReadInt32();
            this.XPixelsPerMeter = reader.ReadInt32();
            this.YPixelsPerMeter = reader.ReadInt32();
            this.ColorsUsed      = reader.ReadInt32();
            this.ColorsImportant = reader.ReadInt32();

            this.CodecPrivateData = reader.ReadBytes(this.Size - (int)(reader.Offset - initialOffset));
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VideoInfoHeader2"/> class.
        /// </summary>
        /// <param name="reader">The box binary reader.</param>
        public VideoInfoHeader2(BoxBinaryReader reader)
        {
            this.SourceRectangle = new Rectangle(reader);
            this.TargetRectangle = new Rectangle(reader);

            this.BitRate = reader.ReadInt32();
            this.BitErrorRate = reader.ReadInt32();
            this.AverageTimePerFrame = reader.ReadInt64();
            this.Interlace = (InterlaceFlags)reader.ReadInt32();
            this.CopyProtect = (CopyProtectFlags)reader.ReadInt32();
            this.PictureAspectRatioX = reader.ReadInt32();
            this.PictureAspectRatioY = reader.ReadInt32();
            this.Control = (ControlFlags)reader.ReadInt32();
            this.Reserved2 = reader.ReadInt32();

            this.BitmapInformationHeader = new BitmapInfonHeader(reader);
        }