9768 Commits

Author SHA1 Message Date
kimvde
7df99381c1 Optimize extractors order using file extension
PiperOrigin-RevId: 314508481
2020-06-04 14:15:45 +01:00
olly
a818049143 Fix position jank after pausing and seeking
Issue: #6901
PiperOrigin-RevId: 314418536
2020-06-03 10:18:04 +01:00
olly
fb011e66a6 AudioTrackPositionTracker: Prevent negative timestamps
Issue: #7456
PiperOrigin-RevId: 314408767
2020-06-03 10:17:53 +01:00
aquilescanta
79acadcc89 Check for section_syntax_indicator in TS tables
Issue:#7325
PiperOrigin-RevId: 314321914
2020-06-03 10:17:39 +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
olly
ed7db116c0 Finalize release notes for 2.11.5
PiperOrigin-RevId: 314304928
2020-06-02 23:51:42 +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
Oliver Woodman
5e2b89b562 Add release date 2020-06-01 19:15:15 +01:00
Oliver Woodman
9f87c2eaef Finalize release notes 2020-06-01 19:12:39 +01:00
Oliver Woodman
9830c773c6
Merge pull request #7455 from google/dev-v2-r2.11.5-7193
Merge fix for #7193 into dev-v2-r2.11.5
2020-06-01 19:11:01 +01:00
tonihei
145754618d Simplify keeping track of current id in DefaultPlaybackSessionManager
We currently have a currentMediaPeriodId and an activeSessionId that are more
or less tracking the same thing unless the current media period isn't "active" yet.

Simplify this logic by using a single currentSessionId field and the respective
isActive flag of this session. Also move all session creation and activation code in
the same method to make it easier to reason about the code.

This change also fixes a subtle bug where events after a seek to a new window
are not ignored as they should.

PiperOrigin-RevId: 289432181
2020-06-01 18:04:26 +01:00
tonihei
f4cc1d6250 Make sure finishAllSessions() can be called without removing listener
Currently, this method is only supposed to be called before removing
the listener from the player or when releasing the player.

If called at other times, it will throw an exception later when
a playback session is ended automatically.

issue:#7193
PiperOrigin-RevId: 308254993
2020-06-01 18:01:46 +01:00
tonihei
18eccf9a81 Make sure not to create new playback sessions while still IDLE.
The first session should only be created once we have the media items
and/or called prepare. Otherwise the first session is created with
an EventTime having an empty timeline making it less useful.

issue:#7193
PiperOrigin-RevId: 308100555
2020-06-01 17:52:48 +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
andrewlewis
c13be44f68 Add one hour on-demand test video
PiperOrigin-RevId: 314100932
2020-06-01 14:59:56 +01:00
Oliver Woodman
1062edf52e Revert "Update TrackSelectionDialogBuilder to use androidx compat Dialog."
This reverts commit b05e9944ea95c2b1a341610568e5cfbe8df6f333.
2020-06-01 09:50:40 +01:00
Arnold Szabo
a1ebffd238 Correct tie-breaking rules when selecting fixed video track 2020-05-31 23:40:10 +03:00
andrewlewis
b5e5b55ef8 Fix typo
PiperOrigin-RevId: 312083761
2020-05-29 22:32:43 +01:00
andrewlewis
35a705e92a Add release notes for issues fixed by preloading migration
PiperOrigin-RevId: 312080838
2020-05-29 22:32:12 +01:00
andrewlewis
51a3f214ed Fix handling of fetch errors for post-rolls
The ad break time in seconds from IMA was "-1" for postrolls, but this didn't
match C.TIME_END_OF_SOURCE in the ad group times array.

Handle an ad break time of -1 directly by mapping it onto the last ad group,
instead of trying to look it up in the array.

PiperOrigin-RevId: 312064886
2020-05-29 22:29:29 +01:00
andrewlewis
51b2a0f7a9 Add support for timing out ad preloading
Detect stuck buffering cases in ImaAdsLoader, and discard the ad group after
a timeout. This is intended to make the IMA extension more robust in the case
where an ad group unexpectedly doesn't load.

The timing out behavior is enabled by default but apps can choose to retain
the old behavior by setting an unset timeout on ImaAdsLoader.Builder.

PiperOrigin-RevId: 311729798
2020-05-29 22:29:14 +01:00
andrewlewis
e8c7405545 Upgrade IMA SDK to 3.19.0
PiperOrigin-RevId: 311106612
2020-05-29 22:20:00 +01:00
andrewlewis
e482aa2be8 Fix method ordering in ImaAdsLoader
Put static methods at the end.

Also add a couple of missing parameter name comments.

PiperOrigin-RevId: 311077684
2020-05-29 22:18:15 +01:00
andrewlewis
929b60e209 Improve DEBUG logging in ImaAdsLoader
Log content progress events, as these are helpful to debug triggering of events
based on the content progress.

Don't log AD_PROGRESS events as they occur several times per second while ads
are playing, and the verbosity makes logs difficult to read.

PiperOrigin-RevId: 311077302
2020-05-29 22:17:51 +01:00
andrewlewis
5529c124fe Remove deprecated symbols in ImaAdsLoader
PiperOrigin-RevId: 310901647
2020-05-29 22:17:24 +01:00
andrewlewis
8c108fb5fd Upgrade IMA SDK to 3.18.2
PiperOrigin-RevId: 310883076
2020-05-29 22:17:00 +01:00
andrewlewis
3b99a84dae Migrate to new IMA preloading APIs
issue:#6429
PiperOrigin-RevId: 309906760
2020-05-29 22:15:30 +01:00
andrewlewis
de03e389c0 Enable nullness checking for the IMA extension
adPlaybackState is now non-null, and the uninitialized case is covered by a new
boolean hasAdPlaybackState. Position progress updates are now non-null and
initialized with IMA's VIDEO_TIME_NOT_READY constant.

Also fix some misc code issues:
- Remove empty branch for SmoothStreaming (Android Studio warns about this).
- Tidy onTimelineChanged and onPositionDiscontinuity and the methods they call
  to improve naming.
- Remove logging for IMA events after release, as these methods are expected to
  be called in the current IMA SDK behavior.

PiperOrigin-RevId: 308977116
2020-05-29 21:58:59 +01:00
andrewlewis
6e66dc02fb Replace IMA ad tag fakes with mocks
The mocking setup is quite messy/unclear compared to the fakes, but it seems
worth switching over because IMA API changes have already required changes
to fakes in the past, and there are more API changes in the version we are
about to upgrade to. This change should generally remove the need to keep
the fakes up-to-date.

PiperOrigin-RevId: 308819176
2020-05-29 21:58:46 +01:00
tonihei
67d1b728d3 Clarify/fix position reference points for AdPlaybackState.
The positions were interchangeably used with window and period
positions. This change more clearly ensures that all positions in the
AdPlaybackState are based on periods and that we use the right adjustments
for all usages.

PiperOrigin-RevId: 297811633
2020-05-29 21:50:07 +01:00
tonihei
d1b900604a Add test to ensure AdsLoader is initialized.
This tests explicitly that initialization happens even if the Timeline
is a placeholder.

No other change is needed. While the Timeline is still a placeholder
ImaAdsLoader.getCurrentPeriodPosition will return 0 and trigger
pre-rolls (intended behaviour) and it doesn't matter whether the
actual initial period position may be somewhere else.

PiperOrigin-RevId: 298833867
2020-05-29 21:42:22 +01:00
Andrew Lewis
03be1551a7 Clean up player event handling
This change is similar to e8293b92d877bd6e5a00606358db610d6fb7a4d6
but without relying on new player events that haven't been released
yet, to make it easier to merge changes related to ImaAdsLoader on
top.
2020-05-29 21:15:17 +01:00
andrewlewis
b3de2b08d4 Inline ENABLE_PRELOADING
ImaAdsLoader relies on preloading being enabled (it doesn't
work without it) so we may as well remove the constant to
avoid potential confusion.

PiperOrigin-RevId: 284951356
2020-05-29 21:15:17 +01:00
Oliver Woodman
cb85cdd3eb Fix typo in release notes 2020-05-29 21:15:17 +01:00
Oliver Woodman
4e6fe31ee1 Merge pull request #6724 from nnoury:fix/subtitles-outline-color
PiperOrigin-RevId: 292316767
2020-05-29 21:15:17 +01:00
olly
d162c07ecf Add show/hideScrubber to DefaultTimeBar
PiperOrigin-RevId: 300249371
2020-05-29 21:15:17 +01:00
olly
2640538228 Apply minimal layout change according to view size
- Add method to scale scrubber handle of DefaultTimeBar

PiperOrigin-RevId: 294366734
2020-05-29 21:15:17 +01:00
andrewlewis
10b8eff727 Don't overwrite MP4 container fps using capture fps
The capture frame rate is currently available both via Format.metadata
and decoded in Format.frameRate. As the container Format.frameRate may
be useful to apps, only store the capture frame rate in metadata (apps
will need to decode it but can now access the container frame rate too).

PiperOrigin-RevId: 284165711
2020-05-29 21:15:17 +01:00
tonihei
d14f559e94 Fix message indexing bug.
We keep an index hint for the next pending player message. This hint
wasn't updated correctly when messages are removed due to a timeline
update.

This change makes sure to only use the hint locally in one method so
that it doesn't need to be updated anywhere else and also adds the "hint"
suffix to the variable name to make it clearer that it's just a hint and
there are no guarantees this index actually exists anymore.

issue:#7278
PiperOrigin-RevId: 309217614
2020-05-29 21:15:17 +01:00
bachinger
68059070f4 Add missing nullable annotations
The MediaSessionConnector gets a Bundle passed to the MediaSession.Callback
from the framework which can be null. This needs to be properly annotated
with @Nullable.

Issue: #7234
PiperOrigin-RevId: 307822764
2020-05-29 21:15:17 +01:00
Oliver Woodman
9d6a46bccd Clean up release notes 2020-05-29 21:15:17 +01:00
Oliver Woodman
7e02066f6e Merge pull request #7422 from noamtamim:bandwidthmeter-5g
PiperOrigin-RevId: 313372995
2020-05-29 21:15:17 +01:00
tonihei
b05e9944ea Update TrackSelectionDialogBuilder to use androidx compat Dialog.
This ensure style themes are correctly applied.

issue:#7357
PiperOrigin-RevId: 313145345
2020-05-29 21:15:17 +01:00