Ejemplo n.º 1
0
        public void ToBuffer(ref FMp4MessagePackWriter writer)
        {
            Start(ref writer);
            if (MovieFragmentHeaderBox != null)
            {
                MovieFragmentHeaderBox.ToBuffer(ref writer);
            }
            if (TrackFragmentBox != null)
            {
                TrackFragmentBox.ToBuffer(ref writer);
            }
            End(ref writer);
            var moofOffsetPosition = writer.GetMoofOffsetPosition();

            if (moofOffsetPosition > 0)
            {
                writer.WriteUInt64Return((ulong)writer.GetCurrentPosition(), moofOffsetPosition);
            }
            writer.ClearMoofOffsetPosition();
            var trunOffsetPosition = writer.GetTrunOffsetPosition();

            if (trunOffsetPosition > 0)
            {
                writer.WriteInt32Return(writer.GetCurrentPosition() - SizePosition + 8, trunOffsetPosition);
                writer.ClearTrunOffsetPosition();
            }
        }
Ejemplo n.º 2
0
 public void ToBuffer(ref FMp4MessagePackWriter writer)
 {
     Start(ref writer);
     if (MovieFragmentHeaderBox != null)
     {
         MovieFragmentHeaderBox.ToBuffer(ref writer);
     }
     if (TrackFragmentBox != null)
     {
         TrackFragmentBox.ToBuffer(ref writer);
     }
     End(ref writer);
 }