2907 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
aquilescanta
2ad87f4f5b Add time unit and javadocs to fields in DashManifest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176335667
2017-12-12 20:46:38 +00:00
aquilescanta
dc425a942c Use consistent case for sideloaded
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176333544
2017-12-12 20:46:29 +00:00
hoangtc
09f3055bad Add Builder to SingleSampleMediaSource.
Add Builder pattern to SingleSampleMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176332964
2017-12-12 20:46:14 +00:00
olly
1b7c950d1e Add MediaSourceTestRunner for MediaSource tests.
- MediaSourceTestRunner aims to encapsulate some of the logic
  currently used in DynamicConcatenatingMediaSourceTest, so it
  can be re-used for testing other MediaSource implementations.
- The change also fixes DynamicConcatenatingMediaSourceTest to
  execute calls on the correct threads, and to release handler
  threads at the end of each test.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176117535
2017-12-12 20:45:07 +00:00
olly
14299e0643 Simplify LoopingMediaSourceTest setup
This test seems to obtain a timeline from a prepared
FakeMediaSource, but that's identical to the timeline
passed into that source to start with :).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176117133
2017-12-12 20:44:59 +00:00
tonihei
bb4be4314a Add simplified FakeTimeline constructor.
This is helpful for tests which don't care about detailled timeline set-ups
besides the number of windows.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176097369
2017-12-12 20:44:38 +00:00
hoangtc
1f70d3cdd7 Add Builder to ExtractorMediaSource.
Add Builder pattern to ExtractorMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176088810
2017-12-12 20:44:19 +00:00
olly
f5a3a27726 Deduplicate ExtractorMediaPeriod discontinuity reporting
This change makes sure progress is being made before reporting
a discontinuity. Else in cases like having no network and
playing a live stream, we allow the discontinuity to be read
each time an internal retry occurs, meaning it gets read
repeatedly. This does no harm, but is noisy and unnecessary.

We should also not allow skipping whilst there is a pending
reset or discontinuity notification, just like we don't allow
reads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175953064
2017-12-12 20:42:49 +00:00
andrewlewis
820a445944 Add support for float output for FfmpegAudioRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175940553
2017-12-12 20:42:34 +00:00
andrewlewis
108900cf52 Add support for float output in DefaultAudioSink
Also switch from using MIME types to C.ENCODING_* encodings in DefaultAudioSink.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175936872
2017-12-12 20:41:27 +00:00
andrewlewis
d49fc54968 Use ArrayDeque for playback parameters checkpoints
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175837754
2017-12-12 20:40:01 +00:00