1865 Commits

Author SHA1 Message Date
olly
317a8ef19b Simplify DashMediaSource and simulate manifest refreshes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130507478
2016-08-31 15:25:07 +01:00
andrewlewis
5296d5b198 Move isFinal flag to the Window.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130503190
2016-08-31 15:25:07 +01:00
eguven
671a15badf ExtractorMediaPeriod: Use URI sha1 hash as the DataSpec key.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130422264
2016-08-31 15:25:07 +01:00
olly
7bed85950e Fix/improve SmoothStreaming live window
- Add missing callback call.
- Allow injection of live edge offset.
- Refine calculation of live window size to correctly
  handle just-started streams where the DVR window
  hasn't yet grown to full size.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130412465
2016-08-31 15:25:06 +01:00
olly
e0773f705f Allow applications to specify the live edge offset.
Also allow use of suggestedPresentationDelay taken from the
manifest, and enable this by default.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130409924
2016-08-31 15:25:06 +01:00
andrewlewis
76f7fffb8d Clean up period identifiers.
SinglePeriodTimelines can all use the same identifier, as their identifier is
wrapped in a pair with the (fixed) source index when they are concatenated with
other sources' timelines.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130386297
2016-08-31 15:25:06 +01:00
olly
bb8cbbfbe8 Allow mapping of period->window
This is a 1:1 mapping. This change formalises the fact,
and makes it possible to easily query the mapping.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130375111
2016-08-31 15:25:06 +01:00
olly
e35f9addaf Remove playWhenReadyCommitted.
This was always a bit of a hack; for Play Movies. It may well
no longer be necessary, and if not I'd like to think of a nicer
or more general way of doing it. We can always bring it back
if needed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130373433
2016-08-31 15:25:06 +01:00
olly
18a8655343 Javadoc cleanup: ExoPlayer#x -> #x
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130369177
2016-08-31 15:25:06 +01:00
eguven
096f85202e Use manifest URL sha1 hash as the content id.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130293908
2016-08-31 15:25:06 +01:00
andrewlewis
63ab601d75 Use consistent identifiers for extractor periods.
Also, fix clearing the timeline for source info changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130292700
2016-08-31 15:25:06 +01:00
andrewlewis
80227840f6 Post source info refreshes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130289294
2016-08-31 15:25:06 +01:00
olly
1a909fd163 Change SeekWindow -> Window, and add window duration.
- This avoids the need to have to use the timeline to
  calculate a window duration, which can be awkward.
- Window now represents a window of availability with
  an isSeekable flag, rather than a window of
  seekability.
- Promoted Timeline and Window to top package; they're
  pretty important :).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130278509
2016-08-31 15:25:06 +01:00
andrewlewis
b120bea029 Don't reuse MediaPeriods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130266483
2016-08-31 15:25:06 +01:00
olly
b5e41a903d Remove buffered position edge case.
It's no longer safe to convert END_OF_SOURCE -> duration on
the main therad, since the Timeline from which the duration
is obtained is posted to the main thread, where-as the
buffered position is passed by updating a volatile. Hence
an update to the latter might become visible to the main
thread before the corresponding Timeline.

This change moves the conversion to the playback thread.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130265893
2016-08-31 15:25:06 +01:00
andrewlewis
6e24372414 Use integers as identifiers for DASH periods.
This is in preparation for making it so that periods aren't reused.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130113382
2016-08-31 15:25:05 +01:00
olly
0ca81b1a4c Make sure TrackSelections refer to the correct TrackGroups
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130111048
2016-08-31 15:25:05 +01:00
aquilescanta
fc5df6312d Add support for multiple truns in a single traf
This kind of mp4 files has been seen in Hls+fMp4 samples.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130094845
2016-08-31 15:25:05 +01:00
olly
d04fde1a53 Distinguish dense vs sparse tracks for buffering purposes
- For audio/video, we should report the minimum largest
  queued timestamp. This ensures that buffering continues
  rather than stops in the case of bad sample interleaving.
- If there are "sparse" tracks then they should be ignored
  for this calculation, otherwise the buffered position can
  end up getting stuck at some small value (e.g. if there's
  a text track containing a single sample with a small
  timestamp).
- In the edge case that there are only "sparse" tracks, we
  probably want to take the maximum largest queued time
  instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130094266
2016-08-31 15:25:05 +01:00
eguven
c380ba2dc1 CacheSpan.isEOS (is end of stream) field shows whether the {@link CacheSpan} contains the end of the original stream.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130084365
2016-08-31 15:25:05 +01:00
olly
cc28aeadd8 Automated rollback
*** Reason for rollback ***

Referential equality was probably the right thing to do, since using .equals
breaks track selection in the case that a source exposes two or more tracks
whose formats are equal. We should fix the way overrides work instead.

*** Original change description ***

Fix multi-period transitions with track selection overrides

An override applies across periods provided they expose the
same track groups according to .equals, but the formats in
the override are then compared against the period's formats
according to ==. Use .equals consistently to fix.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130083840
2016-08-31 15:24:50 +01:00
olly
1811b01b07 Report duration only via Timeline
It's error prone (and more code) to report two ways

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129999117
2016-08-31 13:25:21 +01:00
olly
d8ffafea65 Simplify Timeline classes a bit
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129993536
2016-08-31 13:24:44 +01:00
eguven
56bfa78f0a Enable test coverage report generation for library project.
To generate the reports, under 'v2' folder run:
./gradlew createDebugCoverageReport

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129991223
2016-08-31 13:24:06 +01:00
olly
5deb948d14 Bugfix: If no renderers enabled, we don't need buffer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129987973
2016-08-31 13:23:30 +01:00
olly
f9005c7a78 Bugfix: Allow discontinuity on selectTracks
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129987709
2016-08-31 13:22:54 +01:00
olly
153c0aef2b Rework MediaPeriod track selection
This change allows MediaPeriod instances to replace
SampleStream instances when the selection isn't changing.
It also allows MediaPeriod instances to retain a
SampleStream but indicate that the renderer consuming
from it needs to be reset.

The change is used to fix the ref'd bug, and is used to
do the same thing in HLS without the need for the source
to report a discontinuity. Note that reporting discontinuity
could cause unnecessary failure when used as a child of
MergingMediaSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129971782
2016-08-31 13:22:15 +01:00
olly
9092c5665b Bump V1 to 1.5.10 + Fix incorrect Javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129966073
2016-08-31 13:21:38 +01:00
vigneshv
a2dfc62e08 MatroskaExtractor: Implement subsample encryption
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129908648
2016-08-31 13:20:50 +01:00
olly
f6fdcee9b3 Parse stz2 Atoms during mp4 extraction.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129892143
2016-08-10 20:16:05 +01:00
andrewlewis
e883b7c270 Clear the timeline on seeking if renderers are reading ahead.
If a renderer is reading ahead of the playing period, seeking within the
playing period would fail, because renderers would not be disabled but then try
to read from SampleStreams that have a released period.

Also, in the same circumstances, seeking within the reading period would fail,
because all renderers would be disabled, but their sample streams have already
been read. When they are reenabled they expect to see a format but don't
receive one.

In both cases, seeking can just clear the timeline. This only occurs in rare
circumstances when the player is reading ahead, so the cost of re-preparing
will not be incurred often, and allows the seeking logic to be simpler.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129891060
2016-08-10 20:15:30 +01:00
olly
932574a3cb Fix us/ms conversion error.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129871792
2016-08-10 20:14:10 +01:00
olly
91c7551cc3 Remove Timeline.UNKNOWN_PERIOD_COUNT
It's no longer used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129870115
2016-08-10 20:13:37 +01:00
olly
d10c811bd8 Fix Tx3g decoding
Issue #1712

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129869936
2016-08-10 20:13:03 +01:00
olly
cd4cc1dc14 Add absolute start time to Timeline
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129869741
2016-08-10 20:12:29 +01:00
olly
4502a464dd Use ms for SeekWindow, for consistency with Timeline
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129868070
2016-08-10 20:11:56 +01:00
olly
c5a2f9b010 Expose seek window + start position for SmoothStreaming
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129867969
2016-08-10 20:11:23 +01:00
olly
2a15480102 Fix SmoothStreaming
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129851843
2016-08-10 20:10:49 +01:00
andrewlewis
23981a6fc4 Hide the shutter view when no video is being rendered.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129849825
2016-08-10 20:10:14 +01:00
olly
aab4e36d1a Don't reuse SampleStream instance in SingleSampleMediaSource
Referential equality is going to become important for detecting
whether a SampleStream has been replaced, so we need to create
new instances as we do elsewhere.

This also enables multiple SampleStreams to be provided for a
single TrackGroup, as is also true for DASH and SmoothStreaming.
It's forbidden to ask for multiple SampleStreams from a single
TrackGroup currently, but we may choose to relax that at some
point (and indicate whether it's allowed as a flag on each
TrackGroup).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129842336
2016-08-10 20:09:40 +01:00
olly
665c9fc14c Fix DASH period duration reporting
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129787235
2016-08-10 20:09:05 +01:00
andrewlewis
cdb706bac8 Fix period durations for single period and concatenated timelines.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129748865
2016-08-10 20:08:31 +01:00
andrewlewis
88bf1d0739 Expose the seekable window.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129747377
2016-08-10 20:07:56 +01:00
olly
39482f244b Fix broken Javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129733571
2016-08-10 20:07:20 +01:00
olly
300ddc2aef Cronet extension project setup
- Add build test to [] so it runs in presubmit
- Tweak README.md instructions
- Use symlinks to make the extension usable in Android
  Studio internally, without taking any special action
- Remove unnecessary dependencies
- Simplify setup instructions in README.md

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129733466
2016-08-10 20:06:43 +01:00
eguven
bd37216902 CacheSpan and Util.un/escapeFileName tests.
Fixed CacheSpan regexp for line breaks characters in key.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129631446
2016-08-10 20:06:06 +01:00
olly
b15ceba780 Enhance DefaultTrackSelector part 2
- Support specifying a preferred text language.
- Score based selection for text/audio/other tracks.
- Prefer default tracks to non-default ones.
- Allow overriding of base select*Track methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129626994
2016-08-10 20:05:31 +01:00
andrewlewis
95f4113456 Fix seeking into a different period that has been prepared.
When seekToPeriodPosition found that the seek destination period was already
prepared, it would not disable/re-enable renderers. This was fine if the
playing period wasn't changing, but in other cases the renderers would be left
reading the incorrect streams (and the underlying periods may have been
released).

Also, transition to the buffering state before re-enabling renderers, so that
the renderers are not started until leaving the buffering state.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129625632
2016-08-10 20:04:56 +01:00
olly
5783272444 Fix missing generics
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129624395
2016-08-10 20:04:19 +01:00
olly
a7cb98d991 Pass source to TransferListener events
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129622239
2016-08-10 20:03:30 +01:00