Java Code Examples for com.google.android.exoplayer2.C#TRACK_TYPE_DEFAULT

The following examples show how to use com.google.android.exoplayer2.C#TRACK_TYPE_DEFAULT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Util.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Returns a string representation of a {@code TRACK_TYPE_*} constant defined in {@link C}.
 *
 * @param trackType A {@code TRACK_TYPE_*} constant,
 * @return A string representation of this constant.
 */
public static String getTrackTypeString(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_AUDIO:
      return "audio";
    case C.TRACK_TYPE_DEFAULT:
      return "default";
    case C.TRACK_TYPE_METADATA:
      return "metadata";
    case C.TRACK_TYPE_CAMERA_MOTION:
      return "camera motion";
    case C.TRACK_TYPE_NONE:
      return "none";
    case C.TRACK_TYPE_TEXT:
      return "text";
    case C.TRACK_TYPE_VIDEO:
      return "video";
    default:
      return trackType >= C.TRACK_TYPE_CUSTOM_BASE ? "custom (" + trackType + ")" : "?";
  }
}
 
Example 2
Source File: EventLogger.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static String getTrackTypeString(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_AUDIO:
      return "audio";
    case C.TRACK_TYPE_DEFAULT:
      return "default";
    case C.TRACK_TYPE_METADATA:
      return "metadata";
    case C.TRACK_TYPE_NONE:
      return "none";
    case C.TRACK_TYPE_TEXT:
      return "text";
    case C.TRACK_TYPE_VIDEO:
      return "video";
    default:
      return trackType >= C.TRACK_TYPE_CUSTOM_BASE ? "custom (" + trackType + ")" : "?";
  }
}
 
Example 3
Source File: Util.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Maps a {@link C} {@code TRACK_TYPE_*} constant to the corresponding {@link C}
 * {@code DEFAULT_*_BUFFER_SIZE} constant.
 *
 * @param trackType The track type.
 * @return The corresponding default buffer size in bytes.
 */
public static int getDefaultBufferSize(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_DEFAULT:
      return C.DEFAULT_MUXED_BUFFER_SIZE;
    case C.TRACK_TYPE_AUDIO:
      return C.DEFAULT_AUDIO_BUFFER_SIZE;
    case C.TRACK_TYPE_VIDEO:
      return C.DEFAULT_VIDEO_BUFFER_SIZE;
    case C.TRACK_TYPE_TEXT:
      return C.DEFAULT_TEXT_BUFFER_SIZE;
    case C.TRACK_TYPE_METADATA:
      return C.DEFAULT_METADATA_BUFFER_SIZE;
    default:
      throw new IllegalStateException();
  }
}
 
Example 4
Source File: EventLogger.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static String getTrackTypeString(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_AUDIO:
      return "audio";
    case C.TRACK_TYPE_DEFAULT:
      return "default";
    case C.TRACK_TYPE_METADATA:
      return "metadata";
    case C.TRACK_TYPE_NONE:
      return "none";
    case C.TRACK_TYPE_TEXT:
      return "text";
    case C.TRACK_TYPE_VIDEO:
      return "video";
    default:
      return trackType >= C.TRACK_TYPE_CUSTOM_BASE ? "custom (" + trackType + ")" : "?";
  }
}
 
Example 5
Source File: Util.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Maps a {@link C} {@code TRACK_TYPE_*} constant to the corresponding {@link C}
 * {@code DEFAULT_*_BUFFER_SIZE} constant.
 *
 * @param trackType The track type.
 * @return The corresponding default buffer size in bytes.
 */
public static int getDefaultBufferSize(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_DEFAULT:
      return C.DEFAULT_MUXED_BUFFER_SIZE;
    case C.TRACK_TYPE_AUDIO:
      return C.DEFAULT_AUDIO_BUFFER_SIZE;
    case C.TRACK_TYPE_VIDEO:
      return C.DEFAULT_VIDEO_BUFFER_SIZE;
    case C.TRACK_TYPE_TEXT:
      return C.DEFAULT_TEXT_BUFFER_SIZE;
    case C.TRACK_TYPE_METADATA:
      return C.DEFAULT_METADATA_BUFFER_SIZE;
    default:
      throw new IllegalStateException();
  }
}
 
Example 6
Source File: Util.java    From K-Sonic with MIT License 6 votes vote down vote up
/**
 * Maps a {@link C} {@code TRACK_TYPE_*} constant to the corresponding {@link C}
 * {@code DEFAULT_*_BUFFER_SIZE} constant.
 *
 * @param trackType The track type.
 * @return The corresponding default buffer size in bytes.
 */
public static int getDefaultBufferSize(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_DEFAULT:
      return C.DEFAULT_MUXED_BUFFER_SIZE;
    case C.TRACK_TYPE_AUDIO:
      return C.DEFAULT_AUDIO_BUFFER_SIZE;
    case C.TRACK_TYPE_VIDEO:
      return C.DEFAULT_VIDEO_BUFFER_SIZE;
    case C.TRACK_TYPE_TEXT:
      return C.DEFAULT_TEXT_BUFFER_SIZE;
    case C.TRACK_TYPE_METADATA:
      return C.DEFAULT_METADATA_BUFFER_SIZE;
    default:
      throw new IllegalStateException();
  }
}
 
Example 7
Source File: EventLogger.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
private static String getTrackTypeString(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_AUDIO:
      return "audio";
    case C.TRACK_TYPE_DEFAULT:
      return "default";
    case C.TRACK_TYPE_METADATA:
      return "metadata";
    case C.TRACK_TYPE_CAMERA_MOTION:
      return "camera motion";
    case C.TRACK_TYPE_NONE:
      return "none";
    case C.TRACK_TYPE_TEXT:
      return "text";
    case C.TRACK_TYPE_VIDEO:
      return "video";
    default:
      return trackType >= C.TRACK_TYPE_CUSTOM_BASE ? "custom (" + trackType + ")" : "?";
  }
}
 
Example 8
Source File: EventLogger.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
private static String getTrackTypeString(int trackType) {
  switch (trackType) {
    case C.TRACK_TYPE_AUDIO:
      return "audio";
    case C.TRACK_TYPE_DEFAULT:
      return "default";
    case C.TRACK_TYPE_METADATA:
      return "metadata";
    case C.TRACK_TYPE_CAMERA_MOTION:
      return "camera motion";
    case C.TRACK_TYPE_NONE:
      return "none";
    case C.TRACK_TYPE_TEXT:
      return "text";
    case C.TRACK_TYPE_VIDEO:
      return "video";
    default:
      return trackType >= C.TRACK_TYPE_CUSTOM_BASE ? "custom (" + trackType + ")" : "?";
  }
}
 
Example 9
Source File: PlaybackStatsListener.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Notifies the tracker that a format being read by the renderers for the current playback
 * changed.
 *
 * @param eventTime The {@link EventTime}.
 * @param mediaLoadData The {@link MediaLoadData} describing the format change.
 */
public void onDownstreamFormatChanged(EventTime eventTime, MediaLoadData mediaLoadData) {
  if (mediaLoadData.trackType == C.TRACK_TYPE_VIDEO
      || mediaLoadData.trackType == C.TRACK_TYPE_DEFAULT) {
    maybeUpdateVideoFormat(eventTime, mediaLoadData.trackFormat);
  } else if (mediaLoadData.trackType == C.TRACK_TYPE_AUDIO) {
    maybeUpdateAudioFormat(eventTime, mediaLoadData.trackFormat);
  }
}