We do this in the dynamic case, and I think we've seen
a few GitHub issues where developers do this and don't
understand what they've done wrong (because the failure
comes later).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163688557
Currently the ExoPlayerWrapper is used to run tests using an ExoPlayer
implementation. Some properties of the test are set in the constructor, some
are set by overloading the class, others are hard-coded in the
ExoPlayerWrapper class, and a mechanism similar to the existing ActionSchedule
is missing.
This change does the following:
1. Renames ExoPlayerWrapper to ExoPlayerTestRunner as it better reflects
its purpose.
2. Adds an internal Builder to easily set-up the test in a coherent way. This
allows to only set necessary test components while using defaults for the rest.
3. Integrate ActionSchedule.
4. Apply the new structure to the existing tests currently using ExoPlayerWrapper.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163186578
Prepend sequence headers to the next frame, instead of appending them to
the previous frame. Tested decoders like FFMPEG and Google's
Android/MPEG2 expects to read the sequence headers before the first
frame they apply to. When sequence headers are appended to the previous
frame, these are ignored and this leads to incorrect decoding.
There's no way to represent a beta in our integer versioning
scheme. I propose we just set it the same for all betas + the
stable release. The versioning for the demo app isn't that
important, so I've just put it directly to 2.5.0 as well.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162749130
SKIPPED can't be handled as CONTENT_RESUME_REQUESTED because after skipping an
ad there may be further ads to play in its ad group.
Remove workaround for handling unexpected playAd without stopAd, as the player
can instead recover when IMA sends CONTENT_RESUME_REQUESTED. This in turn fixes
handling of the case where playAd is called twice but IMA expects only the
first ad to play, when skipping a particular ad. (Add an ad tag where this
occurs to internal samples.)
Check whether a currently playing ad has been marked as played in
ExoPlayerImplInternal, and handle this case as a seek. This ensures that any
loaded ad periods are discarded in the case of CONTENT_RESUME_REQUESTED.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162610621
When an ExtractorMediaSource is used in a concatenation, and
probably when using repeat modes, it needs to produce multiple
ExtractorMediaPeriods during usage. Currently we fire a
source info refresh every time a new ExtractorMediaPeriod
instance prepares, which triggers ExoPlayer.EventListener's
onTimelineChanged method. In nearly all cases the timeline is
unchanged after the first ExtractorMediaPeriod is prepared.
This change suppresses these no-op changes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162484234
A content period just before a postroll ad group with all ads played
was not being marked as the last media period in the timeline period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162471919
This is the first step towards facilitating Cast integration to ExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162366198
When resetting a SampleQueue, by default the upstream format
is not cleared. This is necessary for progressive playbacks,
since (a) the formats never change, and (b) the extractors
only output them once. So when a seek occurs, it's necessary
to clear all sample data from the queue, but retain the current
upstream format.
Uniquely for HLS, the media in a SampleQueue that we may read
from can be in a format not supported by the consuming renderers.
We clear all the sample data from the queue in this case, but
not the upstream format. Since we have an optimization that
allows the upstream format to be read in advance of another
sample being written into the queue, this can result in an
unsupported format being read by a consuming renderer. This
change ensures the upstream format is correctly cleared in the
problematic case.
Issue: #3079
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162360267
The default behaviour stays the same as Clock.DEFAULT == SystemClock. And it
enables bandwidth measurements in tests with simulated clocks.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162350852
All implementations of SequenceableLoader already implement this method.
Moreover, all composite media periods contained an exact copy of an
implementation that now moved to CompositeSequencableLoader.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162349083
The FakeClock allows to simulate timing behaviour including sleep time
for test cases.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162345258
The position returned by getContentPosition() could be C.TIME_END_OF_SOURCE.
Fix the content position stored in MediaPeriodInfos for postroll ads to be the
duration of the containing period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162322339
We currently read at most 5 packets at a time from the
extractor input. Whether this is inefficient depends on
how efficiently the underlying DataSource handles lots
of small reads. It seems likely, however, that DataSource
implementations will in general more efficiently handle
fewer larger reads, and in the case of this extractor
it's trivial to do this.
Notes:
- The change appears to make little difference in my
testing with DefaultHttpDataSource, although analysis
in #3040 suggests that it does help.
- This change shouldn't have any negative implications
(i.e. at worst it should be neutral wrt performance). In
particular it should not make buffering any more likely,
because the underlying DataSource should return fewer
bytes than are being requested in the case that it
cannot fully satisfy the requested amount.
Issue: #3040
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162206761
If seek is called for a non-seekable period, when the period is prepared the
start position will be updated from the seek position to zero. Because the
start position is part of the renderer offset for the first loaded period
holder, after the update the renderer offset start position and the new start
position would no longer cancel out, leading to the player position being
negative.
The first period holder's renderer offset is the fixed base offset (60 seconds)
plus its start position, but the start position is always subtracted. Avoid
subtracting the start position for the first period holder so that when it
changes there is no need to update the renderer offset.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162188133
This enables adaptive media test cases using TrackGroups with multiple
Formats.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162182005
This allows to create extensions of FakeDataSet and also simplifies the
FakeDataSource class.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162180952
Also move to using an array to hold the SampleQueues,
as we've moved to doing in ExtractorMediaPeriod.
Issue: #551
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161972990
drmInitData can be null in DASH if all of the init data is
specified at the manifest level instead. I took a look at
injecting the manifest format into the extractors, so that
we can actually copy the scheme type into it, but that's
at least non-trivial enough to delay for a subsequent CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161956246
On an old version of okhttp, opening connection clears the thread interrupt flag silently. This is a workaround
to reduce the effect of the bug.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161784435
ParsableBitArray.readBit in particular was doing an excessive
amount of work. The new implementation is ~20% faster on desktop.
Issue: #3040
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161666420
Really low hanging fruit optimization for TS extraction.
ParsableBitArray is quite expensive. In particular readBits
contains at least 2 if blocks and a for loop, and was being
called 5 times per 188 byte packet (4 times via readBit). A
separate change will follow that optimizes readBit, but for
this particular case there's no real value to using a
ParsableBitArray anyway; use of ParsableBitArray IMO only
really becomes useful when you need to parse a bitstream more
than 4 bytes long, or where parsing the bitstream requires
some control flow (if/for) to parse.
There are probably other places where we're using
ParsableBitArray over-zealously. I'll roll that into a
tracking bug for looking in more detail at all extractors.
Issue: #3040
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161650940
This CL also makes DefaultTrackSelector take it into account when RendererCapabilities
sets it to unsupported.
A following CL could add a DefaultTrackSelector parameter to force DRM "known support" for specific track types.
Issue:#1661
Issue:#1989
Issue:#2089
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161556467
Let's do it this way for now. Note there's an implicit
assumption in here that non-AV tracks consist of only
key-frames, but I think we'll not encounter any issues
in the real world as a result, we already make this
assumption in ChunkSampleStream, and actually tagging
every queue with this information explicitly is a very
painful amount of plumbing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161545383
Once background and resuming is supported, the ads loader will be kept when the
player is destroyed and recreated. Move the state relating to the structure of
ads and what ads have been loaded/played out of the media source and into the
loader so the information is not lost when the source is released, in
preparation for supporting background and resuming.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161503571
This option allows to move the currently playing media source to another position
and also to move other media source without creating a new MediaSource object.
Issue:#1706
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161402022