public FileTypeBox(FourCC majorBrand, uint minorVersion, FourCC[] compatibleBrands) : this() { MajorBrand = majorBrand; MinorVersion = minorVersion; foreach(FourCC fourCC in compatibleBrands) _CompatibleBrands.Add(fourCC); }
public BoxType(FourCC fourcc) { _FourCC = fourcc; byte[] uuidBytes = new byte[16]; Buffer.BlockCopy(_FourCC.GetBytes(), 0, uuidBytes, 0, 4); Buffer.BlockCopy(BASE_UUID, 4, uuidBytes, 4, 12); _UserType = new Guid(uuidBytes); }
public BoxType(Guid uuid) { _UserType = uuid; bool isBaseType = true; byte[] uuidBytes = uuid.ToByteArray(); for (int i = 4; i < 16; i++) if (uuidBytes[i] != BASE_UUID[i]) isBaseType=false; if (isBaseType) _FourCC = new FourCC(BitConverter.ToUInt32(uuidBytes, 0).NetworkToHostOrder()); else _FourCC = UUID_FOURCC; }
protected override void LoadFromStream(Stream stream) { base.LoadFromStream(stream); MajorBrand = new FourCC(stream.ReadBEUInt32()); MinorVersion = stream.ReadBEUInt32(); ulong remainingBytes = EffectiveSize - CalculateSize(); ulong numBrands = remainingBytes / 4; for (ulong i = 0; i < numBrands ; i++) { _CompatibleBrands.Add(new FourCC(stream.ReadBEUInt32())); } }
public BoxType(Guid uuid) { _UserType = uuid; bool isBaseType = true; byte[] uuidBytes = uuid.ToByteArray(); for (int i = 4; i < 16; i++) { if (uuidBytes[i] != BASE_UUID[i]) { isBaseType = false; } } if (isBaseType) { _FourCC = new FourCC(BitConverter.ToUInt32(uuidBytes, 0).NetworkToHostOrder()); } else { _FourCC = UUID_FOURCC; } }
public override string ToString() { return(FourCC == UUID_FOURCC?string.Format("uuid({0})", UserType.ToString()) : FourCC.ToString()); }
public override string ToString() { return(FourCC == UUID_FOURCC ? $"uuid({UserType})" : FourCC.ToString()); }
public bool IsCompatibleWith(FourCC brand) { if (MajorBrand == brand) return true; if (_CompatibleBrands.Contains(brand)) return true; return false; }