299 Commits

Author SHA1 Message Date
olly
d3d63101d1 [Refactor - Step #5] Introduce TrackSelector
Notes:

- The way this works is that every time the player needs to
  select some tracks it invokes the TrackSelector. When a
  track selection is actually activated (i.e. "hits the
  screen") it gets passed back to the TrackSelector, which
  allows it to expose the current tracks through an API that
  it may choose to define. Since playlist support doesn't exist
  yet, it's currently the case that the pass-back always occurs
  immediately.
- A TrackSelector can invalidate its previous selections if its
  selection criteria changes. This will force the player to invoke
  it again to make a new selection. If the new selection is the
  same as the previous one for a renderer then the player handles
  this efficiently (i.e. turns it into a no-op).
- DefaultTrackSelector supports disabling/enabling of renderers.
  Separately, it supports overrides to select specific formats.
  Since formats may change (playlists/periods), overrides are
  specific to not only the renderer but also the set of formats
  that are available to it. If the formats available to a renderer
  change then the override will no longer apply. If the same set
  of formats become available at some point later, it will apply
  once more. This will nicely handle cases like ad-insertion where
  the ads have different formats, but all segments of main content
  use the same set of formats.
- In general, in  multi-period or playlist cases, the preferred
  way of selecting formats will be via constraints (e.g. "don't play
  HD", "prefer higher quality audio") rather than explicit format
  selections. The ability to set various constraints on
  DefaultTrackSelector is future work.

Note about the demo app:

- I've removed the verbose log toggle. I doubt anyone has
  ever used it! I've also removed the background audio option.
  Without using a service it can't be considered a reference
  implementation, so it's probably best to leave developers to
  figure this one out. Finally, listening to AudioCapabilities
  has also gone. This will be replaced by having the player
  detect and handle the capabilities change internally in a
  future CL. This will work by allowing a renderer to invalidate
  the track selections when its capabilities change, much like
  how a selector is able to invalidate the track selections in
  this CL.
- It's now possible to enable ABR with an arbitrary subset of
  tracks.
- Unsupported tracks are shown grayed out in the UI. I'm not
  showing tracks that aren't associated to any renderer, but we
  could optionally add that later.
- Every time the tracks change, there's logcat output showing
  all of the tracks and which ones are enabled. Unassociated
  tracks are displayed in this output.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117122202
2016-06-15 18:54:51 +01:00
olly
a7adcce018 One Format object to rule them all.
- Format can represent both container and sample formats.
  If a container contains a single track (as is true in
  DASH and SmoothStreaming) then the container Format can
  also contain sufficient information about the samples
  to allow for track selection. This avoids the Format to
  MediaFormat conversions that we were previously doing in
  ChunkSource implementations.

- One important result of this change is that adaptive
  format evaluation and static format selection now use the
  same format objects, which is a whole lot less confusing
  for someone who wants to implement both initial selection
  and subsequent adaptation logic. It's not in the V2 doc,
  but it may well make sense if the TrackSelector not only
  selects the tracks to enable for an adaptive playback, but
  also injects a FormatEvaluator when enabling them that will
  control the subsequent adaptive selections. That would make
  it so that all format selection logic originates from the
  same place.

- As part of this change, the adaptiveX variables are removed
  from the format object; they don't really correspond to a
  single format. This also saves on having to inject the max
  video dimensions through a bunch of classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=114546777
2016-06-15 18:54:50 +01:00
olly
ce324f1ca9 ExoPlayer V2 Refactor - Step 7 (partial)
This change removes the need for SourceBuilders to load their
manifests before building their sources. This is done by pushing
initial manifest loads into the ChunkSource classes. This simplifies
the SourceBuilders a lot, and also DemoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113259259
2016-06-15 18:54:38 +01:00
olly
be47148940 ExoPlayer V2 Refactor - Step 4
Notes:
1. The logic in ExoPlayerImplInternal is very temporary, until we
   have proper TrackSelector implementations. Ignore the fact that
   it's crazy and has loads of nesting.
2. This change removes all capabilities checking. TrackRenderer
   implementations will be updated to perform these checks in a
   subsequent CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113151233
2016-06-15 18:54:26 +01:00
olly
cdae9ac5d2 ExoPlayer V2 Refactor - Steps 1/2.
GitHub note - Apologies for the cryptic change descriptions,
they relate to a design doc that's not externally visible.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113043764
2016-06-15 18:53:40 +01:00
Oliver Woodman
39a7cea987 Bump version to 1.5.4 2016-01-22 16:07:16 +00:00
Oliver Woodman
89ce1ccedf OggVorbisExtractor (WIP - Seeking not yet enabled) 2016-01-22 11:46:37 +00:00
Oliver Woodman
eda8ac4e01 Add eventSourceId to onAvailableRangeChange events 2016-01-22 11:38:06 +00:00
andrewlewis
317842a6b7 Use expandable headers in the sample chooser.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112149442
2016-01-14 17:13:32 +00:00
olly
2690f569af Enable track selection + WebVTT for HLS.
See the documentation of buildTracks for the gory details.

Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112149293
2016-01-14 17:13:32 +00:00
olly
59cf3e02f5 HlsChunkSource: Expose stuff for WebVtt/Variant selection.
Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111945466
2016-01-14 17:13:32 +00:00
eguven
8c8794878d Fixed demo-misc-vp9-opus-sw DASH check
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111839055
2016-01-14 17:13:32 +00:00
olly
ab9e3bac46 Introduce HlsTrackSelector.
This is equivalent to DashTrackSelector and SmoothStreamingTrackSelector.
This is a step toward allowing HlsChunkSource to expose multiple tracks,
which is a requirement for supporting WebVtt.

This change also enables WebVtt extractor instantiation.

Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111698833
2016-01-14 17:08:25 +00:00
olly
00f8deda3d Introduce PtsTimestampAdjusterProvider for HLS WebVTT.
This allows the same adjusters to be used by multiple
HlsChunkSource instances. This is necessary because
WebVTT chunks will be loaded by a second chunk source
to the one loading audio/video. In both cases the same
timestamp adjustments will need to be applied.

Each source may transition from one discontinuity sequence
to the next at a slightly different time, so it's necessary
to maintain a separate adjuster for each sequence.

An adjuster can only be initialized correctly using audio/video
and not WebVTT, because the start time in a WebVTT file in
HLS doesn't necessarily correspond to the chunk start time,
which means the timestamp offset calculated by the adjuster
could end up being incorrect. Hence sources providing WebVTT
chunks will set isMasterSource to false. Lovely, right :(?

Issue: #151
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111693126
2016-01-14 17:08:25 +00:00
olly
b9ec51dbed SmoothStreaming track selector feature parity with DASH.
This gives DefaultSmoothStreamingTrackSelector feature parity
with DefaultDashTrackSelector. Note that the code duplication
across these classes will go away eventually, when we rework
track selection as described in Github Issue #1121.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111688784
2016-01-14 17:08:25 +00:00
olly
7fbffc873c Expose control over decoder selection.
This allows implementation and injection of custom MediaCodecSelector
instances. By injecting a custom selector, it's possible for applications
to exert more control over which decoder(s) they instantiate. For example,
applications can force use of a software decoder.

GitHub Issue #938
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110369810
2015-12-16 20:41:51 +00:00
olly
345e4ec74e Bump version to 1.5.3.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109698010
2015-12-08 18:00:46 +00:00
aquilescanta
1855a5a97d Fixed FFWD/RWD keys support in DemoPlayer
Overrided the dispatchKeyEvent of MediaController to allow FFWD and RWD through
remote control keys.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=108989028
2015-12-02 17:01:10 +00:00
Oliver Woodman
daaebd7d72 Remove file that shouldn't be checked in 2015-11-27 18:10:47 +00:00
Oliver Woodman
a6bfe02d24 Add additional Widevine samples + improve errors.
* Add additional Widevine samples.
* Improve error messaging in demo app around decoders.
* Display toasts for playback errors related to missing insecure
  decoders, missing secure decoders, decoder instantiation failure
  and decoder query failure.
* Remove checks from SampleChooserActivity, since the above largely
  covers off this problem.
2015-11-27 16:40:31 +00:00
Oliver Woodman
cdb6ac4073 Added a isLocalFileUrlOrPath(Uri) method to remove manual checks
Also replaced the manual checks with a call to this method
2015-11-27 15:59:25 +00:00
Oliver Woodman
61fb0c558e Fixed demo player permissions bug
API 23 requires the permissions to be granted at runtime.
This CL submits a solution for EXTERNAL_STORAGE, since it
is the only dangerous privilege required so far.
2015-11-25 17:02:19 +00:00
Oliver Woodman
632ccc6c20 Simplify passthrough playback rate calculation.
This change also fixes pre-M DTS HD passthrough playback on NVIDIA Shield.
2015-11-25 16:43:56 +00:00
Oliver Woodman
a4f1e3ce53 Don't re-buffer when AudioTrack underruns occur. 2015-11-17 16:27:53 +00:00
Oliver Woodman
2cb6db2b42 Update Widevine VP9 samples 2015-10-30 11:58:36 +00:00
Oliver Woodman
f4b07ab147 Resolve conflicts 2015-10-27 20:37:54 +00:00
Oliver Woodman
cda5b20353 Bump version to 1.5.2 2015-10-27 20:15:37 +00:00
Oliver Woodman
4422e8a015 Further cleanup to FLV extractor 2015-10-27 18:23:00 +00:00
Oliver Woodman
6fb5052d2f Fix vp9 samples 2015-10-26 15:54:30 +00:00
Oliver Woodman
22a302c28e Fix widevine samples 2015-10-26 15:52:36 +00:00
Oliver Woodman
c0a81e1138 Update Widevine test streams. 2015-10-26 15:14:25 +00:00
Oliver Woodman
c0f0cbcb7a Move to target API level 23 2015-10-26 15:02:32 +00:00
ojw28
f133524c2f Merge pull request #828 from jeoliva/flv-experiment
FLV (H.264 + AAC) support
2015-10-26 10:17:53 +00:00
Rik Heijdens
282a3fe818 Converted trackId into String 2015-10-23 09:56:00 -04:00
joli
3e36f529f8 FLV Support - Added Video Reader and parsing improvements 2015-10-22 23:50:46 +02:00
Oliver Woodman
0545c58dee Bump version to 1.5.1 2015-10-14 12:12:03 +01:00
Oliver Woodman
bcb9f8282d Enable SmoothFrameTimeHelper by default.
Context:
- Currently, playback is significantly more juddery with it disabled,
  particularly on AndroidTV.
- We should be able to do the "best" job of this internally, so injection
  doesn't buy anything useful. If someone has a better implementation for
  adjusting the frame release, they should improve the core library.
2015-10-12 12:32:10 +01:00
Oliver Woodman
ab489d35e9 Don't pass keyboard escape key to media controller.
This makes it possible to exit the player when using e.g. an Android TV with a
keyboard.
2015-10-12 12:16:15 +01:00
Oliver Woodman
bcb4ea4f70 Allow launching of ExoPlayer demo app via adb shell.
For example:
adb shell am start -a com.google.android.exoplayer.demo.action.VIEW -d http://...
2015-10-12 12:15:13 +01:00
joli
8ddc73511e FLV Support - Added Audio and Script Data readers 2015-09-29 17:20:38 +02:00
Oliver Woodman
427cb34aca Bump version to 1.5.0 2015-09-28 20:56:28 +01:00
Oliver Woodman
dce74f4209 Add onDrmKeysLoaded back again (oops) 2015-09-28 20:24:46 +01:00
Oliver Woodman
decb7f58c7 Expose container track identifier via MediaFormat.
Issue: #770
2015-09-28 12:36:28 +01:00
Oliver Woodman
e035e4de7f Let MediaController handle whatever keys it wants to handle.
....Except BACK and MENU, which only make sense if the the controller
is visible.
2015-09-28 12:25:05 +01:00
Oliver Woodman
c3e0d34aa1 Fixed int overflow issue with callbacks on very long-running streams. 2015-09-28 12:22:12 +01:00
Oliver Woodman
e652019bb3 Tweak new drm listener method. Fix demo app 2015-09-28 11:59:10 +01:00
Oliver Woodman
8a723706d6 Provide more flexibility for setting caption font size.
- Respect any padding set on SubtitleLayout.
- Allow specification of absolute, fractional and fractional-ignoring-padding
  text sizes.
2015-09-18 18:19:28 +01:00
Oliver Woodman
7f9b12982d Use consistent buffer sizes in demo app. 2015-09-18 18:18:15 +01:00
Oliver Woodman
d7697176ed Include language in audio formats.
Issue: #437
2015-09-15 13:45:54 +01:00
Oliver Woodman
95fcb3b411 Draw subtitles over the shutter.
This allows the demo app to display subtitles without video
(when there's no video, the shutter view does not hide itself).
2015-09-10 18:24:31 +01:00