3652 Commits

Author SHA1 Message Date
pavlotsky
93423aa8d4 Moved Exo IMA Demo to ExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173112608
2017-10-27 15:57:28 +01:00
olly
82edf01c22 Re-use single session when multiSession disabled
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173098862
2017-10-27 15:55:46 +01:00
andrewlewis
9306b24c65 Fix some Android Studio inspection warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173085316
2017-10-27 15:54:17 +01:00
eguven
9568802c6d Persist DownloadActions in DownloadManager
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172875067
2017-10-27 15:52:41 +01:00
olly
c2d05f4405 Bump to 2.5.4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172758309
2017-10-19 18:10:27 +01:00
Oliver Woodman
64b928e77f Stylistic cleanup 2017-10-19 17:28:24 +01:00
ojw28
28bd4661ed Merge pull request #3371 from andymiao858/dev-v2
Fix FLV AVCVIDEOPACKET  CTS Type Issue
2017-10-19 17:23:50 +01:00
ojw28
24cca8070e Merge pull request #3378 from Miha-x64/patch-2
Removed useless parentheses
2017-10-19 17:23:28 +01:00
eguven
7d0ec68d86 Put DownloadTasks on hold until preceding conflicting tasks are complete
Tasks conflict if both of them work on the same media and at least one
of them is remove action.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172741795
2017-10-19 16:52:43 +01:00
andrewlewis
bb3dea5191 Remove USE_CHORD_PITCH
We have been using USE_CHORD_PITCH == false for a while and the quality of
pitch changes seems fine. It's now possible to set the sample rate too, but
this only works if USE_CHORD_PITCH is false, so remove the constant.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736631
2017-10-19 16:51:29 +01:00
andrewlewis
08706f9bfb Retain playback position on re-preparation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736350
2017-10-19 16:50:04 +01:00
olly
d09f872179 Fix positions passed to TrackSelection
- When transitioning to a new period, the value of bufferedDurationUs
  passed to TrackSelection.updateSelectedTrack was incorrectly set to
  0. It should have been set to correctly reflect buffered media in
  previous periods still being played out.
- This change fixes the issue described above, and also propagates the
  playback position through to this method. The position of the next
  load within the period can be calculated by adding the position and
  bufferedDurationUs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172736101
2017-10-19 16:48:39 +01:00
aquilescanta
2cfc478c3e Allow extractor injection for HLS
Issue:#2748

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172726367
2017-10-19 16:47:04 +01:00
andrewlewis
49aca6e9ce Fix typo in variable name
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172724250
2017-10-19 16:45:41 +01:00
aquilescanta
daf9c8d19a Update HLS sample streams
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172722536
2017-10-19 16:44:18 +01:00
andrewlewis
eb08e1a5c3 Work around AudioTrack Bluetooth connection issue
If connecting a Bluetooth audio device fails, the AudioTrack may be left in a
bad state, where it is not actually playing and its position has jumped back to
zero. Detect and work around this case by resetting the track.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172600912
2017-10-19 16:42:52 +01:00
olly
b8ef1dcc78 Fix MediaPeriod position param Javadoc.
prepare and selectTracks receive the position from which any
loading should start, where-as continueLoading receives the
actual playback position. These are different in the case that
a previous period is still being played out.

Also removed "relative to the start of the period" from prepare
documentation because it couldn't really be relative to anything
else.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172592769
2017-10-19 16:41:23 +01:00
andrewlewis
1e79d6eb84 Fix seeking with repeated periods
newPlayingPeriodHolder could be set then updated if seeking to a repeated period
that was loaded more than once. This led to MediaPeriodHolders leaking.

Only set newPlayingPeriodHolder once so that any later holders with the same
period identifier get released.

Also add a regression test. FakeMediaSource checks that all created
MediaPeriods were released when it is released.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172591937
2017-10-19 16:39:57 +01:00
olly
fc5e8ee516 Add some additional device specific workarounds
Issue: #3355
Issue: #3257

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172587141
2017-10-19 16:37:10 +01:00
苗华栋(Rabbit)
69e50a43a8 add readSignedInt24 in ParsableByteArray 2017-10-19 23:18:12 +08:00
Mike
276087c532 Removed useless parentheses 2017-10-19 14:23:50 +03:00
miaohuadong
5895884c53 Fix bug 2017-10-19 14:10:18 +08:00
苗华栋(Rabbit)
4f8f87221e Fix FLV AVCVIDEOPACKET -> compositionTimeMs Type from UI 24 to SI 24 2017-10-18 23:03:26 +08:00
andrewlewis
f9249d23ea Add an extractor flag for ignoring edit lists
Issue: #3358

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172464053
2017-10-17 18:28:39 +01:00
olly
2c10e6f1c3 We're not playing an ad if the timeline is empty.
Issue: #3334

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172447125
2017-10-17 18:27:26 +01:00
tonihei
f6821c6d95 Split playbacktests mobile_test into multiple version-dependent test targets.
MobileHarness allocates random devices for each test and repeats tests up to 5 times to
account for spurious test failures. Some of our tests automatically pass for SDK versions
below a certain threshold. Thus, even if such a version-guarded test would always fail,
the MobileHarness test is likely to succeed as it only needs one random allocation to a
device with a lower SDK version.

To prevent this behaviour and to make sure all tests are actually run, the mobile_test
target is split into multiple targets one for each minimum SDK version.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172447046
2017-10-17 18:26:11 +01:00
andrewlewis
ac31dc7c7a Allow setting output sample rate in SonicAudioProcessor
This is not really useful with the DefaultAudioSink, but could be used in a
custom AudioSink when mixing audio from sources that have different sample
rates.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172434482
2017-10-17 18:24:53 +01:00
andrewlewis
e46a7600cf Document DefaultTimeBar attributes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172339124
2017-10-17 18:23:35 +01:00
andrewlewis
9356363117 Document load() exceptions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172329677
2017-10-17 18:22:14 +01:00
aquilescanta
d0758c9393 Fix typo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172328148
2017-10-17 18:20:49 +01:00
Oliver Woodman
eb5146c39b Merge branch 'release-v2' into dev-v2 2017-10-16 13:51:20 +01:00
olly
ebf19c4028 Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172133622
2017-10-16 12:52:02 +01:00
Oliver Woodman
29ba640351 Delete accidentally added files 2017-10-13 23:14:49 +01:00
Oliver Woodman
12513e9898 Tweak recently merged pull requests 2017-10-13 20:40:08 +01:00
ojw28
e6d8e5b096 Merge pull request #3318 from natez0r/pass-playlist-parser
Allow passing of HlsPlaylistParser to HlsMediaSource.
2017-10-13 20:29:55 +01:00
ojw28
40d8b29c9e Merge pull request #3328 from ValveSoftware/dev-v2-multiversion
Allow multiple PSSH boxes for same system
2017-10-13 20:29:44 +01:00
olly
cad88512f5 Only parse common-encryption sinf boxes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172124807
2017-10-13 19:57:03 +01:00
olly
2fee010938 Workaround/Fix #3351
1. Ignore edit list where the sequence doesn't contain a sync
   sample, rather than failing.
2. Make Mp4Extractor.readAtomPayload so it doesn't try and read
   the same payload twice if a failure occurs parsing it.
3. Make processAtomEnded so that it doesn't pop the moov if
   parsing it fails.

Issue: #3351

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172106244
2017-10-13 19:55:50 +01:00
tonihei
c9ed9366ce Fix Cronet extension build and test.
Recently added Java 8 features in the cronet extension and the linked native libs
require to enable Java 8 desugaring in gradle. Moreover, junit.assertThrows is not
available in our version and its usage has been replaced by the manual check.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172077967
2017-10-13 19:54:28 +01:00
tonihei
7038c8fb70 Add chunk size variation to fake adaptive data set.
The chunk size of real video data varies around the given average bitrate.
To account for this fact in the fake adaptive data set, the chunk size varies
randomly with a given standard deviation. The standard deviation used for the
BandwidthProfileSimulator is based on the chunk size variation measured on the
1 hour playlist of real media.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172068110
2017-10-13 19:53:02 +01:00
byungh
3ae4143be3 Cookie-based validation in CronetDataSource
Using cookie validation from streamer, streamer can enforce that only clients who have the cookie are able to stream the video.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171999924
2017-10-13 19:51:38 +01:00
tonihei
b71effb7b0 Fix MobileHarness playback tests.
This change fixes various issues:
 - MobileHarness sometimes allocated devices with SDK < 16. As we have no tests running
   on these SDKs, a new dimension filter for the mobile_test target ensures that only
   devices with SDK >= 16 are selected. A similar filter for SDK version is also added
   to the ABR playback tests to ensure no old devices are selected.
 - DRM specific tests are skipped for Api < 18, but were not able to run because the
   DashTestRunner class tried to link to the MediaDrm constructor. Moved the
   constructor to a seperate Builder class to allow execution on Api levels 16 and 17.
 - DashWidevineOfflineTest also tried to access code for Api >= 18 without checking
   the current level.
 - Action implementations which are waiting for events did not ensure that they have a
   nextAction to wait for. This caused NullPointerExceptions when this next action was
   scheduled.
 - DefaultDrmSession always restored the offline keys when a new license was requested,
   even if the keys were already restored. These repeated slow calls to restoreKeys
   resulted in high numbers of dropped buffers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171974859
2017-10-13 19:50:20 +01:00
bachinger
333e745e7b show PlaybackControlView when on key event for DPAD center or any direction
and consume event without moving the focus.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171967057
2017-10-13 19:48:56 +01:00
olly
a11c704d27 Upgrade dependency versions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171819854
2017-10-13 19:47:25 +01:00
hoangtc
763f663d01 Update DefaultTrackSelector to use more conditions when selecting audio track
Update the audio track selection logic in DefaultTrackSelector:

- When forcing lowest bitrate, use bitrate as tie-breaker when track scores are
the same, prefer the lower bitrate.
- Otherwise, use one of the following values as tie-breaker in order:
  - ChannelCount
  - SampleRate
  - BitRate
If the format being checked is within renderer's capabilities, select it if it
has higher tie-break value, else, select it if it has lower tie-break value.

If all tie-break values are the same, prefer the already selected track.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171803092
2017-10-11 12:35:00 +01:00
olly
5d4fa335f9 Expose public constructors for FrameworkMediaCrypto
MediaCodecRenderer implementations require DrmSessionManager<FrameworkMediaCrypto>,
but it's currently not possible for an app to provide a custom implementation due
to FrameworkMediaCrypto having a package private constructor. This change exposes
public FrameworkMediaCrypto constructors, hence removing this restriction.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171718853
2017-10-11 12:32:25 +01:00
olly
9a6d717a7a Allow overriding of DefaultDashChunkSource.getNextChunk
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171718775
2017-10-11 12:31:02 +01:00
andrewlewis
fc985fe4da Update IMA documentation for AdsLoader
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171533782
2017-10-11 12:29:39 +01:00
tonihei
030f52b41b Wait for HandlerThread to terminate after calling quit.
Calling HandlerThread.quit() or .quitSafely() doesn't immediately terminate
the thread. It just instructs the Looper not to accept any new messages and
to terminate at the next opportunity. Added a HandlerThread.join() everywhere
where the intention is to close and release all resources and to stop all
threads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171525241
2017-10-11 12:26:58 +01:00
andrewlewis
54d3df4b63 Drop to keyframe in LibvpxVideoRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171517156
2017-10-11 12:25:31 +01:00