This is most commonly caused by malformed media, where
the media indicates that something we need to make an
allocation for is *really huge*. Failing playback is
appropriate for this case; killing the process is not.
Issue: #2780
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155408062
Added repeat mode toggle buttons to UI. Current mode gets forwarded to
Exoplayer instance, but without playback behaviour changes yet.
Translations for button descriptions are also missing - this will be another CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155386549
The default byte order for ByteBuffers is big endian, but platform decoder
output buffers use native byte order. AudioProcessors handle native byte order
input/output.
When using a software audio decoding extension the Sonic audio processor would
receive big endian input but was outputting to a native byte order buffer,
which could be little endian. This mismatch caused audio output to be
distorted.
After this change both platform decoder and extension decoder output buffers
should be in native byte order.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155320973
If the codec isn't adaptive, there's no need to accommodate
the width/height/input-size of streams that don't have the
same resolution as the current stream. This is because we'll
always need to instantiate a new codec anyway.
Issue: #2607
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155194458
(Relating to GitHub Issue #2577)
All getter, setter and callbacks have been added and value of repeatMode is
passed to getNextXXXIndex methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155071985
A DummySurface is useful with MediaCodec on API levels 23+.
Rather than having to release a MediaCodec instance when the
app no longer has a real surface to output to, it's possible
to retain the MediaCodec, using MediaCodec.setOutputSurface
to target a DummySurface instance instead. When the app has
a real surface to output to again, it can call swap this
surface back in instantaneously. Without DummySurface a new
MediaCodec has to be instantiated at this point, and decoding
can only start from a key-frame in the media.
A future change may hook this up internally in MediaCodecRenderer
for supported use cases, although this looks a little awkward. If
this approach isn't viable, we can require applications wanting
this to set a DummySurface themselves. This isn't easy to do with
the way SimpleExoPlayerView.setPlayer works at the moment, however,
so some changes will be needed either way.
Issue: #677
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154931778
Looper.myLooper(), the default looper, may be null in background threads. This adds a fallback to use the main app looper.
This will allow ExoPlayer instances to be built in background threads in Photos.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154845446
Using the new getNextWindowIndex method of Timeline, LoopingMediaSource now
uses a InfinitelyLoopingTimeline which does not unroll the windows to
157 million iterations but just starts from the beginning. If an explicit
number of iterations is given, we still unroll.
This change also allows multi-window timebars to show infinitely looping
playlists correctly.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154817554
(Preparation for Repeat Toggle Function - GitHub Issue #2577)
In addition, Timeline now also got a getPreviousWindowIndex and a
getNextPeriodIndex method with default implementations.
Changed ExoPlayerImplInternal and PlaybackControlView to use these
methods at all occurances of period and window index operations.
Note: Does not include repeat mode yet and no timelines are actually
using it so far. Please wait for the next CLs for this.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154520664
To inject custom renderers into SimpleExoPlayer, developers
currently need to extend SimpleExoPlayer and override the
renderer building methods. This is in contrast to the rest
of the library, where we use proper injection. This change
restores consistency. I think it's fine to make
SimpleExoPlayer final again, but if we find people extending
it for non-renderer purposes, we can revert that part of the
change.
ExoPlayerFactory now has analogous methods for the simple
and non-simple cases, which is a nice outcome.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154295726
Fixes the following issues:
1. When a surface is set, it's expected that the renderer will
notify video size + when a frame is rendered to it. This is true
even if the surface isn't changing. Right now this is achieved
by setting renderedFirstFrame to false, but this is problematic
in the case that the surface isn't changing because (a) it will
force rendering of a subsequent frame to the output even when
paused, which is incorrect, and (b) isReady will return false
until this occurs.
2. When the surface really is changing, isReady can return false
until the first frame has been rendered into the new surface, which
will break seamless surface switching. This change allows isReady
to return true up to allowedJoiningTimeMs for this case.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154171111
* colorSpace, colorRange and colorTransfer are relevant to all videos.
* The rest of the fields are relevant only to HDR videos.
* Tested on a prototype device that decodes VP9 profile 2, 10 bit.
* The Webm spec spells color as 'colour' so the webm id reference use the same spelling.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154098189
Prior to this change, the only way to switch SimpleExoPlayerView
was to do:
oldView.setPlayer(null);
newView.setPlayer(player);
This would cause the video renderer to have to transition through
oldSurface->noSurface->newSurface, which is inefficient (noSurface
requires platform decoders to be fully released).
After this change we support:
newView.setPlayer(player);
oldView.setPlayer(null);
This results in direct oldSurface->newSurface transitions, which are
seamless on Android M and above. The change also adds some robustness
against developers ending up with strange behavior as a result of
clearing the player from a view in a different ordering than we expect
w.r.t. registering of other listeners.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154044976
This class is unnecessary; you can simply pass a thread
priority to HandlerThread's own constructor. It's also
broken, since HandlerThread.run() immediately overrides
the priority being set!
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153461225
If AudioTrack.setPlaybackParameters was called before initialization (for
example, when an audio renderer is enabled) the parameters would actually be
dropped, because configure calls reset, which didn't apply draining playback
parameters if the track was not initialized. It would then overwrite the
draining parameters with the current parameters.
Set the playback parameters directly (without draining) for uninitialized tracks
so that the call to setPlaybackParameters in configure is a no-op.
Also, reset the stored channel count and sample rate when the audio processor
is released so that configure returns true when it is next used, which makes
sure that it gets flushed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153078759
The track initialization data of Tx3g includes default style values for
font styles, colour, and font family. Additionally the decoder now supports
vertical subtitle placements other than the Tx3g default of 85% video height.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152930057
The idea of using reflection was so that a developer could
delete a package they didn't want and have everything else
still compile. However, a developer doing this is likely
building from source, in which case editing the factories
too is pretty trivial.
Removing the reflection makes specifying extractor flags
via the default factory easy, and removes the need for
special proguard config.
Issue: #2657
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152810423
Extended Tx3gDecoder to read additional information after subtitle text.
Currently parses font face, font size, and foreground colour.
Font identifier and other information provided in subtitle sample description
not yet supported.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152793774
When no video tracks or renderers are present, attempt audio adaptation.
Issue:#1975
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152708422
I've also removed unnecessary "empty" cases, since to add them
everywhere would bloat the code quite a lot. Note that
new String(new byte[0], 0, 0, encoding) is valid and will produce
and empty string.
Issue: #2663
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152697288
This allows propagating format changes to the track output.
Issue:#2552
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152672983
ExoPlayerImpl.prepare() replaces the timeline with an empty timeline. After this
happens, MSG_SOURCE_INFO_REFRESHED could be handled on the main thread and
could relate to the old source, so the player could expose a stale timeline.
Count pending prepares in ExoPlayerImpl so that source info refreshes can be
suppressed until preparation actually completes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152496255