/// <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.ObjectTypeIndication = (DecoderObjectTypes)reader.ReadByte(); byte num = reader.ReadByte(); this.StreamType = (byte)((num >> 2) & 0x3f); this.UpStream = (num & 2) != 0; this.BufferSize = reader.ReadUInt24(); this.MaxBitrate = reader.ReadUInt32(); this.AverageBitrate = reader.ReadUInt32(); ReadSubDescriptors(reader, initialOffset); }
private uint ReadIntValueFromBytes(BoxBinaryReader reader, byte numberOfBytes) { switch (numberOfBytes) { case 0: return(reader.ReadByte()); case 1: return(reader.ReadUInt16()); case 2: return(reader.ReadUInt24()); case 3: return(reader.ReadUInt32()); default: throw new BoxException("Specified number of bytes to parse an integer is not supported in the traf box."); } }
/// <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) { this.DefaultIsEntrypted = reader.ReadUInt24(); this.DefaultIVSize = reader.ReadByte(); this.DefaultKID = reader.ReadGuid(); }
private uint ReadIntValueFromBytes(BoxBinaryReader reader, byte numberOfBytes) { switch (numberOfBytes) { case 0: return reader.ReadByte(); case 1: return reader.ReadUInt16(); case 2: return reader.ReadUInt24(); case 3: return reader.ReadUInt32(); default: throw new BoxException("Specified number of bytes to parse an integer is not supported in the traf box."); } }