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
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
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
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
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
- 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
- Use ExoPlayer DataSource instrumentation to intercept reads
- Use ExoPlayer Resource URIs
- Use ExoPlayer DefaultMediaSourceFactory
PiperOrigin-RevId: 326912324
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
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
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
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
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
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
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