12370 Commits

Author SHA1 Message Date
hschlueter
cfe61dbbda Write sample size to dumpfile in transformer tests.
If the number of samples changes, the sizes will help us to verify whether they are just split differently or extra data was added.

PiperOrigin-RevId: 407346280
2021-11-11 13:55:12 +00:00
tonihei
8bae89f1c4 Fully support per-track-type selection overrides.
Currently, TrackSelectionOverrides are documented as being applied
per track type, meaning that one override for a type disables all
other selections for the same track type. However, the actual
implementation only applies it per track group, relying on the
track selector to never select another renderer of the same type.

This change fixes DefaultTrackSelector to fully adhere to the
TrackSelectionsOverride definition. This solves problems when
overriding tracks for extension renderers (see Issue: google/ExoPlayer#9675)
and also simplifies a workaround added to StyledPlayerView.

#minor-release

PiperOrigin-RevId: 409121711
2021-11-11 13:54:45 +00:00
christosts
aa2a4e3055 Async buffer queueing: do not throw from flush/shutdown
The asynchronous MediaCodec adapter queues input buffers in a
background thread. If a codec queueuing operation throws an exception,
the buffer enqueuer will store it as a pending exception and re-throw it
the next time the adapter will attempt to queue another input buffer.

The buffer enqueuer's flush() and shutdown() may throw an exception if
the pending error is set. This is subject to a race-condition in which
the pending error can be set while the adapter is flushing/shutting down
the enqueuer, e.g., if an input buffer is still being queued and the
codec throws an exception. As a result, the adapter cannot flush or
shutdown gracefully.

This change makes the buffer enqueuer to ignore any pending error
when flushing/shuttinf down so that the adapter can flush/release
gracefully even if a queueing error was detected.

PiperOrigin-RevId: 409113054
2021-11-11 13:54:33 +00:00
christosts
ac413a14b3 Add experimental method to turn-off async flush
When operating the MediaCodec in asynchronous mode, after a
MediaCodec.flush(), we start MediaCodec in the callback thread,
which might trigger errors in some platforms. This change adds an
experimental flag to move the call to MediaCodec.start() back to the
playback thread.

PiperOrigin-RevId: 407801013
2021-11-11 13:53:42 +00:00
christosts
84c24fb677 Add DefaultMediaCodecFactory.getCodecAdapter() method
Add protected method DefaultRenderersFactory.getCodecAdapter(), so that
subclasses of DefaultRenderersFactory that override
buildVideoRenderers() or buildAudioRenderers() can access the
DefaultRenderersFactory codec adapter factory and pass it to
MediaCodecRenderer instances they may create.

PiperOrigin-RevId: 407345431
2021-11-11 13:53:10 +00:00
tonihei
e408a474af Make TrackSelectionOverride.getTrackType public
This method is helpful when iterating the list of track overrides
to figure out which type the override applies to.

Issue: google/ExoPlayer#9665
PiperOrigin-RevId: 409108977
2021-11-11 13:51:18 +00:00
tonihei
91f6e40922 Add repeat/shuffle mode documentation to the playlist page.
We only had some documentation for a custom shuffle mode, but none
for generic repeat or shuffle modes.

#minor-release

Issue: google/ExoPlayer#9611
PiperOrigin-RevId: 409089623
2021-11-11 13:51:10 +00:00
tonihei
898da1470d Update track selection documentation.
The Javadoc of DefaultTrackSelector can be shortened as it's not the
right place to document detailed options of the Player track selection
parameters.

The documentation page about track selection is updated to the new
APIs and extended with most relevant options and information needed
to work with ExoPlayer's track selection API.

#minor-release

PiperOrigin-RevId: 409088989
2021-11-11 13:51:02 +00:00
ibaker
4c61476f04 Fix header name in WebServerDispatcher used for testing
HTTP header names are case-insensitive, but all the others in this file
are 'correctly' cased, so we might as well be consistent.

PiperOrigin-RevId: 408840566
2021-11-11 13:50:54 +00:00
ibaker
5891b76ba2 Add contract tests for DataSource#getResponseHeaders
PiperOrigin-RevId: 408840409
2021-11-11 13:50:45 +00:00
ibaker
df0e89c167 Make DefaultHttpDataSourceContractTest an instrumentation test
Robolectric uses the JRE HttpURLConnection [1], while real Android
devices and emulators use OkHttp to implement HttpURLConnection. This
can lead to important differences in behaviour, so it's better to use
instrumentation tests when specific HTTP behaviour is important.

[1] https://github.com/robolectric/robolectric/issues/6769#issuecomment-943556156

PiperOrigin-RevId: 408840295
2021-11-11 13:50:36 +00:00
ibaker
c1aaf580f7 Fix TrackSelectionOverrides javadoc
#minor-release

PiperOrigin-RevId: 408825328
2021-11-11 13:36:37 +00:00
tonihei
5c6ee883e6 Add missing deprecation for old track selection override getters.
The setters in the Builder are already deprecated and using the
old getter is error-prone as they only return the overrides set
with the deprecated setters.

Issue: google/ExoPlayer#9665
PiperOrigin-RevId: 408817640
2021-11-11 13:35:15 +00:00
tonihei
eec8d31544 Merge pull request #9543 from KasemJaffer:rf64
PiperOrigin-RevId: 408816643
2021-11-11 13:34:48 +00:00
kimvde
334fe47b60 WavExtractor: skip unknown chunks consistently
#minor-release

PiperOrigin-RevId: 408550935
2021-11-11 13:34:37 +00:00
ibaker
a6334716a8 Update exoplayer.dev copyright notice to 2021
#minor-release

PiperOrigin-RevId: 408331834
2021-11-11 13:34:21 +00:00
ibaker
8ead107181 Rollback of 95e6db931a
*** Original commit ***

Add link to annual media developer survey.

This will be removed after the survey has closed in ~1 month.

***

PiperOrigin-RevId: 408327757
2021-11-11 13:34:11 +00:00
tonihei
864e5a2dbc Add missing @Nullable for ExoPlayer.getPlayerError.
#minor-release

Issue: google/ExoPlayer#9660
PiperOrigin-RevId: 408323173
2021-11-11 13:34:03 +00:00
ibaker
942bfdb140 Add @Deprecated to MediaSourceFactory deprecated overrides
This is needed to ensure the deprecation warning appears on usages in
Android Studio and in javadoc.

#minor-release

PiperOrigin-RevId: 408319182
2021-11-11 13:33:49 +00:00
ibaker
e674a43f6e Remove usages of ParserException from the demo app
PiperOrigin-RevId: 408311942
2021-11-11 13:33:36 +00:00
ibaker
f9c1cab541 Split MediaItemTest#setSubtitles into two tests
Each test exercises one of the setters. Together they assert that both
setters set both fields.

PiperOrigin-RevId: 408309207
2021-11-11 13:33:20 +00:00
ibaker
57df39ffb8 Migrate GL demo from deprecated ExoPlayer.VideoComponent to ExoPlayer
#minor-release

PiperOrigin-RevId: 408304187
2021-11-11 13:32:59 +00:00
christosts
3bc7ffe644 Minor fix in AsynchronousMediaCodecAdapter.signalEndOfInputStream()
PiperOrigin-RevId: 407635099
2021-11-08 10:47:31 +00:00
olly
a9473796b1 Update security mailing list
PiperOrigin-RevId: 407540705
2021-11-08 10:47:16 +00:00
tonihei
f7c9b439a4 Rename indexes to indices in TrackSelectionOverrides
And in a couple of related places.

This is for consistency with the rest of the codebase where
we exclusively use indices.

#minor-release

PiperOrigin-RevId: 408273372
2021-11-08 10:17:42 +00:00
tonihei
80ebbbf18f Fix deprecated Javadoc link.
#minor-release

PiperOrigin-RevId: 408269341
2021-11-08 10:17:30 +00:00
ibaker
e5fc714136 Migrate usages of deprecated MediaItem symbols
#minor-release

PiperOrigin-RevId: 407847729
2021-11-08 10:17:18 +00:00
ibaker
1f0fbafdc6 Migrate the demo app to use non-deprecated MediaItem Builders
#minor-release

PiperOrigin-RevId: 407843859
2021-11-08 10:17:02 +00:00
ibaker
852480a844 Update the demo app to use the stable ExoPlayer.Builder constructor
The ExoPlayer.Builder constructor overloads are only needed for apps
trying to ensure certain classes are removed by R8/proguard, which isn't
relevant for the demo app.

PiperOrigin-RevId: 407819694
2021-11-08 10:16:51 +00:00
tonihei
127aa29fa7 Fix track selection with mixed empty/non-empty overrides
When we have multiple overrides for TrackGroups associated with
one renderer, we need to look at all of them to find the non-empty
one. Empty ones should only be used to remove previously selected
tracks for this group and otherwise be ignored.

Currently this is broken because the first override (no matter if
it's empty or not) is used as the final selection for this renderer.

Issue: google/ExoPlayer#9649

PiperOrigin-RevId: 407792330
2021-11-08 10:16:06 +00:00
tonihei
7fe9ecc1c5
Merge pull request #9648 from google/dev-v2-r2.16.0
r2.16.0
2021-11-04 14:01:15 +00:00
tonihei
7b89c4363c Update Javadoc for 2.16.0
PiperOrigin-RevId: 407379522
2021-11-04 08:32:50 +00:00
tonihei
6388dc6376 Update release notes for 2.16.0
PiperOrigin-RevId: 407333525
2021-11-03 16:13:45 +00:00
tonihei
de71fd6eba Bump version to 2.16.0
PiperOrigin-RevId: 407314385
2021-11-03 15:58:14 +00:00
samrobinson
f6e0790a68 Fix END_OF_STREAM transformer timestamp matching previous.
This cause the muxer to fail to stop on older devices/API levels.

#minor-release

PiperOrigin-RevId: 407309028
2021-11-03 15:58:05 +00:00
ibaker
293cf2f865 Fix broken link on supported-formats dev guide page
#minor-release

PiperOrigin-RevId: 407305661
2021-11-03 15:57:53 +00:00
kimvde
9e247d287f WavExtractor: split header reading state into 2 states
This refactoring is the basis to support RF64 (see
Issue: google/ExoPlayer#9543).

#minor-release

PiperOrigin-RevId: 407301056
2021-11-03 15:57:39 +00:00
tonihei
ac66487013 Add missing RetentionPolicy for IntDef
PiperOrigin-RevId: 407162673
2021-11-03 15:57:29 +00:00
aquilescanta
be4ea151c4 Parse HDR static metadata from MP4 files
#minor-release

PiperOrigin-RevId: 407136922
2021-11-03 15:57:11 +00:00
tonihei
cddebdcf03 Suppress lint warnings in leanback module.
These warnings are caused by the fact that this is a library and the
lint check doesn't see any app using the library in a TV context.

PiperOrigin-RevId: 407110725
2021-11-03 15:57:00 +00:00
samrobinson
5a98c823fc Update the TransformerMediaClock trackTime before deducting the offset.
#minor-release

PiperOrigin-RevId: 407086818
2021-11-03 15:56:47 +00:00
tonihei
368f4d6754 Suppress lint warning about IntDef assignment.
The values returned by the framework method are equivalent to the local IntDef values.

PiperOrigin-RevId: 407048748
2021-11-02 13:10:41 +00:00
christosts
e246eccc10 Replace map with a switch statement in bandwidth meter implementations
#minor-release

PiperOrigin-RevId: 407042882
2021-11-02 13:10:30 +00:00
ibaker
1654842050 Migrate usages of Window-based Player methods
Where this introduced an inconsistency (e.g. assigning to something
called `windowIndex`), I generally renamed the transitive closure of
identifiers to maintain consistency (meaning this change is quite
large). The exception is code that interacts with Timeline and Window
directly, where sometimes I kept the 'window' nomenclature.

#minor-release

PiperOrigin-RevId: 407040052
2021-11-02 13:10:20 +00:00
tonihei
f5cdf1657a Remove FfmpegVideoRenderer from 2.16.0 release 2021-11-02 11:57:30 +00:00
huangdarwin
14eba83df6 Transformer GL: Undo accidental setResolution changes().
Accidental changes were introduced in c53924326d

PiperOrigin-RevId: 406858888
2021-11-02 08:58:49 +00:00
samrobinson
2c2705aa6b Allow remove video transformer option.
PiperOrigin-RevId: 406849436
2021-11-02 08:58:34 +00:00
bachinger
58f36fb854 Fix rewriting upstream/crypto package in lib-datasource
PiperOrigin-RevId: 406840246
2021-11-01 17:39:24 +00:00
tonihei
455fb89cd4 Suppress lint warning about wrong IntDef in FrameworkMuxer
The values are equivalent and we can suppress the warning.

PiperOrigin-RevId: 406839242
2021-11-01 17:39:08 +00:00
tonihei
8cefb845df Merge pull request #9576 from TiVo:p-fix-duration-round
PiperOrigin-RevId: 406839109
2021-11-01 17:38:51 +00:00