internal Projection(Stream stream) { ElementReader reader = new ElementReader(stream); while (!reader.EOF) { eElement id = reader.readElementId(); switch (id) { case eElement.ProjectionType: projectionType = (eProjectionType)reader.readByte(0); break; case eElement.ProjectionPrivate: projectionPrivate = Blob.read(reader); break; case eElement.ProjectionPoseYaw: projectionPoseYaw = reader.readFloat(0); break; case eElement.ProjectionPosePitch: projectionPosePitch = reader.readFloat(0); break; case eElement.ProjectionPoseRoll: projectionPoseRoll = reader.readFloat(0); break; default: reader.skipElement(); break; } } }
internal Audio(Stream stream) { ElementReader reader = new ElementReader(stream); while (!reader.EOF) { eElement id = reader.readElementId(); switch (id) { case eElement.SamplingFrequency: samplingFrequency = reader.readFloat(8000); break; case eElement.OutputSamplingFrequency: outputSamplingFrequency = reader.readFloat(); break; case eElement.Channels: channels = reader.readUlong(1); break; case eElement.ChannelPositions: channelPositions = Blob.read(reader); break; case eElement.BitDepth: bitDepth = reader.readUlong(); break; default: reader.skipElement(); break; } } }
internal MasteringMetadata(Stream stream) { ElementReader reader = new ElementReader(stream); while (!reader.EOF) { eElement id = reader.readElementId(); switch (id) { case eElement.PrimaryRChromaticityX: primaryRChromaticityX = reader.readFloat(); break; case eElement.PrimaryRChromaticityY: primaryRChromaticityY = reader.readFloat(); break; case eElement.PrimaryGChromaticityX: primaryGChromaticityX = reader.readFloat(); break; case eElement.PrimaryGChromaticityY: primaryGChromaticityY = reader.readFloat(); break; case eElement.PrimaryBChromaticityX: primaryBChromaticityX = reader.readFloat(); break; case eElement.PrimaryBChromaticityY: primaryBChromaticityY = reader.readFloat(); break; case eElement.WhitePointChromaticityX: whitePointChromaticityX = reader.readFloat(); break; case eElement.WhitePointChromaticityY: whitePointChromaticityY = reader.readFloat(); break; case eElement.LuminanceMax: luminanceMax = reader.readFloat(); break; case eElement.LuminanceMin: luminanceMin = reader.readFloat(); break; default: reader.skipElement(); break; } } }
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(); } }
internal Video(Stream stream) { ElementReader reader = new ElementReader(stream); while (!reader.EOF) { eElement id = reader.readElementId(); switch (id) { case eElement.FlagInterlaced: flagInterlaced = (eFlagInterlaced)reader.readByte(0); break; case eElement.FieldOrder: fieldOrder = (eFieldOrder)reader.readByte(2); break; case eElement.AlphaMode: alphaMode = reader.readUlong(0); break; case eElement.PixelWidth: pixelWidth = reader.readUint(); break; case eElement.PixelHeight: pixelHeight = reader.readUint(); break; case eElement.PixelCropBottom: pixelCropBottom = reader.readUint(0); break; case eElement.PixelCropTop: pixelCropTop = reader.readUint(0); break; case eElement.PixelCropLeft: pixelCropLeft = reader.readUint(0); break; case eElement.PixelCropRight: pixelCropRight = reader.readUint(0); break; case eElement.DisplayWidth: displayWidth = reader.readUint(); break; case eElement.DisplayHeight: displayHeight = reader.readUint(); break; case eElement.DisplayUnit: displayUnit = (eDisplayUnit)reader.readByte(0); break; case eElement.AspectRatioType: aspectRatioType = (eAspectRatioType)reader.readByte(0); break; case eElement.ColourSpace: colourSpace = reader.readColorSpace(); break; case eElement.GammaValue: gammaValue = reader.readFloat(); break; case eElement.FrameRate: frameRate = reader.readFloat(); break; case eElement.Colour: colour = new Colour(stream); break; case eElement.Projection: projection = new Projection(stream); break; default: reader.skipElement(); break; } } }