Пример #1
0
        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            if (Version == 1)
            {
                CreationTime     = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                TrackID          = stream.ReadBEUInt32();
                Reserved1        = stream.ReadBEUInt32();
                Duration         = stream.ReadBEUInt64();
            }
            else // if (Version == 0)
            {
                CreationTime     = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                TrackID          = stream.ReadBEUInt32();
                Reserved1        = stream.ReadBEUInt32();
                Duration         = stream.ReadBEUInt32();
            }

            Reserved2      = stream.ReadBEUInt64();
            Layer          = stream.ReadBEInt16();
            AlternateGroup = stream.ReadBEInt16();
            Volume         = stream.ReadBEInt16();
            Reserved3      = stream.ReadBEUInt16();

            for (int i = 0; i < 9; i++)
            {
                Matrix[i] = stream.ReadBEInt32();
            }

            Width  = stream.ReadBEUInt32();
            Height = stream.ReadBEUInt32();
        }
Пример #2
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            if (Version == 1)
            {
                stream.WriteBEUInt64(MovieHeaderBox.Convert1904Time(CreationTime));
                stream.WriteBEUInt64(MovieHeaderBox.Convert1904Time(ModificationTime));
                stream.WriteBEUInt32(TrackID);
                stream.WriteBEUInt32(_Reserved1);
                stream.WriteBEUInt64(Duration);
            }
            else // if (Version == 0)
            {
                stream.WriteBEUInt32((uint)MovieHeaderBox.Convert1904Time(CreationTime));
                stream.WriteBEUInt32((uint)MovieHeaderBox.Convert1904Time(ModificationTime));
                stream.WriteBEUInt32(TrackID);
                stream.WriteBEUInt32(_Reserved1);
                stream.WriteBEUInt32((uint)Duration);
            }
            for (int i = 0; i < 2; i++)
            {
                stream.WriteBEUInt32(_Reserved2[i]);
            }
            stream.WriteBEInt16(Layer);
            stream.WriteBEInt16(AlternateGroup);
            stream.WriteBEInt16(Volume);
            stream.WriteBEUInt16(_Reserved3);
            for (int i = 0; i < 9; i++)
            {
                stream.WriteBEInt32(_Matrix[i]);
            }
            stream.WriteBEUInt32(Width);
            stream.WriteBEUInt32(Height);
        }
Пример #3
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            if (Version == 1)
            {
                stream.WriteBEUInt64(MovieHeaderBox.Convert1904Time(CreationTime));
                stream.WriteBEUInt64(MovieHeaderBox.Convert1904Time(ModificationTime));
                stream.WriteBEUInt32(TimeScale);
                stream.WriteBEUInt64(Duration);
            }
            else // if (Version == 0)
            {
                stream.WriteBEUInt32((uint)MovieHeaderBox.Convert1904Time(CreationTime));
                stream.WriteBEUInt32((uint)MovieHeaderBox.Convert1904Time(ModificationTime));
                stream.WriteBEUInt32(TimeScale);
                stream.WriteBEUInt32((uint)Duration);
            }

            stream.WriteBEUInt16(ConvertThreeLetterLanguageCode(Language));
            stream.WriteBEUInt16(Predefined);
        }
Пример #4
0
        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            if (Version == 1)
            {
                CreationTime     = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                TimeScale        = stream.ReadBEUInt32();
                Duration         = stream.ReadBEUInt64();
            }
            else // if (Version == 0)
            {
                CreationTime     = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                TimeScale        = stream.ReadBEUInt32();
                Duration         = stream.ReadBEUInt32();
            }

            Language   = ConvertThreeLetterLanguageCode(stream.ReadBEUInt16());
            Predefined = stream.ReadBEUInt16();
        }