4090 Commits

Author SHA1 Message Date
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
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
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
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
krocard
5a6c99e304 Clarify EventLogger Window log
PiperOrigin-RevId: 347789441
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
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
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
bachinger
2ee40270e5 Support setPlaybackSpeed(float) with the MediaSessionConnector
Issue: #8229
#exofixit
PiperOrigin-RevId: 346968046
2020-12-14 10:17:53 +00:00
kimvde
4ee02a27de Mp4Extractor: add smta metadata to audio track
This is needed for slomo audio flattening.

PiperOrigin-RevId: 346965990
2020-12-14 10:17:43 +00:00
ibaker
73b9cee83a Add a ContentDataSource contract test
PiperOrigin-RevId: 346954787
2020-12-14 10:17:33 +00:00
bachinger
05c928f96d Add live configuration to Timeline.Window
Issue: #5011
PiperOrigin-RevId: 346828103
2020-12-14 10:17:23 +00:00
christosts
392b3ab573 Inject MediaCodecAdapter.Factory
Make the MediaCodecFactory injectable from the constructors of
MediaCodecAudioRenderer and MediaCodecVideoRenderer.

PiperOrigin-RevId: 346784661
2020-12-14 10:17:13 +00:00
olly
d01654386f VideoFrameReleaseTimeHelper: Split out frame-rate estimation
PiperOrigin-RevId: 346554044
2020-12-14 10:16:43 +00:00
tonihei
f18d81f8a8 Ensure onEvents is called when listener is removed.
When a listener is removed or released we may not have called
onEvents for events that happened before this point. To ensure
listeners don't miss events we need to trigger a final onEvents
with all events we have happened so far (if any).

PiperOrigin-RevId: 346553030
2020-12-14 10:16:34 +00:00
christosts
e7f5912677 Add Factory to MediaCodecAdapter
In a later change, MediaCoderAdapter.Factory will be injectable to
MediaCodecRenderer.

PiperOrigin-RevId: 346525171
2020-12-14 10:16:24 +00:00
aquilescanta
9eef7b06f7 Ease the creation of SampleQueues without DRM management
This is useful in cases where the client is not interested in DRM.

PiperOrigin-RevId: 346313024
2020-12-14 10:16:04 +00:00
krocard
42f5e53def Add an TrackSelector base interface
This will allow Player to move in common without
trackSelector and all its many dependency.

Currently all users of `getTrackSelector` are
downcasting it in `DefaultTrackSelector`, this change
thus does not break them.

Track selection API is intended to be reworked, methods
will be added to the currently empty interface.

#player-to-common

PiperOrigin-RevId: 346159765
2020-12-14 10:15:35 +00:00
krocard
b5f0379ba0 Move ExoPlaybackException in common
This is needed to move Player in common.

#player-to-common

PiperOrigin-RevId: 346157905
2020-12-14 10:15:25 +00:00
krocard
7d3e5f2af8 Move MediaPeriodId in common minimalistically
This is needed to move ExoPlayerException in common.
The follow up cl moves MediaPeriodId completely.

#player-to-common

PiperOrigin-RevId: 346133091
2020-12-14 10:15:15 +00:00
krocard
f0edcc4003 Reference C.FORMAT_* in deprecated RendererCapabilities
Avoid duplicating the values.

#player-to-common

PiperOrigin-RevId: 345642356
2020-12-14 10:14:24 +00:00
olly
0f64ace515 Only set experimentalSetForegroundModeTimeoutMs value when it's > 0
PiperOrigin-RevId: 345489364
2020-12-14 10:13:51 +00:00
olly
2980354510 VideoFrameReleaseTimeHelper: Account for playback speed
Previously the helper would constantly lose (or never establish) sync
for non-1x playback speeds. This changes the helper to account for
other playback speeds correctly.

PiperOrigin-RevId: 345458859
2020-12-03 17:13:21 +00:00
ibaker
74bbd5367e Gracefully handle null-terminated subtitle content in MKV containers
This was reported for SSA/ASS in PR #8265, but it seems to me the
SubRip part of the Matroska spec is similarly loose, so this change
handles null-terminated strings in both.

#minor-release

PiperOrigin-RevId: 345452667
2020-12-03 17:13:12 +00:00
ibaker
95e2ce26f3 Update the log tag of DefaultAudioSink
The old tag reflects the original name of this class. It was renamed in
2017:
<unknown commit>

Possibly the old name was kept for compatibility with existing logs
analysis? I didn't see an explicit discussion of this in the review
comments of the rename change.

The current tag confused me slightly - I assumed a line was being
emitted by the android.media.AudioTrack rather than ExoPlayer's
DefaultAudioSink.

PiperOrigin-RevId: 345450056
2020-12-03 17:13:03 +00:00
olly
2766211d0c Disable VSYNC adjustments if display cannot be queried
PiperOrigin-RevId: 345442367
2020-12-03 17:12:50 +00:00
Oliver Woodman
5211a1f0a7 Merge pull request #8154 from samoylenkodmitry:handle_out_of_space
PiperOrigin-RevId: 345428731
2020-12-03 17:12:15 +00:00
krocard
09509c2390 Simple migration to common
Migrate all classes that are simple to move to
common.

#player-to-common

PiperOrigin-RevId: 345412080
2020-12-03 17:11:56 +00:00
andrewlewis
ebe54113a9 Fix SonicAudioProcessor end of stream behavior
The `AudioProcessor` interface requires that no more input is queued after
queueing end of stream, but `DefaultAudioSink` did queue more input and the
implementation of `SonicAudioProcessor` actually relied on this to drain output
at the end of the stream.

Fix this behavior by getting `Sonic` output in `getOutput` and having
`DefaultAudioSink` only queue input to processors that are not draining.

Also add TODOs to clean up audio processor implementations where the code
handles interaction that doesn't conform to the interface.

PiperOrigin-RevId: 345406478
2020-12-03 17:11:47 +00:00