2892 Commits

Author SHA1 Message Date
hoangtc
e575af3ac3 Parse DASH manifest's publish time.
Parse DASH manifest's publishTime node as defined by ISO/IEC 23009-1:2014,
section 5.3.1.2.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176525922
2017-11-22 18:21:13 +00:00
tonihei
6607f49be6 Fix reporting of format changes in ChunkSampleStream.
Until recently, changing primary track formats were reported when the
corresponding media chunk was discarded which always happened immediately
after the sample has been read.

Now, media chunks may be discarded later on or in batches, leaving the
current reporting mechanism broken because changes may never be reported.

This fix separates the discarding from the reporting such that format changes
can be reported when the media chunk is first read from, while the discarding
operation only discards without reporting format changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176519071
2017-11-22 18:19:46 +00:00
andrewlewis
15a1f9a552 Remove DefaultLoadControl buffer time state
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176515168
2017-11-22 18:18:19 +00:00
hoangtc
e619079a0d Let EventMessage encloses its presentationTimeMs.
Currently EventMessage's presentationTimeMs is kept separately in
EventSampleStream. However, EventMessage's presentationTimeMs maybe used in
other places besides EventSampleStream, such as when handling `emsg' messages
targeting the player. This CL let EventMessage object to holds its
presentationTimeMs for such use cases.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176502938
2017-11-22 18:16:58 +00:00
Oliver Woodman
3998ed49ae Mini cleanup 2017-11-21 13:42:12 +00:00
ojw28
1a138ad4dc
Merge pull request #3486 from IanDBird/dev-v2
Fix initializationData check for SSA subtitles
2017-11-21 13:31:06 +00:00
olly
856c2f8d3e Make ExtractorMediaSource timeline dynamic until duration is set
We (eventually - albeit possibly infinitely far in the future)
expect a timeline update with a window of known duration. This
also stops live radio stream playbacks transitioning to ended
state when their tracks are disabled.

As part of this fix, I found an issue where getPeriodPosition
could return null even when defaultPositionProjectionUs is 0,
which is not as documented.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176492024
2017-11-21 13:16:19 +00:00
andrewlewis
31e2cfce9e Pass playback speed to LoadControl and TrackSelection
This allows implementations of those classes to take into account the playback
speed for adaptive track selection and controlling when to resume the player.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176484361
2017-11-21 13:13:35 +00:00
tonihei
e1d960db68 Unify internal reset method to support state and position resets.
The ExoPlayerImplInternal.reset method now takes the same set of options
as the ExoPlayer.prepare method. This also allows to
- Remove some code duplication within ExoPlayerImplInternal
- Fix calls to prepare(sameSource, resetPosition=true, resetState=false)
  with enabled shuffle mode where the position was not correctly reset to the
  first period index.
- Keep the current timeline when calling stop (in line with ExoPlayerImpl).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176481878
2017-11-21 13:10:45 +00:00
tonihei
aac53cac56 Add reason to onTimelineChanged.
Currently onTimelineChanged doesn't allow to distinguish easily between the
different reasons why it's being called. Especially, finding
out whether a new media source has been prepared or the current source
refreshed dynamically was impossible without tightly coupling the player
operations with the listener.

The new reasons provide this disdinction by either indicating a newly
initialized media source, a dynamic update to an existing timeline
or manifest, or a reset of the player (which usually results in an
empty timeline).

The original onTimelineChanged method without reason is kept in the
DefaultEventListener as deprecated to prevent the need to update all
existing listeners in one go.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176478701
2017-11-21 13:07:46 +00:00
olly
13b595ed39 Don't do work after track selection when in ended state
This causes the player to report that it's started loading
when in the ended state.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176371892
2017-11-21 13:06:11 +00:00
olly
275292cb63 Report additional position discontinuities
- Properly report internal discontinuities
- Add DISCONTINUITY_REASON_SEEK_ADJUSTMENT to distinguish
  seek adjustments from other internal discontinuity events

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176367365
2017-11-21 13:04:47 +00:00
olly
c06fe73b66 Bump target API level to 27
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366693
2017-11-21 13:03:28 +00:00
olly
3656230cb1 Use MediaSourceTestRunner in additional source tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366471
2017-11-21 13:01:59 +00:00
hoangtc
0de57cbfae Allow more flexible loading strategy when loading multiple sub streams.
Currently for a DASH ChunkSource that consists of multiple sub-streams, we
always use a CompositeSequenceableLoader, which only allows the furthest behind
loader or any loader that are behind current playback position to continue
loading.
This changes allow clients to have more flexibility when deciding the loading
strategy:
- They can construct a different kind of composite SequenceableLoader from
the sub-loaders, and use it by injecting a different CompositeSequeableLoaderFactory accordingly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176363870
2017-11-21 12:59:11 +00:00
Ian Bird
a9d91b3387 Fix initializationData check for SSA subtitles 2017-11-21 10:59:10 +00:00
andrewlewis
c4fe0e6482 Add support for Dolby Atmos
Issue: #2465

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176341309
2017-11-20 13:43:31 +00:00
tonihei
75acfc7957 Move media clock handling to its own class.
This class implements MediaClock itself and handles the switching between
renderer and standalone media clock.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176340615
2017-11-20 13:42:06 +00:00
tonihei
3f6b4d18a9 Move MockitoUtils to testutils and use it for all Mockito set-ups.
In particular this allows to have the workaround for
https://code.google.com/p/dexmaker/issues/detail?id=2 in one place only.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176340526
2017-11-20 13:40:28 +00:00
olly
82d0a27fd9 Fix some lint issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176337058
2017-11-20 13:39:03 +00:00
aquilescanta
a7c424a15c Add time unit and javadocs to fields in DashManifest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176335667
2017-11-20 13:37:35 +00:00
aquilescanta
d856d0f056 Use consistent case for sideloaded
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176333544
2017-11-20 13:36:16 +00:00
hoangtc
2a02171c42 Add Builder to SingleSampleMediaSource.
Add Builder pattern to SingleSampleMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176332964
2017-11-20 13:34:45 +00:00
olly
676f3bfc49 Add MediaSourceTestRunner for MediaSource tests.
- MediaSourceTestRunner aims to encapsulate some of the logic
  currently used in DynamicConcatenatingMediaSourceTest, so it
  can be re-used for testing other MediaSource implementations.
- The change also fixes DynamicConcatenatingMediaSourceTest to
  execute calls on the correct threads, and to release handler
  threads at the end of each test.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176117535
2017-11-17 19:02:14 +00:00
olly
8455d10366 Simplify LoopingMediaSourceTest setup
This test seems to obtain a timeline from a prepared
FakeMediaSource, but that's identical to the timeline
passed into that source to start with :).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176117133
2017-11-17 19:00:43 +00:00
eguven
00f68b26c9 Replace hard coded UUID in OfflineLicenseHelper with a parameter
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176102179
2017-11-17 18:59:20 +00:00
tonihei
525ae7fed7 Add simplified FakeTimeline constructor.
This is helpful for tests which don't care about detailled timeline set-ups
besides the number of windows.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176097369
2017-11-17 18:57:51 +00:00
hoangtc
e349905039 Add Builder to ExtractorMediaSource.
Add Builder pattern to ExtractorMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176088810
2017-11-17 18:56:25 +00:00
olly
74e74402da Deduplicate ExtractorMediaPeriod discontinuity reporting
This change makes sure progress is being made before reporting
a discontinuity. Else in cases like having no network and
playing a live stream, we allow the discontinuity to be read
each time an internal retry occurs, meaning it gets read
repeatedly. This does no harm, but is noisy and unnecessary.

We should also not allow skipping whilst there is a pending
reset or discontinuity notification, just like we don't allow
reads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175953064
2017-11-17 18:54:55 +00:00
andrewlewis
b8aedfbf4f Add support for float output for FfmpegAudioRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175940553
2017-11-17 18:53:26 +00:00
andrewlewis
15a2f47f31 Add support for float output in DefaultAudioSink
Also switch from using MIME types to C.ENCODING_* encodings in DefaultAudioSink.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175936872
2017-11-17 18:51:43 +00:00
andrewlewis
6db895bd7b Use ArrayDeque for playback parameters checkpoints
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175837754
2017-11-17 18:48:42 +00:00
olly
28693ac7d6 Allow LoadControl to configure the back-buffer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175833398
2017-11-17 18:47:14 +00:00
olly
bd0bc03f64 Inject toKeyframe discard parameter from ExoPlayerImplInternal
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175805139
2017-11-17 18:45:51 +00:00
hoangtc
28df0e133b Add Builder pattern to HlsMediaSource.
Add Builder pattern to HlsMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175803853
2017-11-17 18:44:28 +00:00
olly
5301d38136 Some test cleanup
The purpose of this change isn't to fix anything. It's just to
simplify things a little bit. There will be following CLs that
make some changes to get things onto correct threads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175800354
2017-11-17 18:41:38 +00:00
tonihei
5aa053d91d Add method to FakeMediaSource to trigger source info refresh.
This allows to remove the LazyMediaSource used within
DynamicConcatenatingMediaSourceTest and also allows to write test which
simulates dynamic timeline or manifest updates.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175680371
2017-11-17 18:37:08 +00:00
olly
22b95032b3 Reinstate buffer discard for SmoothStreaming
Now we have a ChunkSampleStream.discardBuffer, we need to call
it from SsMediaPeriod as well as for the DASH case.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175675427
2017-11-17 18:35:39 +00:00
tonihei
b30b786350 Avoid track group array error-prone reference quality check in CastPlayer.
Also replaced the duplicated EMPTY track group array with the one already defined
in TrackGroupArray.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175670266
2017-11-17 18:32:38 +00:00
hoangtc
fee6cf5cd8 Continue adding Builder to MediaSource.
Add Builder pattern to SsMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175659618
2017-11-17 18:29:50 +00:00
tonihei
b865259e63 Forward ad group and ad index when creating period from concatanted media sources.
Also added tests which verify the intended behaviour.

GitHub:#3452

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175656478
2017-11-17 18:28:21 +00:00
aquilescanta
b17ae80679 Fix cenc mode support and add support for the .mp4a extension.
Also add encrypted HLS internal sample streams.

Issue:#1661

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175577648
2017-11-17 18:26:41 +00:00
olly
afe6f667b2 Move all buffer discard to MediaPeriod.discardBuffer
This is a step toward retaining a back-buffer in a way that
works for all MediaSource implementations. It's not possible
to adjust the discardBuffer calls in ExoPlayerImplInternal
to discard up to (position - backBufferDurationUs). Next steps
are to:

1. Find an appropriate place to specify the back buffer value,
   to be passed to the discardBuffer calls. I guess the
   LoadControl is the appropriate place to define such values.
2. Enhance discardBuffer to support a toKeyframe argument to
   pass through to discardTo.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175565363
2017-11-13 20:07:25 +00:00
hoangtc
67bbbed9fe Notify TrackSelection when it's enabled and disabled.
Add onEnable() and onDisable() call-backs to TrackSelection. This allows
TrackSelection to perform interesting operations (like subscribe to
NetworkStatus) and clean up after itself.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175558485
2017-11-13 20:06:06 +00:00
arnaudberry
db7e9a548c Make it possible to extend DashManifestParser to parse revision-id.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175554723
2017-11-13 20:04:40 +00:00
Oliver Woodman
e92667ba5b Only set shutter color if attr is declared 2017-11-13 17:28:25 +00:00
ojw28
99d0a7a3da
Merge pull request #3451 from nvalletta/dev-v2-shutter-background-color
Add an easy way to set the shutter view background color
2017-11-13 17:11:39 +00:00
ojw28
73e96be85c
Merge pull request #3440 from yqritc/fix-bravia
Skip using MediaCodec.setOutputSurface on Bravia
2017-11-13 17:11:24 +00:00
hoangtc
0be4b46bb4 Introduce Builder pattern to create MediaSource.
Start with DASH MediaSource. The number of injected arguments is getting
out-of-control.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175529031
2017-11-13 17:08:24 +00:00
hoangtc
735af5c0b0 Update several minor code/test style issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175180089
2017-11-13 15:15:07 +00:00