4164 Commits

Author SHA1 Message Date
tonihei
ea0f72e46c Update initial bandwidth estimates
PiperOrigin-RevId: 361569511
2021-03-12 10:40:04 +00:00
gyumin
ffb7c466ed Implement addMediaItems(List) and clearMediaItems() in BasePlayer
PiperOrigin-RevId: 361487730
2021-03-12 10:39:54 +00:00
gyumin
c1dba81ed2 Move TimelineTest to common module
PiperOrigin-RevId: 361125522
2021-03-12 10:39:43 +00:00
gyumin
51f6aea265 Merge AdPlaybackStateTests
PiperOrigin-RevId: 361125492
2021-03-12 10:39:33 +00:00
kimvde
0dcdbf0adf Add Player onAvailableCommandsChanged callback
PiperOrigin-RevId: 361122259
2021-03-12 10:39:22 +00:00
Ian Baker
83d7a3c1f4 Merge pull request #8662 from joakimzhang:dev-v2
PiperOrigin-RevId: 361029604
2021-03-12 10:38:36 +00:00
bachinger
8dc63dd2aa Reset playback speed when live speed control becomes unused
Issue: #8664
#minor-release
PiperOrigin-RevId: 360877086
2021-03-12 10:38:04 +00:00
Denise LaFayette
0f0e0c974b Fix missing background color behind emphasis mark
Add more comments and tests for TextEmphasis
2021-03-09 14:01:32 -08:00
Denise LaFayette
671032204f Remove unused code 2021-03-08 10:12:11 -08:00
Denise LaFayette
f7f40bcb25 Address code review comments
- Split text emphasis mark and style into two IntDefs
- Represent textEmphasis="none" with a span rather than null
- Fixed bugs in the style parsing logic
2021-03-05 12:23:34 -08:00
Denise LaFayette
60a3af8d77 Fix broken unit test in TtmlDecoder.textEmphasis()
- Merge RUBY_POSITION with TEXT_EMPHASIS_POSITION in TtmlNode
2021-03-04 16:06:56 -08:00
Denise LaFayette
4ad6454713 Address code review comments
- Refactor TextEmphasis class to support different ordering of styles
- Merge RubySpan.Position and TextEmphasisSpan.Position
- Remove TTML constructs from Spanned classes
2021-03-04 15:49:28 -08:00
Ian Baker
d80d548503
Merge branch 'dev-v2' into dev-v2-8435-bolditalic 2021-03-04 09:41:39 +00:00
Abel Jimenez
8ac74a009e formatting 2021-03-03 02:51:26 -08:00
joakimzhang
dc814fc37d Detect external surround sound on Xiaomi devices
exoplayer can enable dolby passthrough on xiaomi device when get
EXTERNAL_SURROUND_SOUND_KEY

Signed-off-by: joakimzhang <zq15011526977@gmail.com>
2021-03-03 10:14:17 +08:00
kimvde
67b18a958e Link to callback in Player getters' Javadoc
PiperOrigin-RevId: 360398175
2021-03-02 17:04:35 +00:00
andrewlewis
292700e93b Fall back from DTS HD to DTS
#minor-release

PiperOrigin-RevId: 360384540
2021-03-02 17:04:25 +00:00
olly
3f17f5d441 1) Adds new csi ticks:
exp (ExoPlayer prepare)
ffr (First Frame Rendered)
psr (Player State Ready).

2) Modifies aci/acc vci/vcc to report timing from ExoPlayer Playback thread.

3) Fix to report pvri and pari for every playback.

and other minor bug fixes.

PiperOrigin-RevId: 360228206
2021-03-02 17:04:15 +00:00
aquilescanta
ef1d797681 Introduce ChunkExtractor.Factory for dependency injection
PiperOrigin-RevId: 360175031
2021-03-02 17:03:55 +00:00
olly
560ed115df Add ResolvingDataSourceContractTest
PiperOrigin-RevId: 359783527
2021-03-02 17:03:35 +00:00
olly
1e3337e4b7 Add RawResourceDataSource contract test
PiperOrigin-RevId: 359743165
2021-03-02 17:03:25 +00:00
krocard
72aec83a9e Add setPlaybackSpeed as a convenience method to change speed.
PiperOrigin-RevId: 359734928
2021-03-02 17:03:05 +00:00
olly
c319220354 Add BandaidHttpDataSourceContractTest
Also fix a bug where BandaidHttpDataSource would pass -1 to
TransferListener.onBytesTransferred!

PiperOrigin-RevId: 359722821
2021-03-02 17:02:45 +00:00
krocard
b050391467 Clarify that set/getVolume is in fact a linear gain.
The API is a lot more useful if apps can rely on the fact
that the gain is linear and applied to all channels.

This is already guaranty by AudioTrack and should be too
by any reasonable implementation.

PiperOrigin-RevId: 359706113
2021-03-02 17:02:35 +00:00
olly
27c8679ce4 Make updateCodecOperatingRate protected.
Use the api in YouTube code to update the operating rate.

PiperOrigin-RevId: 359572194
2021-03-02 17:02:26 +00:00
ibaker
34d76a793b Make SsaDecoder robust against absent Format items
Suggested in a comment on PR Issue: #8615

PiperOrigin-RevId: 359522217
2021-03-02 17:02:15 +00:00
olly
635544efe9 Add DataSourceContractTest for reading from the end with a set length
Given we're proposing to make reading from the end a non-error case,
it's important to check that we return the right thing from open(),
and that we read the right thing (i.e., nothing) once opened.

For now, this test allows quite a bit of permissiveness, in line
with other related tests. This will be tightened up in due course.

PiperOrigin-RevId: 359504075
2021-03-02 17:02:04 +00:00
Abel Jimenez
ec69977a1c ssa bold and italic 2021-03-01 15:55:34 -08:00
Denise LaFayette
fcda8d47ff Support tts:textEmphasis in TTML parser and WebView output 2021-03-01 14:21:22 -08:00
krocard
36e480d81c Allow low level control of gapless offload
Allow offload of gapless content even if gapless offload is not known to be supported by the device.

This is not exposed in the high level DefaultRendererFactory as most
users are expected to prefer fidelity to power savings.

PiperOrigin-RevId: 359336407
2021-02-25 09:18:49 +00:00
olly
a5424acede TestContentProvider: Noop change to use correct constant
The constant values are the same, so this is a no-op, but for
correctness, we should pass the defined constant that the API
documents itself to accept.

PiperOrigin-RevId: 359293471
2021-02-25 09:18:31 +00:00
ibaker
019819a94a Rename MediaPeriodHolder.allRenderersEnabled
The new name reflects that it also waits for previously-used renderers
to be disabled.

Also fix some broken javadoc. These methods changed signature in
ea347a464a

PiperOrigin-RevId: 359253177
2021-02-24 15:46:55 +00:00
marcbaechinger
4ed36e19cf Merge pull request #8615 from szaboa:dev-v2-8435-ssa-font-size
PiperOrigin-RevId: 359244236
2021-02-24 15:46:44 +00:00
krocard
589f50fb22 Move renderer from Player to ExoPlayer
The concept of Renderers is not needed in the
Player interface. Move it to ExoPlayer.

This should not break most users as they use SimpleExoPlayer.

PiperOrigin-RevId: 359220977
2021-02-24 15:46:35 +00:00
olly
19adc43bf1 Contract test for start-position-out-of-range case
Currently, this only asserts that *if* an exception is thrown, it
must be a position-out-of-range exception as determined by
DataSourceException.isCausedByPositionOutOfRange.

Issue: #7326
PiperOrigin-RevId: 359092124
2021-02-24 15:46:19 +00:00
olly
d8b5a1d7f4 Contract test for end-position-out-of-range case
Assert that an exception is not thrown from DataSource.open
if the DataSpec's start position is valid but its end position
extends beyond the end of the data.

HTTP based DataSource implementations have no good way of
knowing when this is the case, so it makes sense to make this
the required behaviour, rather than requiring an exception to
be thrown or allowing both.

There are also use cases where the caller may want to use the
end position as an upper bound, without knowing for sure how
long the content is. An example of this use case is wanting to
pre-cache the first N bytes of a stream. This implies that any
exception should be thrown after reading to the end of the
data, rather than preemptively in open.

Issue: #7326
PiperOrigin-RevId: 359063721
2021-02-24 15:46:02 +00:00
olly
c067ee8853 Fix CacheWriter to handle potential DataSink write failures
- If DataSource.close fails then it's unknown whether the underlying file was
  written to the cache. We should assume that it has not been.
- Always re-query cachedBytes at the start of CacheWriter.cache, since its
  current value may be incorrect if a previous failure was the result of a
  file not being written to the cache.

PiperOrigin-RevId: 359039109
2021-02-23 15:06:38 +00:00
gyumin
520f77bef5 Mark convenience methods as final in BasePlayer
PiperOrigin-RevId: 359021944
2021-02-23 15:06:28 +00:00
olly
920d2e03e6 Remove unused mocking in CacheWriterTest
#minor-release

PiperOrigin-RevId: 358998449
2021-02-23 12:30:22 +00:00
olly
b4b22d9808 Simplify Resource.isEndOfInputExpected
- Make it a property of the DataSource, not of the resource.
- Apply it only when a contract test reads using an
  unbounded DataSpec.

PiperOrigin-RevId: 358997735
2021-02-23 12:30:14 +00:00
ibaker
7b692f9676 Pass the session state to the onDrmSessionAcquired listener method
PiperOrigin-RevId: 358823166
2021-02-23 12:29:59 +00:00
ibaker
623597addb De-duplicate DRM acquire & release events by EventDispatcher
When we add DRM pre-acquire support to SampleQueue, we'll dispatch
twice the number of acquire and release events. This is slightly
confusing, since there's the same number of
DrmSessionManager#acquireSession() calls.

We can mitigate this by only dispatching each acquire and release
event to at most one EventDispatcher.

This also changes the events fired when playing a stream with both audio
and video encrypted with the same keys (even without pre-acquisition).

Before: The EventDispatcher would see 2 aquires, 1 key load and 2
release events.

After: The EventDispatcher will see 1 acquire, 1 key load and 1 release.
PiperOrigin-RevId: 358804502
2021-02-23 12:29:43 +00:00
ibaker
8d942dc213 Simplify release event logic in DefaultDrmSession
This is a no-op assuming the class is always used correctly.
When release causes referenceCount to reach zero there can be at most
one EventDispatcher still connected (which is the one that must be
passed to that final release() call), so we can always pass the event
directly to the EventDispatcher passed in to release().

PiperOrigin-RevId: 358794004
2021-02-23 12:29:19 +00:00
Arnold Szabo
dafe710ab3 Remove extra space from SsaDecoderTest.java. 2021-02-22 20:36:06 +01:00
Arnold Szabo
9c35d76184 Parse font size into float, and fallback to Cue.DIMEN_UNSET instead of null. 2021-02-22 20:33:12 +01:00
krocard
399e1365d0 Add missing @Nullable to method override.
Method override parameter nullness should contravariant.

PiperOrigin-RevId: 358772798
2021-02-22 10:35:41 +00:00
tonihei
ceb76f35e9 Align pattern of calling deprecated listener methods.
There are two different patterns we use at the moment:
 1. Call both deprecated and non-deprecated method from call site with
    no default method implementation body.
 2. Use default method of non-deprecated method to call deprecated
    method.

Pattern 1 is easier to reason about as it makes the calls more explicit,
so changing all usages of pattern 2 to pattern 1.

PiperOrigin-RevId: 358769803
2021-02-22 10:35:30 +00:00
ibaker
93a608d507 Static import Assertions methods in DefaultDrmSessionManager
PiperOrigin-RevId: 358384778
2021-02-22 10:35:22 +00:00
ibaker
74ad0949fd Add support for preparing DRM sessions before they're needed
This adds an optional DrmSessionManager#preacquireSession() method
and implements it on DefaultDrmSessionManager.

The manager doesn't promise to keep the preacquired sessions alive, and
will proactively release them if a ResourceBusyException suggests the
device is running out of available sessions in the underlying framework.

In a future change, SampleQueue will preacquire sessions on the loading
thread and keep track of preacquired 'references', releasing them
when seeking or clearing the queue.

Issue: #4133
PiperOrigin-RevId: 358381616
2021-02-22 10:35:14 +00:00
aquilescanta
ecb109dad8 Make MediaParser available for use in progressive media
PiperOrigin-RevId: 358379167
2021-02-22 10:35:06 +00:00