4334 Commits

Author SHA1 Message Date
andrewlewis
e7d4524c27 Use mappedTrackInfo local
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178216750
2017-12-12 21:49:29 +00:00
olly
39e8f07566 Add missing Nullable annotation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178117289
2017-12-12 21:49:22 +00:00
olly
02e32a1838 Hide subtitles when switching player in SimpleExoPlayerView
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177941993
2017-12-12 21:48:59 +00:00
olly
9cb0c2f702 Remove self @link
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177938212
2017-12-12 21:48:54 +00:00
andrewlewis
3c0bb7263b Invoke onLoadCanceled/Completed for ExtractorMediaSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177936271
2017-12-12 21:48:47 +00:00
andrewlewis
82122b9f3b Make one ad request in ImaAdsLoader
This fixes an issue where quickly detaching and reattaching the player might
cause ads to be requested multiple times with both responses handled.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177922167
2017-12-12 21:48:27 +00:00
amesbah
aef9063e94 Add @SuppressWarnings("ComparableType") for instances of a class implementing 'Comparable<T>' where T is not compatible with the type of the class.
In order to facilitate enabling a compile-time error check, we are suppressing these existing instances. Once the compile-time error is enabled, we will file bugs to clean up any unfixed instances in [].

Note that this CL should result in no effective changes to the code, but the code as currently-written might contain a real bug. If you'd prefer to fix the bug now, please either reply with edits, or accept this CL then follow up with a change that fixes the underlying issue.

Tested:
    tap_presubmit: []    Some tests failed; test failures are believed to be unrelated to this CL

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177836122
2017-12-12 21:48:16 +00:00
olly
13a7037c82 Fix playback of FLV live streams with no audio track
Issue: #3188

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177811487
2017-12-12 21:48:01 +00:00
andrewlewis
bc7bfb4e7c Fix setting supported ad MIME types without preloading
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177810991
2017-12-12 21:47:55 +00:00
olly
29f6351b19 Support timezone offsets in ISO8601 timestamps
Issue: #3524

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177808106
2017-12-12 21:47:45 +00:00
olly
a8298b4c56 Tentative fix for roll-up row count
Issue: #3513

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177804505
2017-12-12 21:46:33 +00:00
Oliver Woodman
10b24be6f0 Fix build 2017-12-12 21:46:02 +00:00
andrewlewis
e759462af8 Update internal usages of deprecated AdaptiveMediaSourceEventListener
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177786580
2017-12-12 21:40:21 +00:00
andrewlewis
393a762563 Use AdaptiveMediaSourceEventListener for ExtractorMediaSource
This is a step towards harmonizing the MediaSource Builders and (potentially)
providing MediaSource factories.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177783157
2017-12-12 21:33:59 +00:00
olly
b61d09c416 Fix mp3 extractor test
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177458840
2017-12-12 21:33:40 +00:00
olly
0ea8c8bfa0 Fix VBRI and XING seekers
- Remove skipping of the VBRI/XING frame before calculating position
  offsets. This was incorrect. Instead, a constraint is used to ensure
  we don't return positions within these frames, the difference being
  that the constraint adjusts only positions that would fall within
  the frames, where-as the previous approach shifted positions through
  the whole stream.
- Excluded last entry in the VBRI table because it has an invalid
  position (the length of the stream).
- Give variables in XingSeeker descriptive names.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177451295
2017-12-12 21:33:34 +00:00
andrewlewis
022b85a625 Move resetting audio processors to initialize()
The set of active audio processors was only updated on reconfiguration and when
draining playback parameters completed. Draining playback parameters are cleared
in reset(), so if parameters were set while paused then the sink was quickly
reset, without draining completing, the set of active audio processors wouldn't
be updated. This means that a switch to or from speed or pitch = 1 would not be
handled correctly if made while paused and followed by a seek.

Move resetting active audio processors from configure (where if the active audio
processors were reset we'd always initialize a new AudioTrack) to initialize().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177442098
2017-12-12 21:33:18 +00:00
olly
8fbc2a5c9b Snap to frame boundary in ConstantBitrateSeeker
- This change snaps the seek position for constant bitrate MP3s
  to the nearest frame boundary, avoiding the need to skip one
  byte at a time to re-synchronize (this may still happen if the
  MP3 does not really have fixed size frames).
- Tweaked both ConstantBitrateSeeker and WavHeader to ensure the
  returned positions are valid.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177441798
2017-12-12 21:32:40 +00:00
andrewlewis
4e8b9282f5 Add a notice that NDK <= version 15c is required for VP9
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177430827
2017-12-12 21:31:26 +00:00
andrewlewis
315a6c3558 Update getPosition(0) positions for FragmentedMp4Extractor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177424314
2017-12-12 21:31:17 +00:00
andrewlewis
9526e8586a Use a MediaSource factory internally in AdsMediaSource
Support ad MediaSources that aren't prepared immediately by using
DeferredMediaPeriod, moved up from DynamicConcatenatingMediaSource.

In a later change the new interfaces will be made public so that apps
can provide their own MediaSource factories.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177424172
2017-12-12 21:31:02 +00:00
andrewlewis
2567bf51fc Log load errors from AdsMediaSource in the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177419981
2017-12-12 21:28:52 +00:00
mdoucleff
f0f726dfa9 Add manifestless captions support. This code fits into the pre-existing
captions fetcher architecture.

1.  ManifestlessCaptionsMetadata

Other captions fetchers must first fetch a manifest (HLS or manifest) to
discover captions tracks.  This process does not exist for manifestless.  All
we need to do is scan the FormatStream's for the right itag, so this is an
all-static class.

2.  ManifestlessSubtitleWindowProvider

Once a captions track is selected, a subtitles provider is instantiated.  This
is the main interface used by the player to retrieve captions according to
playback position.  This class stores fetched captions in a tree index by time
for efficient lookups.  Background captions fetches are used to populate
the tree.

3.  ManifestlessCaptionsFetch

Captions are fetched one segment at a time.  One instance of this object
is required per fetch.  It performs a blocking fetch on call(), and is
intended to be submitted to a background-thread executor.

4.  ManifestlessCaptionsFetch.CaptionSegment

This is the result of the caption fetch.  These values are used to populate
the captions tree.

Manifestlessness

The initial request is always a headm request.  There is a separate tree
of every segment indexed by start time.  This tree is used to improve
manifestless sequence number calculation.  Once we have data for the current
timestamp, we walk forward through the tree to find the next unfetched
sequence number, and fetch that.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177385094
2017-12-12 21:28:45 +00:00
olly
800cfeea3d Optimize seeking for unseekable SeekMaps
- Avoid re-downloading data prior to the first mdat box when
  seeking back to the start of an unseekable FMP4.
- Avoid re-downloading data prior to the first frame for
  constant bitrate MP3.
- Update SeekMap.getPosition documentation to allow a non-zero
  position for the unseekable case. Note that XingSeeker was
  already returning a non-zero position if unseekable.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177317256
2017-12-12 21:28:28 +00:00
olly
91b324f6b9 Fix weird XingSeeker indexing
There are still things broken about the seeker, but this
cleans up some of the weird bits.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177315136
2017-12-12 21:28:22 +00:00
tonihei
63dbf56b6c Allow multiple video and audio debug listeners in SimpleExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177184331
2017-12-12 21:28:05 +00:00
andrewlewis
c12349e2c9 Allow setting supported formats on AdsLoaders
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177175377
2017-12-12 21:27:53 +00:00
olly
9eed1150e0 Clean up some extrator SeekMap implementations
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177173618
2017-12-12 21:27:31 +00:00
aquilescanta
a8d4ad94f4 Fix DefaultTrackSelector#Parameter withSelectUndeterminedTextLanguage
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177170994
2017-12-12 21:27:24 +00:00
olly
0e0300b802 Extractor cleanup
- Align class summary Javadoc
- Fix ErrorProne + Style warnings

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177165593
2017-12-12 21:26:36 +00:00
olly
7a03198028 Add some clarifications to MediaSource documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177141094
2017-12-12 21:26:07 +00:00
olly
1d96492c1e Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177063576
2017-12-12 21:25:47 +00:00
Pavel Stambrecht
ee05b60a19 Iso8601Parser improved to be able to parse timestamp offsets from UTC 2017-12-12 21:25:35 +00:00
Pavel Stambrecht
e175bf9e42 Iso8601Parser improved to be able to parse timestamp offsets from UTC 2017-12-12 21:25:29 +00:00
ojw28
d3fd2d1b87 Update ISSUE_TEMPLATE 2017-12-12 21:25:20 +00:00
olly
23a7f2d994 Force wrapping of HLS ID3 timestamp
Merge of https://github.com/google/ExoPlayer/pull/3495

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177057183
2017-12-12 21:25:10 +00:00
tonihei
1861aea2b3 Add throws IllegalSeekPositionException doc to seekTo(windowIndex, positionMs).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177011497
2017-12-12 21:24:39 +00:00
aquilescanta
c1c892f5ec Support undefined text track language when preferred is not available
Also slightly improve language normalization/documentation.

For this CL, it is assumed that null and "und" languages are different
entities. Once we fully tackle language tag normalization, we can decide
whether to normalize the "undefined" language.

Issue:#2867
Issue:#2980

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177008509
2017-12-12 21:23:25 +00:00
tonihei
ce557b11fc Add final to boolean used within Runnable.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176997767
2017-12-12 21:21:45 +00:00
tonihei
86d91a59a0 Remove race condition when stopping FakeExoPlayer.
A message to stop the playback and to quit the playback thread was posted in release().
The stop message removed all other already queued messages which might include
the second message to quit the thread. That led to infinite waiting in the
release method because the playback thread never got the quit signal.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176997104
2017-12-12 21:21:38 +00:00
andrewlewis
6c1f562230 Switch from currentTimeMillis to elapsedRealtime
currentTimeMillis is not guaranteed to be monotonic and elapsedRealtime is
recommend for interval timing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176853118
2017-12-12 21:21:05 +00:00
andrewlewis
b19512fb20 Propagate the player error to ExoPlayerTestRunner
In a test run where no exceptions were thrown on the main thread and the test
did not time out, exceptions from onPlayerError were not correctly propagated to
the test thread (handleException would be called with null).

Fix ExoPlayerTestRunner.onPlayerError to propagate the actual exception from the
player.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176825907
2017-12-12 21:20:29 +00:00
simophin
cf3ab9051d Guard against out-of-range timestamp
We've found that in our production environment, the AAC stream's timestamp exceeds the 33bit limit from time to time, when it happens, `peekId3PrivTimestamp` returns a value that is greater than `TimestampAdjuster.MAX_PTS_PLUS_ONE`, which causes a overflow in `TimestampAdjuster.adjustTsTimestamp` (overflow inside `ptsToUs`) after playing for a while . When the overflow happens, the start time of the stream becomes negative and the playback simply stucks at buffering forever.

I fully understand that the 33bit is a spec requirement, thus I asked our stream provider to correct this mistake. But in the mean time, I'd also like ExoPlayer to handle this situation more error tolerance, as in other platforms (iOS, browsers) we see more tolerance behavior.
2017-12-12 21:20:10 +00:00
olly
d5b79f3a43 Update gradle wrapper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176693785
2017-12-12 21:18:44 +00:00
hoangtc
f2a78adc21 Parse DASH manifest's publish time.
Parse DASH manifest's publishTime node as defined by ISO/IEC 23009-1:2014,
section 5.3.1.2.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176525922
2017-12-12 21:18:20 +00:00
olly
fa5cc5be51 Bump target API level to 27
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366693
2017-12-12 20:49:32 +00:00
olly
5c0e1f3e8a Use MediaSourceTestRunner in additional source tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366471
2017-12-12 20:49:14 +00:00
aquilescanta
7903166886 Allow human readable strings as DRM intent extras.
Issue:#3478

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176351086
2017-12-12 20:48:50 +00:00
andrewlewis
c3b92f8456 Add support for Dolby Atmos
Issue: #2465

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176341309
2017-12-12 20:47:48 +00:00
tonihei
82ce68009c Move MockitoUtils to testutils and use it for all Mockito set-ups.
In particular this allows to have the workaround for
https://code.google.com/p/dexmaker/issues/detail?id=2 in one place only.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176340526
2017-12-12 20:47:13 +00:00