Esempio n. 1
0
        internal TrackEntry(Stream stream)
        {
            List <BlockAdditionMapping> blockAdditionMappinglist = null;
            List <string>         codecInfoURLlist     = null;
            List <string>         codecDownloadURLlist = null;
            List <ulong>          trackOverlaylist     = null;
            List <TrackTranslate> trackTranslatelist   = null;
            ElementReader         reader = new ElementReader(stream);

            while (!reader.EOF)
            {
                eElement id = reader.readElementId();
                switch (id)
                {
                case eElement.TrackNumber:
                    trackNumber = reader.readUlong();
                    break;

                case eElement.TrackUID:
                    trackUID = reader.readUlong();
                    break;

                case eElement.TrackType:
                    trackType = (eTrackType)reader.readByte();
                    break;

                case eElement.FlagEnabled:
                    flagEnabled = (byte)reader.readUint(1);
                    break;

                case eElement.FlagDefault:
                    flagDefault = (byte)reader.readUint(1);
                    break;

                case eElement.FlagForced:
                    flagForced = (byte)reader.readUint(0);
                    break;

                case eElement.FlagLacing:
                    flagLacing = (byte)reader.readUint(1);
                    break;

                case eElement.MinCache:
                    minCache = reader.readUlong(0);
                    break;

                case eElement.MaxCache:
                    maxCache = reader.readUlong();
                    break;

                case eElement.DefaultDuration:
                    defaultDuration = reader.readUlong();
                    break;

                case eElement.DefaultDecodedFieldDuration:
                    defaultDecodedFieldDuration = reader.readUlong();
                    break;

                case eElement.TrackOffset:
                    trackOffset = reader.readInt(0);
                    break;

                case eElement.MaxBlockAdditionID:
                    maxBlockAdditionID = reader.readUlong(0);
                    break;

                case eElement.BlockAdditionMapping:
                    if (null == blockAdditionMappinglist)
                    {
                        blockAdditionMappinglist = new List <BlockAdditionMapping>();
                    }
                    blockAdditionMappinglist.Add(new BlockAdditionMapping(stream));
                    break;

                case eElement.Name:
                    name = reader.readUtf8();
                    break;

                case eElement.Language:
                    language = reader.readAscii();
                    break;

                case eElement.LanguageIETF:
                    languageIETF = reader.readAscii();
                    break;

                case eElement.CodecID:
                    codecID = reader.readAscii();
                    break;

                case eElement.CodecPrivate:
                    codecPrivate = reader.readByteArray();
                    break;

                case eElement.CodecName:
                    codecName = reader.readUtf8();
                    break;

                case eElement.AttachmentLink:
                    attachmentLink = reader.readUlong();
                    break;

                case eElement.CodecSettings:
                    codecSettings = reader.readUtf8();
                    break;

                case eElement.CodecInfoURL:
                    if (null == codecInfoURLlist)
                    {
                        codecInfoURLlist = new List <string>();
                    }
                    codecInfoURLlist.Add(reader.readAscii());
                    break;

                case eElement.CodecDownloadURL:
                    if (null == codecDownloadURLlist)
                    {
                        codecDownloadURLlist = new List <string>();
                    }
                    codecDownloadURLlist.Add(reader.readAscii());
                    break;

                case eElement.CodecDecodeAll:
                    codecDecodeAll = (byte)reader.readUint(1);
                    break;

                case eElement.TrackOverlay:
                    if (null == trackOverlaylist)
                    {
                        trackOverlaylist = new List <ulong>();
                    }
                    trackOverlaylist.Add(reader.readUlong());
                    break;

                case eElement.CodecDelay:
                    codecDelay = reader.readUlong(0);
                    break;

                case eElement.SeekPreRoll:
                    seekPreRoll = reader.readUlong(0);
                    break;

                case eElement.TrackTranslate:
                    if (null == trackTranslatelist)
                    {
                        trackTranslatelist = new List <TrackTranslate>();
                    }
                    trackTranslatelist.Add(new TrackTranslate(stream));
                    break;

                case eElement.Video:
                    video = new Video(stream);
                    break;

                case eElement.Audio:
                    audio = new Audio(stream);
                    break;

                case eElement.TrackOperation:
                    trackOperation = new TrackOperation(stream);
                    break;

                case eElement.TrickTrackUID:
                    trickTrackUID = reader.readUlong();
                    break;

                case eElement.TrickTrackSegmentUID:
                    trickTrackSegmentUID = reader.readGuid();
                    break;

                case eElement.TrickTrackFlag:
                    trickTrackFlag = reader.readUlong(0);
                    break;

                case eElement.TrickMasterTrackUID:
                    trickMasterTrackUID = reader.readUlong();
                    break;

                case eElement.TrickMasterTrackSegmentUID:
                    trickMasterTrackSegmentUID = reader.readGuid();
                    break;

                case eElement.ContentEncodings:
                    contentEncodings = new ContentEncodings(stream);
                    break;

                default:
                    reader.skipElement();
                    break;
                }
            }
            if (blockAdditionMappinglist != null)
            {
                blockAdditionMapping = blockAdditionMappinglist.ToArray();
            }
            if (codecInfoURLlist != null)
            {
                codecInfoURL = codecInfoURLlist.ToArray();
            }
            if (codecDownloadURLlist != null)
            {
                codecDownloadURL = codecDownloadURLlist.ToArray();
            }
            if (trackOverlaylist != null)
            {
                trackOverlay = trackOverlaylist.ToArray();
            }
            if (trackTranslatelist != null)
            {
                trackTranslate = trackTranslatelist.ToArray();
            }
        }
Esempio n. 2
0
        internal Info(Stream stream)
        {
            List <Guid>             segmentFamilylist    = null;
            List <ChapterTranslate> chapterTranslatelist = null;
            ElementReader           reader = new ElementReader(stream);

            while (!reader.EOF)
            {
                eElement id = reader.readElementId();
                switch (id)
                {
                case eElement.SegmentUID:
                    segmentUID = reader.readGuid();
                    break;

                case eElement.SegmentFilename:
                    segmentFilename = reader.readUtf8();
                    break;

                case eElement.PrevUID:
                    prevUID = reader.readGuid();
                    break;

                case eElement.PrevFilename:
                    prevFilename = reader.readUtf8();
                    break;

                case eElement.NextUID:
                    nextUID = reader.readGuid();
                    break;

                case eElement.NextFilename:
                    nextFilename = reader.readUtf8();
                    break;

                case eElement.SegmentFamily:
                    if (null == segmentFamilylist)
                    {
                        segmentFamilylist = new List <Guid>();
                    }
                    segmentFamilylist.Add(reader.readGuid());
                    break;

                case eElement.ChapterTranslate:
                    if (null == chapterTranslatelist)
                    {
                        chapterTranslatelist = new List <ChapterTranslate>();
                    }
                    chapterTranslatelist.Add(new ChapterTranslate(stream));
                    break;

                case eElement.TimestampScale:
                    timestampScale = reader.readUlong(1000000);
                    break;

                case eElement.Duration:
                    duration = reader.readFloat();
                    break;

                case eElement.DateUTC:
                    dateUTC = reader.readDate();
                    break;

                case eElement.Title:
                    title = reader.readUtf8();
                    break;

                case eElement.MuxingApp:
                    muxingApp = reader.readUtf8();
                    break;

                case eElement.WritingApp:
                    writingApp = reader.readUtf8();
                    break;

                default:
                    reader.skipElement();
                    break;
                }
            }
            if (segmentFamilylist != null)
            {
                segmentFamily = segmentFamilylist.ToArray();
            }
            if (chapterTranslatelist != null)
            {
                chapterTranslate = chapterTranslatelist.ToArray();
            }
        }
Esempio n. 3
0
        internal ChapterAtom(Stream stream)
        {
            List <ChapterDisplay> chapterDisplaylist = null;
            List <ChapProcess>    chapProcesslist    = null;
            ElementReader         reader             = new ElementReader(stream);

            while (!reader.EOF)
            {
                eElement id = reader.readElementId();
                switch (id)
                {
                case eElement.ChapterUID:
                    chapterUID = reader.readUlong();
                    break;

                case eElement.ChapterStringUID:
                    chapterStringUID = reader.readUtf8();
                    break;

                case eElement.ChapterTimeStart:
                    chapterTimeStart = reader.readUlong();
                    break;

                case eElement.ChapterTimeEnd:
                    chapterTimeEnd = reader.readUlong();
                    break;

                case eElement.ChapterFlagHidden:
                    chapterFlagHidden = (byte)reader.readUint(0);
                    break;

                case eElement.ChapterFlagEnabled:
                    chapterFlagEnabled = (byte)reader.readUint(1);
                    break;

                case eElement.ChapterSegmentUID:
                    chapterSegmentUID = reader.readGuid();
                    break;

                case eElement.ChapterSegmentEditionUID:
                    chapterSegmentEditionUID = reader.readUlong();
                    break;

                case eElement.ChapterPhysicalEquiv:
                    chapterPhysicalEquiv = reader.readUlong();
                    break;

                case eElement.ChapterTrack:
                    chapterTrack = new ChapterTrack(stream);
                    break;

                case eElement.ChapterDisplay:
                    if (null == chapterDisplaylist)
                    {
                        chapterDisplaylist = new List <ChapterDisplay>();
                    }
                    chapterDisplaylist.Add(new ChapterDisplay(stream));
                    break;

                case eElement.ChapProcess:
                    if (null == chapProcesslist)
                    {
                        chapProcesslist = new List <ChapProcess>();
                    }
                    chapProcesslist.Add(new ChapProcess(stream));
                    break;

                default:
                    reader.skipElement();
                    break;
                }
            }
            if (chapterDisplaylist != null)
            {
                chapterDisplay = chapterDisplaylist.ToArray();
            }
            if (chapProcesslist != null)
            {
                chapProcess = chapProcesslist.ToArray();
            }
        }