9793 Commits

Author SHA1 Message Date
olly
62829be1ce 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-19 18:21:05 +01:00
olly
36efdc7492 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-19 18:14:45 +01:00
kimvde
43b80fbb78 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-19 18:12:29 +01:00
ibaker
d0875ce790 Document that ConditionVariable instances start closed
PiperOrigin-RevId: 324002247
2020-08-19 18:10:43 +01:00
krocard
8c8ffe601d 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-19 18:10:34 +01:00
olly
c010d28b14 FLV: Ignore invalid SCRIPTDATA name type, rather than fail playback
Issue: #7675
PiperOrigin-RevId: 323371286
2020-08-19 18:07:20 +01:00
olly
3198c51bdb Remove invalid documentation that causes javadoc to crash
PiperOrigin-RevId: 322311636
2020-08-19 18:04:08 +01:00
krocard
53d12747e5 Name [-1,1] the "nominal" range of float samples
Float values are allowed to be > 0dbfs,
it is just not nominal as it will might
distort the signal when played without
attenuation.

This is also consistent with
[AudioTrack.write(FloatBuffer)](https://developer.android.com/reference/android/media/AudioTrack#write(float[],%20int,%20int,%20int)) that explicitly
allows it up to 3dbfs.

PiperOrigin-RevId: 321345077
2020-08-19 18:00:37 +01:00
olly
c5edc1c2f5 Clip float point PCM to its allowed range before resampling
PiperOrigin-RevId: 321340777
2020-08-19 17:57:16 +01:00
andrewlewis
c0cd73f5fd Upgrade IMA SDK to 3.19.4
This brings in a fix for the IMA SDK ignoring the media load timeout.

Issue: #7170
PiperOrigin-RevId: 320557386
2020-08-19 17:57:10 +01:00
kimvde
3b7669ff72 Fix saiz and senc sample count checks for FMP4
Issue: #7592
PiperOrigin-RevId: 320556981
2020-08-19 17:56:22 +01:00
andrewlewis
4633a63546 Upgrade IMA to 3.19.2
PiperOrigin-RevId: 319764381
2020-08-19 17:51:43 +01:00
kimvde
f1dd1894fa Add compatible brands to MP4 sniffer
Issue: #7584
PiperOrigin-RevId: 319744023
2020-08-19 17:51:33 +01:00
William King
b7739283e0 add back removed tests 2020-08-18 21:25:48 -07:00
William King
081c5900bf add mkv samples 2020-08-18 21:21:11 -07:00
kimvde
99d245f7a6 Open source MetadataRetriever
Issue: #3609
PiperOrigin-RevId: 327176362
2020-08-18 08:12:05 +01:00
insun
b853978a91 Fix bug to show 'play' button at the end of stream
PiperOrigin-RevId: 327158791
2020-08-18 08:11:54 +01:00
kimvde
103bb98dba Revert Copybara config to avoid error when syncing the dev-v2 branch.
PiperOrigin-RevId: 327013751
2020-08-17 16:20:03 +01:00
aquilescanta
4cd8f00d72 Avoid setting a PMT reader if one exists for the same PID
This change should only affect HLS, where we don't remove the
PAT reader after reading a PAT.

Issue: #7756
PiperOrigin-RevId: 327008936
2020-08-17 16:14:57 +01:00
olly
f2d2e6475a Bump release to 2.12.0
PiperOrigin-RevId: 327005645
2020-08-17 16:14:48 +01:00
olly
513b301e77 ExoPlaybackException: Align some method naming
PiperOrigin-RevId: 327003695
2020-08-17 16:14:39 +01:00
olly
7ef31e2208 Tweak DefaultMediaSourceFactory documentation
PiperOrigin-RevId: 327000958
2020-08-17 16:14:30 +01:00
olly
02ed809a18 Tweak offload disable Javadoc
PiperOrigin-RevId: 326998407
2020-08-17 16:14:21 +01:00
kimvde
10fa745fab Open source MetadataRetriever
Issue: #3609
PiperOrigin-RevId: 326991376
2020-08-17 16:14:12 +01:00
ibaker
5950557086 Add a release note about WebView-based subtitle output
Also re-word some existing subtitle notes

PiperOrigin-RevId: 326989276
2020-08-17 16:14:02 +01:00
ibaker
f0ae8afd80 Separate the dump files from the test assets
This allows us to more easily create different dumps derived from the
same assets.

This moves media/source files from `assets/` to `assets/media/` and
dump files from `assets/` to `assets/extractordumps/` and
`assets/audiosinkdumps/` as appropriate. I intend to add
`assets/playbackdumps/` in a future CL.

PiperOrigin-RevId: 326986283
2020-08-17 16:13:53 +01:00
insun
333ccedf80 Improve error message and correct reference to proper layout
PiperOrigin-RevId: 326944292
2020-08-17 16:13:43 +01:00
olly
49bf83a169 Media2: Remove MediaSourceFactory + DataSourceCallback
- Applications should generally use DefaultMediaSourceFactory,
  or their own custom implementation if they need one. Having the
  media2 extension implement its own version directly doesn't seem
  that useful.
- Remove support for CallbackMediaItem. This type of MediaItem
  doesn't go cross-process, and it seems like there would never
  be a use case where an app would need to generate one locally.
  If an app needs to provide data from a custom source, it should
  hook into ExoPlayer's way of doing this (i.e., use a UriMediaItem
  with a custom scheme, and inject a custom DataSource that can
  handle this scheme).

PiperOrigin-RevId: 326914465
2020-08-17 16:13:34 +01:00
olly
42cf213aea Media2 tests: Simplify code
- Use ExoPlayer DataSource instrumentation to intercept reads
- Use ExoPlayer Resource URIs
- Use ExoPlayer DefaultMediaSourceFactory

PiperOrigin-RevId: 326912324
2020-08-17 16:13:25 +01:00
olly
94b66f4c24 Specify which function is triggering a TimeoutException
PiperOrigin-RevId: 326666629
2020-08-17 16:13:16 +01:00
andrewlewis
977f0d1ed0 Scale AudioTrack buffer size for AudioTrack speed adjustment
PiperOrigin-RevId: 326642908
2020-08-17 16:13:07 +01:00
samrobinson
eabc486b58 Keep AudioTrack on seek - experimental.
PiperOrigin-RevId: 326622573
2020-08-17 16:12:58 +01:00
jaewan
c2ac33af1b Clean up PlayerWrapper exception log
PlayerWrapper throws Exception if getters is called in the
STATE_IDLE. In that case, log may print 50+ lines of stack
traces. It's verbose and can be considered as serious issue.

This CL include folloing changes
  - Change to use ExoPlayer's log class
  - Adjust log level, because it would be consumed by caller
  - Leave log when the debug flag is turned on.

Another CL will remove exceptions between PlayerWrapper and
and SessionPlayerConnector, not to use Exception for ordinary
control flow as the Effective Java suggests.

PiperOrigin-RevId: 326614559
2020-08-17 16:12:48 +01:00
olly
cdf07f1745 Media2 tests: Clean up assets
Even after this change, it's unclear to me why we need so many
assets for these tests. Just doing a minimal pass for now though!

PiperOrigin-RevId: 326613941
2020-08-17 16:12:39 +01:00
insun
602d880841 Fix StyledControlView's minimal mode bug and setShow{*}Button bug
There were two bugs in StyledPlayerControlView:
- Center icons are shown when toggling control view in minimal mode.
- `StyledControlView#setShow{*}Button` methods and corresponding
  `set_show_*_button` attributes didn't work properly.

This CL fixes bugs by controlling the buttons' visibility in one place,
StyledPlayerControlViewLayoutManager.

PiperOrigin-RevId: 326567213
2020-08-17 16:12:30 +01:00
jaewan
e6bf7bd0ff Migrate to use Player's top level playlist API
Being specific, this includes following changes
  - Remove PlaylistManager and TimelinePlaylistManager
    and use Player's playlist API directly.
  - Replace ConcatenatingMediaSource uses with
    ExoPlayer MediaItem.
  - Replace PlaybackPreparer uses with Player#prepare()
  - Add MediaItemConverter for developers to customize
    converting AndroidX MediaItems to ExoPlayer MediaItems
    and vice-versa.
  - Add DefaultMediaItemConverter for providing default
    implementation of both MediaItemConverter
    and MediaSourceFactory.

Note that removing PlaylistManager loses the ability
to suppress individual playlist API. But decided to remove
for simpler API set. The feature can be added back later
via explicit request.

PiperOrigin-RevId: 326463492
2020-08-17 16:12:21 +01:00
samrobinson
1b9992cf7a Add a GTS test for MediaFormat change occurring at the correct time.
PiperOrigin-RevId: 326428782
2020-08-17 16:12:12 +01:00
olly
339e3f899d Clean up release notes for 2.12: UI, downloads, DRM
PiperOrigin-RevId: 326427225
2020-08-17 16:12:03 +01:00
olly
039af76b0e Clean up release notes for 2.12: Test utils, extensions and demo
PiperOrigin-RevId: 326425279
2020-08-17 16:11:53 +01:00
insun
454a38c366 Increase touch target size and margins between icons
PiperOrigin-RevId: 326423935
2020-08-17 16:11:44 +01:00
andrewlewis
61abe5951a Use consistent naming for 'offload scheduling enabled'
PiperOrigin-RevId: 326413842
2020-08-17 16:11:35 +01:00
aquilescanta
cde795ea98 Fix typo in DrmSessionManager's javadoc
PiperOrigin-RevId: 326413433
2020-08-17 16:11:26 +01:00
aquilescanta
fcb263a407 Make DrmSessionManager take a Format instead of DrmInitData
Skipping acquirePlaceholderSession which will be removed
in a following change.

PiperOrigin-RevId: 326402746
2020-08-17 16:11:17 +01:00
olly
6f7524521b Demo app: Update concatenation terminology to use "playlist"
PiperOrigin-RevId: 326401528
2020-08-17 16:11:08 +01:00
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
olly
5220c70c5e Demo app: Rename drm_license_url to drm_license_uri
It's quite hard to document drm_force_default_license_uri when the
actual license URI uses "url" terminology. This brings the two in
line.

PiperOrigin-RevId: 326283162
2020-08-17 16:10:22 +01:00
olly
a7b1b56064 Demo app: Remove is_live from exolist.json
It's not used in the public exolist.json file. It's only use is to
disable the download icon for live content, but it's quite easy to
forget (there are live samples in our internal exolist.json files
that omit this property!).

It's better just to show a clear error message toast when the
download actually fails for this reason.

PiperOrigin-RevId: 326281649
2020-08-17 16:10:13 +01:00