@Test public void testCreateExtractors_returnExpectedClasses() { DefaultExtractorsFactory defaultExtractorsFactory = new DefaultExtractorsFactory(); Extractor[] extractors = defaultExtractorsFactory.createExtractors(); List<Class> listCreatedExtractorClasses = new ArrayList<>(); for (Extractor extractor : extractors) { listCreatedExtractorClasses.add(extractor.getClass()); } Class[] expectedExtractorClassses = new Class[] { MatroskaExtractor.class, FragmentedMp4Extractor.class, Mp4Extractor.class, Mp3Extractor.class, AdtsExtractor.class, Ac3Extractor.class, TsExtractor.class, FlvExtractor.class, OggExtractor.class, PsExtractor.class, WavExtractor.class, AmrExtractor.class, Ac4Extractor.class }; assertThat(listCreatedExtractorClasses).containsNoDuplicates(); assertThat(listCreatedExtractorClasses).containsExactlyElementsIn(expectedExtractorClassses); }
@Override public synchronized Extractor[] createExtractors() { Extractor[] extractors = new Extractor[FLAC_EXTRACTOR_CONSTRUCTOR == null ? 13 : 14]; extractors[0] = new MatroskaExtractor(matroskaFlags); extractors[1] = new FragmentedMp4Extractor(fragmentedMp4Flags); extractors[2] = new Mp4Extractor(mp4Flags); extractors[3] = new Mp3Extractor( mp3Flags | (constantBitrateSeekingEnabled ? Mp3Extractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[4] = new AdtsExtractor( 0, adtsFlags | (constantBitrateSeekingEnabled ? AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[5] = new Ac3Extractor(); extractors[6] = new TsExtractor(tsMode, tsFlags); extractors[7] = new FlvExtractor(); extractors[8] = new OggExtractor(); extractors[9] = new PsExtractor(); extractors[10] = new WavExtractor(); extractors[11] = new AmrExtractor( amrFlags | (constantBitrateSeekingEnabled ? AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[12] = new Ac4Extractor(); if (FLAC_EXTRACTOR_CONSTRUCTOR != null) { try { extractors[13] = FLAC_EXTRACTOR_CONSTRUCTOR.newInstance(); } catch (Exception e) { throw new IllegalStateException("Unexpected error creating FLAC extractor", e); } } return extractors; }
DefaultExtractorsFactory implements ExtractorsFactory { @Override public synchronized Extractor[] createExtractors() { Extractor[] extractors = new Extractor[FLAC_EXTRACTOR_CONSTRUCTOR == null ? 13 : 14]; extractors[0] = new MatroskaExtractor(matroskaFlags); extractors[1] = new FragmentedMp4Extractor(fragmentedMp4Flags); extractors[2] = new Mp4Extractor(mp4Flags); extractors[3] = new Mp3Extractor( mp3Flags | (constantBitrateSeekingEnabled ? Mp3Extractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[4] = new AdtsExtractor( 0, adtsFlags | (constantBitrateSeekingEnabled ? AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[5] = new Ac3Extractor(); extractors[6] = new TsExtractor(tsMode, tsFlags); extractors[7] = new FlvExtractor(); extractors[8] = new OggExtractor(); extractors[9] = new PsExtractor(); extractors[10] = new WavExtractor(); extractors[11] = new AmrExtractor( amrFlags | (constantBitrateSeekingEnabled ? AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[12] = new Ac4Extractor(); if (FLAC_EXTRACTOR_CONSTRUCTOR != null) { try { extractors[13] = FLAC_EXTRACTOR_CONSTRUCTOR.newInstance(); } catch (Exception e) { throw new IllegalStateException("Unexpected error creating FLAC extractor", e); } } return extractors; } }
DefaultExtractorsFactory implements ExtractorsFactory { @Override public synchronized Extractor[] createExtractors() { Extractor[] extractors = new Extractor[FLAC_EXTRACTOR_CONSTRUCTOR == null ? 13 : 14]; extractors[0] = new MatroskaExtractor(matroskaFlags); extractors[1] = new FragmentedMp4Extractor(fragmentedMp4Flags); extractors[2] = new Mp4Extractor(mp4Flags); extractors[3] = new Mp3Extractor( mp3Flags | (constantBitrateSeekingEnabled ? Mp3Extractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[4] = new AdtsExtractor( 0, adtsFlags | (constantBitrateSeekingEnabled ? AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[5] = new Ac3Extractor(); extractors[6] = new TsExtractor(tsMode, tsFlags); extractors[7] = new FlvExtractor(); extractors[8] = new OggExtractor(); extractors[9] = new PsExtractor(); extractors[10] = new WavExtractor(); extractors[11] = new AmrExtractor( amrFlags | (constantBitrateSeekingEnabled ? AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[12] = new Ac4Extractor(); if (FLAC_EXTRACTOR_CONSTRUCTOR != null) { try { extractors[13] = FLAC_EXTRACTOR_CONSTRUCTOR.newInstance(); } catch (Exception e) { throw new IllegalStateException("Unexpected error creating FLAC extractor", e); } } return extractors; } DefaultExtractorsFactory(); }
DefaultExtractorsFactory implements ExtractorsFactory { @Override public synchronized Extractor[] createExtractors() { Extractor[] extractors = new Extractor[FLAC_EXTRACTOR_CONSTRUCTOR == null ? 13 : 14]; extractors[0] = new MatroskaExtractor(matroskaFlags); extractors[1] = new FragmentedMp4Extractor(fragmentedMp4Flags); extractors[2] = new Mp4Extractor(mp4Flags); extractors[3] = new Mp3Extractor( mp3Flags | (constantBitrateSeekingEnabled ? Mp3Extractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[4] = new AdtsExtractor( 0, adtsFlags | (constantBitrateSeekingEnabled ? AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[5] = new Ac3Extractor(); extractors[6] = new TsExtractor(tsMode, tsFlags); extractors[7] = new FlvExtractor(); extractors[8] = new OggExtractor(); extractors[9] = new PsExtractor(); extractors[10] = new WavExtractor(); extractors[11] = new AmrExtractor( amrFlags | (constantBitrateSeekingEnabled ? AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[12] = new Ac4Extractor(); if (FLAC_EXTRACTOR_CONSTRUCTOR != null) { try { extractors[13] = FLAC_EXTRACTOR_CONSTRUCTOR.newInstance(); } catch (Exception e) { throw new IllegalStateException("Unexpected error creating FLAC extractor", e); } } return extractors; } DefaultExtractorsFactory(); synchronized DefaultExtractorsFactory setConstantBitrateSeekingEnabled(
      boolean constantBitrateSeekingEnabled); synchronized DefaultExtractorsFactory setAdtsExtractorFlags(
      @AdtsExtractor.Flags int flags); synchronized DefaultExtractorsFactory setAmrExtractorFlags(@AmrExtractor.Flags int flags); synchronized DefaultExtractorsFactory setMatroskaExtractorFlags(
      @MatroskaExtractor.Flags int flags); synchronized DefaultExtractorsFactory setMp4ExtractorFlags(@Mp4Extractor.Flags int flags); synchronized DefaultExtractorsFactory setFragmentedMp4ExtractorFlags(
      @FragmentedMp4Extractor.Flags int flags); synchronized DefaultExtractorsFactory setMp3ExtractorFlags(@Mp3Extractor.Flags int flags); synchronized DefaultExtractorsFactory setTsExtractorMode(@TsExtractor.Mode int mode); synchronized DefaultExtractorsFactory setTsExtractorFlags(
      @DefaultTsPayloadReaderFactory.Flags int flags); @Override synchronized Extractor[] createExtractors(); }
DefaultExtractorsFactory implements ExtractorsFactory { @Override public synchronized Extractor[] createExtractors() { Extractor[] extractors = new Extractor[FLAC_EXTRACTOR_CONSTRUCTOR == null ? 13 : 14]; extractors[0] = new MatroskaExtractor(matroskaFlags); extractors[1] = new FragmentedMp4Extractor(fragmentedMp4Flags); extractors[2] = new Mp4Extractor(mp4Flags); extractors[3] = new Mp3Extractor( mp3Flags | (constantBitrateSeekingEnabled ? Mp3Extractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[4] = new AdtsExtractor( 0, adtsFlags | (constantBitrateSeekingEnabled ? AdtsExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[5] = new Ac3Extractor(); extractors[6] = new TsExtractor(tsMode, tsFlags); extractors[7] = new FlvExtractor(); extractors[8] = new OggExtractor(); extractors[9] = new PsExtractor(); extractors[10] = new WavExtractor(); extractors[11] = new AmrExtractor( amrFlags | (constantBitrateSeekingEnabled ? AmrExtractor.FLAG_ENABLE_CONSTANT_BITRATE_SEEKING : 0)); extractors[12] = new Ac4Extractor(); if (FLAC_EXTRACTOR_CONSTRUCTOR != null) { try { extractors[13] = FLAC_EXTRACTOR_CONSTRUCTOR.newInstance(); } catch (Exception e) { throw new IllegalStateException("Unexpected error creating FLAC extractor", e); } } return extractors; } DefaultExtractorsFactory(); synchronized DefaultExtractorsFactory setConstantBitrateSeekingEnabled(
      boolean constantBitrateSeekingEnabled); synchronized DefaultExtractorsFactory setAdtsExtractorFlags(
      @AdtsExtractor.Flags int flags); synchronized DefaultExtractorsFactory setAmrExtractorFlags(@AmrExtractor.Flags int flags); synchronized DefaultExtractorsFactory setMatroskaExtractorFlags(
      @MatroskaExtractor.Flags int flags); synchronized DefaultExtractorsFactory setMp4ExtractorFlags(@Mp4Extractor.Flags int flags); synchronized DefaultExtractorsFactory setFragmentedMp4ExtractorFlags(
      @FragmentedMp4Extractor.Flags int flags); synchronized DefaultExtractorsFactory setMp3ExtractorFlags(@Mp3Extractor.Flags int flags); synchronized DefaultExtractorsFactory setTsExtractorMode(@TsExtractor.Mode int mode); synchronized DefaultExtractorsFactory setTsExtractorFlags(
      @DefaultTsPayloadReaderFactory.Flags int flags); @Override synchronized Extractor[] createExtractors();  }