├── .gitignore
├── .idea
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── hyq
│ │ └── hm
│ │ └── openglexo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── hyq
│ │ │ └── hm
│ │ │ └── openglexo
│ │ │ ├── EGLUtils.java
│ │ │ ├── GLFramebuffer.java
│ │ │ ├── GuideActivity.java
│ │ │ ├── MainActivity.java
│ │ │ └── ShaderUtils.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── ic_launcher_background.xml
│ │ └── ic_play.xml
│ │ ├── layout
│ │ ├── activity_guide.xml
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── hyq
│ └── hm
│ └── openglexo
│ └── ExampleUnitTest.java
├── build.gradle
├── exoplayer
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── example
│ │ └── exoplayer
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── google
│ │ │ └── android
│ │ │ └── exoplayer2
│ │ │ ├── BaseRenderer.java
│ │ │ ├── C.java
│ │ │ ├── ControlDispatcher.java
│ │ │ ├── DefaultControlDispatcher.java
│ │ │ ├── DefaultLoadControl.java
│ │ │ ├── DefaultMediaClock.java
│ │ │ ├── DefaultRenderersFactory.java
│ │ │ ├── ExoPlaybackException.java
│ │ │ ├── ExoPlayer.java
│ │ │ ├── ExoPlayerFactory.java
│ │ │ ├── ExoPlayerImpl.java
│ │ │ ├── ExoPlayerImplInternal.java
│ │ │ ├── ExoPlayerLibraryInfo.java
│ │ │ ├── Format.java
│ │ │ ├── FormatHolder.java
│ │ │ ├── IllegalSeekPositionException.java
│ │ │ ├── LoadControl.java
│ │ │ ├── MediaPeriodHolder.java
│ │ │ ├── MediaPeriodInfo.java
│ │ │ ├── MediaPeriodQueue.java
│ │ │ ├── NoSampleRenderer.java
│ │ │ ├── ParserException.java
│ │ │ ├── PlaybackInfo.java
│ │ │ ├── PlaybackParameters.java
│ │ │ ├── PlaybackPreparer.java
│ │ │ ├── Player.java
│ │ │ ├── PlayerMessage.java
│ │ │ ├── Renderer.java
│ │ │ ├── RendererCapabilities.java
│ │ │ ├── RendererConfiguration.java
│ │ │ ├── RenderersFactory.java
│ │ │ ├── SeekParameters.java
│ │ │ ├── SimpleExoPlayer.java
│ │ │ ├── Timeline.java
│ │ │ ├── audio
│ │ │ ├── Ac3Util.java
│ │ │ ├── AudioAttributes.java
│ │ │ ├── AudioCapabilities.java
│ │ │ ├── AudioCapabilitiesReceiver.java
│ │ │ ├── AudioDecoderException.java
│ │ │ ├── AudioProcessor.java
│ │ │ ├── AudioRendererEventListener.java
│ │ │ ├── AudioSink.java
│ │ │ ├── ChannelMappingAudioProcessor.java
│ │ │ ├── DefaultAudioSink.java
│ │ │ ├── DtsUtil.java
│ │ │ ├── FloatResamplingAudioProcessor.java
│ │ │ ├── MediaCodecAudioRenderer.java
│ │ │ ├── ResamplingAudioProcessor.java
│ │ │ ├── SimpleDecoderAudioRenderer.java
│ │ │ ├── Sonic.java
│ │ │ ├── SonicAudioProcessor.java
│ │ │ └── TrimmingAudioProcessor.java
│ │ │ ├── decoder
│ │ │ ├── Buffer.java
│ │ │ ├── CryptoInfo.java
│ │ │ ├── Decoder.java
│ │ │ ├── DecoderCounters.java
│ │ │ ├── DecoderInputBuffer.java
│ │ │ ├── OutputBuffer.java
│ │ │ ├── SimpleDecoder.java
│ │ │ └── SimpleOutputBuffer.java
│ │ │ ├── drm
│ │ │ ├── ClearKeyUtil.java
│ │ │ ├── DecryptionException.java
│ │ │ ├── DefaultDrmSession.java
│ │ │ ├── DefaultDrmSessionManager.java
│ │ │ ├── DrmInitData.java
│ │ │ ├── DrmSession.java
│ │ │ ├── DrmSessionManager.java
│ │ │ ├── ErrorStateDrmSession.java
│ │ │ ├── ExoMediaCrypto.java
│ │ │ ├── ExoMediaDrm.java
│ │ │ ├── FrameworkMediaCrypto.java
│ │ │ ├── FrameworkMediaDrm.java
│ │ │ ├── HttpMediaDrmCallback.java
│ │ │ ├── KeysExpiredException.java
│ │ │ ├── LocalMediaDrmCallback.java
│ │ │ ├── MediaDrmCallback.java
│ │ │ ├── OfflineLicenseHelper.java
│ │ │ ├── UnsupportedDrmException.java
│ │ │ └── WidevineUtil.java
│ │ │ ├── extractor
│ │ │ ├── ChunkIndex.java
│ │ │ ├── DefaultExtractorInput.java
│ │ │ ├── DefaultExtractorsFactory.java
│ │ │ ├── DummyTrackOutput.java
│ │ │ ├── Extractor.java
│ │ │ ├── ExtractorInput.java
│ │ │ ├── ExtractorOutput.java
│ │ │ ├── ExtractorsFactory.java
│ │ │ ├── GaplessInfoHolder.java
│ │ │ ├── MpegAudioHeader.java
│ │ │ ├── PositionHolder.java
│ │ │ ├── SeekMap.java
│ │ │ ├── SeekPoint.java
│ │ │ ├── TrackOutput.java
│ │ │ ├── flv
│ │ │ │ ├── AudioTagPayloadReader.java
│ │ │ │ ├── FlvExtractor.java
│ │ │ │ ├── ScriptTagPayloadReader.java
│ │ │ │ ├── TagPayloadReader.java
│ │ │ │ └── VideoTagPayloadReader.java
│ │ │ ├── mkv
│ │ │ │ ├── DefaultEbmlReader.java
│ │ │ │ ├── EbmlReader.java
│ │ │ │ ├── EbmlReaderOutput.java
│ │ │ │ ├── MatroskaExtractor.java
│ │ │ │ ├── Sniffer.java
│ │ │ │ └── VarintReader.java
│ │ │ ├── mp3
│ │ │ │ ├── ConstantBitrateSeeker.java
│ │ │ │ ├── Mp3Extractor.java
│ │ │ │ ├── VbriSeeker.java
│ │ │ │ └── XingSeeker.java
│ │ │ ├── mp4
│ │ │ │ ├── Atom.java
│ │ │ │ ├── AtomParsers.java
│ │ │ │ ├── DefaultSampleValues.java
│ │ │ │ ├── FixedSampleSizeRechunker.java
│ │ │ │ ├── FragmentedMp4Extractor.java
│ │ │ │ ├── MetadataUtil.java
│ │ │ │ ├── Mp4Extractor.java
│ │ │ │ ├── PsshAtomUtil.java
│ │ │ │ ├── Sniffer.java
│ │ │ │ ├── Track.java
│ │ │ │ ├── TrackEncryptionBox.java
│ │ │ │ ├── TrackFragment.java
│ │ │ │ └── TrackSampleTable.java
│ │ │ ├── ogg
│ │ │ │ ├── DefaultOggSeeker.java
│ │ │ │ ├── FlacReader.java
│ │ │ │ ├── OggExtractor.java
│ │ │ │ ├── OggPacket.java
│ │ │ │ ├── OggPageHeader.java
│ │ │ │ ├── OggSeeker.java
│ │ │ │ ├── OpusReader.java
│ │ │ │ ├── StreamReader.java
│ │ │ │ ├── VorbisBitArray.java
│ │ │ │ ├── VorbisReader.java
│ │ │ │ └── VorbisUtil.java
│ │ │ ├── rawcc
│ │ │ │ └── RawCcExtractor.java
│ │ │ ├── ts
│ │ │ │ ├── Ac3Extractor.java
│ │ │ │ ├── Ac3Reader.java
│ │ │ │ ├── AdtsExtractor.java
│ │ │ │ ├── AdtsReader.java
│ │ │ │ ├── DefaultTsPayloadReaderFactory.java
│ │ │ │ ├── DtsReader.java
│ │ │ │ ├── DvbSubtitleReader.java
│ │ │ │ ├── ElementaryStreamReader.java
│ │ │ │ ├── H262Reader.java
│ │ │ │ ├── H264Reader.java
│ │ │ │ ├── H265Reader.java
│ │ │ │ ├── Id3Reader.java
│ │ │ │ ├── LatmReader.java
│ │ │ │ ├── MpegAudioReader.java
│ │ │ │ ├── NalUnitTargetBuffer.java
│ │ │ │ ├── PesReader.java
│ │ │ │ ├── PsExtractor.java
│ │ │ │ ├── SectionPayloadReader.java
│ │ │ │ ├── SectionReader.java
│ │ │ │ ├── SeiReader.java
│ │ │ │ ├── SpliceInfoSectionReader.java
│ │ │ │ ├── TsExtractor.java
│ │ │ │ └── TsPayloadReader.java
│ │ │ └── wav
│ │ │ │ ├── WavExtractor.java
│ │ │ │ ├── WavHeader.java
│ │ │ │ └── WavHeaderReader.java
│ │ │ ├── mediacodec
│ │ │ ├── MediaCodecInfo.java
│ │ │ ├── MediaCodecRenderer.java
│ │ │ ├── MediaCodecSelector.java
│ │ │ └── MediaCodecUtil.java
│ │ │ ├── metadata
│ │ │ ├── Metadata.java
│ │ │ ├── MetadataDecoder.java
│ │ │ ├── MetadataDecoderException.java
│ │ │ ├── MetadataDecoderFactory.java
│ │ │ ├── MetadataInputBuffer.java
│ │ │ ├── MetadataOutput.java
│ │ │ ├── MetadataRenderer.java
│ │ │ ├── emsg
│ │ │ │ ├── EventMessage.java
│ │ │ │ ├── EventMessageDecoder.java
│ │ │ │ └── EventMessageEncoder.java
│ │ │ ├── id3
│ │ │ │ ├── ApicFrame.java
│ │ │ │ ├── BinaryFrame.java
│ │ │ │ ├── ChapterFrame.java
│ │ │ │ ├── ChapterTocFrame.java
│ │ │ │ ├── CommentFrame.java
│ │ │ │ ├── GeobFrame.java
│ │ │ │ ├── Id3Decoder.java
│ │ │ │ ├── Id3Frame.java
│ │ │ │ ├── PrivFrame.java
│ │ │ │ ├── TextInformationFrame.java
│ │ │ │ └── UrlLinkFrame.java
│ │ │ └── scte35
│ │ │ │ ├── PrivateCommand.java
│ │ │ │ ├── SpliceCommand.java
│ │ │ │ ├── SpliceInfoDecoder.java
│ │ │ │ ├── SpliceInsertCommand.java
│ │ │ │ ├── SpliceNullCommand.java
│ │ │ │ ├── SpliceScheduleCommand.java
│ │ │ │ └── TimeSignalCommand.java
│ │ │ ├── offline
│ │ │ ├── DownloadException.java
│ │ │ ├── Downloader.java
│ │ │ ├── DownloaderConstructorHelper.java
│ │ │ ├── ProgressiveDownloader.java
│ │ │ └── SegmentDownloader.java
│ │ │ ├── source
│ │ │ ├── AbstractConcatenatedTimeline.java
│ │ │ ├── AdaptiveMediaSourceEventListener.java
│ │ │ ├── BehindLiveWindowException.java
│ │ │ ├── ClippingMediaPeriod.java
│ │ │ ├── ClippingMediaSource.java
│ │ │ ├── CompositeMediaSource.java
│ │ │ ├── CompositeSequenceableLoader.java
│ │ │ ├── CompositeSequenceableLoaderFactory.java
│ │ │ ├── ConcatenatingMediaSource.java
│ │ │ ├── DefaultCompositeSequenceableLoaderFactory.java
│ │ │ ├── DeferredMediaPeriod.java
│ │ │ ├── DynamicConcatenatingMediaSource.java
│ │ │ ├── EmptySampleStream.java
│ │ │ ├── ExtractorMediaPeriod.java
│ │ │ ├── ExtractorMediaSource.java
│ │ │ ├── ForwardingTimeline.java
│ │ │ ├── LoopingMediaSource.java
│ │ │ ├── MediaPeriod.java
│ │ │ ├── MediaSource.java
│ │ │ ├── MediaSourceEventListener.java
│ │ │ ├── MergingMediaPeriod.java
│ │ │ ├── MergingMediaSource.java
│ │ │ ├── SampleMetadataQueue.java
│ │ │ ├── SampleQueue.java
│ │ │ ├── SampleStream.java
│ │ │ ├── SequenceableLoader.java
│ │ │ ├── ShuffleOrder.java
│ │ │ ├── SinglePeriodTimeline.java
│ │ │ ├── SingleSampleMediaPeriod.java
│ │ │ ├── SingleSampleMediaSource.java
│ │ │ ├── TrackGroup.java
│ │ │ ├── TrackGroupArray.java
│ │ │ ├── UnrecognizedInputFormatException.java
│ │ │ ├── ads
│ │ │ │ ├── AdPlaybackState.java
│ │ │ │ ├── AdsLoader.java
│ │ │ │ ├── AdsMediaSource.java
│ │ │ │ └── SinglePeriodAdTimeline.java
│ │ │ ├── chunk
│ │ │ │ ├── BaseMediaChunk.java
│ │ │ │ ├── BaseMediaChunkOutput.java
│ │ │ │ ├── Chunk.java
│ │ │ │ ├── ChunkExtractorWrapper.java
│ │ │ │ ├── ChunkHolder.java
│ │ │ │ ├── ChunkSampleStream.java
│ │ │ │ ├── ChunkSource.java
│ │ │ │ ├── ChunkedTrackBlacklistUtil.java
│ │ │ │ ├── ContainerMediaChunk.java
│ │ │ │ ├── DataChunk.java
│ │ │ │ ├── InitializationChunk.java
│ │ │ │ ├── MediaChunk.java
│ │ │ │ └── SingleSampleMediaChunk.java
│ │ │ ├── dash
│ │ │ │ ├── DashChunkSource.java
│ │ │ │ ├── DashManifestStaleException.java
│ │ │ │ ├── DashMediaPeriod.java
│ │ │ │ ├── DashMediaSource.java
│ │ │ │ ├── DashSegmentIndex.java
│ │ │ │ ├── DashUtil.java
│ │ │ │ ├── DashWrappingSegmentIndex.java
│ │ │ │ ├── DefaultDashChunkSource.java
│ │ │ │ ├── EventSampleStream.java
│ │ │ │ ├── PlayerEmsgHandler.java
│ │ │ │ ├── manifest
│ │ │ │ │ ├── AdaptationSet.java
│ │ │ │ │ ├── DashManifest.java
│ │ │ │ │ ├── DashManifestParser.java
│ │ │ │ │ ├── Descriptor.java
│ │ │ │ │ ├── EventStream.java
│ │ │ │ │ ├── FilteringDashManifestParser.java
│ │ │ │ │ ├── Period.java
│ │ │ │ │ ├── RangedUri.java
│ │ │ │ │ ├── Representation.java
│ │ │ │ │ ├── RepresentationKey.java
│ │ │ │ │ ├── SegmentBase.java
│ │ │ │ │ ├── SingleSegmentIndex.java
│ │ │ │ │ ├── UrlTemplate.java
│ │ │ │ │ └── UtcTimingElement.java
│ │ │ │ └── offline
│ │ │ │ │ └── DashDownloader.java
│ │ │ ├── hls
│ │ │ │ ├── Aes128DataSource.java
│ │ │ │ ├── DefaultHlsDataSourceFactory.java
│ │ │ │ ├── DefaultHlsExtractorFactory.java
│ │ │ │ ├── HlsChunkSource.java
│ │ │ │ ├── HlsDataSourceFactory.java
│ │ │ │ ├── HlsExtractorFactory.java
│ │ │ │ ├── HlsManifest.java
│ │ │ │ ├── HlsMediaChunk.java
│ │ │ │ ├── HlsMediaPeriod.java
│ │ │ │ ├── HlsMediaSource.java
│ │ │ │ ├── HlsSampleStream.java
│ │ │ │ ├── HlsSampleStreamWrapper.java
│ │ │ │ ├── SampleQueueMappingException.java
│ │ │ │ ├── TimestampAdjusterProvider.java
│ │ │ │ ├── WebvttExtractor.java
│ │ │ │ ├── offline
│ │ │ │ │ └── HlsDownloader.java
│ │ │ │ └── playlist
│ │ │ │ │ ├── FilteringHlsPlaylistParser.java
│ │ │ │ │ ├── HlsMasterPlaylist.java
│ │ │ │ │ ├── HlsMediaPlaylist.java
│ │ │ │ │ ├── HlsPlaylist.java
│ │ │ │ │ ├── HlsPlaylistParser.java
│ │ │ │ │ └── HlsPlaylistTracker.java
│ │ │ └── smoothstreaming
│ │ │ │ ├── DefaultSsChunkSource.java
│ │ │ │ ├── SsChunkSource.java
│ │ │ │ ├── SsMediaPeriod.java
│ │ │ │ ├── SsMediaSource.java
│ │ │ │ ├── manifest
│ │ │ │ ├── FilteringSsManifestParser.java
│ │ │ │ ├── SsManifest.java
│ │ │ │ ├── SsManifestParser.java
│ │ │ │ ├── SsUtil.java
│ │ │ │ └── TrackKey.java
│ │ │ │ └── offline
│ │ │ │ └── SsDownloader.java
│ │ │ ├── text
│ │ │ ├── CaptionStyleCompat.java
│ │ │ ├── Cue.java
│ │ │ ├── SimpleSubtitleDecoder.java
│ │ │ ├── SimpleSubtitleOutputBuffer.java
│ │ │ ├── Subtitle.java
│ │ │ ├── SubtitleDecoder.java
│ │ │ ├── SubtitleDecoderException.java
│ │ │ ├── SubtitleDecoderFactory.java
│ │ │ ├── SubtitleInputBuffer.java
│ │ │ ├── SubtitleOutputBuffer.java
│ │ │ ├── TextOutput.java
│ │ │ ├── TextRenderer.java
│ │ │ ├── cea
│ │ │ │ ├── Cea608Decoder.java
│ │ │ │ ├── Cea708Cue.java
│ │ │ │ ├── Cea708Decoder.java
│ │ │ │ ├── CeaDecoder.java
│ │ │ │ ├── CeaSubtitle.java
│ │ │ │ └── CeaUtil.java
│ │ │ ├── dvb
│ │ │ │ ├── DvbDecoder.java
│ │ │ │ ├── DvbParser.java
│ │ │ │ └── DvbSubtitle.java
│ │ │ ├── pgs
│ │ │ │ ├── PgsDecoder.java
│ │ │ │ └── PgsSubtitle.java
│ │ │ ├── ssa
│ │ │ │ ├── SsaDecoder.java
│ │ │ │ └── SsaSubtitle.java
│ │ │ ├── subrip
│ │ │ │ ├── SubripDecoder.java
│ │ │ │ └── SubripSubtitle.java
│ │ │ ├── ttml
│ │ │ │ ├── TtmlDecoder.java
│ │ │ │ ├── TtmlNode.java
│ │ │ │ ├── TtmlRegion.java
│ │ │ │ ├── TtmlRenderUtil.java
│ │ │ │ ├── TtmlStyle.java
│ │ │ │ └── TtmlSubtitle.java
│ │ │ ├── tx3g
│ │ │ │ ├── Tx3gDecoder.java
│ │ │ │ └── Tx3gSubtitle.java
│ │ │ └── webvtt
│ │ │ │ ├── CssParser.java
│ │ │ │ ├── Mp4WebvttDecoder.java
│ │ │ │ ├── Mp4WebvttSubtitle.java
│ │ │ │ ├── WebvttCssStyle.java
│ │ │ │ ├── WebvttCue.java
│ │ │ │ ├── WebvttCueParser.java
│ │ │ │ ├── WebvttDecoder.java
│ │ │ │ ├── WebvttParserUtil.java
│ │ │ │ └── WebvttSubtitle.java
│ │ │ ├── trackselection
│ │ │ ├── AdaptiveTrackSelection.java
│ │ │ ├── BaseTrackSelection.java
│ │ │ ├── DefaultTrackSelector.java
│ │ │ ├── FixedTrackSelection.java
│ │ │ ├── MappingTrackSelector.java
│ │ │ ├── RandomTrackSelection.java
│ │ │ ├── TrackSelection.java
│ │ │ ├── TrackSelectionArray.java
│ │ │ ├── TrackSelector.java
│ │ │ └── TrackSelectorResult.java
│ │ │ ├── ui
│ │ │ ├── AspectRatioFrameLayout.java
│ │ │ ├── DebugTextViewHelper.java
│ │ │ ├── DefaultTimeBar.java
│ │ │ ├── PlaybackControlView.java
│ │ │ ├── PlayerControlView.java
│ │ │ ├── PlayerView.java
│ │ │ ├── SimpleExoPlayerView.java
│ │ │ ├── SubtitlePainter.java
│ │ │ ├── SubtitleView.java
│ │ │ └── TimeBar.java
│ │ │ ├── upstream
│ │ │ ├── Allocation.java
│ │ │ ├── Allocator.java
│ │ │ ├── AssetDataSource.java
│ │ │ ├── BandwidthMeter.java
│ │ │ ├── ByteArrayDataSink.java
│ │ │ ├── ByteArrayDataSource.java
│ │ │ ├── ContentDataSource.java
│ │ │ ├── DataSchemeDataSource.java
│ │ │ ├── DataSink.java
│ │ │ ├── DataSource.java
│ │ │ ├── DataSourceException.java
│ │ │ ├── DataSourceInputStream.java
│ │ │ ├── DataSpec.java
│ │ │ ├── DefaultAllocator.java
│ │ │ ├── DefaultBandwidthMeter.java
│ │ │ ├── DefaultDataSource.java
│ │ │ ├── DefaultDataSourceFactory.java
│ │ │ ├── DefaultHttpDataSource.java
│ │ │ ├── DefaultHttpDataSourceFactory.java
│ │ │ ├── DummyDataSource.java
│ │ │ ├── FileDataSource.java
│ │ │ ├── FileDataSourceFactory.java
│ │ │ ├── HttpDataSource.java
│ │ │ ├── Loader.java
│ │ │ ├── LoaderErrorThrower.java
│ │ │ ├── ParsingLoadable.java
│ │ │ ├── PriorityDataSource.java
│ │ │ ├── PriorityDataSourceFactory.java
│ │ │ ├── RawResourceDataSource.java
│ │ │ ├── TeeDataSource.java
│ │ │ ├── TransferListener.java
│ │ │ ├── UdpDataSource.java
│ │ │ ├── cache
│ │ │ │ ├── Cache.java
│ │ │ │ ├── CacheDataSink.java
│ │ │ │ ├── CacheDataSinkFactory.java
│ │ │ │ ├── CacheDataSource.java
│ │ │ │ ├── CacheDataSourceFactory.java
│ │ │ │ ├── CacheEvictor.java
│ │ │ │ ├── CacheSpan.java
│ │ │ │ ├── CacheUtil.java
│ │ │ │ ├── CachedContent.java
│ │ │ │ ├── CachedContentIndex.java
│ │ │ │ ├── CachedRegionTracker.java
│ │ │ │ ├── LeastRecentlyUsedCacheEvictor.java
│ │ │ │ ├── NoOpCacheEvictor.java
│ │ │ │ ├── SimpleCache.java
│ │ │ │ └── SimpleCacheSpan.java
│ │ │ └── crypto
│ │ │ │ ├── AesCipherDataSink.java
│ │ │ │ ├── AesCipherDataSource.java
│ │ │ │ ├── AesFlushingCipher.java
│ │ │ │ └── CryptoUtil.java
│ │ │ ├── util
│ │ │ ├── Assertions.java
│ │ │ ├── AtomicFile.java
│ │ │ ├── Clock.java
│ │ │ ├── CodecSpecificDataUtil.java
│ │ │ ├── ColorParser.java
│ │ │ ├── ConditionVariable.java
│ │ │ ├── ErrorMessageProvider.java
│ │ │ ├── EventLogger.java
│ │ │ ├── FlacStreamInfo.java
│ │ │ ├── HandlerWrapper.java
│ │ │ ├── LibraryLoader.java
│ │ │ ├── LongArray.java
│ │ │ ├── MediaClock.java
│ │ │ ├── MimeTypes.java
│ │ │ ├── NalUnitUtil.java
│ │ │ ├── ParsableBitArray.java
│ │ │ ├── ParsableByteArray.java
│ │ │ ├── ParsableNalUnitBitArray.java
│ │ │ ├── Predicate.java
│ │ │ ├── PriorityTaskManager.java
│ │ │ ├── RepeatModeUtil.java
│ │ │ ├── ReusableBufferedOutputStream.java
│ │ │ ├── SlidingPercentile.java
│ │ │ ├── StandaloneMediaClock.java
│ │ │ ├── SystemClock.java
│ │ │ ├── SystemHandlerWrapper.java
│ │ │ ├── TimestampAdjuster.java
│ │ │ ├── TraceUtil.java
│ │ │ ├── UriUtil.java
│ │ │ ├── Util.java
│ │ │ └── XmlPullParserUtil.java
│ │ │ └── video
│ │ │ ├── AvcConfig.java
│ │ │ ├── ColorInfo.java
│ │ │ ├── DummySurface.java
│ │ │ ├── HevcConfig.java
│ │ │ ├── MediaCodecVideoRenderer.java
│ │ │ ├── VideoFrameReleaseTimeHelper.java
│ │ │ ├── VideoListener.java
│ │ │ ├── VideoRendererEventListener.java
│ │ │ └── VideoTimeListener.java
│ ├── javadoc
│ │ └── com
│ │ │ └── google
│ │ │ └── android
│ │ │ └── exoplayer2
│ │ │ └── doc-files
│ │ │ ├── exoplayer-threading-model.svg
│ │ │ ├── renderer-states.svg
│ │ │ ├── timeline-advanced.svg
│ │ │ ├── timeline-live-indefinite.svg
│ │ │ ├── timeline-live-limited.svg
│ │ │ ├── timeline-live-multi-period.svg
│ │ │ ├── timeline-period.svg
│ │ │ ├── timeline-playlist.svg
│ │ │ ├── timeline-single-file-midrolls.svg
│ │ │ ├── timeline-single-file.svg
│ │ │ └── timeline-window.svg
│ └── res
│ │ ├── drawable-anydpi-v21
│ │ ├── exo_controls_fastforward.xml
│ │ ├── exo_controls_fullscreen_enter.xml
│ │ ├── exo_controls_fullscreen_exit.xml
│ │ ├── exo_controls_next.xml
│ │ ├── exo_controls_pause.xml
│ │ ├── exo_controls_play.xml
│ │ ├── exo_controls_previous.xml
│ │ ├── exo_controls_repeat_all.xml
│ │ ├── exo_controls_repeat_off.xml
│ │ ├── exo_controls_repeat_one.xml
│ │ ├── exo_controls_rewind.xml
│ │ └── exo_controls_shuffle.xml
│ │ ├── drawable-hdpi
│ │ ├── exo_controls_fastforward.png
│ │ ├── exo_controls_fullscreen_enter.png
│ │ ├── exo_controls_fullscreen_exit.png
│ │ ├── exo_controls_next.png
│ │ ├── exo_controls_pause.png
│ │ ├── exo_controls_play.png
│ │ ├── exo_controls_previous.png
│ │ ├── exo_controls_repeat_all.png
│ │ ├── exo_controls_repeat_off.png
│ │ ├── exo_controls_repeat_one.png
│ │ ├── exo_controls_rewind.png
│ │ └── exo_controls_shuffle.png
│ │ ├── drawable-ldpi
│ │ ├── exo_controls_fastforward.png
│ │ ├── exo_controls_fullscreen_enter.png
│ │ ├── exo_controls_fullscreen_exit.png
│ │ ├── exo_controls_next.png
│ │ ├── exo_controls_pause.png
│ │ ├── exo_controls_play.png
│ │ ├── exo_controls_previous.png
│ │ ├── exo_controls_repeat_all.png
│ │ ├── exo_controls_repeat_off.png
│ │ ├── exo_controls_repeat_one.png
│ │ ├── exo_controls_rewind.png
│ │ └── exo_controls_shuffle.png
│ │ ├── drawable-mdpi
│ │ ├── exo_controls_fastforward.png
│ │ ├── exo_controls_fullscreen_enter.png
│ │ ├── exo_controls_fullscreen_exit.png
│ │ ├── exo_controls_next.png
│ │ ├── exo_controls_pause.png
│ │ ├── exo_controls_play.png
│ │ ├── exo_controls_previous.png
│ │ ├── exo_controls_repeat_all.png
│ │ ├── exo_controls_repeat_off.png
│ │ ├── exo_controls_repeat_one.png
│ │ ├── exo_controls_rewind.png
│ │ └── exo_controls_shuffle.png
│ │ ├── drawable-xhdpi
│ │ ├── exo_controls_fastforward.png
│ │ ├── exo_controls_fullscreen_enter.png
│ │ ├── exo_controls_fullscreen_exit.png
│ │ ├── exo_controls_next.png
│ │ ├── exo_controls_pause.png
│ │ ├── exo_controls_play.png
│ │ ├── exo_controls_previous.png
│ │ ├── exo_controls_repeat_all.png
│ │ ├── exo_controls_repeat_off.png
│ │ ├── exo_controls_repeat_one.png
│ │ ├── exo_controls_rewind.png
│ │ └── exo_controls_shuffle.png
│ │ ├── drawable-xxhdpi
│ │ ├── exo_controls_fastforward.png
│ │ ├── exo_controls_fullscreen_enter.png
│ │ ├── exo_controls_fullscreen_exit.png
│ │ ├── exo_controls_next.png
│ │ ├── exo_controls_pause.png
│ │ ├── exo_controls_play.png
│ │ ├── exo_controls_previous.png
│ │ ├── exo_controls_repeat_all.png
│ │ ├── exo_controls_repeat_off.png
│ │ ├── exo_controls_repeat_one.png
│ │ ├── exo_controls_rewind.png
│ │ └── exo_controls_shuffle.png
│ │ ├── drawable
│ │ └── exo_edit_mode_logo.xml
│ │ ├── layout
│ │ ├── exo_playback_control_view.xml
│ │ ├── exo_player_control_view.xml
│ │ ├── exo_player_view.xml
│ │ └── exo_simple_player_view.xml
│ │ ├── values-af
│ │ └── strings.xml
│ │ ├── values-am
│ │ └── strings.xml
│ │ ├── values-ar
│ │ └── strings.xml
│ │ ├── values-az-rAZ
│ │ └── strings.xml
│ │ ├── values-b+sr+Latn
│ │ └── strings.xml
│ │ ├── values-be-rBY
│ │ └── strings.xml
│ │ ├── values-bg
│ │ └── strings.xml
│ │ ├── values-bn-rBD
│ │ └── strings.xml
│ │ ├── values-bs-rBA
│ │ └── strings.xml
│ │ ├── values-ca
│ │ └── strings.xml
│ │ ├── values-cs
│ │ └── strings.xml
│ │ ├── values-da
│ │ └── strings.xml
│ │ ├── values-de
│ │ └── strings.xml
│ │ ├── values-el
│ │ └── strings.xml
│ │ ├── values-en-rAU
│ │ └── strings.xml
│ │ ├── values-en-rGB
│ │ └── strings.xml
│ │ ├── values-en-rIN
│ │ └── strings.xml
│ │ ├── values-es-rUS
│ │ └── strings.xml
│ │ ├── values-es
│ │ └── strings.xml
│ │ ├── values-et-rEE
│ │ └── strings.xml
│ │ ├── values-eu-rES
│ │ └── strings.xml
│ │ ├── values-fa
│ │ └── strings.xml
│ │ ├── values-fi
│ │ └── strings.xml
│ │ ├── values-fr-rCA
│ │ └── strings.xml
│ │ ├── values-fr
│ │ └── strings.xml
│ │ ├── values-gl-rES
│ │ └── strings.xml
│ │ ├── values-gu-rIN
│ │ └── strings.xml
│ │ ├── values-hi
│ │ └── strings.xml
│ │ ├── values-hr
│ │ └── strings.xml
│ │ ├── values-hu
│ │ └── strings.xml
│ │ ├── values-hy-rAM
│ │ └── strings.xml
│ │ ├── values-in
│ │ └── strings.xml
│ │ ├── values-is-rIS
│ │ └── strings.xml
│ │ ├── values-it
│ │ └── strings.xml
│ │ ├── values-iw
│ │ └── strings.xml
│ │ ├── values-ja
│ │ └── strings.xml
│ │ ├── values-ka-rGE
│ │ └── strings.xml
│ │ ├── values-kk-rKZ
│ │ └── strings.xml
│ │ ├── values-km-rKH
│ │ └── strings.xml
│ │ ├── values-kn-rIN
│ │ └── strings.xml
│ │ ├── values-ko
│ │ └── strings.xml
│ │ ├── values-ky-rKG
│ │ └── strings.xml
│ │ ├── values-lo-rLA
│ │ └── strings.xml
│ │ ├── values-lt
│ │ └── strings.xml
│ │ ├── values-lv
│ │ └── strings.xml
│ │ ├── values-mk-rMK
│ │ └── strings.xml
│ │ ├── values-ml-rIN
│ │ └── strings.xml
│ │ ├── values-mn-rMN
│ │ └── strings.xml
│ │ ├── values-mr-rIN
│ │ └── strings.xml
│ │ ├── values-ms-rMY
│ │ └── strings.xml
│ │ ├── values-my-rMM
│ │ └── strings.xml
│ │ ├── values-nb
│ │ └── strings.xml
│ │ ├── values-ne-rNP
│ │ └── strings.xml
│ │ ├── values-nl
│ │ └── strings.xml
│ │ ├── values-pa-rIN
│ │ └── strings.xml
│ │ ├── values-pl
│ │ └── strings.xml
│ │ ├── values-pt-rBR
│ │ └── strings.xml
│ │ ├── values-pt-rPT
│ │ └── strings.xml
│ │ ├── values-pt
│ │ └── strings.xml
│ │ ├── values-ro
│ │ └── strings.xml
│ │ ├── values-ru
│ │ └── strings.xml
│ │ ├── values-si-rLK
│ │ └── strings.xml
│ │ ├── values-sk
│ │ └── strings.xml
│ │ ├── values-sl
│ │ └── strings.xml
│ │ ├── values-sq-rAL
│ │ └── strings.xml
│ │ ├── values-sr
│ │ └── strings.xml
│ │ ├── values-sv
│ │ └── strings.xml
│ │ ├── values-sw
│ │ └── strings.xml
│ │ ├── values-ta-rIN
│ │ └── strings.xml
│ │ ├── values-te-rIN
│ │ └── strings.xml
│ │ ├── values-th
│ │ └── strings.xml
│ │ ├── values-tl
│ │ └── strings.xml
│ │ ├── values-tr
│ │ └── strings.xml
│ │ ├── values-uk
│ │ └── strings.xml
│ │ ├── values-ur-rPK
│ │ └── strings.xml
│ │ ├── values-uz-rUZ
│ │ └── strings.xml
│ │ ├── values-vi
│ │ └── strings.xml
│ │ ├── values-zh-rCN
│ │ └── strings.xml
│ │ ├── values-zh-rHK
│ │ └── strings.xml
│ │ ├── values-zh-rTW
│ │ └── strings.xml
│ │ ├── values-zu
│ │ └── strings.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── constants.xml
│ │ ├── ids.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── example
│ └── exoplayer
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── img
├── after.png
├── befor.png
└── 图解.png
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
14 |
19 |
24 |
26 | * The same {@link TrackOutput} is returned if multiple calls are made with the same {@code id}.
27 | *
28 | * @param id A track identifier.
29 | * @param type The type of the track. Typically one of the {@link com.google.android.exoplayer2.C}
30 | * {@code TRACK_TYPE_*} constants.
31 | * @return The {@link TrackOutput} for the given track identifier.
32 | */
33 | TrackOutput track(int id, int type);
34 |
35 | /**
36 | * Called when all tracks have been identified, meaning no new {@code trackId} values will be
37 | * passed to {@link #track(int, int)}.
38 | */
39 | void endTracks();
40 |
41 | /**
42 | * Called when a {@link SeekMap} has been extracted from the stream.
43 | *
44 | * @param seekMap The extracted {@link SeekMap}.
45 | */
46 | void seekMap(SeekMap seekMap);
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/extractor/ExtractorsFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.extractor;
17 |
18 | /**
19 | * Factory for arrays of {@link Extractor}s.
20 | */
21 | public interface ExtractorsFactory {
22 |
23 | /**
24 | * Returns an array of new {@link Extractor} instances.
25 | */
26 | Extractor[] createExtractors();
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/extractor/PositionHolder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.extractor;
17 |
18 | /**
19 | * Holds a position in the stream.
20 | */
21 | public final class PositionHolder {
22 |
23 | /**
24 | * The held position.
25 | */
26 | public long position;
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/extractor/mp4/DefaultSampleValues.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.extractor.mp4;
17 |
18 | /* package */ final class DefaultSampleValues {
19 |
20 | public final int sampleDescriptionIndex;
21 | public final int duration;
22 | public final int size;
23 | public final int flags;
24 |
25 | public DefaultSampleValues(int sampleDescriptionIndex, int duration, int size, int flags) {
26 | this.sampleDescriptionIndex = sampleDescriptionIndex;
27 | this.duration = duration;
28 | this.size = size;
29 | this.flags = flags;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/metadata/MetadataDecoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.metadata;
17 |
18 | /**
19 | * Decodes metadata from binary data.
20 | */
21 | public interface MetadataDecoder {
22 |
23 | /**
24 | * Decodes a {@link Metadata} element from the provided input buffer.
25 | *
26 | * @param inputBuffer The input buffer to decode.
27 | * @return The decoded metadata object.
28 | * @throws MetadataDecoderException If a problem occurred decoding the data.
29 | */
30 | Metadata decode(MetadataInputBuffer inputBuffer) throws MetadataDecoderException;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/metadata/MetadataDecoderException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.metadata;
17 |
18 | /**
19 | * Thrown when an error occurs decoding metadata.
20 | */
21 | public class MetadataDecoderException extends Exception {
22 |
23 | /**
24 | * @param message The detail message for this exception.
25 | */
26 | public MetadataDecoderException(String message) {
27 | super(message);
28 | }
29 |
30 | /**
31 | * @param message The detail message for this exception.
32 | * @param cause The cause of this exception.
33 | */
34 | public MetadataDecoderException(String message, Throwable cause) {
35 | super(message, cause);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/metadata/MetadataInputBuffer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.metadata;
17 |
18 | import com.google.android.exoplayer2.Format;
19 | import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
20 |
21 | /**
22 | * A {@link DecoderInputBuffer} for a {@link MetadataDecoder}.
23 | */
24 | public final class MetadataInputBuffer extends DecoderInputBuffer {
25 |
26 | /**
27 | * An offset that must be added to the metadata's timestamps after it's been decoded, or
28 | * {@link Format#OFFSET_SAMPLE_RELATIVE} if {@link #timeUs} should be added.
29 | */
30 | public long subsampleOffsetUs;
31 |
32 | public MetadataInputBuffer() {
33 | super(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_NORMAL);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/metadata/MetadataOutput.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.metadata;
17 |
18 | /**
19 | * Receives metadata output.
20 | */
21 | public interface MetadataOutput {
22 |
23 | /**
24 | * Called when there is metadata associated with current playback time.
25 | *
26 | * @param metadata The metadata.
27 | */
28 | void onMetadata(Metadata metadata);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Frame.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.metadata.id3;
17 |
18 | import com.google.android.exoplayer2.metadata.Metadata;
19 | import com.google.android.exoplayer2.util.Assertions;
20 |
21 | /**
22 | * Base class for ID3 frames.
23 | */
24 | public abstract class Id3Frame implements Metadata.Entry {
25 |
26 | /**
27 | * The frame ID.
28 | */
29 | public final String id;
30 |
31 | public Id3Frame(String id) {
32 | this.id = Assertions.checkNotNull(id);
33 | }
34 |
35 | @Override
36 | public int describeContents() {
37 | return 0;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/metadata/scte35/SpliceCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.metadata.scte35;
17 |
18 | import com.google.android.exoplayer2.metadata.Metadata;
19 |
20 | /**
21 | * Superclass for SCTE35 splice commands.
22 | */
23 | public abstract class SpliceCommand implements Metadata.Entry {
24 |
25 | @Override
26 | public int describeContents() {
27 | return 0;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/metadata/scte35/SpliceNullCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.metadata.scte35;
17 |
18 | import android.os.Parcel;
19 |
20 | /**
21 | * Represents a splice null command as defined in SCTE35, Section 9.3.1.
22 | */
23 | public final class SpliceNullCommand extends SpliceCommand {
24 |
25 | // Parcelable implementation.
26 |
27 | @Override
28 | public void writeToParcel(Parcel dest, int flags) {
29 | // Do nothing.
30 | }
31 |
32 | public static final Creator
29 | * Must be called prior to each attempt to dequeue output buffers from the decoder.
30 | *
31 | * @param positionUs The current playback position in microseconds.
32 | */
33 | void setPositionUs(long positionUs);
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/text/SubtitleDecoderException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.text;
17 |
18 | /**
19 | * Thrown when an error occurs decoding subtitle data.
20 | */
21 | public class SubtitleDecoderException extends Exception {
22 |
23 | /**
24 | * @param message The detail message for this exception.
25 | */
26 | public SubtitleDecoderException(String message) {
27 | super(message);
28 | }
29 |
30 | /**
31 | * @param message The detail message for this exception.
32 | * @param cause The cause of this exception.
33 | */
34 | public SubtitleDecoderException(String message, Throwable cause) {
35 | super(message, cause);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/text/SubtitleInputBuffer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.text;
17 |
18 | import com.google.android.exoplayer2.Format;
19 | import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
20 |
21 | /** A {@link DecoderInputBuffer} for a {@link SubtitleDecoder}. */
22 | public class SubtitleInputBuffer extends DecoderInputBuffer {
23 |
24 | /**
25 | * An offset that must be added to the subtitle's event times after it's been decoded, or
26 | * {@link Format#OFFSET_SAMPLE_RELATIVE} if {@link #timeUs} should be added.
27 | */
28 | public long subsampleOffsetUs;
29 |
30 | public SubtitleInputBuffer() {
31 | super(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_NORMAL);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/text/TextOutput.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.text;
17 |
18 | import java.util.List;
19 |
20 | /**
21 | * Receives text output.
22 | */
23 | public interface TextOutput {
24 |
25 | /**
26 | * Called when there is a change in the {@link Cue}s.
27 | *
28 | * @param cues The {@link Cue}s.
29 | */
30 | void onCues(List
21 | * The allocation's length is obtained by calling {@link Allocator#getIndividualAllocationLength()}
22 | * on the {@link Allocator} from which it was obtained.
23 | */
24 | public final class Allocation {
25 |
26 | /**
27 | * The array containing the allocated space. The allocated space might not be at the start of the
28 | * array, and so {@link #offset} must be used when indexing into it.
29 | */
30 | public final byte[] data;
31 |
32 | /**
33 | * The offset of the allocated space in {@link #data}.
34 | */
35 | public final int offset;
36 |
37 | /**
38 | * @param data The array containing the allocated space.
39 | * @param offset The offset of the allocated space in {@code data}.
40 | */
41 | public Allocation(byte[] data, int offset) {
42 | this.data = data;
43 | this.offset = offset;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/BandwidthMeter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream;
17 |
18 | /**
19 | * Provides estimates of the currently available bandwidth.
20 | */
21 | public interface BandwidthMeter {
22 |
23 | /**
24 | * A listener of {@link BandwidthMeter} events.
25 | */
26 | interface EventListener {
27 |
28 | /**
29 | * Called periodically to indicate that bytes have been transferred.
30 | *
31 | * Note: The estimated bitrate is typically derived from more information than just
32 | * {@code bytes} and {@code elapsedMs}.
33 | *
34 | * @param elapsedMs The time taken to transfer the bytes, in milliseconds.
35 | * @param bytes The number of bytes transferred.
36 | * @param bitrate The estimated bitrate in bits/sec, or {@link #NO_ESTIMATE} if an estimate is
37 | * not available.
38 | */
39 | void onBandwidthSample(int elapsedMs, long bytes, long bitrate);
40 |
41 | }
42 |
43 | /**
44 | * Indicates no bandwidth estimate is available.
45 | */
46 | long NO_ESTIMATE = -1;
47 |
48 | /**
49 | * Returns the estimated bandwidth in bits/sec, or {@link #NO_ESTIMATE} if an estimate is not
50 | * available.
51 | */
52 | long getBitrateEstimate();
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/DataSourceException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream;
17 |
18 | import java.io.IOException;
19 |
20 | /**
21 | * Used to specify reason of a DataSource error.
22 | */
23 | public final class DataSourceException extends IOException {
24 |
25 | public static final int POSITION_OUT_OF_RANGE = 0;
26 |
27 | /**
28 | * The reason of this {@link DataSourceException}. It can only be {@link #POSITION_OUT_OF_RANGE}.
29 | */
30 | public final int reason;
31 |
32 | /**
33 | * Constructs a DataSourceException.
34 | *
35 | * @param reason Reason of the error. It can only be {@link #POSITION_OUT_OF_RANGE}.
36 | */
37 | public DataSourceException(int reason) {
38 | this.reason = reason;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/DummyDataSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream;
17 |
18 | import android.net.Uri;
19 | import java.io.IOException;
20 |
21 | /**
22 | * A dummy DataSource which provides no data. {@link #open(DataSpec)} throws {@link IOException}.
23 | */
24 | public final class DummyDataSource implements DataSource {
25 |
26 | public static final DummyDataSource INSTANCE = new DummyDataSource();
27 |
28 | /** A factory that produces {@link DummyDataSource}. */
29 | public static final Factory FACTORY = new Factory() {
30 | @Override
31 | public DataSource createDataSource() {
32 | return new DummyDataSource();
33 | }
34 | };
35 |
36 | private DummyDataSource() {}
37 |
38 | @Override
39 | public long open(DataSpec dataSpec) throws IOException {
40 | throw new IOException("Dummy source");
41 | }
42 |
43 | @Override
44 | public int read(byte[] buffer, int offset, int readLength) throws IOException {
45 | throw new UnsupportedOperationException();
46 | }
47 |
48 | @Override
49 | public Uri getUri() {
50 | return null;
51 | }
52 |
53 | @Override
54 | public void close() throws IOException {
55 | // do nothing.
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/FileDataSourceFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream;
17 |
18 | /**
19 | * A {@link DataSource.Factory} that produces {@link FileDataSource}.
20 | */
21 | public final class FileDataSourceFactory implements DataSource.Factory {
22 |
23 | private final TransferListener super FileDataSource> listener;
24 |
25 | public FileDataSourceFactory() {
26 | this(null);
27 | }
28 |
29 | public FileDataSourceFactory(TransferListener super FileDataSource> listener) {
30 | this.listener = listener;
31 | }
32 |
33 | @Override
34 | public DataSource createDataSource() {
35 | return new FileDataSource(listener);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/TransferListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream;
17 |
18 | /**
19 | * A listener of data transfer events.
20 | */
21 | public interface TransferListener {
22 |
23 | /**
24 | * Called when a transfer starts.
25 | *
26 | * @param source The source performing the transfer.
27 | * @param dataSpec Describes the data being transferred.
28 | */
29 | void onTransferStart(S source, DataSpec dataSpec);
30 |
31 | /**
32 | * Called incrementally during a transfer.
33 | *
34 | * @param source The source performing the transfer.
35 | * @param bytesTransferred The number of bytes transferred since the previous call to this
36 | * method (or if the first call, since the transfer was started).
37 | */
38 | void onBytesTransferred(S source, int bytesTransferred);
39 |
40 | /**
41 | * Called when a transfer ends.
42 | *
43 | * @param source The source performing the transfer.
44 | */
45 | void onTransferEnd(S source);
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSinkFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream.cache;
17 |
18 | import com.google.android.exoplayer2.upstream.DataSink;
19 |
20 | /**
21 | * A {@link DataSink.Factory} that produces {@link CacheDataSink}.
22 | */
23 | public final class CacheDataSinkFactory implements DataSink.Factory {
24 |
25 | private final Cache cache;
26 | private final long maxCacheFileSize;
27 | private final int bufferSize;
28 |
29 | /**
30 | * @see CacheDataSink#CacheDataSink(Cache, long)
31 | */
32 | public CacheDataSinkFactory(Cache cache, long maxCacheFileSize) {
33 | this(cache, maxCacheFileSize, CacheDataSink.DEFAULT_BUFFER_SIZE);
34 | }
35 |
36 | /**
37 | * @see CacheDataSink#CacheDataSink(Cache, long, int)
38 | */
39 | public CacheDataSinkFactory(Cache cache, long maxCacheFileSize, int bufferSize) {
40 | this.cache = cache;
41 | this.maxCacheFileSize = maxCacheFileSize;
42 | this.bufferSize = bufferSize;
43 | }
44 |
45 | @Override
46 | public DataSink createDataSink() {
47 | return new CacheDataSink(cache, maxCacheFileSize, bufferSize);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheEvictor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream.cache;
17 |
18 | /**
19 | * Evicts data from a {@link Cache}. Implementations should call {@link Cache#removeSpan(CacheSpan)}
20 | * to evict cache entries based on their eviction policies.
21 | */
22 | public interface CacheEvictor extends Cache.Listener {
23 |
24 | /**
25 | * Called when cache has been initialized.
26 | */
27 | void onCacheInitialized();
28 |
29 | /**
30 | * Called when a writer starts writing to the cache.
31 | *
32 | * @param cache The source of the event.
33 | * @param key The key being written.
34 | * @param position The starting position of the data being written.
35 | * @param maxLength The maximum length of the data being written.
36 | */
37 | void onStartFile(Cache cache, String key, long position, long maxLength);
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/cache/NoOpCacheEvictor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream.cache;
17 |
18 |
19 | /**
20 | * Evictor that doesn't ever evict cache files.
21 | *
22 | * Warning: Using this evictor might have unforeseeable consequences if cache
23 | * size is not managed elsewhere.
24 | */
25 | public final class NoOpCacheEvictor implements CacheEvictor {
26 |
27 | @Override
28 | public void onCacheInitialized() {
29 | // Do nothing.
30 | }
31 |
32 | @Override
33 | public void onStartFile(Cache cache, String key, long position, long maxLength) {
34 | // Do nothing.
35 | }
36 |
37 | @Override
38 | public void onSpanAdded(Cache cache, CacheSpan span) {
39 | // Do nothing.
40 | }
41 |
42 | @Override
43 | public void onSpanRemoved(Cache cache, CacheSpan span) {
44 | // Do nothing.
45 | }
46 |
47 | @Override
48 | public void onSpanTouched(Cache cache, CacheSpan oldSpan, CacheSpan newSpan) {
49 | // Do nothing.
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/upstream/crypto/CryptoUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.upstream.crypto;
17 |
18 | /**
19 | * Utility functions for the crypto package.
20 | */
21 | /* package */ final class CryptoUtil {
22 |
23 | private CryptoUtil() {}
24 |
25 | /**
26 | * Returns the hash value of the input as a long using the 64 bit FNV-1a hash function. The hash
27 | * values produced by this function are less likely to collide than those produced by
28 | * {@link #hashCode()}.
29 | */
30 | public static long getFNV64Hash(String input) {
31 | if (input == null) {
32 | return 0;
33 | }
34 |
35 | long hash = 0;
36 | for (int i = 0; i < input.length(); i++) {
37 | hash ^= input.charAt(i);
38 | // This is equivalent to hash *= 0x100000001b3 (the FNV magic prime number).
39 | hash += (hash << 1) + (hash << 4) + (hash << 5) + (hash << 7) + (hash << 8) + (hash << 40);
40 | }
41 | return hash;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/util/Clock.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.util;
17 |
18 | import android.os.Handler;
19 | import android.os.Looper;
20 | import android.support.annotation.Nullable;
21 |
22 | /**
23 | * An interface through which system clocks can be read and {@link HandlerWrapper}s created. The
24 | * {@link #DEFAULT} implementation must be used for all non-test cases.
25 | */
26 | public interface Clock {
27 |
28 | /**
29 | * Default {@link Clock} to use for all non-test cases.
30 | */
31 | Clock DEFAULT = new SystemClock();
32 |
33 | /** @see android.os.SystemClock#elapsedRealtime() */
34 | long elapsedRealtime();
35 |
36 | /** @see android.os.SystemClock#uptimeMillis() */
37 | long uptimeMillis();
38 |
39 | /** @see android.os.SystemClock#sleep(long) */
40 | void sleep(long sleepTimeMs);
41 |
42 | /**
43 | * Creates a {@link HandlerWrapper} using a specified looper and a specified callback for handling
44 | * messages.
45 | *
46 | * @see Handler#Handler(Looper, Handler.Callback)
47 | */
48 | HandlerWrapper createHandler(Looper looper, @Nullable Handler.Callback callback);
49 | }
50 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/util/ErrorMessageProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.util;
17 |
18 | import android.util.Pair;
19 |
20 | /** Converts throwables into error codes and user readable error messages. */
21 | public interface ErrorMessageProvider