コード例 #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;
        }
コード例 #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));
        }
コード例 #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;
        }
コード例 #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();
        }
コード例 #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());
        }
コード例 #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());
        }
コード例 #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());
        }
コード例 #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;
        }
コード例 #9
0
        @Override
        public void parse(String line, ParseState state) throws ParseException {
          super.parse(line, state);

          // deprecated
        }
コード例 #10
0
 @Override
 public void parse(String line, ParseState state) throws ParseException {
   validateNotMaster(state);
   state.setMedia();
   super.parse(line, state);
 }