6489 Commits

Author SHA1 Message Date
insun
cda35f6677 Make play/pause button to reflect getPlayWhenReady state
Previously, it refelects isPlaying() and it makes the button to seem
unresponsive when playback error occurs.

PiperOrigin-RevId: 326396570
2020-08-17 16:10:59 +01:00
andrewlewis
501f464217 Add support for using framework speed adjustment
AudioTrack.setPlaybackParams can be used to adjust playback speed.
This is preferable to application-level speed adjustment (currently
implemented in ExoPlayer) from API 23 because the speed change
occurs in the mixer, which means that the audio track buffer doesn't
need to drain out before the speed adjustment takes effect.

Issue: #7502
PiperOrigin-RevId: 326392301
2020-08-17 16:10:50 +01:00
insun
b95c984d16 Cleanup unused ui resources and code
PiperOrigin-RevId: 326390725
2020-08-17 16:10:40 +01:00
olly
a0088f068a Change getMaxInputSize visibility.
PiperOrigin-RevId: 326341905
2020-08-17 16:10:31 +01:00
andrewlewis
6aeacd70bc Fix miscellaneous nits
PiperOrigin-RevId: 326208366
2020-08-17 16:09:19 +01:00
krocard
b02398ff75 Save input format in Configuration
This will allow for better exception
on AudioTrack error.

PiperOrigin-RevId: 326091883
2020-08-17 16:09:10 +01:00
olly
511a6c729e Increase flexibility of ISM URL handling
PiperOrigin-RevId: 326025335
2020-08-17 16:09:01 +01:00
andrewlewis
607e11718b Remove deprecated AudioSink methods
Also do some minor cleanup in DefaultAudioSink.

PiperOrigin-RevId: 326012441
2020-08-17 16:08:52 +01:00
olly
82b26357c9 Infer ISM content type from URL specified extension
PiperOrigin-RevId: 326012248
2020-08-17 16:08:43 +01:00
ibaker
443468d103 Clarify MediaItem.Builder javadoc
Make it clear that setUri sets PlaybackProperties.uri

Also capitalise all references to DRM, ID, URI and UUID

PiperOrigin-RevId: 326002853
2020-08-17 16:08:34 +01:00
ibaker
da4d55635c Create a DumpFileAsserts from the dumpfile logic in FakeExtractorOutput
Also use it to replace the same logic in CapturingAudioSink

PiperOrigin-RevId: 325969455
2020-08-17 16:08:24 +01:00
olly
361e5d9326 Demo app: Fix DRM support check for ClearKey
Issue: Issue: #7735
PiperOrigin-RevId: 325900705
2020-08-17 16:08:15 +01:00
krocard
19db6feddb Use message to set offload scheduling
The code was mutating boolean across threads.

PiperOrigin-RevId: 325826214
2020-08-17 16:07:57 +01:00
krocard
192c1e5dee Improve OnExperimentalOffloadSchedulingEnabled name
For consistency with onShuffleModeEnabledChanged.

PiperOrigin-RevId: 325820951
2020-08-17 16:07:48 +01:00
samrobinson
63faf51c7e Change experimental method naming of setReleaseTimeoutMs.
PiperOrigin-RevId: 325795609
2020-08-17 16:07:39 +01:00
samrobinson
78424efc90 Change experimental method naming for throwWhenStuckBuffering.
PiperOrigin-RevId: 325795485
2020-08-17 16:07:29 +01:00
samrobinson
69c2a76d01 Change experimental method naming of set*MediaCodecOperationMode.
PiperOrigin-RevId: 325790799
2020-08-17 16:07:20 +01:00
krocard
6c3a011dc3 Listener for offload scheduling
Let the app know when offload scheduling is enabled or disabled.

PiperOrigin-RevId: 325790017
2020-08-17 16:07:11 +01:00
samrobinson
9a0203e954 Change experimental method naming for blockUntilDelivered.
PiperOrigin-RevId: 325786522
2020-08-17 16:07:02 +01:00
samrobinson
eb9463454b Change setBandwidthAllocationCheckpoints naming.
PiperOrigin-RevId: 325786473
2020-08-17 16:06:53 +01:00
samrobinson
6db25cdab6 Change experimental method naming for allowMultipleAdaptiveSelections
PiperOrigin-RevId: 325784936
2020-08-17 16:06:43 +01:00
samrobinson
b956f85b45 Change experimental method naming for enableOffloadScheduling.
PiperOrigin-RevId: 325784822
2020-08-17 16:06:34 +01:00
ibaker
28697b9b9e Fix DefaultTrackSelector docs on select*Track methods
formatSupport is a 2-dimensional int array but it's documented as
being indexed by 3 things. This seems to be a copy-paste mistake in
e97b8347eb

selectAllTracks() takes a 3-dimensional array with the same
3-indexed documentation, which makes sense there.

Also rename formatSupports -> formatSupport for consistency.

PiperOrigin-RevId: 325779435
2020-08-17 16:06:25 +01:00
ibaker
16d54f5e3d Add a sentence to TrackSelector javadoc calling out #invalidate()
PiperOrigin-RevId: 325767964
2020-08-17 16:06:15 +01:00
ibaker
5ed0c12ff0 Tweak how MediaCodecVideoRenderer renotifies the existing surface
Use a dedicated boolean to track if we've notified the current surface,
rather than re-using rendereredFirstFrameAfterReset.

PiperOrigin-RevId: 325757948
2020-08-17 16:06:06 +01:00
andrewlewis
acc8453628 Add support for audio-only ad display containers
Issue: #7689
PiperOrigin-RevId: 325752377
2020-08-17 16:05:56 +01:00
olly
7f6940fb8b TS EsInfo: Be robust against a invalid descriptor length
Issue: Issue: #7722
PiperOrigin-RevId: 325431839
2020-08-07 19:04:47 +01:00
krocard
03a1a3ee82 Temporary disable offload after failure
PiperOrigin-RevId: 325429029
2020-08-07 19:04:37 +01:00
kimvde
d8a95af5e0 FragmentedMp4Extractor: simplify track bundle initialization
This will simplify the addition of nullness annotations.

PiperOrigin-RevId: 325414700
2020-08-07 19:04:18 +01:00
christosts
a5e6e3054d Offline DRM in main demo app
PiperOrigin-RevId: 325413035
2020-08-07 19:04:09 +01:00
christosts
c7a1151c2b Use MimeType.allSamplesAreSyncSamples in ClippingMediaPeriod
PiperOrigin-RevId: 325409392
2020-08-07 19:03:59 +01:00
olly
6a54ddd217 FMP4: Correctly handle multiple sbgp and sgpd boxes
Find sbgp and sgpd boxes with grouping_type == seig in the case they don't
come first. Previoulsy we would only find them if they came first.

Issue: Issue: #7716
PiperOrigin-RevId: 325407819
2020-08-07 19:03:50 +01:00
olly
b9612bc338 Fix codec initialization data for Opus in MP4
PiperOrigin-RevId: 325327466
2020-08-07 19:03:40 +01:00
tonihei
eee9b312dc Change default value of throwWhenStuckBuffering to true.
This change caused no problems and can be enabled by default.

PiperOrigin-RevId: 325264859
2020-08-07 19:03:30 +01:00
ibaker
092c66fac3 Rollback of 1ed5d8b563
*** Original commit ***

Rollback of bf5e6c7862

*** Original commit ***

Pass startPositionUs into Renderer.replaceStream

Plumb this down into BaseRenderer.onStreamChanged and use it when
deciding whether to render the first frame of a new period.

***

***

PiperOrigin-RevId: 325251261
2020-08-07 19:03:21 +01:00
olly
60630fe97b Upgrade some null checks to assertions
PiperOrigin-RevId: 325226353
2020-08-07 19:03:11 +01:00
kimvde
38dd1bb74f FragmentedMp4Extractor: simplify extra tracks logic
This will simplify the addition of nullness annotations.

PiperOrigin-RevId: 325221749
2020-08-07 19:03:02 +01:00
ibaker
ea347a464a Rollback of 1ed5d8b563
*** Original commit ***

Rollback of bf5e6c7862

*** Original commit ***

Pass startPositionUs into Renderer.replaceStream

Plumb this down into BaseRenderer.onStreamChanged and use it when
deciding whether to render the first frame of a new period.

***

***

PiperOrigin-RevId: 325218588
2020-08-07 19:02:52 +01:00
olly
283bed8cb2 Fix ExoMediaCryptoType attachment
- Attach types for placeholder sessions. If a placeholder session will be
  attached and a downstream renderer doesn't know what to do with it, then
  this attachment is necessary to correctly determine that the renderer
  does not support the track.
- Attach types to sample formats. Without this, if playback fails due to
  a CryptoException, the ExoPlaybackException that gets thrown spuriously
  indicates that the format's DRM type was not supported.

PiperOrigin-RevId: 325214745
2020-08-07 19:02:42 +01:00
kimvde
f29af879c0 FragmentedMp4Extractor: allow both first_sample_flags and sample_flags
Having both in the trun box is not allowed (see section section 8.8.8.1
of ISO/IEC 14496-12:2015) but this CL makes the code more robust in case
this happens. Before this change, the first sample flag was not read,
making subsequent reads incorrect.

Issue: #7698
PiperOrigin-RevId: 325212160
2020-08-07 19:02:33 +01:00
olly
5169652575 Fix MP4 sniffing for very short files
The sniffer sniffs boxes at the start of the file to try and determine
whether the file is fragmented. However, if the file is extremely short
then it's possible that sniffing will try and read beyond the end of
the file, resulting i EOFException being thrown.

In general it's OK for sniffing to throw EOFException if the file is
not of the correct type. The problem in this case is that EOFException
can be thrown for an actual MP4 file, due to the sniffer continuing up
sniff atoms up to bytesToSearch in case the file is fragmented.

PiperOrigin-RevId: 325205389
2020-08-07 19:02:23 +01:00
olly
5de56cd618 Opus: Add utility for handling header and initialization data
PiperOrigin-RevId: 325202386
2020-08-07 19:02:14 +01:00
tonihei
94fb9adec1 Update initial bandwidth estimates.
Also include 5G-NSA estimates and update code to use immutable
structures to prevent external updates by the app.

PiperOrigin-RevId: 325196303
2020-08-07 19:02:04 +01:00
insun
8661876960 Remove unnessary resources
1) As we don't display metadata (title) removed titlebar.
2) Removed exo_ic_{forward,rewind}_30.xml which are not used.

PiperOrigin-RevId: 325195605
2020-08-07 19:01:55 +01:00
insun
b26d578ff3 Fix bug that clicking didn't show up controls at the beginning
StyledLayoutManager#isFullyVisibility() was wrong and
so hiding/showing logic didn't work properly.

PiperOrigin-RevId: 324996446
2020-08-07 19:01:45 +01:00
krocard
5342576e73 Use bypass for PCM if AudioTrack supports it
Codec bypass is now enabled for all formats
audio track supports.

PiperOrigin-RevId: 324987842
2020-08-07 19:01:35 +01:00
krocard
d2e50e40dc Use "Passthrough" terminology only for non-offload direct playback
The term "passthrough" was heavily overloaded. For clarity, split most
of its usage to different terms:
 * codec "bypass": no MediaCodec is used
 * "direct playback": no decoding occurs (but decryption may or may not)
 * "decrypt only codec": a MediaCodec used only to decrypt, not decode
 * "offload": playback to an offload AudioTrack.
 * "passthrough" is now only used in the sense of playing encoded audio
 * to a non offload AudioTrack.

PiperOrigin-RevId: 324984612
2020-08-07 19:01:25 +01:00
olly
c0ee267a6c Fix E-AC3 format propagation
Issue: Issue: #7611
PiperOrigin-RevId: 324884412
2020-08-07 19:00:57 +01:00
aquilescanta
8da7fc7d2f Fix chunkless preparation for playlists with dangling EXT-X-MEDIA tags
We are not able to associate a codecs attribute to an EXT-X-MEDIA tag if
there is no variant with a matching AUDIO GROUP-ID. Lack of codecs string
prevents chunkless preparation from determining the track type.

Issue: #7678
PiperOrigin-RevId: 324822415
2020-08-07 19:00:48 +01:00
aquilescanta
0670782de8 Avoid using trickplay variants for preparing an HLS stream
PiperOrigin-RevId: 324810361
2020-08-07 19:00:38 +01:00