Java 类com.google.android.exoplayer.chunk.Format 实例源码

项目:ExoPlayer-Demo    文件:DashChunkSource.java   
private static String getMediaMimeType(Format format) {
  String formatMimeType = format.mimeType;
  if (MimeTypes.isAudio(formatMimeType)) {
    return MimeTypes.getAudioMediaMimeType(format.codecs);
  } else if (MimeTypes.isVideo(formatMimeType)) {
    return MimeTypes.getVideoMediaMimeType(format.codecs);
  } else if (mimeTypeIsRawText(formatMimeType)) {
    return formatMimeType;
  } else if (MimeTypes.APPLICATION_MP4.equals(formatMimeType)) {
    if ("stpp".equals(format.codecs)) {
      return MimeTypes.APPLICATION_TTML;
    }
    if ("wvtt".equals(format.codecs)) {
      return MimeTypes.APPLICATION_MP4VTT;
    }
  }
  return null;
}
项目:ExoPlayer-Demo    文件:HlsChunkSource.java   
@Override
public void adaptiveTrack(HlsMasterPlaylist playlist, Variant[] variants) {
  Arrays.sort(variants, new Comparator<Variant>() {
    private final Comparator<Format> formatComparator =
        new Format.DecreasingBandwidthComparator();
    @Override
    public int compare(Variant first, Variant second) {
      return formatComparator.compare(first.format, second.format);
    }
  });

  int defaultVariantIndex = computeDefaultVariantIndex(playlist, variants, bandwidthMeter);
  int maxWidth = -1;
  int maxHeight = -1;

  for (int i = 0; i < variants.length; i++) {
    Format variantFormat = variants[i].format;
    maxWidth = Math.max(variantFormat.width, maxWidth);
    maxHeight = Math.max(variantFormat.height, maxHeight);
  }
  // TODO: We should allow the default values to be passed through the constructor.
  // TODO: Print a warning if resolution tags are omitted.
  maxWidth = maxWidth > 0 ? maxWidth : 1920;
  maxHeight = maxHeight > 0 ? maxHeight : 1080;
  tracks.add(new ExposedTrack(variants, defaultVariantIndex, maxWidth, maxHeight));
}
项目:androidtv-sample    文件:DemoPlayer.java   
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
        long mediaTimeMs) {
    if (infoListener == null) {
        return;
    }
    if (sourceId == TYPE_VIDEO) {
        videoFormat = format;
        infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
    } else if (sourceId == TYPE_AUDIO) {
        infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
    }
}
项目:androidtv-sample    文件:DemoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
        long mediaStartTimeMs, long mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
项目:androidtv-sample    文件:DemoPlayer.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger,
        Format format,
        long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs,
        long loadDurationMs) {
    if (infoListener != null) {
        infoListener
                .onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
                        mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
项目:androidtv-sample    文件:VideoPlayer.java   
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
                                      long mediaTimeMs) {
    if (infoListener == null) {
        return;
    }
    if (sourceId == TYPE_VIDEO) {
        videoFormat = format;
        infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
    } else if (sourceId == TYPE_AUDIO) {
        infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
    }
}
项目:androidtv-sample    文件:VideoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
        long mediaStartTimeMs, long mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
项目:androidtv-sample    文件:VideoPlayer.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger,
        Format format,
        long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs,
        long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format,
                mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
项目:AndroidTvDemo    文件:EventLogger.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  loadStartTimeMs[sourceId] = SystemClock.elapsedRealtime();
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    Log.v(TAG, "loadStart [" + getSessionTimeString() + ", " + sourceId + ", " + type
        + ", " + mediaStartTimeMs + ", " + mediaEndTimeMs + "]");
  }
}
项目:AndroidTvDemo    文件:EventLogger.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
     long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    long downloadTime = SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
    Log.v(TAG, "loadEnd [" + getSessionTimeString() + ", " + sourceId + ", " + downloadTime
        + "]");
  }
}
项目:AndroidTvDemo    文件:DemoPlayer.java   
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
    long mediaTimeMs) {
  if (infoListener == null) {
    return;
  }
  if (sourceId == TYPE_VIDEO) {
    videoFormat = format;
    infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
  } else if (sourceId == TYPE_AUDIO) {
    infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
  }
}
项目:AndroidTvDemo    文件:DemoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs);
  }
}
项目:AndroidTvDemo    文件:DemoPlayer.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (infoListener != null) {
    infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
  }
}
项目:chilly    文件:VideoPlayer.java   
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
        long mediaTimeMs) {
    if (infoListener == null) {
        return;
    }
    if (sourceId == TYPE_VIDEO) {
        videoFormat = format;
        infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
    } else if (sourceId == TYPE_AUDIO) {
        infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
    }
}
项目:chilly    文件:VideoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
        long mediaStartTimeMs, long mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
项目:chilly    文件:VideoPlayer.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger,
        Format format,
        long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs,
        long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format,
                mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
项目:ShaddockVideoPlayer    文件:EventLogger.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  loadStartTimeMs[sourceId] = SystemClock.elapsedRealtime();
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    Log.v(TAG, "loadStart [" + getSessionTimeString() + ", " + sourceId + ", " + type
        + ", " + mediaStartTimeMs + ", " + mediaEndTimeMs + "]");
  }
}
项目:ShaddockVideoPlayer    文件:EventLogger.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
     long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    long downloadTime = SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
    Log.v(TAG, "loadEnd [" + getSessionTimeString() + ", " + sourceId + ", " + downloadTime
        + "]");
  }
}
项目:ShaddockVideoPlayer    文件:DemoPlayer.java   
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
    long mediaTimeMs) {
  if (infoListener == null) {
    return;
  }
  if (sourceId == TYPE_VIDEO) {
    videoFormat = format;
    infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
  } else if (sourceId == TYPE_AUDIO) {
    infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
  }
}
项目:ShaddockVideoPlayer    文件:DemoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs);
  }
}
项目:ShaddockVideoPlayer    文件:DemoPlayer.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (infoListener != null) {
    infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
  }
}
项目:android-tv-news    文件:VideoPlayer.java   
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
        long mediaTimeMs) {
    if (infoListener == null) {
        return;
    }
    if (sourceId == TYPE_VIDEO) {
        videoFormat = format;
        infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
    } else if (sourceId == TYPE_AUDIO) {
        infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
    }
}
项目:android-tv-news    文件:VideoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
        long mediaStartTimeMs, long mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
项目:android-tv-news    文件:VideoPlayer.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger,
        Format format,
        long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs,
        long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format,
                mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
项目:sbs-android-tv    文件:EventLogger.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
                          int mediaStartTimeMs, int mediaEndTimeMs) {
    loadStartTimeMs[sourceId] = SystemClock.elapsedRealtime();
    if (VerboseLogUtil.isTagEnabled(TAG)) {
        Log.v(TAG, "loadStart [" + getSessionTimeString() + ", " + sourceId + ", " + type
                + ", " + mediaStartTimeMs + ", " + mediaEndTimeMs + "]");
    }
}
项目:Mediathek    文件:Player.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
                            long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
项目:mimi-reader    文件:ExoPlayerHelper.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
                          long mediaStartTimeMs, long mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
项目:mimi-reader    文件:ExoPlayerHelper.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
                            long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
项目:ExoPlayerController    文件:EventLogger.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  loadStartTimeMs[sourceId] = SystemClock.elapsedRealtime();
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    Log.v(TAG, "loadStart [" + getSessionTimeString() + ", " + sourceId + ", " + type
        + ", " + mediaStartTimeMs + ", " + mediaEndTimeMs + "]");
  }
}
项目:ExoPlayerController    文件:EventLogger.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
     long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    long downloadTime = SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
    Log.v(TAG, "loadEnd [" + getSessionTimeString() + ", " + sourceId + ", " + downloadTime
        + "]");
  }
}
项目:sbs-android-tv    文件:VideoPlayer.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
                            int mediaStartTimeMs, int mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
项目:WliveTV    文件:EventLogger.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
     long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    long downloadTime = SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
    Log.v(TAG, "loadEnd [" + getSessionTimeString() + ", " + sourceId + ", " + downloadTime
        + "]");
  }
}
项目:ExoPlayer-Demo    文件:SmoothStreamingChunkSource.java   
public ExposedTrack(MediaFormat trackFormat, int elementIndex, Format[] adaptiveFormats,
    int adaptiveMaxWidth, int adaptiveMaxHeight) {
  this.trackFormat = trackFormat;
  this.elementIndex = elementIndex;
  this.adaptiveFormats = adaptiveFormats;
  this.adaptiveMaxWidth = adaptiveMaxWidth;
  this.adaptiveMaxHeight = adaptiveMaxHeight;
  this.fixedFormat = null;
}
项目:sbs-android-tv    文件:VideoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
                          int mediaStartTimeMs, int mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
项目:ExoPlayerController    文件:DemoPlayer.java   
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
    long mediaTimeMs) {
  if (infoListener == null) {
    return;
  }
  if (sourceId == TYPE_VIDEO) {
    videoFormat = format;
    infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
  } else if (sourceId == TYPE_AUDIO) {
    infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
  }
}
项目:ExoPlayerController    文件:DemoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs);
  }
}
项目:FriendsCameraSDK-android    文件:DemoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs);
  }
}
项目:sbs-android-tv    文件:EventLogger.java   
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
                            int mediaStartTimeMs, int mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
    if (VerboseLogUtil.isTagEnabled(TAG)) {
        long downloadTime = SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
        Log.v(TAG, "loadEnd [" + getSessionTimeString() + ", " + sourceId + ", " + downloadTime
                + "]");
    }
}
项目:talk-android    文件:DemoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs);
  }
}
项目:WliveTV    文件:DemoPlayer.java   
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs);
  }
}