237 Commits

Author SHA1 Message Date
eguven
6cc049f6ef Increase supported libflac version to 1.3.2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215214894
2018-10-01 19:37:35 +01:00
tonihei
5c8dabade6 Add @Documented to @IntDef and @StringDef annotations.
This makes the annotations appear in the generated JavaDoc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214952419
2018-10-01 19:22:34 +01:00
tonihei
d0161ad18b Fix all error-prone, style, optional suggestion, etc. issues.
This fixes or suppresses all reported issues by the code review linter tools.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210107759
2018-08-28 16:37:14 +01:00
tonihei
4bf5e4991c Improve IntDef javadoc.
The doc can be improved by enumerating and linking all possible values from
the interface doc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209772309
2018-08-24 15:53:30 +01:00
andrewlewis
5c2dd9ca42 Move all tests to JUnit 4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209412403
2018-08-24 15:25:56 +01:00
olly
bd8a956d53 Use lamdas everywhere
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209162373
2018-08-24 15:19:30 +01:00
hoangtc
f08ad55892 Supports seeking for MPEG PS Streams.
This CL adds support for seeking within PS streams by using binary search. For
any seek timestamp, it tries to find the location in the stream where SCR
timestamp is close to the target timestamp, and return this position as the
seek position.

Github: #4476.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206787691
2018-08-01 13:49:21 +01:00
hoangtc
d810352f2c Refactor FlacBinarySearchSeeker.
Rewrite FlacBinarySearchSeeker and extract out the core binary search algorithm
into BinarySearchSeeker class so it can be re-used for other formats.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206012900
2018-07-26 18:27:46 +01:00
olly
7551d98087 Cleanup: Use lambdas for extractor factories
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205407693
2018-07-23 10:24:09 +01:00
olly
972fd0ced8 Use maxInputSize for extension decoders where possible
Issue: #3120

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204898773
2018-07-17 20:37:13 +01:00
andrewlewis
a26bb350ee Add IMA and FLAC tests to the codebase
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204302135
2018-07-17 20:10:20 +01:00
tonihei
156e2317cc Deprecate Player.DefaultEventListener in favor of default no-ops in interface.
The DefaultEventListener was added for selective overrides. Now that Java 8
support is enabled, these selective listener overrides can be implemented
more easily and more flexible using default methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201695490
2018-06-22 17:49:25 +01:00
aquilescanta
17ab9da5b6 Enable java 8 for some missing projects
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199265539
2018-06-05 12:44:56 +01:00
hoangtc
972304f16b Supports seeking for FLAC files without a SEEKTABLE.
Currently, ExoPlayer only supports seeking for FLAC files with a SEEKTABLE.
This CL adds support seeking for cases when the FLAC files do not have a
SEEKTABLE by searching for individual frames within the file using binary
search.

Github: #1088.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196816398
2018-05-18 15:04:55 +01:00
hoangtc
8a0af84c42 Supports seeking for FLAC stream using binary search.
Added FlacBinarySearchSeeker, which supports seeking in a FLAC stream by searching for individual frames within the file using binary search.

Github: #1808.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196587198
2018-05-18 14:28:18 +01:00
hoangtc
fe32401792 Supports extracting from AMR container format.
Supports extracting data from AMR container format for both narrow and wide
band formats. Also added AmrExtractor as one of the default extractor to be
used in DefaultExtractorsFactory.

GitHub: #2527.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194407507
2018-05-07 06:19:55 +01:00
hoangtc
fb5e31d3d6 Simplify logic to handle FLAC files with ID3 header.
LibFlac internally can skip ID3 tags correctly. Therefore, we don't need to keep track of the whole ID3 header section and skip through this section in Java code. We can just set the whole stream to the native library, and it will handle skipping ID3 tags correctly.

The only thing that the Java part need to do is peeking and parsing ID3 tags (if present), in order to populate the track format metadata.

GitHub: #4055.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193327602
2018-05-07 05:30:29 +01:00
hoangtc
0b0868889e Supports FLAC files with high sample rate (176400 and 192000).
Also add testing media to verify FLAC extension can play these sample rates.

Github: #3769.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192783193
2018-04-16 10:51:50 +01:00
hoangtc
986095a4a3 Support FLAC files with ID3 headers.
Support parsing ID3 tags at the beginning of FLAC files, even though FLAC spec
does not require this.

GitHub: #4055.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192127929
2018-04-11 00:28:35 +01:00
tonihei
66d2b76a6c Remove test max SDK version overrides.
These don't seem to be needed anymore. All tests run without them in gradle
and Blaze.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191867518
2018-04-08 16:39:57 +01:00
olly
0989f272f2 Fix "FLAC decoder input buffer too small" issue
Issue: #3514

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190752950
2018-03-29 13:32:05 +01:00
olly
73b6b20fa3 Improve decoder retention logic.
1. Allow retaining a decoder without any reconfiguration, in addition
   to retaining with reconfiguration (and not retaining)
2. Fix retention logic for video decoders to take into account changing
   ColorInfo
3. Allow retention of audio decoders when possible

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187500285
2018-03-02 09:27:48 +00:00
hoangtc
fcb796a80c Migrate ExoPlayer Gradle build files.
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
2018-03-02 09:20:02 +00:00
tonihei
c14ef75037 Move (almost all) remaining core library instrumentation tests to Robolectric.
There are 4 tests which can't currently be moved:
 - DownloadManagerTest explicitly uses the main looper which isn't easily
   supported because the test runs on this thread.
 - ContentDataSourceTest uses an AssetFileDescriptor which wraps a
   ParcelFileDescriptor. It seems Robolectric doesn't correctly forward the
   inner wrapped file descriptor leading to NPE.
 - CacheContentIndexTest and SimpleCacheSpanTest both work fine with Gradle
   but fail with seemingly valid test failures on Blaze.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185366678
2018-02-16 11:46:34 +00:00
olly
ca3be996bc Add proper exception checks when returning to native from Java.
The pending exception will be thrown upon returning to Java
from native, but we should return early rather than continuing
to execute the native method to the end so as to avoid undefined
behavior. Note that the return value is irrelevant (because the
pending exception will be thrown).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184119606
2018-02-01 15:22:32 +00:00
andrewlewis
6bed2ffc04 Remove ndk-build from [] flac build rules
Android NDK r9 in [] is deprecated (see []

Update the ExoPlayer flac extensions to use android_jni_library.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182017669
2018-01-23 18:41:05 +00:00
tonihei
4ee971052b Improve Extractor partial read tests.
Partial reads were performed once using a partial size of 1 byte.
This was not enough to detect problems which only occur in combination
with IOExceptions. Partial reads are now only applied when no exception
is thrown.

Moreover, the tests didn't check whether the total number of sampled bytes
is what it is supposed to be. Added a field to the data dumps checking
the total number of bytes in the sampled data.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181296545
2018-01-15 11:33:23 +00:00
olly
7b9f71b44d Don't kill the process if SimpleDecoder.decode throws.
Issue: #3645

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180659855
2018-01-04 15:44:00 +00:00
tonihei
106e69b3fc Check if native libraries are available in tests.
If the library is not available, no tracks can be selected and the
tests silently run through by immediately switching to ended state
without error.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178904347
2017-12-15 11:57:27 +00:00
andrewlewis
8c7fe8a258 Make ExtractorMediaSource.Builder a factory for ExtractorMediaSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178605481
2017-12-12 19:15:14 +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
c06fe73b66 Bump target API level to 27
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366693
2017-11-21 13:03:28 +00:00
hoangtc
e349905039 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-11-17 18:56:25 +00:00
andrewlewis
b8aedfbf4f Add support for float output for FfmpegAudioRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175940553
2017-11-17 18:53:26 +00:00
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
hoangtc
0d86f4475c Remove the resampling to 16bit step from FlacDecoder.
Currently FlacDecoder/FlacExtractor always perform resampling to 16bit. In some
case (with 24bit audio), this might lower the audio quality if the system
supports 24bit audio.
Since AudioTrack implementation supports resampling, we will remove the
resampling step, and return an output with the same bits-per-sample as the original stream.
User can choose to re-sample to 16bit in AudioTrack if necessary.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167494350
2017-09-04 16:30:37 +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
412138b2ea Some extractor fixes
- Fix Ogg extractor to work without sniffing.
- Fix extractors to handle seek() before init().
- Add tests for both issues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163992343
2017-08-02 17:44:41 +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
tonihei
05a77eef5d Move Extractor test assertion methods to ExtractorAsserts class.
This cleans up test the TestUtil class that in large parts consisted of
assertions for Extractor tests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160829066
2017-07-05 15:02:39 +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