This is in preparation for supporting non-extractor MediaSources for ads in
AdsMediaSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178377627
This should be a no-op change. And it eliminates the need to use the index variable
which will be removed once the MediaPeriodHolderQueue is implemented.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177963360
In some occasions, we may want to discard a part of the buffered media to
improve playback quality. This CL adds this functionality by allowing the
loading media period to re-evaluate its buffer periodically (every 2s) and discard
chunks as it needs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177958910
This is a step towards harmonizing the MediaSource Builders and (potentially)
providing MediaSource factories.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177783157
Waiting for the timeline change didn't work correctly because the timeline was
already equal to Timeline.EMPTY (due to the masking). Now waiting explicitly
for the empty Timeline exposed by the source.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177749292
- Remove skipping of the VBRI/XING frame before calculating position
offsets. This was incorrect. Instead, a constraint is used to ensure
we don't return positions within these frames, the difference being
that the constraint adjusts only positions that would fall within
the frames, where-as the previous approach shifted positions through
the whole stream.
- Excluded last entry in the VBRI table because it has an invalid
position (the length of the stream).
- Give variables in XingSeeker descriptive names.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177451295
The set of active audio processors was only updated on reconfiguration and when
draining playback parameters completed. Draining playback parameters are cleared
in reset(), so if parameters were set while paused then the sink was quickly
reset, without draining completing, the set of active audio processors wouldn't
be updated. This means that a switch to or from speed or pitch = 1 would not be
handled correctly if made while paused and followed by a seek.
Move resetting active audio processors from configure (where if the active audio
processors were reset we'd always initialize a new AudioTrack) to initialize().
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177442098
- This change snaps the seek position for constant bitrate MP3s
to the nearest frame boundary, avoiding the need to skip one
byte at a time to re-synchronize (this may still happen if the
MP3 does not really have fixed size frames).
- Tweaked both ConstantBitrateSeeker and WavHeader to ensure the
returned positions are valid.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177441798
Support ad MediaSources that aren't prepared immediately by using
DeferredMediaPeriod, moved up from DynamicConcatenatingMediaSource.
In a later change the new interfaces will be made public so that apps
can provide their own MediaSource factories.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177424172
captions fetcher architecture.
1. ManifestlessCaptionsMetadata
Other captions fetchers must first fetch a manifest (HLS or manifest) to
discover captions tracks. This process does not exist for manifestless. All
we need to do is scan the FormatStream's for the right itag, so this is an
all-static class.
2. ManifestlessSubtitleWindowProvider
Once a captions track is selected, a subtitles provider is instantiated. This
is the main interface used by the player to retrieve captions according to
playback position. This class stores fetched captions in a tree index by time
for efficient lookups. Background captions fetches are used to populate
the tree.
3. ManifestlessCaptionsFetch
Captions are fetched one segment at a time. One instance of this object
is required per fetch. It performs a blocking fetch on call(), and is
intended to be submitted to a background-thread executor.
4. ManifestlessCaptionsFetch.CaptionSegment
This is the result of the caption fetch. These values are used to populate
the captions tree.
Manifestlessness
The initial request is always a headm request. There is a separate tree
of every segment indexed by start time. This tree is used to improve
manifestless sequence number calculation. Once we have data for the current
timestamp, we walk forward through the tree to find the next unfetched
sequence number, and fetch that.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177385094
Currently FragmentedMp4Extractor only parses and outputs emsg messages if the
flag FLAG_ENABLE_EMSG_TRACK is set (when there's a metadata renderer that
handles emsg messages). Since there are emsg messages that only targets the
player, which we want to handle independently from MetadateRenderer, this CL
adds the ability for FragmentedMp4Extractor to output emsg messages to an
additional TrackOutput if provided, independently from FLAG_ENABLED_EMSG_TRACK.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177318983
- Avoid re-downloading data prior to the first mdat box when
seeking back to the start of an unseekable FMP4.
- Avoid re-downloading data prior to the first frame for
constant bitrate MP3.
- Update SeekMap.getPosition documentation to allow a non-zero
position for the unseekable case. Note that XingSeeker was
already returning a non-zero position if unseekable.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177317256
There are still things broken about the seeker, but this
cleans up some of the weird bits.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177315136
Makes it less error-prone to accidentatly forget to set the right overwrites.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177282089
This allows to keep the state synced with ExoPlayerImpl after stopping the player,
but still releases the media source immediately as it needs to be reprepared.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177167980
We can acknoledge seeks before preparation finished immediately now,
because ExoPlayerImpl won't leave the masking state until the first prepare
operation is processed.
As a side effect, it also cleans up the responsibility of the callbacks.
Prepares are always acknowledged with a SOURCE_INFO_REFRESHED, while seeks
are always acknowledged with a SEEK_ACK.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177144089
The ExoPlayerImpl implementation forwards the stop request with this optional
parameter. To ensure correct masking (e.g. when timeline updates arrive after
calling reset in ExoPlayerImpl but before resetInternal in
ExoPlayerImplInternal), we use the existing prepareAck counter and extend it
also count stop operations. For this to work, we also return the updated
empty timeline after finishing the reset.
The CastPlayer doesn't support the two reset options so far.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177132107
Unconditionally waiting for the action schedule to finish in ExoPlayerTestRunner
doesn't work if the action schedule is not intended to be finished.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177024139
Also slightly improve language normalization/documentation.
For this CL, it is assumed that null and "und" languages are different
entities. Once we fully tackle language tag normalization, we can decide
whether to normalize the "undefined" language.
Issue:#2867
Issue:#2980
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177008509
Update the default AdaptiveTrackSelection and DefaultLoadControl to use playback
speed information.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176989168
currentTimeMillis is not guaranteed to be monotonic and elapsedRealtime is
recommend for interval timing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176853118
Fixed by explicitly waiting for the timeline update. This shouldn't be
necessary and will be removed as soon as the correct order of events
can be guaranteed (timeline change -> state change -> onSeekProcessed).
The waiting for the timeline update is implemented by introducing the
feature that the test runner also waits until the action schedule has
finished before stopping the test.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176848540