Exemplo n.º 1
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                ParseUtil.match(Constants.EXT_X_ENDLIST_PATTERN, line, getTag());
                state.getMedia().endOfList = true;
            }
Exemplo n.º 2
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);
                Match match = ParseUtil.match(Constants.EXT_X_BYTERANGE_PATTERN, line, getTag());

                state.getMedia().byteRange = ParseUtil.matchByteRange(match);
            }
Exemplo n.º 3
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                Match match = ParseUtil.match(Constants.EXT_X_VERSION_PATTERN, line, getTag());

                if (state.getCompatibilityVersion() != ParseState.NONE)
                {
                    throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
                }

                int compatibilityVersion = ParseUtil.parseInt(match.Groups[1].Value, getTag());

                if (compatibilityVersion < Playlist.MIN_COMPATIBILITY_VERSION)
                {
                    throw ParseException.create(ParseExceptionType.INVALID_COMPATIBILITY_VERSION, getTag(), line);
                }

                if (compatibilityVersion > Constants.MAX_COMPATIBILITY_VERSION)
                {
                    throw ParseException.create(ParseExceptionType.UNSUPPORTED_COMPATIBILITY_VERSION, getTag(), line);
                }

                state.setCompatibilityVersion(compatibilityVersion);
            }
Exemplo n.º 4
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);
                Match match = ParseUtil.match(Constants.EXT_X_DISCONTINUITY_PATTERN, line, getTag());

                state.getMedia().hasDiscontinuity = true;
            }
Exemplo n.º 5
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                Match match = ParseUtil.match(Constants.EXTINF_PATTERN, line, getTag());

                state.getMedia().trackInfo = new TrackInfo(ParseUtil.parseFloat(match.Groups[1].Value, getTag()), match.Groups[2].Value);
            }
Exemplo n.º 6
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                ParseUtil.match(Constants.EXT_X_I_FRAMES_ONLY_PATTERN, line, getTag());

                if (state.getCompatibilityVersion() < 4)
                {
                    throw ParseException.create(ParseExceptionType.REQUIRES_PROTOCOL_VERSION_4_OR_HIGHER, getTag());
                }

                state.setIsIframesOnly();
            }
Exemplo n.º 7
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                Match match = ParseUtil.match(Constants.EXT_X_MEDIA_SEQUENCE_PATTERN, line, getTag());

                if (state.getMedia().mediaSequenceNumber != null)
                {
                    throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
                }

                state.getMedia().mediaSequenceNumber = ParseUtil.parseInt(match.Groups[1].Value, getTag());
            }
Exemplo n.º 8
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                Match match = ParseUtil.match(Constants.EXT_X_TARGETDURATION_PATTERN, line, getTag());

                if (state.getMedia().targetDuration != null)
                {
                    throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
                }

                state.getMedia().targetDuration = ParseUtil.parseInt(match.Groups[1].Value, getTag());
            }
Exemplo n.º 9
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                Match match = ParseUtil.match(Constants.EXT_X_PROGRAM_DATE_TIME_PATTERN, line, getTag());

                if (state.getMedia().programDateTime != null)
                {
                    throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
                }

                state.getMedia().programDateTime = ParseUtil.parseDateTime(line, getTag());
            }
Exemplo n.º 10
0
            public void parse(String line, ParseState state)
            {
                lineParser.parse(line, state);

                Match match = ParseUtil.match(Constants.EXT_X_PLAYLIST_TYPE_PATTERN, line, getTag());

                if (state.getMedia().playlistType != null)
                {
                    throw ParseException.create(ParseExceptionType.MULTIPLE_EXT_TAG_INSTANCES, getTag(), line);
                }

                //state.getMedia().playlistType = ParseUtil.parseEnum(match.Groups[1].Value, typeof(PlaylistType), getTag());
                state.getMedia().playlistType = PlaylistType.fromValue(match.Groups[1].Value);
            }