Ejemplo n.º 1
0
 public override void WriteBody(Mp4Stream stream)
 {
     if (base.Version == 0)
     {
         stream.WriteUInt32((uint)this.CreationTime);
         stream.WriteUInt32((uint)this.ModificationTime);
         stream.WriteUInt32(this.TimeScale);
         stream.WriteUInt32((uint)this.Duration);
     }
     else
     {
         stream.WriteUInt64(this.CreationTime);
         stream.WriteUInt64(this.ModificationTime);
         stream.WriteUInt32(this.TimeScale);
         stream.WriteUInt64(this.Duration);
     }
     stream.WriteUInt32(this.Rate);
     stream.WriteUInt16(this.Volume);
     stream.Write(this.Reserved1, this.Reserved1.Length);
     stream.Write(this.Reserved2, this.Reserved2.Length);
     for (int i = 0; i < 9; i++)
     {
         stream.WriteUInt32(this.Matrix[i]);
     }
     stream.Write(this.Predefined, this.Predefined.Length);
     stream.WriteUInt32(this.NextTrackId);
 }
Ejemplo n.º 2
0
 public override void WriteBody(Mp4Stream stream)
 {
     if (base.Version == 0)
     {
         stream.WriteUInt32((uint)this.CreationTime);
         stream.WriteUInt32((uint)this.ModificationTime);
         stream.WriteUInt32(this.TrackId);
         stream.WriteUInt32(this.Reserved1);
         stream.WriteUInt32((uint)this.Duration);
     }
     else
     {
         stream.WriteUInt64(this.CreationTime);
         stream.WriteUInt64(this.ModificationTime);
         stream.WriteUInt32(this.TrackId);
         stream.WriteUInt32(this.Reserved1);
         stream.WriteUInt64(this.Duration);
     }
     stream.Write(this.Reserved2, this.Reserved2.Length);
     stream.WriteUInt16(this.Layer);
     stream.WriteUInt16(this.AlternateGroup);
     stream.WriteUInt16(this.Volume);
     stream.WriteUInt16(this.Reserved3);
     for (int i = 0; i < 9; i++)
     {
         stream.WriteUInt32(this.Matrix[i]);
     }
     stream.WriteUInt32(this.Width);
     stream.WriteUInt32(this.Height);
 }
Ejemplo n.º 3
0
 public override void WriteBody(Mp4Stream stream)
 {
     stream.WriteUInt32(this.EntryCount);
     for (int i = 0; i < this.EntryCount; i++)
     {
         stream.WriteUInt64(this.Entries[i]);
     }
 }
Ejemplo n.º 4
0
 public override void WriteBody(Mp4Stream stream)
 {
     if (base.Version == 1)
     {
         stream.WriteUInt64(this.FragmentDuration);
     }
     else
     {
         stream.WriteUInt32((uint)this.FragmentDuration);
     }
 }
Ejemplo n.º 5
0
 public virtual void WriteHeader(Mp4Stream stream)
 {
     stream.WriteUInt32(this.Size);
     stream.WriteUInt32(this.Type);
     if (this.Size == 1)
     {
         stream.WriteUInt64(this.LargeSize);
     }
     if (this.UserType != null)
     {
         stream.Write(this.UserType, this.UserType.Length);
     }
 }
Ejemplo n.º 6
0
        public override void WriteBody(Mp4Stream stream)
        {
            if (base.Version == 0)
            {
                stream.WriteUInt32((uint)this.CreationTime);
                stream.WriteUInt32((uint)this.ModificationTime);
                stream.WriteUInt32(this.TimeScale);
                stream.WriteUInt32((uint)this.Duration);
            }
            else
            {
                stream.WriteUInt64(this.CreationTime);
                stream.WriteUInt64(this.ModificationTime);
                stream.WriteUInt32(this.TimeScale);
                stream.WriteUInt64(this.Duration);
            }
            byte num  = (byte)(this.Language[0] - '`');
            byte num2 = (byte)(this.Language[1] - '`');
            byte num3 = (byte)(this.Language[2] - '`');

            stream.WriteUInt08((byte)((num << 2) | (num2 >> 3)));
            stream.WriteUInt08((byte)((num2 << 5) | num3));
            stream.WriteUInt16(0);
        }
Ejemplo n.º 7
0
 public override void WriteBody(Mp4Stream stream)
 {
     stream.WriteUInt32(this.TrackId);
     if ((base.Flags & 1) != 0)
     {
         stream.WriteUInt64(this.BaseDataOffset);
     }
     if ((base.Flags & 2) != 0)
     {
         stream.WriteUInt32(this.SampleDescriptionIndex);
     }
     if ((base.Flags & 8) != 0)
     {
         stream.WriteUInt32(this.DefaultSampleDuration);
     }
     if ((base.Flags & 0x10) != 0)
     {
         stream.WriteUInt32(this.DefaultSampleSize);
     }
     if ((base.Flags & 0x20) != 0)
     {
         stream.WriteUInt32(this.DefaultSampleFlags);
     }
 }
Ejemplo n.º 8
0
        public override void WriteBody(Mp4Stream stream)
        {
            stream.WriteUInt32(this.TrackId);
            uint num = (uint)(this.Reserved << 6);

            num |= (uint)(this.LengthSizeOfTrafNum << 4);
            num |= (uint)(this.LengthSizeOfTrunNum << 2);
            num |= this.LengthSizeOfSampleNum;
            stream.WriteUInt32(num);
            stream.WriteUInt32((uint)this.NumberOfEntry);
            for (int i = 0; i < this.Entries.Count; i++)
            {
                Mp4TfraEntry entry = this.Entries[i];
                if (base.Version == 1)
                {
                    stream.WriteUInt64(entry.Time);
                    stream.WriteUInt64(entry.MoofOffset);
                }
                else
                {
                    stream.WriteUInt32((uint)entry.Time);
                    stream.WriteUInt32((uint)entry.MoofOffset);
                }
                switch (this.LengthSizeOfTrafNum)
                {
                case 0:
                    stream.WriteUInt08((byte)entry.TrafNumber);
                    break;

                case 1:
                    stream.WriteUInt16((ushort)entry.TrafNumber);
                    break;

                case 2:
                    stream.WriteUInt24(entry.TrafNumber);
                    break;

                case 3:
                    stream.WriteUInt32(entry.TrafNumber);
                    break;
                }
                switch (this.LengthSizeOfTrunNum)
                {
                case 0:
                    stream.WriteUInt08((byte)entry.TrunNumber);
                    break;

                case 1:
                    stream.WriteUInt16((ushort)entry.TrunNumber);
                    break;

                case 2:
                    stream.WriteUInt24(entry.TrunNumber);
                    break;

                case 3:
                    stream.WriteUInt32(entry.TrunNumber);
                    break;
                }
                switch (this.LengthSizeOfSampleNum)
                {
                case 0:
                    stream.WriteUInt08((byte)entry.SampleNumber);
                    break;

                case 1:
                    stream.WriteUInt16((ushort)entry.SampleNumber);
                    break;

                case 2:
                    stream.WriteUInt24(entry.SampleNumber);
                    break;

                case 3:
                    stream.WriteUInt32(entry.SampleNumber);
                    break;
                }
            }
        }