9245 Commits

Author SHA1 Message Date
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
gyumin
6e11d32092 Use static import for TimeUnit
PiperOrigin-RevId: 324941042
2020-08-07 19:01:07 +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
olly
71fd335bcd Simplify output format propagation
PiperOrigin-RevId: 324805335
2020-08-07 19:00:28 +01:00
olly
4d03d30890 Audio extension decoders: Pass decoder to getOutputFormat
It seems generally useful to have access to the decoder in
getOutputFormat. We're currently working around lack of access
by using member variables in the concrete audio extension
renderers. In the case of the Ffmpeg extension, holding a
reference to the decoder is preventing it from being garbage
collected when the decoder is released by the base class.

PiperOrigin-RevId: 324799670
2020-08-07 19:00:18 +01:00
tonihei
a6be8eeb6b Prevent extractor reuse after upstream discard.
After discarding upstream we shouldn't reuse the extractor from the
(newly) last media chunk because the extractor may have been reused
already by the discarded chunks.

Also add an assertion to SampleQueue that prevents the hard-to-detect
failure mode of overlapping sample byte ranges.

Issue: #7690
PiperOrigin-RevId: 324785093
2020-08-07 19:00:09 +01:00
tonihei
33af7a4536 Don't log mediaId in EventLogger and DefaultMediaSourceFactory.
The media id defaults to the URI that shouldn't be logged to logcat.

PiperOrigin-RevId: 324770157
2020-08-07 18:59:59 +01:00
claincly
ea01489c8b Added float output mode for Opus extension
The working of libOpus is different from ffmpeg. With ffmpeg, the decoder can
be configured to output floating point PCM. While in libOpus, floating samples
are acquired by calling a different function. This is the reason the new JNI
functions and the logic in OpusDecoder/LibopusAudioRenderer is added to
support float output.

PiperOrigin-RevId: 324661603
2020-08-07 18:59:50 +01:00
olly
b2ea48f4e2 Fix parameter comments that don't match the formal parameter name
More information:
https://docs.google.com/a/google.com/document/d/1lzK04DqCZgjOoGQfBT053QIrCvlsyAAwLo0jfqcN6ds/edit?usp=sharing

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:324422822:BASE:324408434:1596318556672:a8b3beed
PiperOrigin-RevId: 324621068
2020-08-07 18:59:40 +01:00
christosts
f4287ed070 Add a builder for DownloadRequest
PiperOrigin-RevId: 324616617
2020-08-07 18:59:30 +01:00
christosts
129ef7ccd4 DefaultMediaSourceFactory sets the offline license
PiperOrigin-RevId: 324610991
2020-08-07 18:59:21 +01:00
olly
be88143fcd Remove deprecated parts of demo app IntentUtil
PiperOrigin-RevId: 324604419
2020-08-07 18:59:11 +01:00
christosts
33fe3a47e3 Remove references to Downloads from IntentUtil
PiperOrigin-RevId: 324599130
2020-08-07 18:59:01 +01:00
olly
5c879ac8f8 Final string import for 2.12
PiperOrigin-RevId: 324579230
2020-08-07 18:58:51 +01:00
christosts
abfe7a2314 Support clip start/end points in demo app
Demo app supports clip start/end points and demonstrates manual
ad insertions.

PiperOrigin-RevId: 324574358
2020-08-07 18:58:41 +01:00
andrewlewis
9392dff225 Call VideoAdPlayerCallback.onLoaded
This callback was not notified before, which could theoretically lead to ad
loading timing out. In practice it doesn't currently happen because the timeout
appears to start when the ad cue point is reached, not when loadAd is called.

We notify onLoaded when the ad media period is prepared (for HTML5 the
recommendation is to notify on the HTMLMediaElement 'canplay' event, which this
roughly corresponds to).

PiperOrigin-RevId: 324568407
2020-08-07 18:58:31 +01:00
olly
42a7083b5c FragmentedMp4Extractor: Fix clearHeaderSize handling
PiperOrigin-RevId: 324560994
2020-08-07 18:58:21 +01:00
olly
a04769f2d5 Tweak DefaultDrmSessionManager Mode Javadoc
PiperOrigin-RevId: 324557397
2020-08-07 18:58:11 +01:00
ibaker
132cff1e47 Add an example of tx3g subtitles in an MP4 container
Issue: #7677
PiperOrigin-RevId: 324180797
2020-08-01 12:56:48 +01:00
tonihei
d625af67db Add load cancelation support to DASH and SS
Issue: #7244 added this feature to HLS. This change is the exact copy
in ChunkSampleStream to add the same support to the other adaptive
formats.

Note that ChunkSampleStream doesn't support slicing, so we can't cancel
a read-from chunk, and we need to prevent reading into an already
canceled chunk load so that the chunk can be automatically discarded
after the cancelation.

Issue: #2848
PiperOrigin-RevId: 324179972
2020-08-01 12:56:39 +01:00
gyumin
32d1a7878d Update mockito version to 2.28.2
PiperOrigin-RevId: 324003583
2020-08-01 12:56:30 +01:00
ibaker
c8f039f0a9 Document that ConditionVariable instances start closed
PiperOrigin-RevId: 324002247
2020-08-01 12:56:21 +01:00
krocard
7b300ca411 Build cmake AV1 outside of CITC
PiperOrigin-RevId: 323988640
2020-08-01 12:56:12 +01:00
christosts
12bd36d41a Migrate test resettingMediaSourcesGivesFreshSourceInfo() to TestExoPlayer
PiperOrigin-RevId: 323985679
2020-08-01 12:56:03 +01:00
aquilescanta
6d0696a3c8 Stop auto-generating a CEA-608 track for standalone TS
PiperOrigin-RevId: 323811839
2020-08-01 12:55:54 +01:00
samrobinson
d6ee5b84d3 Group overloaded method together.
PiperOrigin-RevId: 323806853
2020-08-01 12:55:45 +01:00
aquilescanta
867d45ca62 Simplify the av1 extension build system
Also add cpu_features to .hgignore.

PiperOrigin-RevId: 323804458
2020-08-01 12:55:36 +01:00
christosts
6054bda028 Statically import assertions
PiperOrigin-RevId: 323769467
2020-08-01 12:55:27 +01:00
krocard
6e3fc5e40a OMX.broadcom.video_decoder.tunnel.secure needs EOS workaround
The passthrough codec does not propagate
the EOS back to ExoPlayer.

Issue: https://github.com/google/ExoPlayer/issues/7647
PiperOrigin-RevId: 323758941
2020-08-01 12:55:18 +01:00
christosts
33360513a2 Migrate ExoPlayerTest.readAheadToEndDoesNotResetRenderer to TestExoplayer
PiperOrigin-RevId: 323758590
2020-08-01 12:55:09 +01:00
christosts
075ef824ec Migrate ExoPlayerTest.playShortDurationPeriods to use TestExoPlayer
PiperOrigin-RevId: 323754499
2020-08-01 12:55:00 +01:00
olly
7f10800e25 Restore wrapping of MediaCodec ISEs in MediaCodecDecoderException
Wrapping MediaCodec ISEs in MediaCodecDecoderException lets us attach
MediaCodecInfo, which contains lots of useful information such as the
MediaCodec name, the codec capabilities, etc.

PiperOrigin-RevId: 323575782
2020-08-01 12:54:51 +01:00
christosts
bcb9ad22af Migrate ExoPlayerTest to use TestExoPlayer.
Tests playSinglePeriodTimeline and playMultiPeriodTimeline are migrated
to use TestExoplayer.

PiperOrigin-RevId: 323546141
2020-08-01 12:54:42 +01:00
christosts
ce0f814b77 Migrate ExoPlayerTest.playEmptyTimeline to TestExoPlayer
PiperOrigin-RevId: 323544694
2020-08-01 12:54:33 +01:00
gyumin
437275caed Implement device info/volume methods
PiperOrigin-RevId: 323544314
2020-08-01 12:54:23 +01:00