com.google.android.exoplayer.chunk.Format Java Examples
The following examples show how to use
com.google.android.exoplayer.chunk.Format.
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: DemoPlayer.java From WliveTV with Apache License 2.0 | 5 votes |
@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); } }
Example #2
Source File: DemoPlayer.java From AndroidTvDemo with Apache License 2.0 | 5 votes |
@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); } }
Example #3
Source File: DemoPlayer.java From AndroidTvDemo with Apache License 2.0 | 5 votes |
@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); } }
Example #4
Source File: EventLogger.java From ShareBox with Apache License 2.0 | 5 votes |
@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 + "]"); } }
Example #5
Source File: SmoothStreamingChunkSource.java From Exoplayer_VLC with Apache License 2.0 | 5 votes |
private static MediaChunk newMediaChunk(Format formatInfo, Uri uri, String cacheKey, Extractor extractor, Map<UUID, byte[]> psshInfo, DataSource dataSource, int chunkIndex, boolean isLast, long chunkStartTimeUs, long nextChunkStartTimeUs, int trigger) { int nextChunkIndex = isLast ? -1 : chunkIndex + 1; long nextStartTimeUs = isLast ? -1 : nextChunkStartTimeUs; long offset = 0; DataSpec dataSpec = new DataSpec(uri, offset, -1, cacheKey); // In SmoothStreaming each chunk contains sample timestamps relative to the start of the chunk. // To convert them the absolute timestamps, we need to set sampleOffsetUs to -chunkStartTimeUs. return new ContainerMediaChunk(dataSource, dataSpec, formatInfo, trigger, chunkStartTimeUs, nextStartTimeUs, nextChunkIndex, extractor, psshInfo, false, -chunkStartTimeUs); }
Example #6
Source File: DemoPlayer.java From ShareBox with Apache License 2.0 | 5 votes |
@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); } }
Example #7
Source File: DemoPlayer.java From ShareBox with Apache License 2.0 | 5 votes |
@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); } }
Example #8
Source File: DemoPlayer.java From AndroidTvDemo with Apache License 2.0 | 5 votes |
@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); } }
Example #9
Source File: DemoPlayer.java From talk-android with MIT License | 5 votes |
@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); } }
Example #10
Source File: DemoPlayer.java From talk-android with MIT License | 5 votes |
@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); } }
Example #11
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 5 votes |
@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); } }
Example #12
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 5 votes |
@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); } }
Example #13
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 5 votes |
@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); } }
Example #14
Source File: Representation.java From Exoplayer_VLC with Apache License 2.0 | 5 votes |
/** * Constructs a new instance. * * @param periodStartMs The start time of the enclosing period in milliseconds. * @param periodDurationMs The duration of the enclosing period in milliseconds, or -1 if the * duration is unknown. * @param contentId Identifies the piece of content to which this representation belongs. * @param revisionId Identifies the revision of the content. * @param format The format of the representation. * @param segmentBase A segment base element for the representation. * @return The constructed instance. */ public static Representation newInstance(long periodStartMs, long periodDurationMs, String contentId, long revisionId, Format format, SegmentBase segmentBase) { if (segmentBase instanceof SingleSegmentBase) { return new SingleSegmentRepresentation(periodStartMs, periodDurationMs, contentId, revisionId, format, (SingleSegmentBase) segmentBase, -1); } else if (segmentBase instanceof MultiSegmentBase) { return new MultiSegmentRepresentation(periodStartMs, periodDurationMs, contentId, revisionId, format, (MultiSegmentBase) segmentBase); } else { throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or " + "MultiSegmentBase"); } }
Example #15
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 5 votes |
@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); } }
Example #16
Source File: EventLogger.java From AndroidTvDemo with Apache License 2.0 | 5 votes |
@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 + "]"); } }
Example #17
Source File: DemoPlayer.java From WliveTV with Apache License 2.0 | 5 votes |
@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); } }
Example #18
Source File: EventLogger.java From Android-Example-HLS-ExoPlayer with Apache License 2.0 | 5 votes |
@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 + "]"); } }
Example #19
Source File: EventLogger.java From Android-Example-HLS-ExoPlayer with Apache License 2.0 | 5 votes |
@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 + "]"); } }
Example #20
Source File: Representation.java From Exoplayer_VLC with Apache License 2.0 | 5 votes |
/** * @param periodStartMs The start time of the enclosing period in milliseconds. * @param periodDurationMs The duration of the enclosing period in milliseconds, or -1 if the * duration is unknown. * @param contentId Identifies the piece of content to which this representation belongs. * @param revisionId Identifies the revision of the content. * @param format The format of the representation. * @param segmentBase The segment base underlying the representation. * @param contentLength The content length, or -1 if unknown. */ public SingleSegmentRepresentation(long periodStartMs, long periodDurationMs, String contentId, long revisionId, Format format, SingleSegmentBase segmentBase, long contentLength) { super(periodStartMs, periodDurationMs, contentId, revisionId, format, segmentBase); this.uri = segmentBase.uri; this.indexUri = segmentBase.getIndex(); this.contentLength = contentLength; // If we have an index uri then the index is defined externally, and we shouldn't return one // directly. If we don't, then we can't do better than an index defining a single segment. segmentIndex = indexUri != null ? null : new DashSingleSegmentIndex(periodStartMs * 1000, periodDurationMs * 1000, new RangedUri(uri, null, 0, -1)); }
Example #21
Source File: VideoPlayer.java From iview-android-tv with MIT License | 5 votes |
@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); } }
Example #22
Source File: DemoPlayer.java From Android-Example-HLS-ExoPlayer with Apache License 2.0 | 5 votes |
@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); } }
Example #23
Source File: DemoPlayer.java From Android-Example-HLS-ExoPlayer with Apache License 2.0 | 5 votes |
@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); } }
Example #24
Source File: DemoPlayer.java From Android-Example-HLS-ExoPlayer with Apache License 2.0 | 5 votes |
@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); } }
Example #25
Source File: HlsEventProxy.java From exoplayer-textureview with Apache License 2.0 | 5 votes |
/** HlsSampleSource.EventListener */ @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); } }
Example #26
Source File: HlsEventProxy.java From exoplayer-textureview with Apache License 2.0 | 5 votes |
/** HlsSampleSource.EventListener */ @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); } }
Example #27
Source File: HlsEventProxy.java From exoplayer-textureview with Apache License 2.0 | 5 votes |
/** HlsSampleSource.EventListener */ @Override public void onDownstreamFormatChanged(int sourceId, Format format, int trigger, long mediaTimeMs) { if (infoListener == null) { return; } if (sourceId == Player.TYPE_VIDEO) { setVideoFormat(format); infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs); } else if (sourceId == Player.TYPE_AUDIO) { infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs); } }
Example #28
Source File: EventLogger.java From iview-android-tv with MIT License | 5 votes |
@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 + "]"); } }
Example #29
Source File: VideoPlayer.java From iview-android-tv with MIT License | 5 votes |
@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); } }
Example #30
Source File: MediaPresentationDescriptionParser.java From Exoplayer_VLC with Apache License 2.0 | 5 votes |
protected Representation parseRepresentation(XmlPullParser xpp, String contentId, Uri baseUrl, long periodStartMs, long periodDurationMs, String mimeType, String language, SegmentBase segmentBase) throws XmlPullParserException, IOException { String id = xpp.getAttributeValue(null, "id"); int bandwidth = parseInt(xpp, "bandwidth"); int audioSamplingRate = parseInt(xpp, "audioSamplingRate"); int width = parseInt(xpp, "width"); int height = parseInt(xpp, "height"); mimeType = parseString(xpp, "mimeType", mimeType); String codecs = parseString(xpp, "codecs", null); int numChannels = -1; do { xpp.next(); if (isStartTag(xpp, "BaseURL")) { baseUrl = parseBaseUrl(xpp, baseUrl); } else if (isStartTag(xpp, "AudioChannelConfiguration")) { numChannels = Integer.parseInt(xpp.getAttributeValue(null, "value")); } else if (isStartTag(xpp, "SegmentBase")) { segmentBase = parseSegmentBase(xpp, baseUrl, (SingleSegmentBase) segmentBase); } else if (isStartTag(xpp, "SegmentList")) { segmentBase = parseSegmentList(xpp, baseUrl, (SegmentList) segmentBase, periodDurationMs); } else if (isStartTag(xpp, "SegmentTemplate")) { segmentBase = parseSegmentTemplate(xpp, baseUrl, (SegmentTemplate) segmentBase, periodDurationMs); } } while (!isEndTag(xpp, "Representation")); Format format = buildFormat(id, mimeType, width, height, numChannels, audioSamplingRate, bandwidth, language, codecs); return buildRepresentation(periodStartMs, periodDurationMs, contentId, -1, format, segmentBase != null ? segmentBase : new SingleSegmentBase(baseUrl)); }