/// <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) { if (base.Version == 0) { this.CreationTimeUtc = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt32()); this.ModificationTimeUtc = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt32()); this.TimeScale = reader.ReadUInt32(); this.Duration = reader.ReadUInt32(); } else { this.CreationTimeUtc = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt64()); this.ModificationTimeUtc = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt64()); this.TimeScale = reader.ReadUInt32(); this.Duration = reader.ReadUInt64(); } this.Rate = reader.ReadUInt32(); this.Volume = reader.ReadUInt16(); reader.Read(reserved1, 0, reserved1.Length); reader.Read(reserved2, 0, reserved2.Length); for (int i = 0; i < 9; i++) { matrix[i] = reader.ReadUInt32(); } reader.Read(predefined, 0, predefined.Length); this.NextTrackId = reader.ReadUInt32(); }
/// <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) { if (this.Version == 0) { this.CreationTime = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt32()); this.ModificationTime = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt32()); this.TrackId = reader.ReadUInt32(); reserved1 = reader.ReadUInt32(); this.Duration = reader.ReadUInt32(); } else { this.CreationTime = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt64()); this.ModificationTime = Converter.SecondsOffsetToDateTimeUtc(reader.ReadUInt64()); this.TrackId = reader.ReadUInt32(); reserved1 = reader.ReadUInt32(); this.Duration = reader.ReadUInt64(); } reader.Read(reserved2, 0, 8); this.Layer = reader.ReadUInt16(); this.AlternateGroup = reader.ReadUInt16(); this.Volume = reader.ReadUInt16(); reserved3 = reader.ReadUInt16(); for (int i = 0; i < 9; i++) { matrix[i] = reader.ReadUInt32(); } this.Width = reader.ReadUInt32(); this.Height = reader.ReadUInt32(); }
/// <summary> /// Reads the sample entry properties from stream. /// </summary> /// <param name="reader">The stream reader.</param> internal override void ReadSampleEntryPropertiesFromStream(BoxBinaryReader reader) { predefined1 = reader.ReadUInt16(); reserved1 = reader.ReadUInt16(); predefined2 = reader.ReadBytes(12); this.Width = reader.ReadUInt16(); this.Height = reader.ReadUInt16(); this.HorizResolution = reader.ReadUInt32(); this.VertResolution = reader.ReadUInt32(); reserved2 = reader.ReadUInt32(); this.FrameCount = reader.ReadUInt16(); byte[] buffer = new byte[0x20]; reader.Read(buffer, 0, 0x20); int count = buffer[0]; if (count < 0x20) { this.CompressorName = Encoding.UTF8.GetString(buffer, 1, count); } this.Depth = reader.ReadUInt16(); predefined3 = reader.ReadUInt16(); if (reader.PeekNextBoxType() != BoxType.Null) { ReadInnerBoxes(reader, BoxType.Esds, BoxType.Avcc, BoxType.Avc1, BoxType.Dvc1, BoxType.Btrt, BoxType.Sinf); this.VideoCodecData = GetVideoCodecDataFromInnerBoxes(); } else { var videoInfoHeader = new VideoInfoHeader2(reader); this.VideoCodecData = new VideoTrackCodecData(videoInfoHeader); } }
/// <summary> /// Reads the descriptor properties from stream. /// </summary> /// <param name="reader">The binary reader with the stream.</param> protected override void ReadDescriptorPropertiesFromStream(BoxBinaryReader reader) { var initialOffset = reader.Offset; this.ElementaryStreamId = reader.ReadUInt16(); byte num = reader.ReadByte(); this.Flags = (uint)((num >> 5) & 7); this.StreamPriority = (byte)(num & 0x1f); if ((this.Flags & 1) != 0) { this.DependsOn = reader.ReadUInt16(); } else { this.DependsOn = 0; } if ((this.Flags & 2) != 0) { byte count = reader.ReadByte(); if (count != 0) { byte[] buffer = new byte[count + 1]; reader.Read(buffer, 0, count); buffer[count] = 0; this.Url = Encoding.UTF8.GetString(buffer, 0, count); } } if ((this.Flags & 2) != 0) { this.OcrElementaryStreamId = reader.ReadUInt16(); } else { this.OcrElementaryStreamId = 0; } ReadSubDescriptors(reader, initialOffset); }
/// <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) { BaseLocation = reader.ReadString(256); PurchaseLocation = reader.ReadString(256); reader.Read(reserved, 0, 512); }