11979 Commits

Author SHA1 Message Date
Scott
83d2c39a36 Updated MediaCodecInfo with correct channel adjustments for DTS codecs 2021-07-08 11:17:24 +01:00
Scott
dffcf258ee Updated mimetypes to support DTSX and to correct assign dtse to DTS Express 2021-07-08 11:11:26 +01:00
Scott
716cbceaa4 Updates to mp4 atom extractor/parser for dtsx support. 2021-07-08 11:07:56 +01:00
olly
a55c0654fb Improve Cronet and OkHttp READMEs
PiperOrigin-RevId: 382279955
2021-06-30 13:54:16 +01:00
olly
dea52048cb Bump dependency versions
PiperOrigin-RevId: 382277352
2021-06-30 13:53:01 +01:00
samrobinson
9013facdd7 Rename PlaylistMediaMetadata to PlaylistMetadata in Player.
This affects the setter, getter and callback, as well as various
media 3 methods.

PiperOrigin-RevId: 382275672
2021-06-30 13:51:51 +01:00
aquilescanta
764f9f20d6 Add info about trick-playness to the Format log string
PiperOrigin-RevId: 382139109
2021-06-30 13:50:32 +01:00
kimvde
6e4508daec Improve support for Ogg truncated content
#minor-release

Issue:#7608
PiperOrigin-RevId: 382081687
2021-06-30 13:49:15 +01:00
aquilescanta
155e27ec7c Move ExoPlaybackException back into core
PiperOrigin-RevId: 381941053
2021-06-30 13:47:30 +01:00
claincly
02db70bdd0 Amend RTSP dev guide to match the current code status.
PiperOrigin-RevId: 381852972
2021-06-30 13:46:13 +01:00
claincly
ffbec2234d Assign PlaybackException.ErrorCode to renderer failures.
PiperOrigin-RevId: 381852092
2021-06-30 13:45:02 +01:00
olly
7aaba1ffe5 Migrate usage of Player.EventListener to Player.Listener
PiperOrigin-RevId: 381837274
2021-06-30 13:43:51 +01:00
olly
ea99c3fa94 Add ability to set Cronet request priority
PiperOrigin-RevId: 381833403
2021-06-30 13:42:42 +01:00
Oliver Woodman
8588bdb02a Merge pull request #9119 from chvp:media2-dispatch-previous-next
PiperOrigin-RevId: 381833313
2021-06-30 13:41:35 +01:00
olly
bb82e7df9d Cronet: Align terminology with documentation
PiperOrigin-RevId: 381472436
2021-06-30 13:40:24 +01:00
olly
6fe2f25fe9 Update DataSource extension documentation
Also upgrade the RTMP extension to use an inner class
for its factory.

PiperOrigin-RevId: 381469114
2021-06-30 13:39:09 +01:00
olly
ec9f512fee OkHttp: Upgrade to 4.9.1 (minSdkVersion 21)
Until now, we have stuck with the 3.12 long-term branch so as
to keep support for older API levels. However, this means that
the version we're using is 2.5 years old at this point. The
3.12 branch will stop receiving critical updates in December
2021.

Since use of the OkHttp extension is optional anyway, it seems
preferable to move to a modern version of OkHttp at this point.

PiperOrigin-RevId: 381465269
2021-06-30 13:37:58 +01:00
olly
c9193fdcf7 Fix release notes
PiperOrigin-RevId: 381443205
2021-06-30 13:36:52 +01:00
aquilescanta
b58fce1bd9 Assign some more IO error codes
Specifically:
- ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT
- ERROR_CODE_IO_NETWORK_CONNECTION_FAILED
- ERROR_CODE_IO_NETWORK_CONNECTION_CLOSED
PiperOrigin-RevId: 381441329
2021-06-30 13:35:37 +01:00
aquilescanta
465f7c06d8 Add ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED
And assign it to CleartextNotPermittedException.

PiperOrigin-RevId: 381247430
2021-06-30 13:34:31 +01:00
olly
bcd4bb87e5 Deprecate CronetEngineWrapper
PiperOrigin-RevId: 381239971
2021-06-30 13:32:43 +01:00
aquilescanta
1cc62c65a7 Add @ErrorCode to local variables in ExoPlayerImplInternal
PiperOrigin-RevId: 381236418
2021-06-30 13:30:58 +01:00
aquilescanta
cca4ac73ca Assign ERROR_CODE_IO_DNS_FAILED to UnknownHostException
PiperOrigin-RevId: 381235721
2021-06-30 13:29:53 +01:00
olly
1e9b6d66a3 [CronetDataSource] Support keeping the POST method and body for 302
Currently when a HTTP POST request receives a 302, CronetDataSource will change the request method from POST to GET for the redirected request, and drop the post body. This aligns with the behaviours of many user agents, but our use case would like to keep the POST method and the post body.

org.chromium.net.UrlRequest.followRedirect also changes POST to GET for 302, so should be avoided here.

PiperOrigin-RevId: 381233011
2021-06-30 13:28:50 +01:00
aquilescanta
fc26d4eeb1 Remove the last deprecated ParserException constructor
PiperOrigin-RevId: 381221669
2021-06-30 13:27:45 +01:00
bachinger
1cb4fb290f Change signature of ChunkSource.onChunkLoadError
A no-op change that changes the signature of the onChunkLoadError method of the ChunkSource. Implementors can get the exclusion duration directly from the LoadErrorHndlingPolicy instead of receiving it as an argument of the callback.

PiperOrigin-RevId: 381102935
2021-06-30 13:26:32 +01:00
bachinger
ed471fae96 Add @FallbackType to LoadErrorHandlingPolicy
No-op change that adds the @FallbackType IntDef and changes the signature of getBlacklistDurationMsFor(LoadErrorInfo) to getExclusionDurationMsFor(@FallbackType, LoadErrorInfo).

PiperOrigin-RevId: 381075496
2021-06-30 13:25:08 +01:00
olly
75c06cc4e7 Cronet: Cleanup and simplify CronetEngineWrapper
A subsequent change will deprecate CronetEngineWrapper and move
all of the logic into a utility class for obtaining a suitable
CronetEngine.

This change also deprioritizes use of unknown cronet providers.

PiperOrigin-RevId: 381051164
2021-06-30 13:24:01 +01:00
aquilescanta
d6a95482d6 Add release notes for PlaybackException-related changes
PiperOrigin-RevId: 381021014
2021-06-30 13:22:53 +01:00
olly
116e50f365 Cronet: Deprecate internal fallback
The way CronetDataSource.Factory can internally fall back to another
factory is confusing and unnecessary. In the case the application cannot
instantiate a CronetEngine, it should directly use another factory.

This makes CronetDataSource more consistent with OkHttpDataSource. In
both cases, their factory constructors take the component that the
respective libraries advise should only be created once by the application,
which are CronetEngine and OkHttpClient respectively.

CronetEngineWrapper will be deprecated in a subsequent change.

PiperOrigin-RevId: 381016504
2021-06-30 13:21:39 +01:00
samrobinson
2d44f82aa4 Correct naming of compilation field MediaMetadata.
PiperOrigin-RevId: 381016088
2021-06-30 13:20:18 +01:00
andrewlewis
7d05f20493 Signal container MIME type for JPEGs
Before this change the `Format` on the image track output by the
`JpegExtractor` doesn't have a MIME type.

PiperOrigin-RevId: 381015819
2021-06-30 13:19:00 +01:00
aquilescanta
1a8592c5c0 Add Player.Listener.onPlayerErrorChanged
Equivalent to onPlayerError, except it's also called for null.

PiperOrigin-RevId: 381015336
2021-06-30 13:17:49 +01:00
claincly
620ab67fee Improve timeout handling and allow customizing the timeout.
Previously, a SocketTimeourException is used to signal the end of the stream
that is caused by "no RTP packets received for a while". However, such
signaling is inappropriate under TransferRtpDataChannel, or FakeRtpDataChannel
in RtspPlaybackTests.

Hence, the signaling of end of stream is changed to use RESULT_END_OF_INPUT.
The RtpDataChannel implementations will Still block until a set timeout, but
will return a C.RESULT_END_OF_INPUT should a timeout occur, instead of
throwing a nested SocketTimeoutException.

This also allowed customization of the timeout amount, in
RtspMediaSource.Factory

PiperOrigin-RevId: 380981534
2021-06-30 13:16:44 +01:00
krocard
5e2197d82e Remove extra test checks intended to debug flaky test.
Those test are no longer flaky since the test clock
was made deterministic.

The removed assertions were introduced in a4ad351fb1.

PiperOrigin-RevId: 380793961
2021-06-30 13:15:21 +01:00
aquilescanta
d87fdaa370 Fix the single-sample SampleStream regarding FLAG_REQUIRE_FORMAT
The current FLAG_REQUIRE_FORMAT documentation states: If an end of
stream buffer would be read were the flag not set, then behavior is
unchanged.

PiperOrigin-RevId: 380792251
2021-06-30 13:14:12 +01:00
aquilescanta
ddd6a22561 Fix EventSampleStream's implementation regarding FLAG_REQUIRE_FORMAT
The current FLAG_REQUIRE_FORMAT documentation states: If an end of
stream buffer would be read were the flag not set, then behavior is
unchanged.

PiperOrigin-RevId: 380781976
2021-06-30 13:12:44 +01:00
bachinger
b48b618bce Parse multiple BaseURL elements
After this change, multiple BaseURL elements are parsed, but the player still only uses the first BaseURL element appearing in the manifest and its corresponding availabilityTimeOffsetUs.

PiperOrigin-RevId: 380775256
2021-06-30 13:11:25 +01:00
claincly
341e66ceec Amend release note for 46bc49a4f6.
PiperOrigin-RevId: 380766548
2021-06-30 13:10:12 +01:00
Charlotte Van Petegem
efc6992e17
Remove useless assertions 2021-06-28 12:06:28 +02:00
Charlotte Van Petegem
13fb0baf0e
Use better builtin ControlDispatcher methods in media2 extension 2021-06-26 12:31:25 +02:00
olly
9df2e42d4d Fix expansion of items within StyledPlayerView popup
Issue: #9086
#minor-release
PiperOrigin-RevId: 380756562
2021-06-22 10:17:28 +01:00
olly
c7b3fa367b HLS: Fix issue where a live event doesn't transition to STATE_ENDED
The problem occurs when the primary media playlist URL switches
from one whose latest snapshot has not yet got the ended tag, to
one whose latest snapshot already has the ended tag. In this case:

- We trigger a redundant load of the ended playlist.
- When the redundant load completes,
  MediaPlaylistBundle.processLoadedPlaylist detects that the
  playlist is unchanged from the one it already has, and so
  doesn't call onPlaylistUpdated.
- PrimaryPlaylistListener.onPrimaryPlaylistRefreshed is never
  called with the new primary. Hence the externally visible primary
  is still the one that hasn't ended. HlsMediaSource therefore thinks
  the event hasn't ended, which in turn prevents the player from
  transitioning to the ended state.

This commit detects when the new primary already has the ended tag.
In this case, we call onPrimaryPlaylistRefreshed directly and remove
the unnecessary playlist load.

Issue: #9067
#minor-release
PiperOrigin-RevId: 380680532
2021-06-21 23:53:59 +01:00
olly
b1dda6a02a Fix DefaultTimeBar glitches
The glitches were introduced in:
https://github.com/google/ExoPlayer/commit/6c31e34528

The problem is that Listener.onEvents is called in a later looper iteration
than the listener methods that were previously used. This created a gap on
the main thread between the UI component dispatching a seek operation to the
player, and onEvents being called to update the progress bar's position.

At the start of this gap the progress bar is rendering the new position,
but its position member variable is still set to the old position. If the
progress bar is re-drawn by another message on the main thread within the
gap, it will briefly show the old position until onEvents is called.

There are multiple possible fixes to this, and the best one is probably to
modify ListenerSet to remove the gap. That's high risk though, so for now we
fix the flicker by always updating the progress immediately after the seek
is dispatched, in addition to when onEvents is called.

Issue: #9049
#minor-release
PiperOrigin-RevId: 380678388
2021-06-21 23:52:43 +01:00
olly
3d3ac623a6 Specify a root when inflating child views
#minor-release

PiperOrigin-RevId: 380655806
2021-06-21 22:31:52 +01:00
olly
6f686be751 Workaround for focus issues on API levels less than 26
Issue: #9061
PiperOrigin-RevId: 380640601
2021-06-21 22:30:38 +01:00
aquilescanta
81c542b6a7 Remove deprecated ParserException constructor
And replace it with factory method which includes more
context for error code assignment.

PiperOrigin-RevId: 380624625
2021-06-21 22:29:27 +01:00
bachinger
f609fecf9b Parse BaseURL element including DVB attributes in DASH manifest
This change parses the entire BaseURL element including DVB extension attributes, stores it in an instance of new BaseUrl class and puts it in a list of base URLs of the resulting Representation. The base url handling itself is still the same, which means that only the first base url is taken into account, just as before this change.

PiperOrigin-RevId: 380609495
2021-06-21 22:28:17 +01:00
ibaker
663082161a Re-word the DataSourceContractTest javadoc
This softens the language around suppressing individual test methods.
There are some legitimate cases where this is needed, e.g.
ByteArrayDataSourceContractTest has to suppress all the tests related
to non-existent resources because it's not possible to simulate that
case.

#minor-release

PiperOrigin-RevId: 380570017
2021-06-21 22:27:02 +01:00
claincly
46bc49a4f6 Use a HashMap like behaviour in parsing SDP.
Some server will wrongly insert duplicated attributes. We used to treat this as
a unrecoverable error, but it is better to treat the duplicated attributes in
an "over-writable" fashion like HashMaps.

Issue: #9080,
Issue: #9014
PiperOrigin-RevId: 380547079
2021-06-21 22:25:36 +01:00