1939 Commits

Author SHA1 Message Date
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
andrewlewis
3ef837341e Don't use OMX.qcom.audio.decoder.mp3 on LGE Optimus API 16.
Issue: #1714

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129600348
2016-08-08 11:53:30 +01:00
aquilescanta
52d9539878 Fix NPE in track selection view
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129336905
2016-08-08 11:53:30 +01:00
andrewlewis
c2c41558e5 Merge the internal timeline into ExoPlayerImplInternal.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129325922
2016-08-08 11:53:30 +01:00
olly
ee565300cb Enhance DefaultTrackSelector part 1
- Enforce viewport constraints for fixed video track selection.
- Select best fixed video track, not the first one.
- Better handling of video tracks with unknown dimensions.
- Mini bug fix.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129226593
2016-08-08 11:53:30 +01:00
olly
2395f13682 Tweak project structure
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129212987
2016-08-08 11:53:22 +01:00
olly
e26f72d454 Update @return to Returns where appropriate
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129201483
2016-08-08 11:16:33 +01:00
olly
490c5fea78 Further improve codec reconfiguration
- Only setup a codec to allow adaptation to other compatible
  formats in the stream. If something like the mimeType is
  changing adaptation will never be possible, so there's no
  point.
- Incorporate maxInputSize into the reconfiguration logic.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129088464
2016-08-08 11:15:44 +01:00
eguven
bd7c8fed1b While buffering check for errors even if renderes are ready.
On an edge case, player may get stuck when the renderers are ready but the buffer doesn't get full enough because of a fatal error in data source. An example state can be created by starting a live DASH stream and switching between normal and slow network connections.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129084824
2016-08-08 11:15:06 +01:00
olly
9a272068b4 Allow resetting of position when setting source
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129083335
2016-08-08 11:14:18 +01:00
olly
90ceade08f Add option to manually replace manifest URI
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129081694
2016-08-08 11:13:39 +01:00
olly
af8f1b8387 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=129081591
2016-08-08 11:13:01 +01:00
olly
1bea48f249 Suppress noop format changes
For self-initializing segments, DefaultTrackOutput receives
a null format and then the actual format. This broke the
deduplication logic in InfoQueue.format, since there were
two transitions: FormatX->Null and Null->FormatX. This CL
allows deduplication to succeed in this case.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129081583
2016-08-08 11:12:22 +01:00
olly
5345702ec5 Improve formatting in demo app track selector
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129080823
2016-08-08 11:11:40 +01:00
olly
02a79f8c51 Improve video canReconfigureCodec accuracy
The codec cannot be reconfigured if the format rotation
changes, or if the format dimensions exceed the current
decoder's configured maximum dimensions.

Issue #1707

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129004187
2016-08-08 11:10:59 +01:00
olly
ced7906737 Make track selection dialog d-pad friendly
This wont help much until the buttons to get the dialogs
to display are focusable! Use of MediaController seems to
make that tricky (to be continued...).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128989328
2016-08-08 11:10:19 +01:00
olly
17014e6264 Fix concat media source premature listener invocation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128987095
2016-08-08 11:09:36 +01:00
andrewlewis
c1729b640c Allow seeking to a default position in a period.
When seeking to the default position in a period, the containing source may
actually return a position in another period. Multi-period live sources can do
this to seek the player to the live edge.

ExoPlayerImplInternal uses the same functionality when the playback position
reaches the end of a period to determine what period/position to play next.
This means that when playback transitions to a multi-period live source from
some other source (playing a concatenation of those two sources), the player
will play the live edge rather than the beginning of the earliest period.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128984355
2016-08-08 11:08:50 +01:00
olly
abd5653dc4 Add Util.getUtf8Bytes to avoid warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128980489
2016-08-08 11:08:11 +01:00
olly
3604d589c1 Deduplication AVC/HEVC config parsing + other TODOs
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128979671
2016-08-08 11:07:29 +01:00
andrewlewis
8d122a101d Use new import ordering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128967776
2016-08-08 11:06:48 +01:00
andrewlewis
f89e170054 Remove --disable-vp10 from vp9 extension configuration.
The option was removed in
67edc5e83b%5E%21/#F2.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128801977
2016-08-08 11:05:29 +01:00
olly
846f8e1d46 Enable track blacklisting for DASH and SmoothStreaming
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128721068
2016-07-28 20:04:41 +01:00
olly
f66b90e34b Eliminate cruft from the demo apps's PlayerActivity
Useful functionality promoted to core library:

1. Management of SurfaceHolder.Callback lifecycle
   promoted to SimpleExoPlayer
2. Ability to determine whether audio/video tracks
   exist but are all unsupported promoted to
   MappingTrackSelector.TrackInfo
3. Read external storage permissions check promoted
   to Util
4. SubtitleView given ability to act directly as a
   TextRenderer.Output to remove layer of indirection
5. SubtitleView given ability to configure itself to
   user's platform wide caption styling
6. KeyCompatibleMediaController promoted to library's
   UI package.

Relocation of boring stuff:

1. ID3 frame logging moved to EventLogger.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128714230
2016-07-28 20:04:41 +01:00
olly
3501332dd3 Converge track selection to a single place.
This change merges the duties of FormatEvaluator into
TrackSelection classes, so that both the static and
dynamic parts of track selection are implemented in a
single place.

New feature: Demo app now allows you to enable random
adaptation in the track selection dialog.

Notes:

- It should be quite easy to allow application side
track blacklisting in addition to source side, as an
extension to this. That would effectively allow
applications to do seamless/deferred track selection
by creating a TrackSelection with all tracks enabled,
and then toggling the blacklist flags to select the
ones they want to be active.

- It should be trivial to implement format blacklisting
for DASH and SS as an extension to this. Will do in a
follow up CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128707517
2016-07-28 20:04:40 +01:00
olly
5eb6190682 Fix branch documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128707067
2016-07-28 20:04:40 +01:00
eguven
2040615cc8 Support for added and removed DASH periods.
Logic and some code is copied from V1.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128706688
2016-07-28 20:04:40 +01:00