Ejemplo n.º 1
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          match(Constants.EXT_X_ENDLIST_PATTERN, line);
          state.getMedia().endOfList = true;
        }
Ejemplo n.º 2
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          final Matcher matcher = match(Constants.EXTINF_PATTERN, line);

          state.getMedia().trackInfo =
              new TrackInfo(ParseUtil.parseFloat(matcher.group(1), getTag()), matcher.group(2));
        }
Ejemplo n.º 3
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          final StartData.Builder builder = new StartData.Builder();
          parseAttributes(line, builder, state, HANDLERS);
          final StartData startData = builder.build();

          state.getMedia().startData = startData;
        }
Ejemplo n.º 4
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          match(Constants.EXT_X_I_FRAMES_ONLY_PATTERN, line);

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

          state.setIsIframesOnly();
        }
Ejemplo n.º 5
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          final Matcher matcher = match(Constants.EXT_X_MEDIA_SEQUENCE_PATTERN, line);

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

          state.getMedia().mediaSequenceNumber = ParseUtil.parseInt(matcher.group(1), getTag());
        }
Ejemplo n.º 6
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          final Matcher matcher = match(Constants.EXT_X_TARGETDURATION_PATTERN, line);

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

          state.getMedia().targetDuration = ParseUtil.parseInt(matcher.group(1), getTag());
        }
Ejemplo n.º 7
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          final Matcher matcher = match(Constants.EXT_X_PLAYLIST_TYPE_PATTERN, line);

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

          state.getMedia().playlistType =
              ParseUtil.parseEnum(matcher.group(1), PlaylistType.class, getTag());
        }
Ejemplo n.º 8
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          final EncryptionData.Builder builder =
              new EncryptionData.Builder()
                  .withKeyFormat(Constants.DEFAULT_KEY_FORMAT)
                  .withKeyFormatVersions(Constants.DEFAULT_KEY_FORMAT_VERSIONS);

          parseAttributes(line, builder, state, HANDLERS);
          final EncryptionData encryptionData = builder.build();

          if (encryptionData.getMethod() != EncryptionMethod.NONE
              && encryptionData.getUri() == null) {
            throw ParseException.create(ParseExceptionType.MISSING_ENCRYPTION_URI, getTag(), line);
          }

          state.getMedia().encryptionData = encryptionData;
        }
Ejemplo n.º 9
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          // deprecated
        }
Ejemplo n.º 10
0
 @Override
 public void parse(String line, ParseState state) throws ParseException {
   validateNotMaster(state);
   state.setMedia();
   super.parse(line, state);
 }