801 Commits

Author SHA1 Message Date
olly
5bed2bf503 Don't copy primary-track format to non-primary tracks
This time plumbing the track type in from the other side.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166898172
2017-08-29 23:17:16 +01:00
olly
d9cd13ce74 Automated rollback of changelist 166843123.
*** Reason for rollback ***

Doesn't work because trackOutputProvider can be null when extracting init data.

*** Original change description ***

Don't copy primary-track format to non-primary tracks

Copying non-primary-track formats to non-primary tracks
looks non-trivial (I tried; went down a dead-end), so
leaving that for now.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166883654
2017-08-29 23:14:33 +01:00
olly
55e928f75a Make LeanbackPlayerAdapter use a ControlDispatcher + Misc cleanup
1. Make LeanbackPlayerAdapter use a ControlDispatcher. This
   allows apps to suppress control events in some circumstances,
   and is in-line with our mobile controls.
2. Misc simplifications and cleanup to LeanbackPlayerAdapter.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166852816
2017-08-29 23:13:13 +01:00
olly
44dc3c3ab3 Make all renderers DRM aware
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166852758
2017-08-29 23:11:55 +01:00
aquilescanta
aafdd2267a Add media queue support to CastPlayer
Also workaround the non-repeatable queue and fix other minor issues.

Issue:#2283

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166848894
2017-08-29 23:09:03 +01:00
olly
f44e30c754 Fix mapping CLEARKEY_UUID to COMMON_PSSH_UUID
This mapping when we call into platform components also needs
to be applied when creating the MediaCrypto instance. The fix
is to stop propagating the UUID through all the createMediaCrypto
methods. This is unnecessary, since the eventual target already
knows its own UUID!

Issue: #3138

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166843372
2017-08-29 23:07:39 +01:00
olly
3e76227006 Don't copy primary-track format to non-primary tracks
Copying non-primary-track formats to non-primary tracks
looks non-trivial (I tried; went down a dead-end), so
leaving that for now.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166843123
2017-08-29 23:06:16 +01:00
andrewlewis
ba6d208fe9 Use Math.abs in Sonic.java
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166820970
2017-08-29 23:04:52 +01:00
eguven
cc58b515b7 Make Downloaders open source
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166486294
2017-08-29 23:03:08 +01:00
tonihei
30b31b5679 Support empty concatenations and empty timelines in concatenations.
Both cases were not supported so far. Added tests which all failed in the
previous code version and adapted the concatenated media sources to cope with
empty timelines and empty concatenations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166480344
2017-08-29 23:01:41 +01:00
olly
6e03dcdfa1 Add LocalMediaDrmCallback. Useful for providing local keys.
Issue: #3178

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166330215
2017-08-29 22:55:51 +01:00
olly
57bad31e4c Update documentation with new demo app location
Plus a few misc doc fixes / adjustments

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166323135
2017-08-29 22:54:26 +01:00
tonihei
eeebb3968b Implement shuffle mode logic in ExoPlayerImplInternal.
This is mostly connecting the already stored shuffleMode with the timeline queries
for the playback order.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166199330
2017-08-29 22:50:49 +01:00
tonihei
f7eba77ee0 Add shuffle support to dynamic concatenating media source.
The media source is initialized with a DefaultShuffleOrder which can be changed at
any time. Whenever the list of media source is changed, the shuffle order is adapted
accordingly (either on the app thread if the player is not prepared yet, or on the
player thread). The shuffle order is then used to construct the timeline.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166198488
2017-08-29 22:48:10 +01:00
tonihei
e15633e906 Add shuffle support to ConcatenatingMediaSource.
The media source is initialized with a DefaultShuffleOrder which can be changed at
any time. This shuffle order is then used within the corresponding timeline.

The isRepeatOneAtomic flag is extended to also suppress shuffling (now called
isAtomic only).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166197184
2017-08-29 22:46:54 +01:00
andrewlewis
8115e11489 Allow subclasses to customize the MediaFormat
Make getMediaFormat protected so that subclasses can set additional MediaFormat
keys. For example, if the decoder output needs to be read back via an
ImageReader as YUV data it is necessary to set KEY_COLOR_FORMAT to
COLOR_FormatYUV420Flexible.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166195211
2017-08-29 22:45:28 +01:00
tonihei
9fd19d0e7c Add shuffle logic to concatenated timelines.
The implementation in the abstract base class takes care to forward the queries
to the correct methods given the shuffle mode and a given shuffle order.

All concatenated timeline implementations use an unshuffled order so far. The
handling of the shuffle orders will follow in other changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166191165
2017-08-29 22:42:56 +01:00
tonihei
4883a9ba9a Add shuffle support to infinitely looping timeline.
In addition, let unit test assert window indices for both shuffle modes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166191069
2017-08-29 22:41:39 +01:00
tonihei
bd81181892 Add shortcut methods to query next or previous window index.
This functionality is most likely needed by UI modules which currently need
to obtain the timeline, the current repeat and shuffle modes and are only then
able to query the next/previous window index using this information.

Adding these methods simplifies these cumbersome requests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166181202
2017-08-29 22:40:13 +01:00
tonihei
2c8d5f846e Pass shuffle mode to timeline assertion helper methods.
This allows to test the expected behaviour of timeline with different shuffle modes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166181091
2017-08-29 22:38:50 +01:00
tonihei
10f1bd7396 Add shuffle mode parameter to Timeline interface methods.
This parameter is used by methods such as getNextWindowIndex
and getPreviousWindowIndex to determine the playback order.
Additionally, there are method to query the first and last
window index given the shuffle mode.

None of the timeline implementations nor the ExoPlayer
implementation supports shuffling so far.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166170229
2017-08-29 22:37:27 +01:00
tonihei
5214bfa7b1 Update ExoPlayerImplInternal with shuffle mode changes.
The shuffle mode is saved using a message on the playback thread.
After setting the shuffle mode, the same media period holder verification
as for repeat mode changes gets executed.

Note: the shuffle mode is not used yet to change the playback order.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166060231
2017-08-22 16:27:18 +01:00
tonihei
b9a6a40539 Add listener callback for shuffle mode changes.
The listener implementations do not do anything yet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166056933
2017-08-22 16:23:27 +01:00
tonihei
c1d7e5bf9d Add set/getShuffleModeEnabled to Player interface.
And implement a basic version of the methods in all implementations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166041342
2017-08-22 16:19:25 +01:00
olly
f1a97317d9 Handle size==0 in MP4 atoms
Issue: #3191

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165925148
2017-08-22 16:16:48 +01:00
tonihei
cb45a47da1 Remove isFirstWindow/isLastWindow from Timeline.
These methods are only used in one place, and offer duplicate
functionality to checking getNext(Previous)WindowIndex == C.INDEX_UNSET.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165910258
2017-08-22 16:14:02 +01:00
mansfieldmark
8e67837afe Adding conservative @Nullable annotations to Exoplayer v2 Cache + CacheSpan
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165715928
2017-08-22 16:09:53 +01:00
eguven
a1add8f9e6 Fix downcasting in DownloadAction.Serializers
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165699826
2017-08-22 16:07:18 +01:00
aquilescanta
1e4f899548 Add support for the data URI scheme
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165699328
2017-08-22 16:05:58 +01:00
Oliver Woodman
4fa307d654 Minor style tweaks 2017-08-17 23:13:34 +01:00
Dulmandakh
7e586c3a8f expose setPropertyByteArray, setPropertyString
export setPropertyByteArray, setPropertyString of DefaultDrmSessionManager for easy customization.
2017-08-17 23:11:30 +01:00
ojw28
6b7e0cb606 Merge pull request #3182 from WeiChungChang/Support_MP4_in_h262
Support H262 video in MP4
2017-08-17 23:10:05 +01:00
ojw28
7ddcc46cbd Merge pull request #3185 from dbrain/subrip_timing_line_crash
Fix possible subrip timing line NPE
2017-08-17 23:09:50 +01:00
olly
2470b39d95 Split metadata and text outputs from their renderer classes
There will be non-ExoPlayer players that can output text
and metadata, so the outputs should be standalone. There
may also be ExoPlayer instances that use non-standard
text and metadata renderers, for which this change also
makes sense.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165628420
2017-08-17 23:05:44 +01:00
olly
4917929a3a Improve MediaSource/MediaPeriod documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165628229
2017-08-17 23:04:21 +01:00
aquilescanta
e3f305b5c0 Improve FORMAT_UNSUPPORTED_DRM related documentation and logging
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165580016
2017-08-17 23:00:56 +01:00
olly
34960ad891 Tweak and add READMEs + remove refs to V1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165578518
2017-08-17 22:59:34 +01:00
olly
4d7f37f5a9 Work around issue with Xiaomi JB devices
Issue: #3171

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165577562
2017-08-17 22:58:10 +01:00
zhihuichen
c2d2d967e9 Refactor DrmSession part into a separate class to prepare for multi session scenario. NO_SQ=flaky
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165497666
2017-08-17 22:52:33 +01:00
eguven
978019a1a3 Add ProgressiveDownloadAction
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165447436
2017-08-17 22:51:14 +01:00
andrewlewis
8e45bd27df Add nullable annotations to Renderer constructors
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165437929
2017-08-17 22:49:58 +01:00
andrewlewis
bbc3b182bb Restore the interrupted flag after blocking operations
If the main thread was interrupted during
ExoPlayerImplInternal.blockingSendMessage/release, the interrupted flag was
immediately set but then wait() was called on the next iteration. wait() would
immediately throw InterruptedException, causing the main thread to spin until
the blocking operation completed.

Instead of resetting the flag immediately, reset it after the blocking
operation completes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165426493
2017-08-17 22:48:15 +01:00
andrewlewis
e0b69b8115 Add Format.copyWithRotationDegrees
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165314250
2017-08-17 22:46:57 +01:00
olly
f8e47553e8 Destroy GL context when releasing dummy surface
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165293386
2017-08-17 22:40:32 +01:00
olly
00547c5783 Disable secure dummy surface on all Samsung N devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165291627
2017-08-17 22:38:01 +01:00
mdoucleff
d9cd4641f2 Add flag to CachedContentIndex to disable encryption. This allows the encryption feature
to be disabled gracefully: encrypted index files may be read, but plaintext will be written.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165196508
2017-08-17 22:35:27 +01:00
olly
cf6534ea5b SegmentDownloader loadManifest cleanup.
- HlsDownloader.loadManifest (previously called getHlsPlaylist)
  suppressed errors for the offline case, where-as the DashUtil
  equivalent method did not. This change makes them consistent
  and moves both other to use ParsingLoadable.
- Enable GZIP for manifest loads in both cases.
- Use Uri rather than String to represent Uris. Previously the
  strings were parsed into Uris quite deep in the code, which
  isn't ideal if the parsing fails; you'd probably prefer the
  error to occur early at the top level.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165181398
2017-08-17 22:32:57 +01:00
olly
870c8ae4df Fix canAcquireSession for ClearKey
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165159376
2017-08-17 22:29:13 +01:00
Danny Brain
571f98f546 Fix possible subrip timing line NPE 2017-08-17 21:30:46 +10:00
WeiChungChang
469780f7ea Support H262 video in MP4 2017-08-17 13:49:41 +08:00