Exemplo n.º 1
0
        public static void LogStreamAttributes(BasicStreamEntry stream, ClipName clipName)
        {
            var streamCodingType = stream.StreamAttributes.StreamCodingType;
            var result           = StreamCoding.TryGetValue(streamCodingType, out string streamCoding);

            if (!result)
            {
                streamCoding = "und";
            }
            OnLog?.Invoke($"Stream[{clipName}] Type: {streamCoding}");
            if (0x01 != streamCodingType && 0x02 != streamCodingType &&
                0x1b != streamCodingType && 0xea != streamCodingType &&
                0x24 != streamCodingType)
            {
                var isAudio = !(0x90 == streamCodingType || 0x91 == streamCodingType);
                if (0x92 == streamCodingType)
                {
                    OnLog?.Invoke($"Stream[{clipName}] CharacterCode: {CharacterCode[stream.StreamAttributes.CharacterCode]}");
                }
                var language = stream.StreamAttributes.LanguageCode;
                if (language == null || language[0] == '\0')
                {
                    language = "und";
                }
                OnLog?.Invoke($"Stream[{clipName}] Language: {language}");
                if (isAudio)
                {
                    OnLog?.Invoke($"Stream[{clipName}] Channel: {Channel[stream.StreamAttributes.AudioFormat]}");
                    OnLog?.Invoke($"Stream[{clipName}] SampleRate: {SampleRate[stream.StreamAttributes.SampleRate]}");
                }
                return;
            }
            OnLog?.Invoke($"Stream[{clipName}] Resolution: {Resolution[stream.StreamAttributes.VideoFormat]}");
            OnLog?.Invoke($"Stream[{clipName}] FrameRate: {FrameRate[stream.StreamAttributes.FrameRate]}");
        }
Exemplo n.º 2
0
        public PlayItem(Stream stream)
        {
            Length = (ushort)stream.BEInt16();
            var position = stream.Position;

            ClipName    = new ClipName(stream);
            _flagField1 = (ushort)stream.BEInt16();
            RefToSTCID  = (byte)stream.ReadByte();
            TimeInfo    = new TimeInfo(stream);
            UOMaskTable = new UOMaskTable(stream);
            _flagField2 = (byte)stream.ReadByte();
            StillMode   = (byte)stream.ReadByte();
            StillTime   = (ushort)stream.BEInt16();
            if (IsMultiAngle)
            {
                MultiAngle = new MultiAngle(stream);
            }
            STNTable = new STNTable(stream);
            stream.Skip(Length - (stream.Position - position));
        }
Exemplo n.º 3
0
        public SubPlayItem(Stream stream)
        {
            Length = (ushort)stream.BEInt16();
            var position = stream.Position;

            ClipName = new ClipName(stream);
            stream.Skip(3);
            _flagField     = (byte)stream.ReadByte();
            RefToSTCID     = (byte)stream.ReadByte();
            TimeInfo       = new TimeInfo(stream);
            SyncPlayItemID = (ushort)stream.BEInt16();
            SyncStartPTS   = stream.BEInt32();

            if (IsMultiClipEntries)
            {
                NumberOfMultiClipEntries = (byte)stream.ReadByte();
                MultiClipNameEntries     = new ClipNameWithRef[NumberOfMultiClipEntries - 1];
                for (var i = 0; i < NumberOfMultiClipEntries - 1; ++i)
                {
                    MultiClipNameEntries[i] = new ClipNameWithRef(stream);
                }
            }
            stream.Skip(Length - (stream.Position - position));
        }
Exemplo n.º 4
0
 public ClipNameWithRef(Stream stream)
 {
     ClipName   = new ClipName(stream);
     RefToSTCID = (byte)stream.ReadByte();
 }