12802 Commits

Author SHA1 Message Date
christosts
f43d6326bf 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:22:43 +00:00
tonihei
954531bd28 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 11:55:36 +00:00
tonihei
86f109c42f 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 10:58:45 +00:00
tonihei
13806507b0 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 10:54:15 +00:00
tonihei
658def4136 Plumb PlayerId to MediaSource.
MediaSource can be reused with other Player instances after they
have been released, so we need to set the PlayerId when preparing
the source. Access can mostly be handled by the implementation in
BaseMediaSource.

PiperOrigin-RevId: 408878824
2021-11-11 10:49:35 +00:00
ibaker
bf1cf13cab 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 10:45:10 +00:00
ibaker
dd95587cf2 Add contract tests for DataSource#getResponseHeaders
PiperOrigin-RevId: 408840409
2021-11-11 10:40:38 +00:00
ibaker
e4695abc18 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 10:35:56 +00:00
ibaker
0e36bdb2e6 Fix TrackSelectionOverrides javadoc
#minor-release

PiperOrigin-RevId: 408825328
2021-11-11 10:30:28 +00:00
tonihei
ee006ff2b5 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 10:26:02 +00:00
tonihei
04517e17d4 Merge pull request #9543 from KasemJaffer:rf64
PiperOrigin-RevId: 408816643
2021-11-11 10:21:29 +00:00
hschlueter
5ae60f2be7 Split VideoSamplePipeline from TransformerTranscodingVideoRenderer.
The `VideoSamplePipeline` handles all steps from decoding to
re-encoding that where previously in
`TransformerTranscodingVideoRenderer`. The renderer is now only
responsible for reading the format, reading input, passing it to the
pipeline and passing the pipeline's output to the muxer.

When no transformations are needed, decoding and re-encoding is
skipped using the `PassthroughPipeline`.

PiperOrigin-RevId: 408619407
2021-11-11 10:16:53 +00:00
tonihei
f633e76c15 Plumb PlayerId to renderers.
We can rename the existing setIndex method to a more generic init
as this method is only called by EPII and implemented by BaseRenderer
anyway.

PiperOrigin-RevId: 408616055
2021-11-11 10:12:17 +00:00
hschlueter
30c77e8e1c Refactor buffer duration calculation for clarity.
Follow-up to address comments from 9efa32e49b.

PiperOrigin-RevId: 408600470
2021-11-11 10:07:39 +00:00
Sebastian Roth
c09fa7560d PR feedback 2021-11-10 16:41:48 +00:00
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
ibaker
ba9ade1c8e Update exoplayer.dev copyright notice to 2021
#minor-release

PiperOrigin-RevId: 408331834
2021-11-08 17:00:35 +00:00
ibaker
1eca6700ae 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-08 16:56:03 +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
364239ac8c Remove usages of ParserException from the demo app
PiperOrigin-RevId: 408311942
2021-11-08 14:36:53 +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
ibaker
b3b4645e69 Migrate GL demo from deprecated ExoPlayer.VideoComponent to ExoPlayer
#minor-release

PiperOrigin-RevId: 408304187
2021-11-08 14:27:05 +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
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
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
olly
8fb0af83f5 Use stop(boolean) in MediaSessionConnector 2021-11-08 10:08:24 +00:00
ibaker
08d827f2ed Migrate usages of deprecated MediaItem symbols
#minor-release

PiperOrigin-RevId: 407847729
2021-11-08 09:48:45 +00:00
ibaker
ed63fee21c Migrate the demo app to use non-deprecated MediaItem Builders
#minor-release

PiperOrigin-RevId: 407843859
2021-11-08 09:43:55 +00:00
ibaker
028bb2341a 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 09:38:57 +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
olly
0e88f13e0f Update security mailing list
PiperOrigin-RevId: 407540705
2021-11-05 11:44:08 +00:00
Sebastian Roth
ab397e408a move release notes entry 2021-11-05 11:10:29 +00:00
Sebastian Roth
d89e18fe6d Merge branch 'dev-v2' into rtsp-socket-factory 2021-11-05 11:09:48 +00:00
Sebastian Roth
4c0008a29c Merge branch 'dev-v2' of https://github.com/google/ExoPlayer into dev-v2 2021-11-05 11:09:37 +00:00