12205 Commits

Author SHA1 Message Date
andrewlewis
76014cf0e9 Add support for generating javadoc with Dackka
PiperOrigin-RevId: 396297834
2021-09-14 11:51:14 +01:00
huangdarwin
a951769eaa Transformer Demo: Reduce visibility of demo-only include.
PiperOrigin-RevId: 395936070
2021-09-14 11:49:13 +01:00
Marcus Wichelmann
65001cc0e5
Added javadoc comments to HevcConfig 2021-09-13 16:48:08 +02:00
Marcus Wichelmann
45db77dc6d
Fixed some spaces 2021-09-13 12:34:44 +02:00
Marcus Wichelmann
dbc7088716
Keep the existing parseSpsNalUnit (and similar) methods to avoid breaking changes 2021-09-13 12:30:21 +02:00
Marcus Wichelmann
296074fbea
Extend SPS parsing when building the initial MP4 HevcConfig and include the PAR for propagating it into the Format 2021-09-13 10:27:55 +02:00
olly
68ee587e25 Constrain resolved period positions to be within the period
This is a candidate fix for #8906. As mentioned in that issue,
negative positions within windows might be (kind of) valid in
live streaming scenarios, where the window starts at some
non-zero position within the period. However, negative positions
within periods are definitely not valid. Neither are positions
that exceed the period duration.

There was already logic in ExoPlayerImplInternal to prevent a
resolved seek position from exceeding the period duration. This
fix adds the equivalent constraint for the start of the period.
It also moves the application of the constraints into Timeline.
This has the advantage that the constraints are applied as part
of state masking in ExoPlayerImpl.seekTo, removing any UI flicker
where the invalid seek position is temporarily visible.

Issue: #8906
PiperOrigin-RevId: 395917413
2021-09-10 15:11:52 +01:00
claincly
4f06419334 Fix RTSP session header parsing regex error.
Issue: #9416

The dash "-" in the brackets must be escaped, or it acts like a range operator.

#minor-release

PiperOrigin-RevId: 395909845
2021-09-10 15:09:50 +01:00
ibaker
9f3c2fb5e1 Add MediaItem.DrmConfiguration.Builder and use it in MediaItem.Builder
PiperOrigin-RevId: 395896034
2021-09-10 15:07:48 +01:00
huangdarwin
7dff223d80 Transformer Demo: Add config page to remove audio/video.
The new ConfigurationActivity can be used to
configure settings specifying Transformer inputs,
using checkboxes and submitted via a button.

PiperOrigin-RevId: 395826358
2021-09-10 15:05:26 +01:00
bachinger
2138bfb396 Add DASH samples with multiple base URLs
PiperOrigin-RevId: 395727438
2021-09-09 18:21:50 +01:00
bachinger
9e3ef8180f Select base URL on demand when a new chunk is created
Instead of selecting the base URL initially or when a load error occurs, it is now selected when a chunk or initialization chunk is created. The selected base URL is then assigned to `RepresentationHolder.lastUsedBaseUrl` that is excluded in case of a load error. For a next chunk another base URL will be selected by using the `BaseUrlExclusionList`.

#minor-release #exo-fixit

PiperOrigin-RevId: 395721221
2021-09-09 18:19:51 +01:00
andrewlewis
0c4bb23dd3 Rename audioVolume parameter to volume
The new name is consistent with the corresponding parameters to `onVolumeChanged`, `setDeviceVolume` and `onDeviceVolumeChanged`.

PiperOrigin-RevId: 395705288
2021-09-09 18:17:40 +01:00
olly
1bef1a2b38 Fix STATE_IDLE Javadoc
Since playlist support was added, it's possible for the player to "have media"
and be in STATE_IDLE. The STATE_IDLE documentation therefore became incorrect.

Issue: #8946
#exofixit
#minor-release
PiperOrigin-RevId: 395653716
2021-09-09 18:15:24 +01:00
kimvde
0c969bb73d Remove deprecated SingleSampleMediaSource.createMediaSource
#exofixit

PiperOrigin-RevId: 395518824
2021-09-09 18:13:25 +01:00
ibaker
ee8df7afcb Ensure MediaSourceFactory instances can be re-used
This fixes DefaultDrmSessionManager so it can be used by a new Player
instance (by nulling out its reference to the playback thread, which is
unique per-Player instance). This only works if the
DefaultDrmSessionManager is 'fully released' before being used by the
second Player instance, meaning that the reference count of the manager
and all its sessions is zero.

#exofixit
#minor-release
Issue: #9099
PiperOrigin-RevId: 395490506
2021-09-09 18:09:21 +01:00
kimvde
b6e0ade939 Rename transformer renderer methods to make them match
#exofixit

PiperOrigin-RevId: 395479329
2021-09-08 17:20:25 +01:00
ibaker
bd38c28bb8 Fix a bug in core_settings.gradle with relative paths
I think this has been broken since 617267bfcf (which was trying to fix
the same problem).

This change initializes `rootDir` to always be the current project (i.e. ExoPlayer)
directory. From the [Gradle docs](https://docs.gradle.org/current/userguide/working_with_files.html#sec:single_file_paths):
> What happens in the case of multi-project builds? The file() method
> will always turn relative paths into paths that are relative to the
> current project directory, which may be a child project.

We can also then remove exoplayerRoot completely and simplify the local
dependency instructions.

* #minor-release
* #exofixit
* Issue: #9403

PiperOrigin-RevId: 395478121
2021-09-08 17:18:31 +01:00
apodob
837667dea1 Add seeking support to the SubtitleExtractor
SubtitleExtractor is using IndexSeekMap with only one position to
indicate that its output is seekable. SubtitleExtractor is keeping Cues
in memory anyway so more seek points are not needed. SubtitleExtractor
gets notified about seek occurrence through seek() method. Inside that
method extractor saves seekTimeUs, and on the next call to read()
extractor outputs all cues that should be displayed at this time and
later.

PiperOrigin-RevId: 395477127
2021-09-08 17:16:31 +01:00
ibaker
87d2054b67 Update value of C.TRACK_TYPE_NONE to -2 to allow for future 'real'
track types.

PiperOrigin-RevId: 395460563
2021-09-08 17:14:34 +01:00
claincly
e6b5392e63 Handle malformed URL in RTP-Info header.
Some server will send partial URIs in the RTP-Info header, while the RTSP spec
requires absolute URLs.

Issue: #9346

#exofixit

PiperOrigin-RevId: 395452741
2021-09-08 17:12:47 +01:00
samrobinson
c403de1c19 Fix AudioSink reset javadoc.
PiperOrigin-RevId: 395444714
2021-09-08 17:10:44 +01:00
olly
c2e6d2028b Fix poor documentation and variable name choice in StreamKey
Issue #9284

PiperOrigin-RevId: 395443015
2021-09-08 17:08:56 +01:00
claincly
e088cb4318 Handle RTSP request by replying Method Not Allowed.
PiperOrigin-RevId: 395438728
2021-09-08 17:06:46 +01:00
bachinger
d9bc22314a Use identical cache keys for downloading and playing DASH segments
#minor-release #exofixit
Issue: #9370
PiperOrigin-RevId: 395429794
2021-09-08 17:04:57 +01:00
andrewlewis
3cdc8a9ea3 Use correct last timestamp for C2 MP3 workaround
The C2 MP3 decoder produces an extra output buffer when draining after
end-of-stream is queued. This output buffer has a later timestamp than the last
queued input buffer so we need to calculate its timestamp to detect a stream
change in the correct position.

Before this CL we used the original input buffer timestamp as the largest
queued timestamp, which caused the stream change to be detected at the correct
position because the original input buffer timestamp was slightly larger than
the actual last output buffer timestamp. After this change we use exact
calculated timestamp as the largest queued timestamp. I manually verified
gapless continues to work on a device using the C2 MP3 decoder by comparing
output of the MP3 gapless and MP3 gapless stripped playlists in the demo app,
and that the last buffer timestamp now matches.

#exofixit

PiperOrigin-RevId: 395428928
2021-09-08 17:02:48 +01:00
klhyun
442a5f4500 Update PlayerView's UI when available commands change
PiperOrigin-RevId: 395395015
2021-09-08 16:58:44 +01:00
olly
86f8c4e44e Fix some PlayerControlView accessibility issues
- Fix focus when pausing and resuming
- Prevent repeated readout of the playback position when paused

#exofixit
#minor-release
Issue #9111

PiperOrigin-RevId: 395301765
2021-09-07 20:28:54 +01:00
olly
e53e59388f ID3: Fix end-of-string detection for UTF-16
The current detection logic checks that the two byte terminator starts
at an even position in the ID3 data, where-as it should check that it
starts at an even position relative to the start of the string.

#minor-release
#exofixit
Issue: #9087
PiperOrigin-RevId: 395274934
2021-09-07 20:26:35 +01:00
apodob
66335ab6f5 Redesign states of the SubtitleExtractor.
Simplifies the SubtitleExtractor implementation. Makes the extractor
more aligned with the Extractor interface documentation by removing
STATE_DECODING in which extractor was doing nothing in term of input
and output while returning RESULT_CONTINUE at the same time.

PiperOrigin-RevId: 395267468
2021-09-07 20:24:16 +01:00
ibaker
9949424da4 Deprecate all methods on C and move them to Util
C should only hold constants.

Also resolve the TODO in getErrorCodeForMediaDrmErrorCode(), and
annotate the deprecated methods with Error Prone's @InlineMe to
facilitate automated refactoring of callers.

PiperOrigin-RevId: 395244855
2021-09-07 17:56:41 +01:00
olly
b6089758ff Fix incorrect assertion in CacheDataSource
#minor-release
#exofixit

PiperOrigin-RevId: 395233639
2021-09-07 17:54:35 +01:00
samrobinson
11d2d7daf9 Add open @IntDef for Renderer message types.
#exofixit

PiperOrigin-RevId: 395233622
2021-09-07 17:52:40 +01:00
claincly
093d117127 Handle when additional spaces are in SDP's RTPMAP atrribute
Issue: #9379
PiperOrigin-RevId: 395226701
2021-09-07 17:50:42 +01:00
olly
730cdbb9e6 Use defStyleAttr when obtaining styled attributes in player views
#minor-release
#exofixit
Issue #9024

PiperOrigin-RevId: 395224661
2021-09-07 17:48:45 +01:00
olly
97b717b8dc Duration readers: Return TIME_UNSET rather than a negative value
This typically happens if there's a discontinuity in the stream.
It's better to say we don't know, than it is to return a negative
position.

Issue: #8346
#exofixit
#minor-release
PiperOrigin-RevId: 395224088
2021-09-07 17:46:47 +01:00
olly
2e21208f63 Workaround ConnectivityManager SecurityException on Android 11
#exofixit
#minor-release
Issue: #9002
PiperOrigin-RevId: 395221648
2021-09-07 17:44:41 +01:00
samrobinson
5183eaaf1e Add open @IntDef for track selection reasons.
#exofixit

PiperOrigin-RevId: 395217458
2021-09-07 17:42:30 +01:00
kimvde
7129d84efd Avoid OMX.qti.audio.decoder.flac on API level < 32
Before, this decoder was avoided on API levels < 30.

#minor-release
Issue:#9349
PiperOrigin-RevId: 395209684
2021-09-07 11:56:18 +01:00
andrewlewis
d05c15dee0 Add open @IntDef for track types
Also add handling of `C.TRACK_TYPE_IMAGE` in a couple of places where it was
missing.

#exofixit

PiperOrigin-RevId: 395078312
2021-09-06 15:04:47 +01:00
gyumin
00dda049ea Fix FlagSet.equals on API levels below 24
#minor-release

PiperOrigin-RevId: 395004645
2021-09-06 15:00:29 +01:00
kimvde
9991f14643 Add Open GL step to Transformer
PiperOrigin-RevId: 394708737
2021-09-06 14:58:25 +01:00
apodob
dd19bc8927 Integrate ExoplayerCuesDecoder and SubtitleExtractor
This CL contains integration of the ExoplayerCuesDecoder and the
SubtitleExtractor with the player. The SubtitleExtractor is integrated
inside the DefaultMediaSourceFactory. The flag was added to the
state of the DefaultMediaSourceFactory to let user decide between the
ProgressiveMediaSource and the SingleSampleMediaSource as a source for
subtitles. Choosing the ProgressiveMediaSource will cause data to flow
through the SubtitleExtractor and eventually the ExoplayerCuesDecoder.

PiperOrigin-RevId: 394500305
2021-09-06 14:54:38 +01:00
apodob
3213f969c0 Add handling end of stream in the ExoplayerCuesDecoder
Empty buffer with flag C.BUFFER_FLAG_END_OF_STREAM is send at the end
of the stream. Handling that flag properly is necessary to make the
ExoplayerCuesDecoder work properly with components like TextRenderer.

PiperOrigin-RevId: 394472642
2021-09-06 14:52:41 +01:00
kimvde
373db56a52 Add method to compile program from shader paths in GlUtil
This method will be useful for adding Open GL to the Transformer.

PiperOrigin-RevId: 394420744
2021-09-02 14:53:20 +01:00
olly
68eff51d96 Remove max API level for reading TV resolution from system properties
PiperOrigin-RevId: 394415421
2021-09-02 14:49:28 +01:00
samrobinson
0d4986f806 Remove deprecated static metadata methods.
PiperOrigin-RevId: 394196332
2021-09-02 09:44:04 +01:00
andrewlewis
be1fe08ba5 Add license headers
PiperOrigin-RevId: 394176546
2021-09-02 09:42:10 +01:00
kimvde
9e04789e4d Fix DefaultTrackSelector Javadoc about tunneling
#minor-release
Issue:#9350
PiperOrigin-RevId: 394112689
2021-09-02 09:40:21 +01:00
apodob
095c63933b Fix the preparation of Extractor inside the init() method
Extractor was not calling endTracks() and seekMap() on the
extractorOutput which are required to finish the preparation.
At that point extractor does not support seeking.

PiperOrigin-RevId: 393994848
2021-09-02 09:38:30 +01:00