10340 Commits

Author SHA1 Message Date
bachinger
04824dfd25 Make DefaultHttpDataSourceFactory an inner class of the built class
#exofixit

PiperOrigin-RevId: 348441436
2020-12-23 22:51:20 +00:00
Oliver Woodman
5e47c3c5e5 Merge pull request #8357 from TiVo:p-fix-cea708anchor
PiperOrigin-RevId: 348440799
2020-12-23 22:51:10 +00:00
tonihei
30ee29df1a Use real SampleQueue in FakeSampleStream.
This replaces all the duplicated logic previously implemented in
FakeSampleStream and more closely follows the pattern of how
SampleStreams are used from real MediaPeriods.

Some tests needed adjustments because using real the SampleQueue
improved behaviour:
 - Waiting for isLoading is only needed once even across period
   boundaries because the real SampleQueue doesn't have the on/off
   pattern.
 - AnalyticsCollectorTest.playlistOperations() was wrongly asserting
   that some pre-buffering events. The new version is more intuitively
   correct we pre-buffer the second item during the initial loading
   phase (thus period1seq1) and keep the buffer in the queue after
   the removal operation.

PiperOrigin-RevId: 348440255
2020-12-23 22:51:00 +00:00
tonihei
cf0a4e528e Disable delta updates until merging bug is fixed.
The delta updates loose information about previous init segments.
Until this is properly fixed, we can avoid the problem by not
using delta updates.

Issue: #5011
PiperOrigin-RevId: 348023895
2020-12-23 22:50:51 +00:00
ibaker
466826e673 Remove data capturing logic from ShadowMediaCodecConfig
We're now using CapturingRenderersFactory everywhere

PiperOrigin-RevId: 348018988
2020-12-23 22:50:42 +00:00
ibaker
0d1dac93c4 Use CapturingRenderersFactory in DashPlaybackTest
PiperOrigin-RevId: 348018409
2020-12-23 22:50:33 +00:00
ibaker
1327ecad24 Use CapturingRenderersFactory in Vp9PlaybackTest
PiperOrigin-RevId: 348017841
2020-12-23 22:50:25 +00:00
ibaker
27e290e701 Use CapturingRenderersFactory in TsPlaybackTest
PiperOrigin-RevId: 348017268
2020-12-23 22:50:16 +00:00
krocard
8fb15f97ca Explicitly fail playback if new format has no sampleMimeType
This avoids a NullPointerException later when the format is used.

Fixes https://github.com/google/ExoPlayer/issues/8283.

PiperOrigin-RevId: 348017149
2020-12-23 22:50:07 +00:00
ibaker
fe5176c009 Use CapturingRenderersFactory in OggPlaybackTest
PiperOrigin-RevId: 348016819
2020-12-23 22:49:58 +00:00
ibaker
6a89027f56 Use CapturingRenderersFactory in Mp3PlaybackTest
PiperOrigin-RevId: 348016339
2020-12-23 22:49:49 +00:00
ibaker
56d30205ba Use CapturingRenderersFactory in MkvPlaybackTest
PiperOrigin-RevId: 348015859
2020-12-23 22:49:40 +00:00
ibaker
237766548c Use CapturingRenderersFactory in MkaPlaybackTest
PiperOrigin-RevId: 348015304
2020-12-23 22:49:32 +00:00
ibaker
5bfa818533 Use CapturingRenderersFactory in FlvPlaybackTest
PiperOrigin-RevId: 348014814
2020-12-23 22:49:23 +00:00
ibaker
3bf5e6b0e4 Use CapturingRenderersFactory in FlacPlaybackTest
PiperOrigin-RevId: 348014322
2020-12-23 22:49:14 +00:00
christosts
6b43f1566f Reduce length of test data in UdpDataSourceContractTest
PiperOrigin-RevId: 348011243
2020-12-23 22:49:05 +00:00
ibaker
9d2855c31f Add @Test to overridden test in UdpDataSourceContractTest
With @Ignore but not @Test the method is still executed by JUnit:
https://github.com/junit-team/junit4/issues/695

PiperOrigin-RevId: 348009981
2020-12-23 22:48:56 +00:00
kimvde
e6d8741467 Add method to compute a SparseLongArray min value.
PiperOrigin-RevId: 348008973
2020-12-23 22:48:47 +00:00
tonihei
490519a49a Update HLS window duration with trailing parts.
If we have trailing parts the available window should reach to
the end of all trailing parts and not only to the last finished
segment.

Issue: #5011
PiperOrigin-RevId: 347996626
2020-12-23 22:48:38 +00:00
ibaker
7027e75ce8 DataSourceContractTest: Check an unbounded subrange is read correctly
PiperOrigin-RevId: 347994829
2020-12-23 22:48:29 +00:00
ibaker
1a00da4c19 Add CapturingRenderersFactory and use it in Mp4PlaybackTest
I decided not to migrate all the tests in one CL to keep the diff
manageable. I'll make follow-up CLs to migrate the tests, and eventually
delete TeeCodec and all associated logic.

I couldn't completely remove the dump diff because
ShadowMediaCodec.getCodecInfo() (which would give me access to the MIME
type) doesn't seem to work properly - it returned video/avc when
name=exotest.audio.aac, and looking into the code it looks like there's
some native methods that are missing shadow implementations.
PiperOrigin-RevId: 347991956
2020-12-23 22:48:20 +00:00
tonihei
43886491f6 Make FakeMediaPeriod and FakeAdaptiveMediaPeriod independent.
The adaptive period currently extends the base (non-adaptive) period
to share common MediaPeriod boilerplate code.

However, once we start using the real SampleQueue in FakeMediaPeriod
the common code becomes even less and the overhead to support
multiple stream implementation from the base class is no longer
worth it. Thus, this change removes the class hierarchy and copies
the common parts to FakeAdaptiveMediaPeriod.

PiperOrigin-RevId: 347990468
2020-12-23 22:48:10 +00:00
bachinger
8a560429e9 Fix flaky test case
PiperOrigin-RevId: 347987861
2020-12-17 11:25:54 +00:00
bachinger
d9c058c60a Fix flaky test case
PiperOrigin-RevId: 347987306
2020-12-17 11:25:54 +00:00
ibaker
4849b3e35d Remove zero-byte resource from FileDataSourceContractTest
This was added due to a misunderstanding - we're more interested in
testing the edge case of trying to read the last zero bytes of a
non-zero-byte resource.

In a future change I want to be able test reading a subrange, so each
TestResource will need to be at least N bytes long.

PiperOrigin-RevId: 347980843
2020-12-17 11:25:54 +00:00
christosts
8da4eaa377 HlsPlaylistParser: ignore subtitles without URI
Issue: #8323
PiperOrigin-RevId: 347827615
2020-12-17 11:25:54 +00:00
tonihei
3b277b2810 Fix unintentional new sessions after player release in stats listener.
PlaybackStatsListener has a method whose original intention was to be
called when the player is releaed to finish all pending sessions.
However, this also meant that later events (e.g. onVideoDecoderDisabled)
could create new sessions because the old one was already finished.

Use the new onPlayerReleased callback to implement this properly and to
fix the unintentional new session creation.

PiperOrigin-RevId: 347809527
2020-12-17 11:25:54 +00:00
tonihei
e95e2e0f73 Disable flaky tests.
PiperOrigin-RevId: 347807539
2020-12-17 11:25:54 +00:00
ibaker
db12fae5ca Update Robolectric dependency from 4.5-SNAPSHOT to 4.5-alpha-3
PiperOrigin-RevId: 347806040
2020-12-17 11:25:54 +00:00
ibaker
abff5168f4 Fix EPI.seekTo to balance operation acks when seeking during an ad
This regression was introduced in
b1e9257de1

Issue: #8349

#minor-release

PiperOrigin-RevId: 347802049
2020-12-17 11:25:53 +00:00
krocard
f11a9cdf71 Move documentation in common that linked to core classes
This will allow moving Player in common.

#player-to-common

PiperOrigin-RevId: 347797285
2020-12-17 11:25:53 +00:00
andrewlewis
e791e3ce54 Fix checking imaAdMediaInfo nullness
It's intended to log a warning in this case, rather than throw.

Issue: #8290

#minor-release

PiperOrigin-RevId: 347790527
2020-12-17 11:25:53 +00:00
krocard
5a6c99e304 Clarify EventLogger Window log
PiperOrigin-RevId: 347789441
2020-12-17 11:25:53 +00:00
olly
751809b4e5 StyledPlayerView: Fix control overflow logic
PiperOrigin-RevId: 347657903
2020-12-17 11:25:53 +00:00
olly
7c28df62fd StyledPlayerView: Fix progressBar to noBar transformation
Also make some related naming improvements.

PiperOrigin-RevId: 347653802
2020-12-17 11:25:53 +00:00
olly
70ba62a281 StyledPlayerView: Add separate fullscreen button for minimal mode
Moving the fullscreen button around depending on modes is quite error
prone. There is currently a bug where the order of the settings cog
and fullscreen button can end up being swapped around as a result of
moving the fullscreen button to the minimal controls and back again.

It's less error prone just to have a second fullscreen button that's
always part of the minimal controls.

PiperOrigin-RevId: 347639484
2020-12-17 11:25:53 +00:00
olly
7ac19ff406 StyledPlayerView: Fix calculations to account for margins
Also make some related naming improvements.

PiperOrigin-RevId: 347631916
2020-12-17 11:25:53 +00:00
kimvde
761bd091c3 Check atom size and recording mode of Samsung saut boxes
- In slow motion videos flattened by Samsung, the saut box is kept but
only have the 4 first bytes (author field).
- In Samsung normal videos, the recording mode is zero.

In these cases, skip this box.

PiperOrigin-RevId: 347577303
2020-12-17 11:25:53 +00:00
andrewlewis
12f1615205 Use MediaItem as ads identifier by default
Issue: #3750
PiperOrigin-RevId: 347572122
2020-12-17 11:25:53 +00:00
andrewlewis
0633778c70 Fix handling of repeated ads identifiers
Previously the `AdTagLoader` only had one listener which meant that updates
that should affect all periods with matching identifiers in the timeline only
affected the last-attached one. Fix this by having `AdTagLoader` track all its
listeners.

Issue: #3750
PiperOrigin-RevId: 347571323
2020-12-17 11:25:53 +00:00
tonihei
9982e1f154 Release AnalyticsListeners after calling SimpleExoPlayer.release
Currently we don't remove the AnalyticsListeners registed to
SimpleExoPlayer after calling release. We didn't do this mainly
because there are messages triggered as part of the release that
still cause interesting events (e.g. decoderDisabled with the
final counters, final dropped counts etc).

However, we should fully release/remove the listeners once these
pending events are delivered to:
 1. Not leak listener implementations (e.g. if the listener is an
    Activity)
 2. Ensure we don't send future events that may cause listeners
    to unintentionally access released or nulled variables. This
    could happen for example if someone calls a player method
    after the player was released.
In addition, we can add a onPlayerReleased callback to
AnalyticsListener to allow implementations to clean themselves up
once all pending events are delivered.

PiperOrigin-RevId: 347434344
2020-12-17 11:25:53 +00:00
andrewlewis
4139ee5c52 Improve ad loader listening in ImaAdsLoaderTest
It is more realistic for each source to have its own listener and to share
`TimelineWindowDefinition`s between them.

Issue: #3750
PiperOrigin-RevId: 347398769
2020-12-17 11:25:53 +00:00
bachinger
6114c894df Make OkHttpDataSourceFactory an inner class of OkHttpDataSource
#exofixit

PiperOrigin-RevId: 347389531
2020-12-17 11:25:53 +00:00
christosts
e18892cd03 Make setters of TestResource.Builder accept a value.
PiperOrigin-RevId: 347388172
2020-12-17 11:25:52 +00:00
christosts
401634a9fb Create UdpDataSource contract test
PiperOrigin-RevId: 347386108
2020-12-17 11:25:52 +00:00
krocard
d857eec1f7 Move classes Player depends on to common
This will allow player to be moved to common.

#player-to-common

PiperOrigin-RevId: 347375344
2020-12-17 11:25:52 +00:00
bachinger
a335c96450 Deprecate HttpDataSource.Factory.getDefaultRequestProperties
#exofixit

PiperOrigin-RevId: 347375323
2020-12-17 11:25:52 +00:00
olly
5aac1898bb Use longs to avoid intger overflow
PiperOrigin-RevId: 347351440
2020-12-17 11:25:36 +00:00
sneelavara
b70f08b740 CEA-708 Decoder fixes for issue #1807
Fixed the verticalAnchorType and horizontalAnchorType calculation

The anchorID 0, 1 and 2 should correspond to verticalAnchorType=ANCHOR_TYPE_START, anchorID 3, 4, 5 is ANCHOR_TYPE_MIDDLE, anchorID 6, 7 and 8 is ANCHOR_TYPE_END

The anchorID 0, 3 and 6 should correspond to horizzonatlAnchor=ANCHOR_TYPE_START, anchorID 1, 4, 7 is ANCHOR_TYPE_MIDDLE, anchorID 2, 5 and 8 is ANCHOR_TYPE_END
2020-12-16 16:22:12 -08:00
sungsoo
4907cf877a Make media2 extension depend on androidx media2 1.1.0
Issue: #8011
#minor-release
PiperOrigin-RevId: 347288689
2020-12-14 10:19:03 +00:00