1326 Commits

Author SHA1 Message Date
olly
afa1ad1a6a Keep playback position advancing when all renderers are disabled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123977520
2016-06-15 19:42:04 +01:00
olly
69bd31f7c2 Fix video renderer rejoining.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123976645
2016-06-15 19:42:03 +01:00
andrewlewis
a100175b72 Rename TrackRenderer.reset to TrackRenderer.onReset.
This allows the TrackRenderer superclass to do things when the renderer is
reset, and makes resetting consistent with other 'events' on renderers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123974633
2016-06-15 19:42:03 +01:00
olly
ff745ac444 Make ExtractorSampleSource constructor consistent.
The allocator and buffering policy (e.g. how large the buffer
is) is moving to the top level as part of playlist support,
so it no longer makes sense to inject these parameters as
args into ExtractorSampleSource's constructor.

Instantiating the allocator and buffer size inside of the
source is temporary and only until they're moved up.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123968976
2016-06-15 19:42:03 +01:00
aquilescanta
6fd610fc5f Added max video size selection to DefaultTrackSelectionPolicy.
It is possible to add use of this feature in the demo app, restricting the selected
tracks to the viewport size. But it should be added in a future CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123965232
2016-06-15 19:42:03 +01:00
eguven
ebd37cfb8e Moved testutils package to a seperate module so it can be accessed by the tests in other modules.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123964784
2016-06-15 19:42:03 +01:00
aquilescanta
105ef1da2d Discard trailing ctts entries with 0 sample counts
The bug this cl fixes is basically an uncaught case of []

Issue: #1567
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123963779
2016-06-15 19:42:03 +01:00
olly
443a656ada Fix build.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123958609
2016-06-15 19:42:03 +01:00
olly
7ef028c67b Fix delivery of onLoadCanceled to occur before thread dies.
This removes "message sent on dead thread" warnings in nearly
all cases, and guarantees delivery of load cancelation to event
listeners.

Issue: #426
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123957691
2016-06-15 19:42:03 +01:00
olly
8e717e2dee Properly disable sample queues when not selected.
- The main goal of this change is to remove the need for
  discardSamplesForDisabledTracks() in continueBuffering
  in HlsTrackStreamWrapper and ExtractorSampleSource. As
  a result we'll also save one Allocation per disabled
  track.
- Another benefit of this change is that Allocator.trim
  calls can no longer be dropped. This could previously
  happen on player release if the playback thread's
  Looper quit before delivery of onLoadCanceled which
  performed the trim in the case that a load needed to be
  canceled at the time of the release.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123957434
2016-06-15 19:42:03 +01:00
olly
14cb76a112 Make ExoPlayer systrace consistent.
Plus remove some unused util methods + make a few
warnings go away.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123888046
2016-06-15 19:42:03 +01:00
olly
5cde3aa314 Show toast if media contains only unplayable audio/video.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123885817
2016-06-15 19:42:03 +01:00
olly
00aef6ddb7 Always include extension renderers in SimplePlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123868547
2016-06-15 19:42:03 +01:00
olly
4888592c76 Fix HLS track selection.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123851448
2016-06-15 19:42:02 +01:00
eguven
94fa2ecfe5 WavExtractorTest and TsExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123848524
2016-06-15 19:42:02 +01:00
olly
ed19a582a7 Suppress source release failures.
This is similar to suppression of failures disabling the
renderers (in the block above).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123847812
2016-06-15 19:42:02 +01:00
andrewlewis
0565d8e100 Handle non-AAC/AVC encrypted audio/video sample entries.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123847497
2016-06-15 19:42:02 +01:00
eguven
ecad3bb396 MatroskaExtractorTest: removed unused local variables.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123847017
2016-06-15 19:42:02 +01:00
eguven
d99679a960 flv, mkv and mp4 extractor sample tests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123845660
2016-06-15 19:42:02 +01:00
olly
eb021cabd1 Small cleanup.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123739334
2016-06-15 19:42:02 +01:00
olly
53b50a61fe Use manifest load start time to dictate refresh period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123734239
2016-06-15 19:42:02 +01:00
olly
7f70ee911b Clean up chunked Sample/Chunk sources.
- Remove need for SampleSources to ref ChunkSources.
- Correctly propagate errors loading manifests through
  ChunkSource components.
- Fix some misc warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123732918
2016-06-15 19:42:02 +01:00
eguven
7aae5805b8 Added Mp3ExtractorTest and modified Mp3Extractor to pass the test.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123640738
2016-06-15 19:42:02 +01:00
eguven
5a4d82c7c2 TestUtil.assertOutput() uses "*.unklen.dump" file if only it exists and simulateUnknownLength is true.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123638992
2016-06-15 19:41:53 +01:00
olly
911d86bf2f Use Loader directly for manifest + utc timing loads.
Aside from deleting code, this change (a) adds retry
functionality for initial manifest fetches, (b) uses
the same loader for the utc timing fetch as for the
manifest.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123634812
2016-06-15 19:41:53 +01:00
aquilescanta
b61b3ab011 Fixed premature linebreak
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123620174
2016-06-15 19:41:53 +01:00
eguven
430985322d TestUtil.assertOutput() uses ExtractorFactory to create a new instance of the Extractor for each combination of simulation parameters.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123506162
2016-06-15 19:41:53 +01:00
olly
8322592ee8 Fix flag issue causing corrupt output on DRM playbacks.
The issue is visible for DRM playbacks because
BUFFER_FLAG_ENCRYPTED is being cleared, which results
in trying to play encrypted samples without decryption.
The issue would have also incorrectly cleared key frame
flags too, for both clear and encrypted playbacks, but
I don't think we're using that flag downstream anywhere
and so the issue wasn't visible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123426582
2016-06-15 19:41:53 +01:00
aquilescanta
7bab9cabfb Added support for video track selection
We allow 2 configurations: Forcing seamless adaptiveness and allowing
mixed mime types adaptation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123420364
2016-06-15 19:41:53 +01:00
olly
8744e8dce9 Refactor #6.HLS.4
Pull more logic up to HlsSampleSource. Somewhat regretfully,
this also backs out the optimization work done toward the
ref'd issue. I think that's one for another time perhaps...

Issue: #551
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123417413
2016-06-15 19:41:53 +01:00
olly
6d62962ab0 Bump version to 2.0.0.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123410989
2016-06-15 19:41:53 +01:00
eguven
651237ac4f Moved/renamed OggExtractorFileTests.parseFile(...) methods to TestUtil.assertOutput(...).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123410374
2016-06-15 19:41:53 +01:00
olly
800006d08d Remove TODOs that we have little urge to actually do.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123410274
2016-06-15 19:41:53 +01:00
eguven
ccfb6beb30 FakeExtractorOutput dump() and assertEquals(..., String dumpFile) methods to facilitate extractor test writing.
Changed OggExtractorFileTests to use dump files.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123407516
2016-06-15 19:41:52 +01:00
olly
abc5c41ff4 Provide setPlaybackParams convenience method.
It's not a comprehensive solution for setting the
playback speed because (a) it doesn't apply when
audio is disabled, and (b) we do some timestamp
interpolation in a few places where we assume real
time. However in practice it works pretty well and
most apps probably don't allow disabling of audio,
so I think it makes sense to expose it.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123406605
2016-06-15 19:41:52 +01:00
andrewlewis
5cf7c2ecf4 Separate enabling/setting TrackStreams in renderers (playlists #1).
This is in preparation for changing the TrackStream while keeping the renderer
enabled, to give seamless transitions for playlists.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123394733
2016-06-15 19:41:52 +01:00
eguven
17f8ac8adf Validate Extractor behavior when load position is reset to 0 following an error.
Added a new method TestUtil.consumeTestData() to emulate
the exact behaviour and modified OggExtractorFileTests to
use it. Rest of the test will be fixed in follow up CLs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123320538
2016-06-15 19:41:35 +01:00
andrewlewis
c2b89d6285 Add SampleSourceProvider as a factory for SampleSources (playlists #2).
Initially only the first source index is used. In a later change,
ExoPlayerImplInternal will create SampleSources for different playlist item
indices as necessary.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123312595
2016-06-15 19:41:35 +01:00
olly
c650ab64bc Less silly generics for Loader.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123310694
2016-06-15 19:41:35 +01:00
olly
1ea149a4d2 Refactor #6.HLS.3
- Pull loading of the initial manifest up to HlsSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123305312
2016-06-15 19:41:35 +01:00
olly
e74fc80aab Loader improvements.
This change moves generally useful functionality (load timing
and fatal error propagation) inside of Loader, so that callers
don't have to duplicate effort.

The change also makes use of generics so that the callback
receives a Loadable with a more specific type.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123304369
2016-06-15 19:41:35 +01:00
olly
db79f7989f Fix a few warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123302488
2016-06-15 19:41:35 +01:00
olly
10329eb111 Allow delivery to multiple messages in a single message.
Where multiple messages are required to be sent in order
to perform a player reconfiguration, it will usually be
desirable to process all messages in a single "transaction"
(i.e. without any rendering happening when only some of
the messages have been applied).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123228334
2016-06-15 19:41:34 +01:00
olly
f995509448 Give MSG constants different values.
This should be a no-op change, but it seems sensible to
have them not overlap.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123208140
2016-06-15 19:41:34 +01:00
olly
35d7dad047 Clean up SimpleExoPlayer.
- Simplify setSurface by always blocking when the surface
  is being cleared.
- Add analogous setVolume API.
- Support setting of playback params for extension audio
  decoders. We can probably use this to add a setPlaybackRate
  API to SimpleExoPlayer for API level 23 and above only,
  but we'd probably want to make sure it works properly when
  there's no audio track too, so some thought will be
  required.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123204581
2016-06-15 19:41:34 +01:00
olly
7d229003ad Add flexibility to DrmSessionManager.
DrmSessionManager is now an actual manager. For each session
request it may return a shared session (as things work now,
and as is suitable for Widevine VOD) or a separate instance
(e.g. for PlayReady where audio and video are protected with
different keys).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123203664
2016-06-15 19:41:34 +01:00
eguven
b6755c145e DefaultOggSeeker loop fix.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123191416
2016-06-15 19:41:34 +01:00
vigneshv
9609302b3d Support VPx in ISO-BMFF (MP4) Container
Netflix created a spec to encapsulate VPx codecs in ISO-BMFF (MP4)
Container [1]. This CL adds support for VP8 and VP9 video codecs
in the MP4 container.

[1] https://github.com/Netflix/vp9-dash/blob/master/Downloads/VPCodecISOMediaFileFormatBinding.pdf
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123160650
2016-06-15 19:41:34 +01:00
olly
ced7de15a9 Promote DemoPlayer to library as SimpleExoPlayer.
DemoPlayer moves into core library as SimpleExoPlayer, which
implements ExoPlayer.

Issue: #383
Issue: #592
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123090184
2016-06-15 19:41:34 +01:00
olly
075e095cba Assume AAC-LC (or HE-AAC) in MPEG-TS.
Issue: #774
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122987179
2016-06-15 19:41:34 +01:00