6295 Commits

Author SHA1 Message Date
krocard
e1beb1d194 Expose experimental offload scheduling
Add a new scheduling mode that stops ExoPlayer main loop
when the audio offload buffer is full and resume it when
it has been partially played.

This mode needs to be enabled and dissabled manually by the app
for now.

#exo-offload

PiperOrigin-RevId: 315860373
2020-06-12 00:24:57 +01:00
kimvde
88b36abce6 Sniff all inferred extractors in DefaultHlsExtractorFactory
PiperOrigin-RevId: 315857270
2020-06-11 10:11:40 +01:00
Oliver Woodman
2fcd759edb Merge pull request #7479 from sravan1213:dev-v2
PiperOrigin-RevId: 315794031
2020-06-11 10:11:30 +01:00
aquilescanta
e7da26368a Add MediaParser-based implementation of ChunkExtractor
PiperOrigin-RevId: 315720712
2020-06-11 10:11:20 +01:00
christosts
3ce57ae2e8 Remove dropped MediaCodecAdadpters
Delete the AsynchronousMediaCodecAdapter, the
MultiLockAsyncMediaCodecAdapter and their tests.

PiperOrigin-RevId: 315694296
2020-06-11 10:11:11 +01:00
tonihei
95b61eb835 Split TrackSelection.evalauteQueueSize in discard and cancelation.
The option to cancel ongoing loads as part of the queue size evalation
was added recently. This split out the decision to a new method so that
a TrackSelection implementation can independently cancel loads and
discard upstream data. It also clarifies that evaluateQueueSize will
only be called if there is no ongoing load.

Issue: #2848
PiperOrigin-RevId: 315659735
2020-06-11 10:11:02 +01:00
tonihei
2a9144fa56 Fix loadCompleted flag in MediaChunk implementations.
This flag was always set even if the load was canceled and not completed.

PiperOrigin-RevId: 315659262
2020-06-11 10:10:53 +01:00
tonihei
b0d98a2e22 Find correct next chunk if previous one didn't finish loading.
If the previous chunk didn't finish loading, we need to find the appropriate
next chunk based on the current loading position (or the previous chunk's
start time if not independent).

PiperOrigin-RevId: 315658435
2020-06-11 10:10:45 +01:00
andrewlewis
b0457da038 Simplify timestamp tracking
An integer multiple/divide can be removed without loss of precision.

PiperOrigin-RevId: 315653905
2020-06-11 10:10:36 +01:00
krocard
0caada8b8c Fix formating in javadoc
PiperOrigin-RevId: 315516836
2020-06-11 10:10:27 +01:00
olly
5aa8a7a507 Prevent shutter closing for within-window seeks to unprepared periods
Issue: #5507
PiperOrigin-RevId: 315512207
2020-06-11 10:10:18 +01:00
kimvde
1f17756ad2 Optimize DefaultExtractorsFactory order using MIME types
PiperOrigin-RevId: 315485985
2020-06-11 10:10:00 +01:00
olly
c759b5b1a9 Add option to hide Prev/Rwnd/Ffwd/Next buttons
Issue: #7410
PiperOrigin-RevId: 315480798
2020-06-09 16:05:44 +01:00
aquilescanta
a11f7b8cdd Document DataSource.getResponseHeaders case-insensitivity
PiperOrigin-RevId: 315480048
2020-06-09 16:05:33 +01:00
ibaker
947485e2b7 CEA-608: Position top-of-screen roll-up cues with bottom-line=row
Reasoning and screenshots here:
https://github.com/google/ExoPlayer/issues/7475#issuecomment-640770791

Issue: #7475
PiperOrigin-RevId: 315475888
2020-06-09 16:05:22 +01:00
christosts
d23ca7b11a Set MediaCodec operation mode for audio/video
Add experimental APIs to set the MediaCodecOperationMode separately
for audio and video.

PiperOrigin-RevId: 315467157
2020-06-09 16:05:11 +01:00
samrobinson
83758577e3 Temporary fix for gapless regression for MP3.
PiperOrigin-RevId: 315334491
2020-06-09 16:04:49 +01:00
kimvde
b1e56304a1 Add support for inferring file format from MIME type
PiperOrigin-RevId: 315283926
2020-06-08 17:41:16 +01:00
bachinger
99d805f6a8 Make media item of SinglePeriodTimeline non-null
This change makes the media item argument in any constructors of the SinglePeriodTimeline non-null. Further a dummy media item is created for deprecated constructors using a tag only.

PiperOrigin-RevId: 315283842
2020-06-08 17:41:06 +01:00
aquilescanta
c37af0b543 Make ChunkExtractor return a ChunkIndex instead of a SeekMap
PiperOrigin-RevId: 315283645
2020-06-08 17:40:55 +01:00
ibaker
770df8636a CEA-608: Don't assume roll-up captions are at the bottom of the screen
ANSI/CTA-608-E R-2014 Annex B.5 says:
"The concept of a movable base row for a roll-up caption is new."

It means "new" compared to TC1 and TC2 (released in or before 1985).

Issue: #7475
PiperOrigin-RevId: 315258859
2020-06-08 17:40:44 +01:00
ibaker
b7486f4883 Add a test for 33-bit HLS WebVTT wraparound
This also gives some general test coverage for HLS' WebvttExtractor

Issue: #7462
PiperOrigin-RevId: 315257252
2020-06-08 17:40:33 +01:00
andrewlewis
bc7310240d Suppress repeated logging for invalid MP3 headers
PiperOrigin-RevId: 315243493
2020-06-08 17:40:22 +01:00
samrobinson
680d955851 Adjust input timestamps for the Codec2 MP3 decoder.
Output timestamps are calculated by the codec based on the buffers,
which is offset in Codec2. This adjusts the input timestamps as they
are passed in so they will match the output timestamps produced by
the MediaCodec.

PiperOrigin-RevId: 314963830
2020-06-08 17:40:11 +01:00
sravan1213
c3282c9a37 Propagate download exception through onDownloadChanged callback 2020-06-08 18:51:54 +05:30
olly
226583f01c Reintroduce isConnected check for download requirements
PiperOrigin-RevId: 314925639
2020-06-05 15:39:25 +01:00
ibaker
ee0c6224af Respect 33-bit wraparound when calculating WebVTT timestamps in HLS
Issue: #7462
PiperOrigin-RevId: 314919210
2020-06-05 14:48:13 +01:00
krocard
8dedbbbfb4 Introduce an offload option to DefaultRederersFactory
This introduces an option to turn on offload in the
audio sink.

#exo-offload

PiperOrigin-RevId: 314907088
2020-06-05 13:06:15 +01:00
bachinger
97a80ac624 Make ConcatentatingMediaSource provide a dummy media item
PiperOrigin-RevId: 314904897
2020-06-05 13:06:06 +01:00
olly
b874b1d563 Bump version to 2.11.5
PiperOrigin-RevId: 314903986
2020-06-05 13:05:57 +01:00
bachinger
60f907be6d Make FakeTimeline and FakeMediaSource provide a media item
FakeMediaSource and FakeTimeline should put a media item to the window just as other media sources and timelines do. This change provides a fake media item for both of them.

Further the MaskingMediaSource needs to provide a media item for when the real timeline of the masked media source is not available. This can be easily done by using mediaSource.getMediaItem() once available. For now a dummy is used to make ExoPlayerTest run green. This can be easily change to use mediaSource.getMediaSource as soon as this method is defined by the MediaSource interface.

PiperOrigin-RevId: 314897474
2020-06-05 13:05:48 +01:00
olly
08b0e08b69 Fix bug where SilenceMediaSource#getTag was always returning null.
SilenceMediaSource never overloaded MediaSource#getTag, and default behavior is to return null.

PiperOrigin-RevId: 314779832
2020-06-05 13:05:39 +01:00
krocard
1dedd080a4 Remove unnecessary TargetApi
This can hide errors as the lint is pretty smart
to understand SDK level checks.

PiperOrigin-RevId: 314728030
2020-06-05 13:05:29 +01:00
kimvde
12a9351781 Miscellaneous renamings in FilenameUtils
PiperOrigin-RevId: 314723830
2020-06-05 13:05:20 +01:00
ibaker
3474c39c10 Add support for non-contiguous Ogg pages
bear_vorbis_gap.ogg is a copy of bear_vorbis.ogg with 10 garbage bytes
(DE AD BE EF DE AD BE EF DE AD) inserted before the second capture
pattern and 3 garbage bytes inserted at the end (DE AD BE).

Issue: #7230
PiperOrigin-RevId: 314715729
2020-06-04 14:16:40 +01:00
olly
9b5cab0478 Fix more cases of downloads not being resumed
Issue: #7453
PiperOrigin-RevId: 314710328
2020-06-04 14:16:31 +01:00
olly
c77e300249 Clean up debug logging
PiperOrigin-RevId: 314707946
2020-06-04 14:16:22 +01:00
bachinger
fb73a9dfc8 Make media item of Timeline.Window non-null
This change makes the media item of Timeline.Window non-null by providing a fallback media item in window.set(...). After having migrated all media sources this should not be needed anymore, but a fallback makes it more safe than just making the mediaItem argument of window.set(...) non-null (which is done in a following CL in this chain of CLs).

PiperOrigin-RevId: 314527983
2020-06-04 14:16:04 +01:00
kimvde
7c33e2570a Update getFormatFromExtension to take a URI
This allows to handle the last segment retrieval and process the case
where the filename is null in the method.

PiperOrigin-RevId: 314512974
2020-06-04 14:15:55 +01:00
kimvde
7df99381c1 Optimize extractors order using file extension
PiperOrigin-RevId: 314508481
2020-06-04 14:15:45 +01:00
olly
3904f6778a Fix position jank after pausing and seeking
Issue: #6901
PiperOrigin-RevId: 314418536
2020-06-02 23:52:17 +01:00
olly
720f0012a8 AudioTrackPositionTracker: Prevent negative timestamps
Issue: #7456
PiperOrigin-RevId: 314408767
2020-06-02 23:52:08 +01:00
aquilescanta
5b06d89467 Check for section_syntax_indicator in TS tables
Issue:#7325
PiperOrigin-RevId: 314321914
2020-06-02 23:51:59 +01:00
tonihei
7bc5fa855f Don't keep pending preferred queue size during cancelation.
Before loading a new chunk, the player will call reevaluateBuffer
anyway, so we don't have to do this directly after cancelation.

This simplifies some logic because we can remove the pending queue
size variable.

PiperOrigin-RevId: 314313268
2020-06-02 23:51:51 +01:00
ibaker
9699889569 Assert that a negative extractor sniff never advances the read position
Extractor#sniff() javadoc says:
"If true is returned, the input's reading position may have been
modified. Otherwise, only its peek position may have been modified."
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/extractor/Extractor.html#sniff-com.google.android.exoplayer2.extractor.ExtractorInput-

PiperOrigin-RevId: 314296922
2020-06-02 23:51:33 +01:00
kimvde
1f80cf1558 Add API to get the format from the file extension
This will allow to use the file extension in DefaultExtractorsFactory.

PiperOrigin-RevId: 314296640
2020-06-02 23:51:24 +01:00
krocard
a5067e6314 Implement offload AudioTrack in DefaultAudioSink.
#exo-offload

PiperOrigin-RevId: 314288300
2020-06-02 23:51:15 +01:00
bachinger
75e54a452a Use identical media item for constructor if possible
If no deprecated methods on the factory is called, the media item instance that is passed to the createMediaSource method must be passed down to the constructor of the media source.

PiperOrigin-RevId: 314193865
2020-06-02 23:51:06 +01:00
olly
2f3c7cb85f Revert pushing download thread interruption into the Downloader implementations
Issue: #5978
PiperOrigin-RevId: 314175257
2020-06-02 23:50:56 +01:00
Ian Baker
8b89a5ed6d Merge pull request #6861 from chrisfillmore:feature/responseBodyForInvalidResponseCodeException_6853
PiperOrigin-RevId: 314105612
2020-06-01 15:00:08 +01:00