3894 Commits

Author SHA1 Message Date
andrewlewis
f2f767bc12 Invoke onLoadCanceled/Completed for ExtractorMediaSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177936271
2017-12-12 18:36:26 +00:00
aquilescanta
f0e9dbf148 Fix HLS (broken on []
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177922948
2017-12-12 18:34:48 +00:00
andrewlewis
59f6b059b0 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 18:33:15 +00:00
amesbah
b3ebdaaed3 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 18:31:43 +00:00
aquilescanta
002df729a5 Allow late HLS sample queue building
Issue:#3149

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177836048
2017-12-12 18:30:00 +00:00
olly
fbfa43f5a3 Enhance SeekMaps to return SeekPoints
Issue: #2882

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177814974
2017-12-04 17:39:43 +00:00
olly
bb0fae3ee8 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-04 17:39:43 +00:00
andrewlewis
7792f667d4 Fix setting supported ad MIME types without preloading
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177810991
2017-12-04 17:39:43 +00:00
olly
9c63d37791 Support timezone offsets in ISO8601 timestamps
Issue: #3524

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177808106
2017-12-04 17:39:43 +00:00
olly
a9c3ca1cfe Tentative fix for roll-up row count
Issue: #3513

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177804505
2017-12-04 17:38:11 +00:00
andrewlewis
fd938fb454 Update internal usages of deprecated AdaptiveMediaSourceEventListener
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177786580
2017-12-04 17:38:11 +00:00
andrewlewis
fbccdf594a 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-04 17:38:11 +00:00
tonihei
03b0d9d46c Fix flaky testEmptyTimeline again.
Waiting for the timeline change didn't work correctly because the timeline was
already equal to Timeline.EMPTY (due to the masking). Now waiting explicitly
for the empty Timeline exposed by the source.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177749292
2017-12-04 17:38:11 +00:00
tonihei
80fff0b7ce Discard buffer in FakeExoPlayer.
This is in line with a recent change in ExoPlayerImplInternal. Not discarding the buffer
causes OOM when running simulated playbacks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177573930
2017-12-04 17:38:11 +00:00
aquilescanta
23cc102151 Move internal HlsSampleStreamWrapper methods under internal methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177462449
2017-12-04 17:38:11 +00:00
olly
3a6b7a346c Fix mp3 extractor test
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177458840
2017-12-04 17:38:11 +00:00
olly
754260e944 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-04 17:38:11 +00:00
tonihei
e28adb00ff Use Handler to post action schedule finished callback.
Calling it directly might skip other callbacks. For example:
ActionSchedule.Builder().waitForTimelineChanged(...).build().
is currently immediately calling through to
callback.onActionScheduleFinished when the timeline changes.
Depending on the position of the action schedule listener in the
listener set, it may skip other listeners also
listening to timeline changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177442975
2017-12-04 17:38:11 +00:00
andrewlewis
7b08899818 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-04 17:38:11 +00:00
olly
cc54d4d3e6 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-04 17:38:11 +00:00
aquilescanta
21d55d4eba Rename DefaultTrackSelector.ParameterBuilder.setViewportSize{FromContext->ToPhysicalDisplaySize}
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177440699
2017-12-04 17:38:11 +00:00
aquilescanta
58e60e1f9d Use the Builder pattern for DefaultTrackSelector#Parameters
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177438430
2017-12-04 17:38:11 +00:00
aquilescanta
ce8736c71a Avoid concurrent read/write access to sampleQueues in HlsSampleStreamWrapper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177435977
2017-12-04 17:38:11 +00:00
tonihei
ef8fa28163 Use VideoRendererEventListener to resolve unknown resolution.
Some streams don't have the new video resolution in the primary format.
Use the subsequent call to videoListener.onVideoInputFormatChanged to
resolve this unknown resolution.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177433618
2017-12-04 17:38:11 +00:00
andrewlewis
a367ae0d2b 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-04 17:38:11 +00:00
andrewlewis
a9c33590df Update getPosition(0) positions for FragmentedMp4Extractor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177424314
2017-12-04 17:38:11 +00:00
andrewlewis
5865f1fe40 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-04 17:38:11 +00:00
andrewlewis
882d698d5f Log load errors from AdsMediaSource in the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177419981
2017-12-04 17:38:11 +00:00
mdoucleff
079a5b3d8c 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-04 17:38:11 +00:00
hoangtc
3afdb24f25 Add support for outputing Emsg messages to a sideloaded track output.
Currently FragmentedMp4Extractor only parses and outputs emsg messages if the
flag FLAG_ENABLE_EMSG_TRACK is set (when there's a metadata renderer that
handles emsg messages). Since there are emsg messages that only targets the
player, which we want to handle independently from MetadateRenderer, this CL
adds the ability for FragmentedMp4Extractor to output emsg messages to an
additional TrackOutput if provided, independently from FLAG_ENABLED_EMSG_TRACK.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177318983
2017-12-04 17:38:11 +00:00
olly
a99ef01d3a 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-04 17:38:11 +00:00
olly
21ea9a821d 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-04 17:38:11 +00:00
tonihei
835b6382ac Move external timeline and start position overwrites to ExoPlayerImpl.
Makes it less error-prone to accidentatly forget to set the right overwrites.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177282089
2017-12-04 17:38:11 +00:00
tonihei
9e8f50a9c0 Allow multiple video and audio debug listeners in SimpleExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177184331
2017-12-04 17:38:11 +00:00
andrewlewis
2282527821 Allow setting supported formats on AdsLoaders
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177175377
2017-12-04 17:38:11 +00:00
olly
ff49bc97c4 Clean up some extrator SeekMap implementations
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177173618
2017-12-04 17:38:11 +00:00
aquilescanta
baa80a1b68 Fix DefaultTrackSelector#Parameter withSelectUndeterminedTextLanguage
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177170994
2017-12-04 17:38:11 +00:00
tonihei
54a1bb186e Allow resetInternal to release MediaSource but keep timeline.
This allows to keep the state synced with ExoPlayerImpl after stopping the player,
but still releases the media source immediately as it needs to be reprepared.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177167980
2017-12-04 17:38:11 +00:00
olly
f2d5541752 Extractor cleanup
- Align class summary Javadoc
- Fix ErrorProne + Style warnings

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177165593
2017-12-04 17:38:11 +00:00
aquilescanta
69f8b250d5 Match SequenceableLoader method order in HlsSampleStreamWrapper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177146923
2017-12-04 17:38:11 +00:00
aquilescanta
20567633a0 Add queue manipulation to the Cast demo
Against all odds, samples can be reordered by using drag & drop.

Issue:#1706
Issue:#2283

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177145553
2017-12-04 17:38:11 +00:00
tonihei
efc709f366 Remove initial seek counting in ExoPlayerImplInternal.
We can acknoledge seeks before preparation finished immediately now,
because ExoPlayerImpl won't leave the masking state until the first prepare
operation is processed.

As a side effect, it also cleans up the responsibility of the callbacks.
Prepares are always acknowledged with a SOURCE_INFO_REFRESHED, while seeks
are always acknowledged with a SEEK_ACK.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177144089
2017-12-04 17:38:11 +00:00
olly
1ae50cb9e5 Add some clarifications to MediaSource documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177141094
2017-12-04 17:38:11 +00:00
tonihei
f46cb907b7 Add stop with position reset to Player interface.
The ExoPlayerImpl implementation forwards the stop request with this optional
parameter. To ensure correct masking (e.g. when timeline updates arrive after
calling reset in ExoPlayerImpl but before resetInternal in
ExoPlayerImplInternal), we use the existing prepareAck counter and extend it
also count stop operations. For this to work, we also return the updated
empty timeline after finishing the reset.

The CastPlayer doesn't support the two reset options so far.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177132107
2017-12-04 17:38:11 +00:00
olly
d84398788a Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177063576
2017-12-04 17:38:10 +00:00
ojw28
de96bb5e4f
Merge pull request #3545 from pstambrecht/feature/iso8601-parser-2
Feature/iso8601 parser 2
2017-12-04 15:02:35 +00:00
Pavel Stambrecht
28d709aa8f Iso8601Parser improved to be able to parse timestamp offsets from UTC 2017-12-04 15:52:12 +01:00
Pavel Stambrecht
ad16efdf56 Iso8601Parser improved to be able to parse timestamp offsets from UTC 2017-12-04 15:45:54 +01:00
ojw28
117608edef
Update ISSUE_TEMPLATE 2017-11-28 17:02:04 +00:00
olly
a0f6bba842 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-11-27 21:29:14 +00:00