Class FilterFormat


  • public final class FilterFormat
    extends Object
    Wrapper class around a Format, as well as any information that may be required to filter it.
    Since:
    4.2.26
    • Constructor Detail

      • FilterFormat

        public FilterFormat​(@NonNull
                            com.google.android.exoplayer2.Format format,
                            int mediaType,
                            @NonNull
                            com.google.android.exoplayer2.Format[] groupFormats,
                            boolean isAd)
    • Method Detail

      • getFormat

        @NonNull
        public com.google.android.exoplayer2.Format getFormat()
        Returns:
        the format of this track
      • getGroupFormats

        @NonNull
        public com.google.android.exoplayer2.Format[] getGroupFormats()
        Returns:
        the formats for all tracks in the same group
      • remove

        public void remove​(int filterReason)
        Marks this track to be removed with the provided reason
        Parameters:
        filterReason - the reason for this removal
      • keep

        public void keep()
        Marks this track to be kept by clearing the filter reason.
      • getMediaType

        public int getMediaType()
        Returns:
        the media type of this track
      • isAd

        public boolean isAd()
        Returns:
        whether this track belongs to an Ad Period
      • isFiltered

        public boolean isFiltered()
        Returns:
        whether this track has been marked as filtered
      • getFilterReason

        public int getFilterReason()
        Returns:
        the filter reason, or 0 in case the track is unfiltered