121 Commits

Author SHA1 Message Date
tonihei
52de36c5eb Add abstract, default Player event listener.
This allows simplified listener implementations as most listeners
will not listen to all possible notifications.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170177821
2017-10-03 08:44:33 +01:00
tonihei
7d59383cc4 Add reason to onPositionDiscontinuity.
This allows listeners to easily determine the source of the discontinuity.
Reasons can be period transitions, seeks, and internal reasons.

Listeners still using the deprecated ExoPlayer.EventListener interface were
updated to Player.EventListener.

GitHub: #3252

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168549612
2017-09-15 23:36:46 +01:00
olly
049d41db2a Add license notes for extensions with non-Google dependencies
Issue: #3197

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166988657
2017-08-31 16:28:22 +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
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
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
andrewlewis
1cfd246cd3 Update extension README with usage instructions
Issue: #3162

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165572088
2017-08-17 22:55:37 +01:00
olly
40f34956a8 Bump minimum and target API levels + support lib version
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164863447
2017-08-11 15:01:43 +01:00
olly
d4c45861f4 Clean up extension READMEs
Issue: #1157

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164434768
2017-08-07 11:54:21 +01:00
olly
78cdd08684 Add some missing @param Javadoc to extensions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164105607
2017-08-03 14:45:45 +01:00
olly
4436e94ba8 Hardcode libopus output frequency to 48000Hz
Issue: #3080

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162746202
2017-07-21 17:37:56 +01:00
andrewlewis
554a399407 Switch to non-deprecated player constants
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162605429
2017-07-21 11:20:07 +01:00
olly
387720d182 Allow module registrations + log player release
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162223981
2017-07-17 23:21:34 +01:00
olly
d5c2cf79f4 Update READMEs with new local build instructions
Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160290097
2017-06-28 22:26:05 +01:00
olly
4a59c7cf40 Make it easier to use ExoPlayer modules in other projects II
With this change, it becomes possible to depend on ExoPlayer
locally in settings.gradle by doing:

gradle.ext.exoplayerRoot = 'path/to/exoplayer/root'
apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')

You can optionally add a prefix onto ExoPlayer's module names
by adding:

gradle.ext.exoplayerModulePrefix = 'prefix'

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160277967
2017-06-28 22:26:05 +01:00
olly
2a8eb5a2a1 Make it easier to use ExoPlayer modules in other projects
It's currently difficult to use ExoPlayer modules in other gradle
projects because they rely on constants and dependencies defined
in our own top level gradle file. This change moves the constants
into a separate file referenced directly from each module. It also
removes the need for the top level gradle file to declare a
dependency on com.novoda:bintray-release. This is now only needed
if "exoplayerPublishEnabled = true" is specified.

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160272072
2017-06-28 22:26:05 +01:00
tonihei
edbc2046e2 Clean-up manifest merge attributes.
1. Remove tools:replace in manifest files. This attribute is only needed to establish priority when two manifests are merged and have the same attribute with different values.
As this is not happening here, the attributes can be removed.

2. Some BUILD files also define a deprecated manifest merge strategy different from the android default merge strategy. For consistency these are set to "android'.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158075128
2017-06-06 16:38:45 +01:00
tonihei
4d1826dd3d Add repeat mode mechanics to Exoplayer.
(Relating to GitHub Issue #2577)

All getter, setter and callbacks have been added and value of repeatMode is
passed to getNextXXXIndex methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155071985
2017-05-04 20:55:48 +01:00
andrewlewis
6a7db4b1ec Remove unused variable and parameter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152107538
2017-04-06 18:52:03 +01:00
Oliver Woodman
757999758b Cleanup for merged pull requests 2017-03-31 19:38:41 +01:00
ojw28
b127e162b6 Merge pull request #2329 from supercairos/dev-v2
Opus: use fixed max size in Opus decoding
2017-03-31 19:32:32 +01:00
andrewlewis
0e6ef0edf6 Add Sonic library for audio speed adjustment.
Add methods to ExoPlayer for setting/getting the playback speed, using
SonicAudioProcessor.

Remove PlaybackParams support, as the AudioTrack timestamp does not work
reliably on Marshmallow. The platform also uses Sonic and performance
should be comparable between the Java and native versions on recent Android
runtimes.

In a later change, SonicAudioProcessor will be made public so it can
be used in conjunction with other processors.

Issue: #26

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151027121
2017-03-23 19:14:48 +00:00
olly
382ba7ecf0 Generate combined Javadoc
Notes:
- Now only generating a single module Javadoc task for the
  release variant.
- Combined Javadoc now includes extensions. VP9 is excluded
  for now since it's failing for an unknown reason.

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150865589
2017-03-22 19:11:28 +00:00
olly
88e74ef381 Generate Javadoc for each module individually
Notes:
- The VP9 one is failing claiming that the util package
  doesn't exist and that LibraryLoader cannot be found.
  Unsure why, since it appears to be setup exactly like
  other extensions (e.g. Opus) that does work.
- @link across modules will not work when generating
  Javadoc for a single module. This is WAI. I subsequent
  change will add an aggregated Javadoc generator that
  will generate Javadoc for all modules together and
  apply cross module @link correctly.

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150864273
2017-03-22 19:10:15 +00:00
olly
ce55d1a712 Modularize ExoPlayer steps 1 + 2.
1. Move entire library from v2/library/ to v2/library/core
2. Add v2/library/all that depends on v2/library/core

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150455693
2017-03-22 18:49:30 +00:00
olly
204537ed40 Pre-modularization cleanup
- Use a variable for the (default) minSdkVersion. There will
  be more modules that need it, and it'll be easier to manage
  if it's in one place.

Issue: #2139

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150050663
2017-03-15 15:44:46 +00:00
andrewlewis
d58008eeb7 Rename BufferProcessor to AudioProcessor.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148763781
2017-02-28 17:35:35 +00:00
olly
3bc320faaf Fix misleading method names.
Issue: #2414

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147325759
2017-02-15 17:00:40 +00:00
andrewlewis
74acbe04e3 Pass an array of BufferProcessors to the AudioTrack.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146215966
2017-02-15 16:41:32 +00:00
Romain Caire
2cf8553049 opus: use fixed max size in Opus decoding as per documentation: If this is less than the maximum packet duration (120 ms; 5760 for 48kHz), this function will not be capable of decoding some packets. 2017-01-14 14:47:21 +01:00
olly
1eede5d5bb Fix gradle/proguard setup
- Add proguard rules for libraries/extensions into .aar files
- Add proguard rules to retain CEA608/708 decoder constructors
- Remove lots of default config from gradle files
- Remove disabling of abort on lint error
- Enable optimizations on release builds of demo app

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144350233
2017-01-13 17:27:25 +00:00
olly
3547c9034e Report audio decoder adaptation support correctly
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144219518
2017-01-13 17:05:45 +00:00
andrewlewis
ae0ac55b8d Add support for resetting the AudioTrack stream type.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139797714
2016-11-21 19:13:34 +00:00
hoangtc
4cd8c77053 Add layer of indirection for DRM.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138383979
2016-11-10 21:14:29 +00:00
olly
2c54363204 Report track groups and selections through ExoPlayer
TrackSelector no longer has a listener. Instead, tracks
change events are reported through ExoPlayer.EventListener.
Applications interested in retrieving the selection info
should retrieve it directly from the TrackSelector by
calling an exposed getter.

Pretty sure the ref'd issue is fixed as a side effect of
this change.

Issue: #1942

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137183073
2016-10-27 12:27:55 +01:00
olly
eaf8218855 Fix shutter open/close behavior
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134389619
2016-09-28 11:26:12 +01:00
olly
de67fa5017 Allow replacement of libraries for Opus/Flac/Ffmpeg too
- Also make some of the naming more concise + misc style cleanup.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132899979
2016-09-13 17:44:10 +01:00
olly
04c28c6d7d Minimal change to fix seeking before prepare + finalize API
- This change fixes seeking before the prepare (or more
  accurately, before the timeline is set). The fix a minimal
  one to fix the behavior. It's inefficient compared to
  posting the pending seek onto the playback thread, which
  will be the long term solution.
- As of this change, I think we can call V2 "done". There are
  some loose ends to tie up, but the API is effectively
  finalized and the implementation is in a state where you
  can take it, use it and expect it to work.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132468107
2016-09-08 16:29:48 +01:00
olly
a779eabdc5 Update SDK / Tools.
- Centralise compileSdkVersion, targetSdkVersion and
  buildToolsVersion in a single place for gradle.
- Bump compileSdkVersion and targetSdkVersion to 24.
- Bump com.android.tools.build version to re-enable
  instant start.
- Bump targetSdkVersion in manifests (needed for
  internal builds).
- Use standard expandable_list_item from Android in
  the demo app, since ours doesn't look right when
  targeting API level 24. We were also setting the
  theme on the wrong element in the manifest, so I'm
  removing that line.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131929216
2016-09-02 16:12:55 +01:00
olly
962b5940c2 Update ExoPlayer documentation + tweak method naming
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131843222
2016-09-02 16:08:45 +01:00
olly
1fbe62c662 Update Opus decoder, move init ouput buffer to native code
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131692317
2016-08-31 15:25:35 +01:00
olly
5f1a2c71f0 Finalize V2 ExoPlayer API
There's still some internal to clean up to do, and in particular
it remains a TODO to be able to handle seek calls before the
timeline is set (for this CL, such calls are dropped). This change
does however finalize the API.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131171318
2016-08-31 15:25:25 +01:00
olly
94c908e89c Rename Window->MediaWindow, Timline->MediaTimeline
Window is potentially confusing with Android's Window class.
Once Window is renamed, it makes sense to rename Timeline too.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130938392
2016-08-31 15:25:24 +01:00
olly
e35f9addaf Remove playWhenReadyCommitted.
This was always a bit of a hack; for Play Movies. It may well
no longer be necessary, and if not I'd like to think of a nicer
or more general way of doing it. We can always bring it back
if needed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130373433
2016-08-31 15:25:06 +01:00
olly
1a909fd163 Change SeekWindow -> Window, and add window duration.
- This avoids the need to have to use the timeline to
  calculate a window duration, which can be awkward.
- Window now represents a window of availability with
  an isSeekable flag, rather than a window of
  seekability.
- Promoted Timeline and Window to top package; they're
  pretty important :).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130278509
2016-08-31 15:25:06 +01:00
andrewlewis
88bf1d0739 Expose the seekable window.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129747377
2016-08-10 20:07:56 +01:00
andrewlewis
8d122a101d Use new import ordering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128967776
2016-08-08 11:06:48 +01:00
andrewlewis
d657360341 Expose period information from MediaSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128357449
2016-07-28 19:39:07 +01:00
olly
5360ddc519 Allow injection of custom FormatEvaluators
This was possible previously, but now we support things
like multi-period DASH we need to do the injection in
the form of factories rather than concrete instances.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127735816
2016-07-22 22:20:32 +01:00
olly
2d8b51a709 Convert extractor factory classes to static final objects
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127415273
2016-07-15 18:16:18 +01:00