8576 Commits

Author SHA1 Message Date
kimvde
4082d8a63d WavExtractor: skip unknown chunks consistently
#minor-release

PiperOrigin-RevId: 408550935
2021-11-09 15:09:42 +00:00
hschlueter
9efa32e49b Accumulate remainder in buffer duration calculations.
When dropping the remainder, the decoder and encoder timestamps start diverging after a few buffers when no speed changes are supposed to occur. Tracking the remainder keeps them in sync.

PiperOrigin-RevId: 408341074
2021-11-08 17:05:09 +00:00
tonihei
5de4915fe4 Add missing @Nullable for ExoPlayer.getPlayerError.
#minor-release

Issue: google/ExoPlayer#9660
PiperOrigin-RevId: 408323173
2021-11-08 14:46:28 +00:00
ibaker
d06e8136ee 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-08 14:41:45 +00:00
ibaker
4404404795 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-08 14:32:04 +00:00
tonihei
136ce57f1e Create wrapper class for LogSessionId.
The platform class is only available from API 31, so we need
a generic wrapper that can be used on all API levels. The wrapper
essentially provides an identifier for a player instance, so naming
it accordingly.

PiperOrigin-RevId: 408292802
2021-11-08 14:22:02 +00:00
christosts
3bc7ffe644 Minor fix in AsynchronousMediaCodecAdapter.signalEndOfInputStream()
PiperOrigin-RevId: 407635099
2021-11-08 10:47:31 +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
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
3e934e5379 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:09:31 +00:00
tonihei
1a81662dad Fix deprecated Javadoc link.
#minor-release

PiperOrigin-RevId: 408269341
2021-11-08 10:09:31 +00:00
ibaker
08d827f2ed Migrate usages of deprecated MediaItem symbols
#minor-release

PiperOrigin-RevId: 407847729
2021-11-08 09:48:45 +00:00
Steve Mayhew
530dd3f733 Correct comment on track selection during seek
The comment "all should be same" is not correct,  it is extremely likely they will be the same but not assured.   In either case the seek position will work, it just may not land exactly on a sync point in every variant.
2021-11-05 13:08:20 -07:00
christosts
9e1597a479 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-05 13:30:44 +00:00
tonihei
0b48570bb3 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

#minor-release

PiperOrigin-RevId: 407792330
2021-11-05 12:11:03 +00:00
hschlueter
8552345f8f Add PassthroughSamplePipeline for audio.
When no transformation is needed, the passthrough pipeline allows us to skip decoding and re-encoding.

PiperOrigin-RevId: 407789767
2021-11-05 12:06:37 +00:00
christosts
85e222a785 Minor fix in AsynchronousMediaCodecAdapter.signalEndOfInputStream()
PiperOrigin-RevId: 407635099
2021-11-05 11:57:41 +00:00
huangdarwin
14b42a4ed1 GL: Misc GL refactoring.
* Remove GlUtil.Program String[] constructor to unify and just use the
  String constructor.
* Add getAttributeArrayLocationAndEnable() to simplify things a tiny bit.
* Increase usage of constant values.

PiperOrigin-RevId: 407570340
2021-11-05 11:53:00 +00:00
hschlueter
62a35018f8 Separate TransformerAudioRenderer and new AudioSamplePipeline.
`TransformerAudioRenderer` reads input and passes `DecoderInputBuffer`s to the `AudioSamplePipeline`. The `AudioSamplePipeline` handles all steps from decoding to encoding. `TransformerAudioRenderer` receives `DecoderInputBuffer`s from the `AudioSamplePipeline` and passes their data to the muxer.

`AudioSamplePipeline` implements a new interface `SamplePipeline`. A pass-through pipeline will be added in a future cl.

PiperOrigin-RevId: 407555102
2021-11-05 11:48:26 +00:00
Sebastian Roth
d89e18fe6d Merge branch 'dev-v2' into rtsp-socket-factory 2021-11-05 11:09:48 +00:00
hschlueter
49a93e31d7 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-04 00:59:42 +00:00
christosts
5d2df83496 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.

#minor-release

PiperOrigin-RevId: 407345431
2021-11-04 00:55:55 +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
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
samrobinson
5a98c823fc Update the TransformerMediaClock trackTime before deducting the offset.
#minor-release

PiperOrigin-RevId: 407086818
2021-11-03 15:56:47 +00:00
tonihei
2d31100264 Bump version to 2.16.0
PiperOrigin-RevId: 407314385
2021-11-03 15:35:19 +00:00
samrobinson
0c4f5ebc91 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:30:43 +00:00
kimvde
1139399193 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:21:28 +00:00
olly
a9f7b943c8 Prepare for adding ServerSideInsertedAdsMediaSource for IMA
PiperOrigin-RevId: 407274072
2021-11-03 15:16:58 +00:00
tonihei
7b9b878aeb Add missing RetentionPolicy for IntDef
PiperOrigin-RevId: 407162673
2021-11-03 15:12:19 +00:00
aquilescanta
41e338229a Parse HDR static metadata from MP4 files
#minor-release

PiperOrigin-RevId: 407136922
2021-11-03 15:07:30 +00:00
samrobinson
9970aaf673 Update the TransformerMediaClock trackTime before deducting the offset.
#minor-release

PiperOrigin-RevId: 407086818
2021-11-03 14:57:58 +00:00
Sebastian Roth
0830c06cd7 PR feedback 2021-11-02 14:58:15 +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
623be98d53 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 12:17:01 +00:00
christosts
ee4af48a10 Replace map with a switch statement in bandwidth meter implementations
#minor-release

PiperOrigin-RevId: 407042882
2021-11-02 12:12:39 +00:00
ibaker
7de079493c 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 12:08:18 +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
huangdarwin
c5f4843de2 Transformer GL: Undo accidental setResolution changes().
Accidental changes were introduced in c53924326d

PiperOrigin-RevId: 406858888
2021-11-02 08:51:54 +00:00
samrobinson
18e8ebe0f8 Allow remove video transformer option.
PiperOrigin-RevId: 406849436
2021-11-02 08:47:32 +00:00
bachinger
58f36fb854 Fix rewriting upstream/crypto package in lib-datasource
PiperOrigin-RevId: 406840246
2021-11-01 17:39:24 +00:00