1667 Commits

Author SHA1 Message Date
olly
abcd10513a Do TODO in HlsChunkSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128190311
2016-07-22 22:41:36 +01:00
olly
9e9634a1a2 Delete disabled tests
The classes these tests are written for have changed
so much we'll have to write them again. We can refer
to V1 if we want to look at what the old tests did, so
there's no need to keep this file in the V2 tree at
the moment.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128189076
2016-07-22 22:41:36 +01:00
olly
ba0a4235a0 Consistent Javadoc for text package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128160177
2016-07-22 22:41:36 +01:00
olly
f0b73e5d5b Consistent Javadoc for upstream package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128159118
2016-07-22 22:41:36 +01:00
olly
692d756ee6 Simplification: Move common logic to TrackSelection
- TrackSelection now exposes the selected formats, ordered
  by decreasing bandwidth. This removes the need for DASH,
  SS and HLS to do the sorting individually.
- The change also removes the need to reconstruct TrackSelection
  instances with a different group index in various places
  (e.g. MergingMediaPeriod).
- This is also a step toward potentially packaging the
  FormatEvaluator inside of the TrackSelection (TBD).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128159064
2016-07-22 22:41:36 +01:00
olly
6f1b24f10f Add some missing Javadoc from the drm package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128085240
2016-07-22 22:41:36 +01:00
eguven
0909446133 Don't let renderer input buffer get too big if codec not available.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128082468
2016-07-22 22:41:36 +01:00
aquilescanta
68156ac7a4 Ignore sequence numbers when switching variants in HLS
According to the spec, there is no mandatory relation between segments'
sequence numbers of different variants. This CL ignores sequence numbers
when switching variants:

* In vod, the switching playback position is obtained by adding the
    duration of previous segments.
* In live playback this is not possible. It is assumed that the
    different live media playlists do not drift apart too much, so
    the playback position is obtained by subtracting the duration
    in reverse order.

In later CLs, the described mechanisms will become the fallback methods
by replacing them with the use of EXT-X-PROGRAM-DATE-TIME information
or more reliable sources.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128072663
2016-07-22 22:41:36 +01:00
aquilescanta
98c5b2b8d0 Treat empty stss boxes as absent
ISSUE: #1681

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128071668
2016-07-22 22:41:35 +01:00
cdrolle
5a7b046462 Re-added call to schedule manifest refreshes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127951757
2016-07-22 22:41:35 +01:00
olly
48f666a0e3 Merge HlsParserUtil into HlsPlaylistParser
It's the only place that uses it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127927164
2016-07-22 22:41:35 +01:00
olly
722e05b8ba Some brevity/consistency renaming in source package
SmoothStreaming -> Ss
MediaPresentationDescription -> DashManifest
DashSingleSegmentIndex -> SingleSegmentIndex

Moved DASH and Ss manifest classes to matching
manifest packages for consistency. For Hls the
package is called playlist still, since that's
what they're widely known as.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127925961
2016-07-22 22:41:35 +01:00
olly
fc457e4c1b Move default DRM callback implementation to library
This also removes direct use of HttpURLConnection and
allows use of any HttpDataSource for license requests,
which means those using OkHttp can finally use the
same network stack for license requests as they're using
for everything else, without having to implement their
own callback.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127841045
2016-07-22 22:41:35 +01:00
andrewlewis
2ed55d97d1 Work around broken VP8 decoders.
Issue: #548

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127821150
2016-07-22 22:41:35 +01:00
olly
9304cb3f8f Plumb key-rotation and drm-playlist support
With this change, MediaCodecRenderer acquires a session
from its DrmSessionManager whenever the DrmInitData in
the format changes. The DrmSessionManager is permitted
to return the same session if it can be re-used.

This plumbing adds support for:

1. Key-rotation, in the case that a key-rotation-aware
   DrmSessionManager is used. Such an implementation will
   return the same DrmSession for every aquisition, but
   will be making use of multiple MediaDrm instances within
   that session to enable the rotation.

2. Playlists with mixed clear and protected content. One
   final piece to this will be to have each MediaPeriod
   provide its own license URL. We could also allow each
   MediaPeriod to specify the DRM UUID, but switching from
   PlayReady to Widevine in a playlist seems like quite a
   hypothetical thing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127816046
2016-07-22 22:41:35 +01:00
olly
ba9a610ac2 Put additional Javadoc files under src
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127811486
2016-07-22 22:41:34 +01:00
cushon
0022487746 Avoid "unnecessary boolean expression" warning
This is a no-op change to avoid an error-prone unnecessary
boolean expression warning.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127787709
2016-07-22 22:40:59 +01:00
olly
6c2a967763 BandwidthMeter shouldn't extend TransferListener
There may be other ways to estimate bandwidth that don't
require listening to our own transfers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127741651
2016-07-22 22:21:54 +01:00
olly
74b43e26bd Allow injection of custom ChunkSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127737169
2016-07-22 22:21:06 +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
e7d95aff34 Update Renderer documentation
- Cleaned up documentation
- Removed getIndex from Renderer interface
- Renamed reset to be positionReset

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127731006
2016-07-22 22:19:56 +01:00
eguven
ff914afd7f Propagate MediaSource loading errors to the player.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127551577
2016-07-22 22:19:21 +01:00
olly
98a0c5f05c Fix restoring of position.
This change restores ExoPlayer to its previous behaviour.
I think we'll want a "resetPosition" boolean parameter on
setMediaSource at some point, but no need to add it right
now. Note that this would not always reset to the start
of the source. For a live playback it will reset to the
desired position (normally somewhere slightly behind the
live edge).

Issue: #1667
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127549700
2016-07-15 18:21:40 +01:00
andrewlewis
15631e12a8 Fix seeking to a non-loaded period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127536151
2016-07-15 18:20:31 +01:00
olly
8a36ce697e Add Renderer.getCapabilities
Renderer no longer extends RendererCapabilities after this
change. Capabilities are instead accessed via a getter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127532634
2016-07-15 18:19:57 +01:00
olly
dcc1ac56df Make Renderer an interface
In V1 we received complaints that Renderer was too locked down.
In particular, it wasn't possible to implement a Renderer that
wrapped another Renderer, since most of the methods were package
private and final (e.g. enable).

This change defines Renderer as a proper interface, removing
this limitation. A method-reordering-only change will follow
this one, to get things into a nice consistent/sane order in
each of the Renderer classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127527995
2016-07-15 18:19:23 +01:00
olly
7c551081f5 Only pass RendererCapabilities to TrackSelectors
We should only give a TrackSelector access to what it
needs, not the whole Renderer. This is particular true
if [] happens, since more Renderer methods
will become publicly visible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127526473
2016-07-15 18:18:50 +01:00
aquilescanta
97d9c94c1a Fix a typo and variable declaration order in Period
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127441130
2016-07-15 18:18:11 +01:00
olly
553023e63f Fix DASH periods mis-reporting their duration + cleanup
DashMediaPeriod.releasePeriod resets duration to 0, but
instances are currently being re-used through multiple
prepare/release cycles. Hence the duration needs to be
retained. This change fixes this issue, and also makes
variables final in DashMediaPeriod where possible.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127440080
2016-07-15 18:17:36 +01:00
eguven
bc77c3eb82 Call MediaSource prepare/release methods in ExoPlayerImplInternal.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127436600
2016-07-15 18:16:55 +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
olly
f758082d40 Big (and hopefully near-final) rename.
1. Rename "extensions" package to "decoder". It's used by both
   text and (should be used by) metadata, so it's no longer just
   for extensions.
2. Move Buffer objects move into the decoder package.
3. Rename SubtitleParser and MetadataParser to SubtitleDecoder
   and MetadataDecoder respectively, since they extend Decoder.
   Ditto for all subclasses.
4. Subtitle and Metadata decoders now throw their own exception
   types rather than ParserException.
5. Move MediaCodec classes into a mediacodec package, with the
   exception of the concrete audio and video renderers.
6. Create an audio package to hold the two audio renderer classes
   plus related util classes.
7. Create a video package to hold the one video renderer class
   plus related util classes.

After this change the following nice properties hold:

1. Want a video renderer? Look in the video package. Ditto for
   audio, text and metadata.
2. All TrackRenderer implementations use a decoder of some kind
   to decode buffers received from the source, so we have
   consistent terminology there.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127326805
2016-07-15 18:14:55 +01:00
olly
4f718363b5 Remove BandwidthMeter from SimpleExoPlayer
The BandwidthMeter should only be used by MediaSource
instances and the objects they reference, so there's
really no reason for the player to need to know about it.

This change sacrifices DebugTextViewHelper showing the
estimated bandwidth, but I think that's a price worth
paying.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127316755
2016-07-15 18:14:14 +01:00
eguven
4a5bb55920 Split DashMediaSource MediaPeriod implementation into DashMediaPeriod and support multiple periods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127315877
2016-07-15 18:13:33 +01:00
aquilescanta
a0c1595725 Add support for CEA608 in MP4 and fMP4
Issue: #1658
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127312721
2016-07-15 18:12:57 +01:00
[]inger
e4a3483d6f Propagate audioSessionId.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127300225
2016-07-15 18:12:20 +01:00
andrewlewis
11e2e0e640 Release Extractors on the loader's thread.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127294338
2016-07-15 18:11:38 +01:00
olly
62ebcaf853 Remove unnecessary res placeholder files
I think these were needed for Eclipse only.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127232262
2016-07-15 18:11:05 +01:00
olly
ea0cfdeeb1 Remove dead code from SmoothStreamingChunkSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127232159
2016-07-15 18:10:29 +01:00
andrewlewis
acef34a6f3 Set the output buffer position/limit only if it's non-null.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127196797
2016-07-15 18:09:11 +01:00
olly
d4d1640808 Use extension rather than composition for track selection
It doesn't look like TrackSelectionPolicy is going to be
useful other than with DefaultTrackSelector, and it's kinda
confusing dealing with both "selector" and "policy"
terminology. This change does the following:

DefaultTrackSelector -> selector.MappingTrackSelector
DefaultTrackSelectionPolicy -> selector.DefaultTrackSelector
TrackSelectionPolicy -> [deleted]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127196326
2016-07-15 18:08:36 +01:00
olly
67be677ddf Move more classes under source package
- Chunk package is only useful to source packages.
- BehindLiveWindowException is a source exception.
- SequenceableLoader is related to sources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127195307
2016-07-15 18:08:00 +01:00
andrewlewis
e4b08117fc Use adaptation workaround on N7v1.
Also, only enable the workaround when the resolution isn't changing but the
format is changing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127192637
2016-07-15 18:07:24 +01:00
olly
de27b2e043 TrackStream -> source.SampleStream
Also addded result constants to C to remove the dependency
on TrackStream from extractor.DefaultTrackOutput.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127192488
2016-07-15 18:06:48 +01:00
olly
be9d77c59c Add new UI package.
There aren't really enough classes to justify it right
now, but if we're going to do a VideoView equivalent and
sensible player controls at some point, it's worth making
now to get classes into the correct place.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127184374
2016-07-15 18:06:12 +01:00
andrewlewis
c936aee412 Fix condition for working around broken decoders.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127102633
2016-07-15 18:05:02 +01:00
olly
bcca373f5b Rename DecoderInfo -> MediaCodecDecoderInfo
All other MediaCodec specific classes are prefixed MediaCodec,
and we now have other decoders that aren't not related to
MediaCodec.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127093330
2016-07-15 18:04:19 +01:00
andrewlewis
fdf26d6a1f Work around volantis adaptation issue.
The volantis H.264/AVC decoder could get stuck when adapting between certain
stream formats where there was no change in resolution.

Queue a small Baseline profile SPS, PPS and IDR slice during adaptation on this
device, to force reallocation of reference frames.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127091330
2016-07-15 18:03:45 +01:00
eguven
464869cf57 Fix DASH duration.
As multi period DASH isn't supported yet use the duration of the first period only.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127086808
2016-07-15 18:03:09 +01:00
olly
4e86c55361 Introduce source package for sources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127073630
2016-07-15 18:02:31 +01:00