Package com.castlabs.android.player.filter

# Class FilterFormat

java.lang.Object
com.castlabs.android.player.filter.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 Summary

  Constructors
  Constructor
  Description
  `FilterFormat(com.google.android.exoplayer2.Format format, int mediaType, com.google.android.exoplayer2.Format[] groupFormats, boolean isAd)`
  Represents a filter format for media content.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getFilterReason()`
  Returns the filter reason, or 0 in case the track is unfiltered.
  `com.google.android.exoplayer2.Format`
  `getFormat()`
  Returns the format of this track.
  `com.google.android.exoplayer2.Format[]`
  `getGroupFormats()`
  Returns the formats for all tracks in the same group.
  `int`
  `getMediaType()`
  Returns the media type of this track.
  `boolean`
  `isAd()`
  Returns whether this track belongs to an Ad Period.
  `boolean`
  `isFiltered()`
  Returns whether this track has been marked as filtered.
  `void`
  `keep()`
  Marks this track to be kept by clearing the filter reason.
  `void`
  `remove()`
  Mark this track as to be removed with reason `SdkConsts.FILTER_REASON_CUSTOM`.
  `void`
  `remove(int filterReason)`
  Marks this track to be removed with the provided reason

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FilterFormat

    public FilterFormat(@NonNull com.google.android.exoplayer2.Format format, int mediaType, @NonNull com.google.android.exoplayer2.Format[] groupFormats, boolean isAd)
    Represents a filter format for media content.
    Parameters:
      `format` - the format of this track
      `mediaType` - the media type of this track, see `SdkConsts.MediaType`
      `groupFormats` - the formats for all tracks in the same group
      `isAd` - whether this track belongs toan Ad Period

- ## Method Details

  - ### getFormat

    @NonNull public com.google.android.exoplayer2.Format getFormat()
    Returns the format of this track.
    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.
    Returns:
      the formats for all tracks in the same group

  - ### remove

    public void remove()
    Mark this track as to be removed with reason `SdkConsts.FILTER_REASON_CUSTOM`.

  - ### 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.
    Returns:
      the media type of this track

  - ### isAd

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

  - ### isFiltered

    public boolean isFiltered()
    Returns whether this track has been marked as filtered.
    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.
    Returns:
      the filter reason, or 0 in case the track is unfiltered