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
1. maybeRenotifyVideoSizeChanged should report reported* variables
2. Add check into maybeNotifyVideoSizeChanged to suppress reporting
in the case that the width and height are still unknown.
Issue: #3007
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160879625
This cleans up test the TestUtil class that in large parts consisted of
assertions for Extractor tests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160829066
The deprecated methods will be removed as soon as HLS is migrated
to use the new ones.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160827936
This also ensures that TimelineAsserts only contains assert methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160827271
They serve the same purpose. One was defined as single window, multi-period
timeline, while the other was a multi-window, single-period-each timeline.
The combined FakeTimeline uses TimelineWindowDefinitions which allow multi-
window, multi-period fake timelines.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160808844
It was a bit strange how it returned something via the return
value and something else via the "out" variable, and doing it
this way wasn't even saving any allocations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160645640
Fake ExoPlayer componenets used within ExoPlayerTest.java can be useful for
other test classes and are therefore made available in testutils.
They can also be merged with other existing fake components.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160632908
Some parts of TimelineTest provided common assertions and helper classes for
other tests. As such, they better fit into testutils. In line with other
assertion methods, the TimelineVerifier class has been converted to a set of
static assertion methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160629797
(Related to GitHub #1706)
When the timeline becomes empty, the playback state transitions to "ended".
When the timeline becomes non-empty again, exceptions are thrown because MSG_DO_SOME_WORK is still regularly sent and media periods are getting prepared.
This change ensures that no MSG_DO_SOME_WORK messages are sent in "ended" state.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160537147
These changes are in part related to handling playback of mixed clear
and encrypted content, where we might want to use a secure decoder
throughout, but only have drm init data and only care about the state
of the DrmSession during playback of encrypted parts.
- requiresSecureDecoderComponent became unnecessary when we added
ExoMediaCrypto, which provides a layer in which requiresSecureDecoderComponent
can be overridden.
- Relaxed requirements for obtaining the MediaCrypto. It's helpful
to allow retrieval in the error state, since it can be used to
instantiate a decoder and play clear samples.
- Deferred throwing of errors in renderer implementations. As long as
we can get a MediaCrypto, we should init the codec. We can also
play clear samples without failing if playClearSamplesWithoutKeys is
true, regardless of the errors state.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160536365
This base class will be used to extend HlsDownloaderFactory from.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160523335
(GitHub issue #1706)
The media source allows adding or removing child sources before and after prepare() was called.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160516636
This is currently happening after toggling the repeat mode. This is line with
the rest of the implementation which requires a seek operation to resume
playback.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160516449
This also adds support for seeking in periods with midroll ads.
Remove Timeline.Period.isAd.
Issue: #2617
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160510702
Two of MediaPeriod's methods are only called after the media period has been
prepared. Added this to JavaDoc of these method to simplify implementations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160510373