3904 Commits

Author SHA1 Message Date
andrewlewis
7fe5230a7e Use gapless edit duration as sample table duration
This matches the non-gapless case.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213462936
2018-09-20 12:22:43 +01:00
andrewlewis
e4f41880bd Add E-AC3 Ac3Extractor sample and test
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213451163
2018-09-20 12:21:13 +01:00
aquilescanta
bca2f5c3a0 Fix Ac3 extractor sniffing for E-AC-3 frames
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213443047
2018-09-20 12:19:43 +01:00
tonihei
a92344ac9e Log warning with stack trace if player is accessed from the wrong thread.
This doesn't break apps which violate this policy. But it creates a clear
warning which is also likely to be reported in analytics tools.

Issue:#4463

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213442510
2018-09-20 12:18:15 +01:00
aquilescanta
db33b3bbd1 Allow HlsSampleStreamWrapper to cancel partial media chunk loads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213439145
2018-09-20 12:16:47 +01:00
tonihei
decbb33490 Add super-simple SimpleExoPlayer factory method.
The DefaultTrackSelector can now be constructed without leaving out a
vital part of the initialization. This allows this new simple factory method.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213438163
2018-09-20 12:15:19 +01:00
aquilescanta
a89645d092 For HLS segment sniffing, fall back on extractor creation by file extension
This reduces the possiblity of regressions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213436912
2018-09-20 12:13:50 +01:00
tonihei
e25b7d2148 Add wrapper for Log messages to allow settig the log level.
Currently there is no way to disable (or reduce) the logcat output generated
by ExoPlayer.

Issue:#4665

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213421072
2018-09-20 12:12:21 +01:00
aquilescanta
c9e4f6b429 Make HlsMediaSource.Factory take a factory of trackers instead of an instance
This allows creating multiple HLS media sources from a single Factory, as
required by the interface.

Issue:#4814

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213297850
2018-09-20 12:10:53 +01:00
olly
b09e36dcb7 SmoothStreaming: Test for fourCC equal to DFXP
Issue: #4824

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213285790
2018-09-17 17:58:03 +01:00
tonihei
585806de24 Clarify doc of components which only allow a main thread player.
ExoPlayer can be run on a background thread, but some components (UI and IMA)
only support players on the main thread. This adds some documentation and
assertions for that.

To simplify assertions, this also moves the getApplicationLooper method from
ExoPlayer to Player.

Issue:#4439

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213280359
2018-09-17 17:56:36 +01:00
tonihei
c18ee3f96d Add some missing @Nullable to public API to improve Kotlin compatiblity.
Kotlin will throw NPE whenever a method returns null or an interface is
called with a null parameter and the respective values are not marked as
@Nullable.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213262886
2018-09-17 17:55:03 +01:00
aquilescanta
76255dfae7 Make ExtractorsFactory javadoc consistent
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213248388
2018-09-17 17:53:30 +01:00
tonihei
d1df41a39e Fix window index comparison.
To check the validity of a window index it needs to be compared with a greater
or equal sign to the window count.

Issue:#4822

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213234403
2018-09-17 17:50:20 +01:00
aquilescanta
caa46d49e5 Explicitly document empty range removal in Util.removeRange.
Also prevent an unnecessary allocation when the removed range is empty.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212993427
2018-09-17 17:48:45 +01:00
tonihei
1284f9ea4d Add Nullable to message payload.
Not having this annotation may cause Kotlin implementations to fail.

Issue:#4802

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212980643
2018-09-17 17:47:11 +01:00
olly
6f6f381beb Fix audio and text track selection in the multi-renderer case
If we can select a track that has a strictly higher score than a
selection already made for a renderer of the same type, we should
prefer it.

Issue: #4711

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212835895
2018-09-13 18:44:53 +01:00
aquilescanta
3e4115ff3c No-op ConcatenatingMediaSource simplification
- Make addMediaSource a specific case of addMediaSources.
- Make clear a specific case of removeMediaSourceRange.
- Make removeMediaSource a specific case of removeMediaSourceRange.
- Remove the unnecessary message handling and constants.
- Move a method so that depending appears before depended.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212809667
2018-09-13 18:43:26 +01:00
olly
b17d49ed27 Add nullness annotations to a few more files
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212644046
2018-09-13 18:40:17 +01:00
olly
b4dfed874d Enable GZIP for SingleSampleMediaSource
Issue: #4771

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212623142
2018-09-12 15:32:14 +01:00
olly
a5a7e988e3 Clip DASH periods to their durations
Issue: #4185

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212619419
2018-09-12 15:30:47 +01:00
andrewlewis
35c230f3c6 Allow partial format for adaptation check
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212443793
2018-09-12 15:25:56 +01:00
tonihei
b1d48179e8 Add support to change shuffle order after playlist creation.
This allows to update the shuffle order after the ConcatenatingMediaSource
has been created. ShuffleOrder objects should be immutable to ensure thread
safety and thus there is no way to do this currently.

Issue:#4791

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212443146
2018-09-12 15:24:23 +01:00
olly
b31438b670 Clean up downstream format notification for ChunkSampleStream
- Fixes the referenced issue.
- Provides more consistent behavior for the edge case of empty
  chunks (i.e. chunks containing now samples). Format changes
  will now always be reported for such chunks, unless the empty
  chunk is discarded from upstream before there's a chance to
  do so.

Issue: #4533

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212443043
2018-09-12 15:22:47 +01:00
tonihei
21c5b0bf67 Add missing AudioSink discontinuity for stream changes.
When the stream is changed in the audio renderer, the timestamps of the
samples can no longer be expected to match the calculations in the AudioSink.

This change tracks the samples at which the stream is changed and notifies the
AudioSink of the discontinuity.

Issue:#4559
Issue:#3829

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212435859
2018-09-12 15:20:40 +01:00
olly
a083c29f7e Don't discard when a reset is pending
When a reset is pending the sample queues normally contain pre-seek
samples (which will be emptied when a pending load is canceled). The
position passed to discard will be a post-seek position. I don't
think anything bad happened in any of the cases being changed, but
discarding is unnecessary in such cases, and reasoning about such
cases is difficult.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212435556
2018-09-12 15:18:56 +01:00
olly
46af49e282 Clean up easy cases of downstream format notification
- This makes it so that onDownstreamFormatChanged will occur before the corresponding
  renderer event. This was not previously the case, since the renderer would typically
  read the format (and report its event), then a sample (causing the
  onDownstreamFormatChanged event).
- The remaining ones to update are ChunkSampleStream (DASH + HLS), which will be done
  in a way that fixes #4533, and HLS.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212434874
2018-09-12 15:17:19 +01:00
olly
6c3c71b554 Fix SampleQueue splicing when sampleOffsetUs != 0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212432661
2018-09-12 15:15:41 +01:00
olly
ba8c22aba5 Make seeking when there's a pending reset more obviously correct
If there's already a pending reset, we need only update the pending
reset position. We can currently end up calling cancelLoading more
than once on the loader for the same task, which is hard to reason
about (although I don't think anything actually broke in practice).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212432266
2018-09-12 15:14:02 +01:00
tonihei
72efc80037 Correct timescale of edit list duration parsing for stbl atoms.
We currently apply the track.timescale whereas we should be applying the
track.movieTimescale. The parsing for the trak atom does this correctly
and the duration from the trak atom currently always takes precedence over the
durations from the stbl atoms as it's always larger.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212421687
2018-09-12 15:12:20 +01:00
andrewlewis
be11369966 Remove UnhandledEditListException
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212303130
2018-09-12 15:10:44 +01:00
tonihei
bf0a7937e2 Fix util nullness warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212276150
2018-09-12 15:09:09 +01:00
andrewlewis
09aaec6b01 Add proguard configuration for download actions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212266041
2018-09-12 15:07:31 +01:00
tonihei
95aa5db148 Reenable edit lists without keyframe again but remove samples before keyframe.
Ignoring all edit lists if they don't start with a keyframe causes A/V sync
issues when valid edit lists are applied at the beginning.

This change allows such edit lists again but removes all samples before the
first keyframe (these samples would be ignored by the renderer anyway if at
the beginning OR cause visible distortions when appended to an unrelated
keyframe).

Issue:#4774
Issue:#4348

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212244407
2018-09-12 15:05:53 +01:00
tonihei
1a80097308 Fix NPE in FrameworkMediaDrm.
Currently causing GTS tests to fail.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212244198
2018-09-12 15:04:24 +01:00
aquilescanta
b14e0935b1 Add container format sniffing in HLS
Issue:#2025

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211977802
2018-09-12 15:02:57 +01:00
olly
cb5c78917c Simplify notification of downstream format change for embedded track
- There's no particular need to read or skip a sample before notifying
- Add missing isPendingReset check

Issue: #4533

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211959762
2018-09-12 15:00:01 +01:00
olly
38386c480a Be explicit about character set.
The default character set is always UTF-8 anyway on Android, but
we don't want our code to behave any differently where it's not
(e.g. robolectric test runs could potentially run in an environment
where UTF-8 isn't the default?).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211953885
2018-09-12 14:58:33 +01:00
tonihei
77a529f0ed Add static Util.EMPTY_BYTE_ARRAY
This prevents repeated instantiation of empty arrays.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211941723
2018-09-12 14:57:01 +01:00
josephmarques
aa7134d538 Adds support for the messageData attribute of the Event element in DASH MPDs for ExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211854408
2018-09-12 14:55:34 +01:00
aquilescanta
f47f1b9f4b Remove BOM check in Webvtt header checks
Reverts the BOM check changes in []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211826731
2018-09-12 14:54:06 +01:00
tonihei
67a2bb3d28 Fix various period preparation and source info refresh error throwing issues
1. Currently, we may throw source info refresh errors while the previous media
   period is still playing.
2. We don't throw if the next period in a playlist fails to prepare and the
   previous renderers are all disabled.
3. We throw source info refresh errors for playlists before playback reaches
   the culprit source.

This change:
1. Defers the exceptions until all existing media periods have been played.
2. Checks for period preparation exception if the next period is not
   getting prepared and the renderer time reached the next period.
3. Does no longer throw from ConcatenatingMediaSource.maybeThrowSourceInfo
   RefreshError. The deferred media periods take care of that for each source
   individually.

Issue:#4661

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211819436
2018-09-12 14:52:33 +01:00
Nicklas Lundin
14f7b6111b Added setMaxFrameRate to ParametersBuilder 2018-09-06 16:17:27 +02:00
olly
502fae7cd4 Bump version to 2.9.0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211792952
2018-09-06 13:47:59 +01:00
olly
c3c309b8a8 Blacklist OMX.SEC.mp3.dec on SM-T530
Issue: #4519

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211646358
2018-09-06 12:04:48 +01:00
bachinger
0e12eb4d92 Dispatch notification actions to the originating PlayerNotificationManager only.
Issue #4643

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211613803
2018-09-06 12:00:55 +01:00
Nicklas Lundin
4c0041f936 added maxFrameRate to the filtering done when selecting a fixed video track 2018-09-06 11:13:03 +02:00
Nicklas Lundin
4f834e7e1a added maxFrameRate to parameters and use it in the adaptive track selection filtering 2018-09-06 11:11:59 +02:00
olly
c57fe1897c Add ExoPlayer.retry convenience method
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211463309
2018-09-05 12:33:28 +01:00
aquilescanta
7959a691ad Add sniffing to WebvttExtractor
Preparation for sniffing in HLS

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211455454
2018-09-05 12:31:06 +01:00