3231 Commits

Author SHA1 Message Date
tonihei
75c3bfb55c Rename Listener for timeline update to avoid confusion with MediaSourceEventListener.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187313128
2018-03-02 09:21:28 +00:00
hoangtc
fcb796a80c Migrate ExoPlayer Gradle build files.
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
2018-03-02 09:20:02 +00:00
tonihei
2f4a3d2e5d Replace ConcatenatingMediaSource with DynamicConcatenatingMediaSource.
The non-dynamic media source has a strict subset of features of the dynamic one and
thus can be replaced.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187299432
2018-03-02 09:16:00 +00:00
tonihei
32b4db361f Send empty timeline for empty DynamicConcatenatingMediaSource immediately.
Without child sources, the timeline can't possibly updated again within the
current looper message. Thus, we can send the empty timeline immediately.

This fixes a recently introduced flakiness in the test.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187295700
2018-03-02 09:14:27 +00:00
andrewlewis
38914f0ba5 Allow clipping offset windows
ClippingMediaSource provides a timeline where the period and window have the
same start/end positions, so when clipping a child timeline with a non-zero
offset between the window and period it is necessary to clear the offset then
apply the offset to the start/end positions used in the ClippingMediaPeriod.

Also add a message to clipping exceptions.

Also fix adjustment of seeks to the start of the clipped view.

Issue: #3888

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187292506
2018-03-02 09:12:54 +00:00
tonihei
b2c445776a Allow parallel reuse of media sources.
This is achieved by adding a BaseMediaSource which keeps a reference count of the
number of times the source has been prepared and forwards to the actual implementations
only once, such that only minimal changes are needed for each media source.

Issue:#3498

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187186691
2018-03-02 09:08:28 +00:00
tonihei
b489f58cdb Change listener notification in DynamicConcatenatingMediaSource.
Up to now we use a boolean "preventListenerNotification" to suppress updates
while other operations are still in progress. This ensures, for example, that
only one initial timeline is issued even for multiple child sources.

As soon as we allow to reuse the same instance, it becomes increasingly difficult
to manage this manual listener notification suppression. Therefore, this change
schedules an update as a new message on the playback thread immediately after the
current message. This way, we also ensure that all simultaneous updates within one
looper message iteration are reported together.

Issue:#3498

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187180342
2018-03-02 09:05:19 +00:00
olly
322e15f63b Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187165173
2018-03-02 09:02:35 +00:00
Oliver Woodman
aa57062199 Restore equivalence 2018-02-27 13:57:18 +00:00
ojw28
51405c9959
Merge pull request #3863 from drhill/dev-v2_mkvDIVX
add h263 format support in fourcc codecID
2018-02-27 11:24:44 +00:00
ojw28
dc34ff2e6b
Merge pull request #3771 from reudismam/dev-v2
Use the pattern "string literal".equals(something) to prevent NPE …
2018-02-27 11:24:29 +00:00
ojw28
932abaf0bc
Merge pull request #3887 from CoryCharlton/dev-v2
Add abstract logging methods to EventLogger
2018-02-27 11:24:12 +00:00
tonihei
b47fb2826b Move extension tests to Robolectric.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187021822
2018-02-27 11:03:50 +00:00
olly
099cc384a8 Move scheduler into its own top level package
The util package is, in practice, for things that are misc enough
to not warrant their own package. If something is deserving of a
package, it's IMO best placed somewhere else (I know you could
argue it's a util, but you could argue that about almost anything
else as well).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187010018
2018-02-26 15:41:18 +00:00
olly
0de6bb28a2 Fix broken Javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186999051
2018-02-26 15:41:18 +00:00
olly
f2f5aac7c5 Allow audio position to jump on first input buffer
Allow the position to jump on receiving the first presentable input buffer,
if and only if the buffer timestamp differs significantly from what was
expected. This prevents a stuck buffering case for streams that are thought
to start at t=0, but actually start at t=large_value.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186990214
2018-02-26 15:41:18 +00:00
Cory Charlton
9f2d53dc21 Fixed the Log.d call in loge 2018-02-23 09:15:14 -08:00
Cory Charlton
afd81146f5 Add abstract logging methods to EventLogger 2018-02-22 13:47:10 -08:00
olly
e3d4464635 Drop EMSG atoms before MOOV
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186454715
2018-02-21 23:40:48 +00:00
olly
44f683e04e Fix robolectric tests when running with gradle
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186291489
2018-02-20 14:32:34 +00:00
Drew Hill
eae1606b90 comment and newline cleanup 2018-02-19 16:57:54 -05:00
olly
69496eb17e Bump to 2.7.0 and prepare release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186200840
2018-02-19 13:24:51 +00:00
tonihei
2406785160 Move DownloadManagerTest to Robolectric.
The waiting for a ConditionVariable to be false was replaced by a
CountDownLatch whose count is asserted to be one. The timeout of a
ConditionVariable doesn't work in Robolectric unless someone is
manually increasing the SystemClock time.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186003125
2018-02-19 13:23:32 +00:00
andrewlewis
6c3b677ddb Catch exceptions in all IMA callbacks
If an exception is thrown in an IMA callback it crashes the process with lots of
logging from WebView (including several stack traces, etc.). This change wraps
ImaAdsLoader code that might throw, skips any remaining ads (as the errors are
not recoverable, in general) and notifies a new load error callback so that the
application can implement its own handling. The intention is to make the loader
robust to unexpected requests from IMA and avoid crashes.

Also handle IMA loading an ad in an ad group that has no available ads. In rare
cases IMA will try to load an ad for which an error was previously notified, so
this drops those load requests allowing playback of the content to continue.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185985850
2018-02-19 13:20:15 +00:00
Drew Hill
9e340291de mkv h263 CR changes 2018-02-18 16:53:56 -05:00
Drew Hill
25c241e5bc add h263 format support in fourcc codecID 2018-02-17 13:08:14 -05:00
aquilescanta
8ffd40ab9a Add little endian and 14-bit mode support for DtsReader
Issue:#3340

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185973510
2018-02-16 12:11:46 +00:00
tonihei
67780bfbc2 Add window sequence number to MediaPeriodId.
All media periods are part of a queue of windows buffered and played by
ExoPlayer. When repeating windows, the current MediaPeriodId is insufficient
to distinguish between the repetitions of the same period. This makes it hard
to see to which media period load events belong to, and it is also difficult to
determine whether two media periods belong to the same logical window or
whether they are part of different repetitions of the same window.

Therefore this change adds a unique sequence number to each window in the
sequence of windows and this sequence number is saved as part of the
MediaPeriodId.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185829509
2018-02-16 12:10:25 +00:00
tonihei
6af2a3c9ef Broaden the surface switching workaround to other Moto C+ variants.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185681751
2018-02-16 12:06:23 +00:00
aquilescanta
1d4bc7dda7 Add initial support for EXT-X-GAP
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185676652
2018-02-16 12:03:49 +00:00
eguven
c8e950537d Run DownloadManager on a custom thread while testing
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185674707
2018-02-16 12:02:36 +00:00
olly
55f2b09340 Use stable order for subtitle buffers with identical timestamps
Issue: #3782

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185673731
2018-02-16 12:01:19 +00:00
aquilescanta
115d199532 Fix CeaUtil's invalid SeiMessage skipping
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185673454
2018-02-16 12:00:05 +00:00
aquilescanta
4d26b316cc Make ID3 GEOB frames parsing more robust
Issue:#3792

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185668919
2018-02-16 11:58:52 +00:00
tonihei
09de29d534 Add Meizu M5C, Lenovo K4 Note, and Sony Xperia E5 to surface workaround.
Also added comments for all existing devices for easier reference.

Issue:#3835
Issue:#3236

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185661900
2018-02-16 11:56:08 +00:00
andrewlewis
5b6344a006 Skip ads for which the media failed to prepare
Also make ad group skipping more robust. After calling onError for an ad, IMA
will sometimes trigger an ad group load error, so this needs to be handled in a
way that allows some ads to be loaded already for the ad group.

This change also fixes calculation of the expected ad index to take into account
whether the position is being faked to trigger loading an ad or is the actual
player position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185655844
2018-02-16 11:55:02 +00:00
andrewlewis
b9f9232b9d Release Extractors on the loading thread
Releasing the player released the internal playback thread once renderers were
released. Releasing a MediaPeriod queued a Loader.ReleaseTask on the loading
thread which would post back to the playback thread. If the playback thread had
been quit by the time this happened, the release task wouldn't be run.

Release on the loading thread instead of the playback thread. This avoids
needing to block releasing the player until the loading threads have ended, and
ensures that release tasks will run eventually. As part of this change,
ExtractorMediaPeriod's call to Extractor.release will now run on the loading
thread (which means that all Extractor methods are called on that thread) and
other cleanup in ReleaseCallback will run on the loading thread instead of the
playback thread.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185651320
2018-02-16 11:53:51 +00:00
olly
2dab21ab4e Add Y611 to setOutputSurfaceWorkaround
Issue: #3724

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185548632
2018-02-16 11:52:37 +00:00
eguven
73e3e16949 Fix SmoothStreaming manifest url for downloading
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185526653
2018-02-16 11:51:19 +00:00
tonihei
51a88ac59d Add Moto C+ to surface switching workaround.
Issue:#3835

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185501181
2018-02-16 11:50:05 +00:00
olly
77ec24ca58 Translation console import
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185409304
2018-02-16 11:47:49 +00:00
tonihei
c14ef75037 Move (almost all) remaining core library instrumentation tests to Robolectric.
There are 4 tests which can't currently be moved:
 - DownloadManagerTest explicitly uses the main looper which isn't easily
   supported because the test runs on this thread.
 - ContentDataSourceTest uses an AssetFileDescriptor which wraps a
   ParcelFileDescriptor. It seems Robolectric doesn't correctly forward the
   inner wrapped file descriptor leading to NPE.
 - CacheContentIndexTest and SimpleCacheSpanTest both work fine with Gradle
   but fail with seemingly valid test failures on Blaze.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185366678
2018-02-16 11:46:34 +00:00
eguven
fc7a6d2596 Increase character limit for download notification strings
This is requested for Romanian translation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185359071
2018-02-16 11:45:27 +00:00
andrewlewis
ac2f6cbf98 Move two further methods from Timeline to AdPlaybackState
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185138158
2018-02-16 11:43:31 +00:00
eguven
2c2aaf0a4b Make SegmentDownloadAction constructor keys parameter simpler
Removed option to pass null keys parameter.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185134822
2018-02-16 11:42:21 +00:00
tonihei
4916baabf0 Fix bug in media period queue update at dynamic timeline changes.
If the period uid doesn't match, the update procedure currently doesn't
remove the correct periods. This may cause the player to get stuck or to play
the wrong periods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185129503
2018-02-16 11:41:16 +00:00
aquilescanta
a9e11e4107 Extend support of 608 captions in SEI messages
Issue:#3816

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185124378
2018-02-16 11:40:20 +00:00
andrewlewis
34a318d348 Check sys.display-size on Philips ATVs
Device models are from
https://support.google.com/googleplay/answer/1727131?hl=en. It looks like among
these devices Build.MANUFACTURER can be set to either "PHILIPS" or "Philips",
based on looking at internal bug reports.

Issue: #3807

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185121182
2018-02-16 11:39:15 +00:00
eguven
0e51a77839 Add message parameter to DownloadNotificationUtil.createNotification
DownloadNotificationUtil should not use getData().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185002149
2018-02-16 11:38:11 +00:00
andrewlewis
6fc70149b5 Fix ad group skipping
Allow skipping an ad group when requested by IMA, even if we aren't currently
playing one, to handle cases where no ads in an ad group will load (so IMA
requests resuming content but we never managed to start playing an ad).

Use the known ad group index (rather than the expected one) when handling ad
group load errors. This ensures we skip the right ad group if we notify IMA of
playback errors for every ad in the ad group, then IMA notifies that the ad
group is empty via a load error.

Also make some other miscellaneous small fixes to ads code:

- Avoid warning about unexpected ad group indices more than once.
- Output a warning if the ad count in an ad group decreases.
- Remove unnecessary assertion.
- Fix getting the ad duration for ad indices that haven't loaded yet.
- Allow setting an ad group state to its current value.
- Fix javadoc for setting the ad resume position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184831495
2018-02-08 14:49:00 +00:00