예제 #1
0
 public FileTypeBox(FourCC majorBrand, uint minorVersion, FourCC[] compatibleBrands)
     : this()
 {
     MajorBrand = majorBrand;
     MinorVersion = minorVersion;
     foreach(FourCC fourCC in compatibleBrands) _CompatibleBrands.Add(fourCC);
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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;
        }
예제 #5
0
        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()));
            }
        }
예제 #6
0
        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;
            }
        }
예제 #7
0
 public override string ToString()
 {
     return(FourCC == UUID_FOURCC?string.Format("uuid({0})", UserType.ToString()) : FourCC.ToString());
 }
예제 #8
0
파일: BoxType.cs 프로젝트: mcguirepr/bmff
 public override string ToString()
 {
     return(FourCC == UUID_FOURCC ? $"uuid({UserType})" : FourCC.ToString());
 }
예제 #9
0
 public bool IsCompatibleWith(FourCC brand)
 {
     if (MajorBrand == brand) return true;
     if (_CompatibleBrands.Contains(brand)) return true;
     return false;
 }