547 Commits

Author SHA1 Message Date
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
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
Oliver Woodman
f90d0a26a4 Merge pull request #9023 from DolbyLaboratories:dev-v2-multicodecs
PiperOrigin-RevId: 379440699
2021-06-15 18:39:14 +01:00
aquilescanta
b5dbadee0c Remove ParserException(cause) constructor
PiperOrigin-RevId: 378635295
2021-06-10 17:36:29 +01:00
ybai001
d176891c9c Restore to the original solution after further discussion 2021-06-10 21:00:10 +08:00
ybai001
aefc6bf51c Revert "Restore to the original solution after further discussion"
This reverts commit e7d1adf9176148aa07c56d540a9e0ddf65aa15e6.
2021-06-10 20:55:46 +08:00
ybai001
e7d1adf917 Restore to the original solution after further discussion 2021-06-10 20:54:44 +08:00
ybai001
aac5e10dee Update solution that DD+JOC track can't be selected 2021-06-10 09:33:46 +08:00
ybai001
c299ccf7e4 DD+JOC track can't be selected if there are multi tracks in manifest file
DD+JOC track can't be selected if there are multi tracks in manifest file.
2021-06-07 22:15:54 +08:00
olly
bb2e0bc0ef Bump targetSdkVersion to 30
- Remove Robolectric workarounds that are no longer needed
- Add workarounds for b/190021699

PiperOrigin-RevId: 377279422
2021-06-03 20:01:50 +01:00
olly
85b6a51666 Add DoNotInstrument annotations to DASH and UI tests
PiperOrigin-RevId: 377048460
2021-06-02 18:19:02 +01:00
olly
1da25f5979 Remove deprecated MediaSource.getTag
PiperOrigin-RevId: 373222158
2021-05-12 11:52:03 +01:00
kim-vde
0a93cc23f0 Merge pull request #8894 from cdongieux:fix/issue-8847
PiperOrigin-RevId: 373128118
2021-05-11 16:01:03 +01:00
Christophe Dongieux
928537182b Make DASH segment available at full network speed if index is marked as explicit 2021-05-10 17:34:29 +02:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
olly
67fc1f0c0a Remove deprecated Downloader constructors
PiperOrigin-RevId: 371307278
2021-04-30 18:54:32 +01:00
ibaker
b5d474010b Reformat some javadoc
PiperOrigin-RevId: 371068549
2021-04-29 11:43:34 +01:00
olly
0db4f13483 Fix 1 ErrorProneStyle finding:
* @Nullable is not a TYPE_USE annotation, so should appear before any modifiers and after Javadocs.
  (see go/java-style#s4.8.5-annotations)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 370377751
2021-04-26 18:01:38 +01:00
ibaker
dafea4e40f Re-format some javadoc
PiperOrigin-RevId: 369642047
2021-04-21 18:46:00 +01:00
olly
a78b18298b Remove some long deprecated methods
PiperOrigin-RevId: 369626542
2021-04-21 18:45:06 +01:00
olly
9a367836e4 DASH: Avoid rounding error in getSegmentCount
Issue: #8804
PiperOrigin-RevId: 369484117
2021-04-21 09:50:01 +01:00
tonihei
4f145a83cf Make ProgramInformation final.
This was likely an oversight when first importing #4930.

PiperOrigin-RevId: 369199775
2021-04-20 00:09:59 +01:00
olly
f438955285 Fix 1 ErrorProneFragileCode finding, REQUIRING THOROUGH REVIEW:
* Prefer instanceof to getClass when implementing Object#equals.
  (see http://go/bugpattern/EqualsGetClass)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Suggest a fix on the CL (go/how-to-suggest-fix).
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneFragileCode if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/exoplayer/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/exoplayer/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

PiperOrigin-RevId: 369180513
2021-04-20 00:09:31 +01:00
ibaker
c50084e7ba Replace Util.toLowerInvariant() with Ascii.toLowerCase()
Even when fixed to the US locale (and thus avoiding surprising behaviour
in e.g. Turkish locale with "i" and "I") there are unexpected behaviours
when upper and lower casing non-ASCII characters.

For example it's sometimes not symmetric, e.g.:
"ẞ".toLowerCase() -> "ß"
"ß".toUpperCase() -> "SS"

In all the ExoPlayer usages we are either dealing with known-ASCII
strings (e.g. MIME types) or comparing against ASCII constant strings
anyway, so it seems easier to just use Guava's ASCII-only class in these
cases.

This change also includes some null-twiddling, because
Util.toLowerInvariant() is null tolerant, while Ascii.toLowerCase() is
not. Most of the usages were already non-null, and it was easy enough to
change the remaining ones to be so by simple reordering of statements.

I'll make an equivalent change for Util.toUpperInvariant() next.

PiperOrigin-RevId: 368419813
2021-04-15 10:51:48 +01:00
ibaker
84282d7c32 Parse DASH forced_subtitle role
#minor-release

Issue: #8781
PiperOrigin-RevId: 368212289
2021-04-13 18:01:20 +01:00
ibaker
472b44f45a Switch DashManifestParser to use Ascii.equalsIgnoreCase
String.equalsIgnoreCase depends on the device locale and is discouraged.

#minor-release

PiperOrigin-RevId: 368211677
2021-04-13 18:01:12 +01:00
ibaker
c02288452b Add test for emsg near to end of DASH period
The dumped output should include metadata, but doesn't because of
Issue: #8710. The fix is in a follow-up change.
PiperOrigin-RevId: 366028303
2021-04-01 16:05:27 +01:00
olly
2d9177b7c2 SampleStream/SampleQueue: Introduce read flags
- SampleQueue.peek is replaced with SampleQueue.read with
  FLAG_PEEK. This also exposes peek functionality through
  SampleStream.
- Use of DecoderInputBuffer.isFlagsOnly is replaced with
  FLAG_OMIT_SAMPLE_DATA. This flag can be used with or
  without FLAG_PEEK, where-as previously the read position
  would never be advanced for an isFlagsOnly buffer.
- formatRequired is replaced with FLAG_FORMAT_REQUIRED.

PiperOrigin-RevId: 363460105
2021-03-24 18:03:28 +00:00
tonihei
31f65f63ff Remove AutoAdvancingFakeClock.
The class is just an empty shell around the super class and can be
removed.

PiperOrigin-RevId: 363386440
2021-03-24 18:03:18 +00:00
aquilescanta
383b6d42f1 Publish API for using MediaParser in DASH
PiperOrigin-RevId: 361828018
2021-03-12 10:41:41 +00:00
aquilescanta
ef1d797681 Introduce ChunkExtractor.Factory for dependency injection
PiperOrigin-RevId: 360175031
2021-03-02 17:03:55 +00:00
tonihei
d700990198 Fix available end time calculation for multi-period DASH live streams
The available end time was accidentally substracted by the start time
of the last period.

To avoid similar time reference confusion in the future, also renaming
many variables and methods to clearly reflect the time reference point.
And to avoid constant conversion, the processManifest method also
attempts to converge to time relative to the start of the window as
quickly as possible.

Issue: #8537
PiperOrigin-RevId: 357001624
2021-02-12 16:39:56 +00:00
andrewlewis
e28332ff82 Add common prefix to loader thread names
All threads created by ExoPlayer should now have the prefix "ExoPlayer:".

PiperOrigin-RevId: 356518037
2021-02-11 12:05:06 +00:00
olly
a1f06987eb Replace non-inclusively named constant
Issue: #7565
PiperOrigin-RevId: 353649187
2021-01-25 17:38:26 +00:00
krocard
ec43735054 Split mutations method out of TrackSelection
`TrackSelection` had mutation methods which were to be called only
internally by ExoPlayer components but were exposed in the
public `Player` interface.

The mutation methods have been moved out of `TrackSelection`
to a new class `ExoTrackSelection`.

Current track related read-only method have also been moved out,
because they are actually something quite unclear.
Even for a single item playlist, it's the track being buffered rather
than the track being played, which is unclear.
But when you have a playlist it starts to get really confusing,
because if the next item is being buffered, then it's actually
the last track to be buffered in the currently playing item.
As a final aside, the implementations don't do proper thread synchronization
to ensure visibility of updated state by the calling thread.

Exposing those mutable methods in the public `Player` interface
was problematic because they leaking internal concepts of `ExoPlayer`.
This is also required to minimize the `Player` interface for long term
stability.

`ExoTrackSelection` is a subclass of `TrackSelection`.
This is not ideal as an `TrackSelection` implementation could
break the current immutability.
This was done in order for this refactor to be simpler.
A future patch will fully split the two classes.

All `MediaPeriod` and `Sources` had to be updated to use the new
`TrackSelection` dynamic aspect class name.
An alternative would have been to break ExoPlayer's public API, keeping
`TrackSelection` as the dynamic aspect name, and calling the public static
aspect class `TrackSelectionState` or similar.
Nevertheless, while it would have impacted less files, it would have
many more small apps and casual users of ExoPlayer.

#player-to-common

PiperOrigin-RevId: 353637924
2021-01-25 15:37:38 +00:00
olly
b069a567ea Rename DUMMY_MEDIA_ID and related cleanup
Issue: #7565
PiperOrigin-RevId: 353616594
2021-01-25 15:37:28 +00:00
ibaker
5b9fa7d7d9 Add MediaSourceFactory#setDrmSessionManagerProvider()
Deprecate other DRM config methods.

Issue: #8466
PiperOrigin-RevId: 353251452
2021-01-22 16:58:56 +00:00
ibaker
b2a42ea157 Rename MediaSourceDrmHelper to DefaultDrmSessionManagerProvider
Also move it to the `drm` package, and extract a
`DrmSessionManagerProvider` interface.

I'll add `MediaSourceFactory.setDrmSessionProvider()` in a follow-up
change.

Issue: #8466
PiperOrigin-RevId: 352582559
2021-01-19 19:24:06 +00:00
christosts
d4a84b88b5 Remove deprecated method setMinLoadableRetryCount().
Remove setMinLoadableRetryCount() from SingleSampleMediaSource,
DashMediaSource, HlsMediaSource and SsMediaSource factories.

PiperOrigin-RevId: 352008657
2021-01-17 21:51:13 +00:00
olly
a7379ee658 PlayerEmsgHandler: Track stream max chunk times separately
Issue: #8408
PiperOrigin-RevId: 350786430
2021-01-08 18:48:21 +00:00
tonihei
1ef06b8d92 Rename sample_mpd to sample_mpd_live
This helps to better disambiguate the file from other mpd files in the
directory.

PiperOrigin-RevId: 350552168
2021-01-08 15:32:26 +00:00
tonihei
2c925a4109 Fix MIGHT_NOT_USE_FULL_NETWORK_SPEED for VOD DASH streams.
The flag compared against the nowTime in the period that is only
set to a positive value for live streams.

PiperOrigin-RevId: 350514934
2021-01-07 10:44:53 +00:00
tonihei
25ed6b127d Clarify parameter Javadoc for playback speed values.
In many cases we just used "playback speed" as a detailed Javadoc
parameter or return type definition. This doesn't define which scale
the speed is using.

PlaybackParameters as the main point to set the speed already uses a
more precise wording to describe the value as a factor by which playback
will be sped up.

This change replaces other usages of "playback speed" with this wording
whereever we would usually add a unit, keeping "playback speed" for
summary statements etc to reference the general concept that doesn't
usually require a unit.

PiperOrigin-RevId: 350379139
2021-01-07 10:44:34 +00:00
tonihei
696bb34ac6 Fix second sync point calculation for unbounded live streams.
We currently use INDEX_UNBOUNDED for the calculation and don't
offset the index by the firstSegmentNum if not unbounded.

PiperOrigin-RevId: 348445797
2020-12-23 22:51:55 +00:00
ibaker
0d1dac93c4 Use CapturingRenderersFactory in DashPlaybackTest
PiperOrigin-RevId: 348018409
2020-12-23 22:50:33 +00:00
bachinger
05c928f96d Add live configuration to Timeline.Window
Issue: #5011
PiperOrigin-RevId: 346828103
2020-12-14 10:17:23 +00:00
aquilescanta
9eef7b06f7 Ease the creation of SampleQueues without DRM management
This is useful in cases where the client is not interested in DRM.

PiperOrigin-RevId: 346313024
2020-12-14 10:16:04 +00:00
tonihei
9f6ff55c0f Replace PeriodSeekInfo by static methods.
The inner class was only used to obtain 3 distinct pieces of
information which is better handled by static methods.

#exofixit

PiperOrigin-RevId: 344767661
2020-11-30 09:33:22 +00:00
bachinger
c17d1091f3 Remove "live" from fields in MediaItem.LiveConfiguraton
#exofixit

PiperOrigin-RevId: 344065519
2020-11-27 11:05:54 +00:00