5663 Commits

Author SHA1 Message Date
olly
f549cf5635 Fix Aes128DataSourceTest portability issue
For background on why doing this works, see below. I don't want to change
how we get our Cipher instance in non-test code, since PKCS7 always works
on Android. It's only when the tests are running on a non-Android host
machine that they can fail. An alternative would be to make it an androidTest,
but androidTests are slow.

------

Background:

"While Java considers PKCS5 and PKCS7 padding to be the "same" (and
one should always use the string "AES/CBC/PKCS5Padding" because
"AES/CBC/PKCS7Padding" will cause NoSuchAlgorithmException to be thrown
when initializing an AES block cipher using the Java crypto API), I
consider this a gross misnaming in the Java platform because the pure
technical definitions of these paddings are not the same."

Ref: https://stackoverflow.com/questions/10193567/java-security-nosuchalgorithmexceptioncannot-find-any-provider-supporting-aes-e

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207234518
2018-08-06 11:25:34 +01:00
jdong
2815ff1b02 Tiny cleanup: remove an extra "thread" in the comment for ExoPlayer interface.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207124509
2018-08-06 11:24:01 +01:00
aquilescanta
a7e9ebcf68 Build codecs string from SPS data in H.264
Issue:#4555

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207096569
2018-08-06 11:22:37 +01:00
christianw
03b04ef23c [third_party] Avoid saving Robolectric shadow instances; instead, save the real framework object, and get its shadow when needed using Shadows.shadowOf(). Call Android framework methods directly on the framework object instead of its shadow whenever possible.
LSC: []
Additional details: []

Cleanup change automatically generated by javacflume/refactory
Refactoring: //third_party/java_src/robolectric/errorprone:ShadowUsageCheck

Tested:
    TAP --sample for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207014379
2018-08-06 11:21:13 +01:00
aquilescanta
cc2a8bb854 Fix encryption data extraction when default values should be used
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206963956
2018-08-06 11:19:51 +01:00
aquilescanta
d458b90cc7 Parameterize load error handling in ExtractorMediaSource
Issue:#2844
Issue:#3370
Issue:#2981

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206927295
2018-08-06 11:18:37 +01:00
olly
d744c979ee Update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206921981
2018-08-06 11:17:35 +01:00
Oliver Woodman
180d6ae902 Disable tests that fail on some host machines 2018-08-01 19:58:05 +01:00
Oliver Woodman
96c8557e00 Release fixes 2018-08-01 19:02:32 +01:00
aquilescanta
fa1049ec5e Fix SCTE-35 timestamp adjustment
Issue:#4573

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206737252
2018-08-01 14:17:48 +01:00
eguven
c41f955f0f Disable automatic imports for inner classes
Inner classes generally has generic names and they make sense when they
are considered with the top level class they appear in.

When this setting is disabled, Android Studio inserts import for the top
level class and append the top level class's name before the reference
to the inner class name.

NO_SQ

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206127763
2018-08-01 14:16:26 +01:00
olly
00891f6469 Don't exclude .idea from MOE input
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205988261
2018-08-01 14:16:19 +01:00
olly
5faa662e43 Apply setOutputSurfaceWorkaround to required FireOS devices
Amazon like to use Device.MODEL, so key on that instead for
these workarounds.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206917935
2018-08-01 14:16:09 +01:00
eguven
ed18be4eea Add missing Nullable annotation Player.EventListener.onTimelineChanged
Issue: #4593

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206911927
2018-08-01 14:15:58 +01:00
olly
d0d6856725 Apply setOutputSurfaceWorkaround to required FireOS devices
Amazon like to use Device.MODEL, so key on that instead for
these workarounds.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206917935
2018-08-01 14:01:45 +01:00
hoangtc
0fbe083d4e Return empty track groups and track selections when user seeks to unprepared period
When user seeks to an unprepared period, since there is no period being played, currently the track groups and track selections are still the ones from previous period. This CL changes it so that when such seeking happens, PlaybackInfo's track groups and track selections are changed to empty.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206916109
2018-08-01 13:59:35 +01:00
eguven
45c1e9eef3 Add missing Nullable annotation Player.EventListener.onTimelineChanged
Issue: #4593

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206911927
2018-08-01 13:49:21 +01:00
andrewlewis
5715960304 Add Context to SimpleExoPlayer factory methods
This is needed for implementing (optional) support for audio focus handling in a
later change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206899837
2018-08-01 13:49:21 +01:00
andrewlewis
429bf4d099 Expand passthrough channel count workaround to all devices
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206893078
2018-08-01 13:49:21 +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
377314a69f Remove unnecessary DefaultKeyStatus, DefaultKeyRequest and DefaultProvisionRequest.
Currently, we have KeyStatus, KeyRequest and ProvisionRequest as interface, so we can use
custom implementation for purpose such as wrapping native objects. However, these interfaces and the corresponding default classes are only used to bundle data, and in all existing implementation (including native code), it's just as efficient to just use the Java default implementation. Therefore we can just get rid of the interfaces, and change
the interfaces into classes with the default implementation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206765389
2018-08-01 13:49:20 +01:00
andrewlewis
7ead310219 Use maximum bitrates for encoded output buffer sizes
There is some risk associated with this change, as audio track buffers come from
shared memory and limits may be device-specific. I've tested these sizes on
Nvidia Shield TV and Nexus Player on various builds. The maximum size allocated
is about 800 KB. We could implement support for retrying creating the audio
track if it fails to initialize, but it seems preferable to avoid the extra
complexity required to do that unless we know it's necessary to work around
device-specific limitations.

Issue: #3803

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206749222
2018-08-01 13:49:20 +01:00
eguven
02e9972630 Add 360 video samples to the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206747144
2018-08-01 13:49:20 +01:00
aquilescanta
9ec14d1ada Fix SCTE-35 timestamp adjustment
Issue:#4573

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206737252
2018-08-01 13:49:20 +01:00
andrewlewis
e2bf474c1e Extend Nexus Player mono workaround to Oreo
The platform fix was merged into O MR1, not O. Nexus Player has
not received this build.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206734342
2018-08-01 13:49:20 +01:00
andrewlewis
19d24ac633 Remove extra brackets
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206725219
2018-08-01 13:49:20 +01:00
andrewlewis
ded2b2eb2a Allow outputting audio to a WAV file
Add TeeAudioProcessor that doesn't modify the input audio but writes it to an
AudioBufferSink, and WavFileAudioBufferSink for writing audio to a .wav file.

This is intended to be used for diagnostics and debugging.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206717458
2018-08-01 13:49:20 +01:00
andrewlewis
68add98c23 Fix detection of TrueHD syncframe in MatroskaExtractor
MatroskaExtractor was checking for INDEX_UNSET as the sample count for buffers
not containing syncframes, but actually 0 was returned for these. Theoretically
this could prevent us starting to play a TrueHD stream as we wait until we can
read the sample count from a syncframe before accepting the audio in
DefaultAudioSink, but it seems that rechunking avoided this issue arising in
practice.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206575462
2018-08-01 13:49:20 +01:00
tonihei
656c2172dd Fix event reporting for merging and looping media sources.
The looping media source doesn't convert the media period id to the externally
visible media period id. And the merging media source reports media period
creations multiple times which will break listeners assuming a media period
with a specific id will only be created once.

Also amend the doc for MediaSource.createPeriod to reflect that media periods
created in parallel do not actually have the same id.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206327241
2018-08-01 13:49:20 +01:00
tonihei
a237ae1810 Fix period transition with non-zero start position.
Period transitions with non-zero start position happen too early as the
playing period is advanced as soon as the renderer offset is reached not
taking into account that the start position needs to be added to that.

Issue:#4583

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206310328
2018-08-01 13:49:20 +01:00
andrewlewis
6a2f94ec4b Document top-level limitation of AdsMediaSource
Issue: #4591

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206307948
2018-08-01 13:49:20 +01:00
andrewlewis
0c0c5942ab Fix incorrect channel configuration for 8 ch pre-M
AudioTrack checks the channel configuration against a mask of allowed channels.
Before Android M the check in getMinBufferSize would always fail for 8 channel
output.

For Android L constants are available to build the required channel
configuration for a conventional 7.1 setup and these constants are part of the
allowed channels mask, so switch to using them.

Before Android L the constants for 7.1 aren't in the allowed channels mask, so
discard channels to give a 5.1 stream.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206307892
2018-08-01 13:49:20 +01:00
eguven
30fecb71d2 Fix TouchTrackerTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206304655
2018-08-01 13:49:20 +01:00
aquilescanta
4eee474555 Remove minLoadableRetryCount from HLS components
Remove minLoadableRetryCount from HLS components in favor of
LoadErrorHandlingPolicy#getMinimumLoadableRetryCount.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206298419
2018-08-01 13:49:20 +01:00
andrewlewis
877837c893 Add audio/eac3-joc to FFmpeg supported formats
If compiled with eac3, audio/eac3-joc stream 5.1 bed-channels
can be decoded. The stream will be decoded as 2-D rather than
3-D.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206296930
2018-08-01 13:49:20 +01:00
tonihei
d3c2cb2aa4 Update remaining DataSource's with new addTransferListener method.
The new method allows to add TransferListeners after the DataSource
has been created. Most implementations just forward to their wrapped
upstream DataSource. Implementation which directly read data implement
BaseDataSource instead.

Also removes the temporary default no-op implementation in DataSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206289986
2018-08-01 13:49:20 +01:00
Gleb Pinigin
8f624861e1 WebvttExtractor: make public to allow create custom HlsExtractorFactory outside of library 2018-07-31 19:45:30 +07:00
Arnold Szabo
dbd25d5854 #4304 - Adjustments after code review 2018-07-27 13:41:02 +03:00
Jovche Mitrejchevski
5635ca2792 Reset aspect ratio 2018-07-27 12:03:39 +02:00
Arnold Szabo
1f12f22bb5 #4304 - Add option to show buffering view when setPlayWhenReady is false 2018-07-27 00:49:11 +03:00
Oliver Woodman
3b61a400c5 Remove stray file 2018-07-26 19:06:33 +01:00
tonihei
133f5f16b8 Pass MediaPeriodId to DeferredMediaPeriod when actual period is created.
This helps to distinguish between the MediaPeriodId the deferred media period is being
created with and the MediaPeriodId which is used to create the actual underlying period.

This serves two purposes:
1. The error reporting of ad prepare errors uses the correct media period id (the
   externally visible ad media period id).
2. The transition to using media period uid instead of indices is simplified.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206160463
2018-07-26 18:27:46 +01:00
tonihei
49ef1f3f8c Fix nullness warnings in Util and Assertions, and provide own castNonNull.
Using our own no-op castNonNull prevents linking into checkerframeworks library.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206152148
2018-07-26 18:27:46 +01:00
eguven
26a0ddcaec Disable automatic imports for inner classes
Inner classes generally has generic names and they make sense when they
are considered with the top level class they appear in.

When this setting is disabled, Android Studio inserts import for the top
level class and append the top level class's name before the reference
to the inner class name.

NO_SQ

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206127763
2018-07-26 18:27:46 +01:00
andrewlewis
217247f113 Remove naming assumption for passthrough decoders
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206119357
2018-07-26 18:27:46 +01:00
andrewlewis
5da703a588 Fix some nullness warnings in audio classes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206021873
2018-07-26 18:27:46 +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
Jovche Mitrejchevski
72a2b82370 Suggestions from Code Review 2018-07-26 12:26:29 +02:00
Jovche Mitrejchevski
46232977f6 Convert defaultArtwork from Bitmap to Drawable
Using bitmaps is still supported, but also this will allow using other types of drawables to be set as artwork.
2018-07-26 09:50:55 +02:00
GiuseppePiscopo
7878bf6a31 chore(playlist): reorder message IDs, fix tabbing 2018-07-25 18:31:14 +02:00