public interface

ExtractorsFactory

 androidx.media3.extractor.ExtractorsFactory

Subclasses:

DefaultExtractorsFactory

Gradle dependencies

compile group: 'androidx.media3', name: 'media3-extractor', version: '1.0.0-alpha03'

  • groupId: androidx.media3
  • artifactId: media3-extractor
  • version: 1.0.0-alpha03

Artifact androidx.media3:media3-extractor:1.0.0-alpha03 it located at Google repository (https://maven.google.com/)

Overview

Factory for arrays of Extractor instances.

Summary

Fields
public static final ExtractorsFactoryEMPTY

Extractor factory that returns an empty list of extractors.

Methods
public ExtractorcreateExtractors()

Returns an array of new Extractor instances.

public ExtractorcreateExtractors(Uri uri, java.util.Map<java.lang.String, java.util.List> responseHeaders)

Returns an array of new Extractor instances.

Fields

public static final ExtractorsFactory EMPTY

Extractor factory that returns an empty list of extractors. Can be used whenever Extractors are not required.

Methods

public Extractor createExtractors()

Returns an array of new Extractor instances.

public Extractor createExtractors(Uri uri, java.util.Map<java.lang.String, java.util.List> responseHeaders)

Returns an array of new Extractor instances.

Parameters:

uri: The of the media to extract.
responseHeaders: The response headers of the media to extract, or an empty map if there are none. The map lookup should be case-insensitive.

Returns:

The Extractor instances.

Source

/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package androidx.media3.extractor;

import android.net.Uri;
import androidx.media3.common.util.UnstableApi;
import java.util.List;
import java.util.Map;

/** Factory for arrays of {@link Extractor} instances. */
@UnstableApi
public interface ExtractorsFactory {

  /**
   * Extractor factory that returns an empty list of extractors. Can be used whenever {@link
   * Extractor Extractors} are not required.
   */
  ExtractorsFactory EMPTY = () -> new Extractor[] {};

  /** Returns an array of new {@link Extractor} instances. */
  Extractor[] createExtractors();

  /**
   * Returns an array of new {@link Extractor} instances.
   *
   * @param uri The {@link Uri} of the media to extract.
   * @param responseHeaders The response headers of the media to extract, or an empty map if there
   *     are none. The map lookup should be case-insensitive.
   * @return The {@link Extractor} instances.
   */
  default Extractor[] createExtractors(Uri uri, Map<String, List<String>> responseHeaders) {
    return createExtractors();
  }
}