Ejemplo n.º 1
0
        private void ReadTrackEntry(EBMLElement element)
        {
            ulong i = 0;

            while (i < element.DataSize)
            {
                EBMLElement child = new EBMLElement(this, element.DataOffset + i);

                MatroskaID matroska_id = (MatroskaID)child.ID;

                switch (matroska_id)
                {
                case MatroskaID.MatroskaTrackType: {
                    TrackType track_type = (TrackType)child.ReadUInt();

                    switch (track_type)
                    {
                    case TrackType.Video: {
                        VideoTrack track = new VideoTrack(this, element);

                        tracks.Add(track);
                        break;
                    }

                    case TrackType.Audio: {
                        AudioTrack track = new AudioTrack(this, element);

                        tracks.Add(track);
                        break;
                    }

                    case TrackType.Subtitle: {
                        SubtitleTrack track = new SubtitleTrack(this, element);

                        tracks.Add(track);
                        break;
                    }

                    default:
                        break;
                    }
                    break;
                }

                default:
                    break;
                }

                i += child.Size;
            }
        }
Ejemplo n.º 2
0
        private void ReadTrackEntry (EBMLElement element)
        {
            ulong i = 0;

            while (i < element.DataSize) {
                EBMLElement child = new EBMLElement (this, element.DataOffset + i);

                MatroskaID matroska_id = (MatroskaID) child.ID;

                switch (matroska_id) {
                    case MatroskaID.MatroskaTrackType: {
                            TrackType track_type = (TrackType) child.ReadUInt ();

                            switch (track_type) {
                                case TrackType.Video: {
                                        VideoTrack track = new VideoTrack (this, element);

                                        tracks.Add (track);
                                        break;
                                    }
                                case TrackType.Audio: {
                                        AudioTrack track = new AudioTrack (this, element);

                                        tracks.Add (track);
                                        break;
                                    }
                                case TrackType.Subtitle: {
                                        SubtitleTrack track = new SubtitleTrack (this, element);

                                        tracks.Add (track);
                                        break;
                                    }
                                default:
                                    break;
                            }
                            break;
                        }
                    default:
                        break;
                }

                i += child.Size;
            }
        }