public MatroskaFileMetaSeek(ulong referencePosition)
 {
     this.referencePosition = referencePosition;
     myPosition             = referencePosition;
     seekHeadElem           = MatroskaDocTypes.SeekHead.GetInstance();
     placeHolderElement     = new VoidElement(BLOCK_RESEVER_SIZE - seekHeadElem.TotalSize);
 }
Exemple #2
0
        public long WriteElement(FileStream writer)
        {
            MasterElement segmentInfoElement = MatroskaDocTypes.Info.GetInstance();

            StringElement writingAppElement = MatroskaDocTypes.WritingApp.GetInstance();

            writingAppElement.Value = "Matroska File Writer v1.0 C#";

            StringElement muxingAppElement = MatroskaDocTypes.MuxingApp.GetInstance();

            muxingAppElement.Value = ".NET EBML v1.0";

            DateElement dateElement = MatroskaDocTypes.DateUTC.GetInstance();

            dateElement.Date = SegmentDate;

            UnsignedIntegerElement timecodeScaleElement = MatroskaDocTypes.TimecodeScale.GetInstance();

            timecodeScaleElement.Value = TimecodeScale;

            segmentInfoElement.AddChildElement(dateElement);
            segmentInfoElement.AddChildElement(timecodeScaleElement);

            if (Duration != null)
            {
                FloatElement durationElement = MatroskaDocTypes.Duration.GetInstance();
                durationElement.Value = (double)Duration;
                segmentInfoElement.AddChildElement(durationElement);
            }

            segmentInfoElement.AddChildElement(writingAppElement);
            segmentInfoElement.AddChildElement(muxingAppElement);

            ulong       len    = segmentInfoElement.WriteElement(writer);
            VoidElement spacer = new VoidElement((ulong)BLOCK_SIZE - len);

            spacer.WriteElement(writer);
            return(1);
        }