11979 Commits

Author SHA1 Message Date
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
kimvde
882957228c Fix errors in Transformer demo
PiperOrigin-RevId: 393951084
2021-09-02 09:36:44 +01:00
apodob
3183183d54 Add ExoplayerCuesDecoder that decodes text/x-exoplayer-cues
PiperOrigin-RevId: 393723394
2021-09-02 09:34:53 +01:00
kimvde
75a6908206 Add methods needed by Transformer to GlUtil
This is to add a step to the Transformer transcoding video pipeline to
copy from a surface to another using OpenGL.

PiperOrigin-RevId: 393391005
2021-09-02 09:32:57 +01:00
kimvde
a1ec56a157 Add basic shaders to Transformer
PiperOrigin-RevId: 393381694
2021-09-02 09:31:09 +01:00
bachinger
8861ab4853 Implement setPlaybackParameters for CastPlayer
Issue: #6784
PiperOrigin-RevId: 393374139
2021-09-02 09:29:22 +01:00
kimvde
9b2cd6a4e9 Fix NPE in TransformerTranscodingVideoRenderer
The NPE was caused by the fact that the encoder surface was passed to
the decoder before configuring the encoder.

PiperOrigin-RevId: 393349794
2021-08-27 16:45:06 +01:00
claincly
58e5ed0afb Fix transcoding drops a few frames.
In the old version, the transcoder uses decoder.isEnded() alone as the criteria
to stop the encoding/muxing process. It's rectified to:

- On decoder ending, signal the encoder of EOS after writing all decoded frames to it.
- On encoder ending, write end track to muxer.

PiperOrigin-RevId: 393322114
2021-08-27 16:43:21 +01:00
ibaker
9c2b4b860b Enforce valid key responses in FakeExoMediaDrm
Make this behaviour optional, so it can be disabled for
AnalyticsCollectorTest where we don't use
FakeExoMediaDrm.LicenseServer.

PiperOrigin-RevId: 393133721
2021-08-27 16:39:47 +01:00
ibaker
84cf63a72f Test DefaultDrmSession provisioning is requested by provideKeyResponse
Follow-up to
<unknown commit>

PiperOrigin-RevId: 393132950
2021-08-27 16:37:59 +01:00
kimvde
f574ec952a Make TransformerTranscodingVideoRenderer support API < 23
PiperOrigin-RevId: 393100075
2021-08-27 16:36:09 +01:00
ibaker
c90d4fd371 Rollback of 557a1833f7
*** Original commit ***

Avoid adding spy to list in DataSourceContractTests

After the fix in https://github.com/mockito/mockito/issues/2331, the calls to
equals on the fake transfer listener (due to its use in a list of listeners)
are treated as interactions with it, meaning that the current verification of
'no more interactions' will fail.

This change makes the transfer listener used for testing count bytes then
delegate to another (mock) transfer listener that's passed in to avoid the
problem.

***

PiperOrigin-RevId: 393093785
2021-08-27 16:34:19 +01:00
bachinger
1d36083e25 Replace fully qualified link annotation
PiperOrigin-RevId: 393081803
2021-08-26 11:09:06 +01:00
kimvde
b42aa4c8dd Rename TransformerVideoRenderer
The new name indicates the difference with the
TransformerTranscodingVideoRenderer.

PiperOrigin-RevId: 393074749
2021-08-26 11:07:24 +01:00
ibaker
3710446b9d Test DefaultDrmSession with NotProvisionedException from getKeyRequest
PiperOrigin-RevId: 392927795
2021-08-26 11:05:31 +01:00
bachinger
a9913e5410 Add the media item to PositionInfo
PiperOrigin-RevId: 392914515
2021-08-26 11:03:40 +01:00
ibaker
e5a39eca1e Fix incorrect DataSourceContractTest test names
These should have been updated as part of
1affbf9357

#minor-release

PiperOrigin-RevId: 392913561
2021-08-26 11:01:59 +01:00
krocard
9fad5f4130 Add Track selection to the Player API
This cl doesn't implement completely the API for
`ExoPlayerImpl` as
`onTrackSelectionParametersChanged` is not called.

The follow up cl adds `TrackSelectionParameters` in PlaybackInfo
to correctly propagate the change event and mask it.

Additionally `TrackSelectionParameters` is serialized as a Parcelable
for now. It is transitioned to bundleable in a follow up cl.

PiperOrigin-RevId: 392899918
2021-08-26 10:58:27 +01:00
samrobinson
66c85245e6 Improve javadoc deprecation for ExoPlayer Components.
PiperOrigin-RevId: 392861577
2021-08-26 10:56:38 +01:00
kimvde
97466ab779 TsExtractor: handle packets without PTS
#minor-release
Issue: #9294
PiperOrigin-RevId: 392844983
2021-08-25 10:59:58 +01:00
andrewlewis
654a320792 Remove stray symlinks
These are unneeded for the external project

#minor-release

PiperOrigin-RevId: 392835942
2021-08-25 10:58:20 +01:00
samrobinson
628e744e26 Deprecate ExoPlayer VideoComponent.
PiperOrigin-RevId: 392668736
2021-08-25 10:56:33 +01:00
samrobinson
d3cc98d368 Deprecate ExoPlayer AudioComponent.
PiperOrigin-RevId: 392655598
2021-08-25 10:54:34 +01:00
olly
3d5e32dc2c Update references to ShadowBaseLooper to use ShadowLooper
ShadowBaseLooper is deprecated and will be removed in a forthcoming CL.

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:391922969:BASE:391896312:1629439874303:285a1989
PiperOrigin-RevId: 392647041
2021-08-25 10:50:35 +01:00
kimvde
60681b9783 Add onReset implementation to TransformerTranscodingVideoRenderer
PiperOrigin-RevId: 392468554
2021-08-23 22:58:00 +01:00
bachinger
2f09ecef53 Make constructor of PlayerNotificationManager protected
Issue: #9303
#minor-release
PiperOrigin-RevId: 392022613
2021-08-23 14:08:39 +01:00
olly
3f16730763 Support generating notifications for paused downloads
- Android 12 will not allow our download service to be
  restarted from the background when conditions that
  allow downloads to continue are met. As an interim
  (and possibly permanent) solution, we'll keep the
  service in the foreground if there are unfinished
  downloads that would continue if conditions were met.
- Keeping the service in the foreground requires a
  foreground notification. Hence we need to be able to
  generate a meaningful notification for this state.

PiperOrigin-RevId: 391969986
2021-08-20 16:25:43 +01:00