Example #1
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);
        }
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(Width);
            stream.WriteBEUInt32(Height);
        }
Example #3
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(TrackID);
            stream.WriteBEUInt32(DefaultSampleDescriptionIndex);
            stream.WriteBEUInt32(DefaultSampleDuration);
            stream.WriteBEUInt32(DefaultSampleSize);
            stream.WriteBEUInt32(DefaultSampleFlags._flags);
        }
Example #4
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt16(MaxProtocolDataUnitSize);
            stream.WriteBEUInt16(AverageProtocolDataUnitSize);
            stream.WriteBEUInt32(MaxBitrate);
            stream.WriteBEUInt32(AverageBitrate);
            stream.WriteBEUInt32(_Reserved);
        }
Example #5
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(_Predefined);
            stream.WriteBEUInt32(HandlerType);
            for (int i = 0; i < _Reserved.Length; i++) stream.WriteBEUInt32(_Reserved[i]);
            if(Name != null)
                stream.WriteUTF8String(Name);
        }
Example #6
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(_Height);
            stream.WriteBEUInt32(_Width);
            stream.WriteBEUInt16(_NumberOfComponents);
            stream.WriteOneByte(BitsPerComponent);
            stream.WriteOneByte(_CompressionType);
            stream.WriteOneByte(_IsUnknownColorspace);
            stream.WriteOneByte(_IsIntellectualProperty);
        }
Example #7
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteNullTerminatedUTF8String(Alias);
            stream.WriteBEUInt32(ResourceType);
            stream.WriteBEInt16(Id);
        }
Example #8
0
        protected override void SaveToStream(Stream stream)
        {
            if(FragmentDuration > UInt32.MaxValue) Version = 1;

            base.SaveToStream(stream);

            if (Version == 1) stream.WriteBEUInt64(FragmentDuration);
            else stream.WriteBEUInt32((uint)FragmentDuration);
        }
Example #9
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteOneByte((byte)SpecificationMethod);
            stream.WriteOneByte(Precedence);
            stream.WriteOneByte(ColorspaceApproximation);
            if (SpecificationMethod == SpecificationMethods.EnumeratedColorspace)
                stream.WriteBEUInt32((uint)EnumeratedColorspace);
            // TODO: Write Profile
        }
Example #10
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);
            stream.WriteBytes(MajorBrand.GetBytes());
            stream.WriteBEUInt32(MinorVersion);

            foreach (FourCC compatibleBrand in _CompatibleBrands)
            {
                stream.WriteBytes(compatibleBrand.GetBytes());
            }
        }
Example #11
0
        protected override void SaveToStream(Stream stream)
        {
            TrackFragmentFlags newFlags = 0;
            if (BaseDataOffset.HasValue) newFlags |= TrackFragmentFlags.BaseDataOffsetPresent;
            if (SampleDescriptionIndex.HasValue) newFlags |= TrackFragmentFlags.SampleDrescriptionIndexPresent;
            if (DefaultSampleDuration.HasValue) newFlags |= TrackFragmentFlags.DefaultSampleDurationPresent;
            if (DefaultSampleSize.HasValue) newFlags |= TrackFragmentFlags.DefaultSampleSizePresent;
            if (DefaultSampleFlags != null) newFlags |= TrackFragmentFlags.DefaultSampleFlagsPresent;
            if (DurationIsEmpty) newFlags |= TrackFragmentFlags.DurationIsEmpty;

            Flags = newFlags;

            base.SaveToStream(stream);

            stream.WriteBEUInt32(TrackID);
            if (BaseDataOffset.HasValue) stream.WriteBEUInt64(BaseDataOffset.Value);
            if (SampleDescriptionIndex.HasValue) stream.WriteBEUInt32(SampleDescriptionIndex.Value);
            if (DefaultSampleDuration.HasValue) stream.WriteBEUInt32(DefaultSampleDuration.Value);
            if (DefaultSampleSize.HasValue) stream.WriteBEUInt32(DefaultSampleSize.Value);
            if (DefaultSampleFlags!=null) stream.WriteBEUInt32(DefaultSampleFlags._flags);
        }
Example #12
0
        protected override void SaveToStream(Stream stream)
        {
            if (Version==0 && 
                (_CreationTime > uint.MaxValue || 
                _ModificationTime > uint.MaxValue || 
                Duration > uint.MaxValue)) Version = 1;

            base.SaveToStream(stream);

            if (Version == 1)
            {
                stream.WriteBEUInt64(_CreationTime);
                stream.WriteBEUInt64(_ModificationTime);
                stream.WriteBEUInt32(TimeScale);
                stream.WriteBEUInt64(Duration);
            }
            else // if(Version == 0)
            {
                stream.WriteBEUInt32(checked((uint)_CreationTime));
                stream.WriteBEUInt32(checked((uint)_ModificationTime));
                stream.WriteBEUInt32(TimeScale);
                stream.WriteBEUInt32(checked((uint)Duration));
            }
            stream.WriteBEInt32(_Rate);
            stream.WriteBEInt16(_Volume);
            stream.WriteBytes(Reserved);
            for (int i = 0; i < 9; i++) stream.WriteBEInt32(Matrix[i]);
            stream.WriteBytes(PreDefined);
            stream.WriteBEUInt32(NextTrackID);
        }
Example #13
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);
        }
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(MfraSize);
        }
Example #15
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(DataFormat);
        }
Example #16
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32((uint)_Children.Count);
        }
Example #17
0
 protected override void SaveChildrenToStream(Stream stream)
 {
     base.SaveChildrenToStream(stream);
     stream.WriteBEUInt32(0);
 }
Example #18
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(SequenceNumber);
        }
Example #19
0
        protected override void SaveToStream(Stream stream)
        {
            base.SaveToStream(stream);

            stream.WriteBEUInt32(UncompressedSize);
        }