747 Commits

Author SHA1 Message Date
andrewlewis
7ead310219 Use maximum bitrates for encoded output buffer sizes
There is some risk associated with this change, as audio track buffers come from
shared memory and limits may be device-specific. I've tested these sizes on
Nvidia Shield TV and Nexus Player on various builds. The maximum size allocated
is about 800 KB. We could implement support for retrying creating the audio
track if it fails to initialize, but it seems preferable to avoid the extra
complexity required to do that unless we know it's necessary to work around
device-specific limitations.

Issue: #3803

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206749222
2018-08-01 13:49:20 +01:00
aquilescanta
9ec14d1ada Fix SCTE-35 timestamp adjustment
Issue:#4573

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206737252
2018-08-01 13:49:20 +01:00
tonihei
a237ae1810 Fix period transition with non-zero start position.
Period transitions with non-zero start position happen too early as the
playing period is advanced as soon as the renderer offset is reached not
taking into account that the start position needs to be added to that.

Issue:#4583

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206310328
2018-08-01 13:49:20 +01:00
eguven
9c337c8806 Add monoscopic 360 surface type to PlayerView
Using this surface it's possible to play 360 videos in a non-VR Activity that is
affected by phone and touch input.

RELNOTES=true

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205720776
2018-07-24 14:54:05 +01:00
olly
61b838f414 Update release notes + bump version
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205660355
2018-07-23 15:57:51 +01:00
tonihei
1d636520ca Auto-register AnalyticsCollector as bandwidth meter listener.
This allows to automatically forward bandwidth estimate events to
AnalyticsListeners.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205642752
2018-07-23 13:32:44 +01:00
Oliver Woodman
badd9356f8 Refine use of KEY_OPERATING_RATE 2018-07-20 16:15:30 +01:00
andrewlewis
b654806996 Add support for setting companion ad slots
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205373398
2018-07-20 16:07:31 +01:00
tonihei
59b18a52d2 Make passing BandwidthMeter to TrackSelector and TrackSelection non-optional.
This was only needed temporatily until we could ensure that the player always
provides a BandwidthMeter.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204903640
2018-07-17 20:38:34 +01:00
tonihei
6aab2bdc55 Set bandwidth meter at player level.
This bandwidth meter is then forwarded to the track selection and as a transfer
listener to media and data sources.

When no bandwidth meter is specified in the ExoPlayerFactory methods, a static
singleton instance will be used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204881497
2018-07-17 20:32:59 +01:00
olly
b25a124239 HLS: Fill primary sample formats with track format info (e.g. bitrate)
Issue: #3297

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204732266
2018-07-17 20:28:52 +01:00
olly
8f0729b5ad Add AudioListener (audio equivalent to VideoListener)
Issue: #3994

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204722997
2018-07-17 20:26:27 +01:00
aquilescanta
e247a08a36 Parameterize load error handling in HLS
Issue:#2844
Issue:#2981

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204718939
2018-07-17 20:25:18 +01:00
hoangtc
19cc2c822a Fix a bug with TTML using font size as % of cellResolution.
After [] we support default font size for TTML, relative to the cellResolution of the document. However, this introduced a bug that makes TTML font-size in such case always follow the cellResolution font size, even when SubtitleView.setApplyEmbeddedStyles(false) and SubtitleView.setApplyEmbeddedFontSizes(false) were used.

This CL updates the fix so that the default font-size using cellResolution works in the same way as other embedded styles, and can be turned off using setters from SubtitleView.

GitHub: #4491

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204467033
2018-07-17 20:18:52 +01:00
andrewlewis
44c253058e Ignore all edit lists if one track's edits can't be applied
Issue: #4348

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204261718
2018-07-12 15:40:11 +01:00
tonihei
78d7754f29 Add addListener/removeListener to BandwidthMeter.
That allows to add listeners after the BandwidthMeter has been created which is
helpful as the BandwidthMeter instances are often long-lived static instances.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204255299
2018-07-12 15:39:05 +01:00
hoangtc
39b812298d Add supports for reading duration for a PS stream.
Add supports for reading duration for a PS stream by reading SCR values from
the header of packs at the start and at the end of the stream, calculating the
difference, and converting that into stream duration.

Github: #4476

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203954752
2018-07-11 14:56:54 +01:00
tonihei
c3df64f102 Extend TransferListener with onTransferInitializing and additional parameters.
This allows more fine-grained analysis of transfers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203950327
2018-07-11 14:54:35 +01:00
tonihei
74d8f89cb6 Restructure track selection in DashMediaPeriod.
Until now, the streams were released and re-enabled for each type of stream
(primary, event, embedded) in that order. That leads to problems when replacing
streams from one type to another (for example embedded to primary).

This change restructures the track selection to:
1. Release and reset all streams that need to be released or replaced.
 1(a). Including embedded orphan streams.
2. Select new streams.

Issue:#4477

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203751233
2018-07-10 13:58:18 +01:00
tonihei
2c00be1aa3 Add workaround for unmatched track indices in tkhd and tfhd.
If there is only one track, we can assume that both boxes refer to the same track
even if the track indices don't match.

Issue:#4083

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203485872
2018-07-06 17:58:08 +01:00
tonihei
1cf8b255dc Add workaround for unmatched track indices in trex and tkhd.
Both boxes should contain the same list of track indices. However, if only one
track index in each list does not match, we can just assume that these belong
together.

Issue:#4477

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203481258
2018-07-06 17:55:47 +01:00
andrewlewis
0b631b05c2 Optionally fall back to other decoders if init fails
Codec initialization may fail in creation, configuration or when start()ing the
codec. If codec initialization fails, there may be other codecs available that
could handle the same format, but currently ExoPlayer can only try to use the
first listed codec for the input format and gives up if it fails to initialize.

This change implements support for optionally falling back to alternative
decoders if initialization fails. MediaCodecSelector can now return a list of
decoders to try in priority order, and use the Format when choosing a codec.
With the default implementation, the codecs and order come from MediaCodecList,
and matches the order used internally by MediaCodec.createDecoderByType (which
implements the same kind of fallback though only to the creation step, without
configuring/starting the codec).

This feature is useful for apps that want to play several videos concurrently on
devices that have software decoders (like OMX.google.h264.decoder), as the new
behavior allows new codecs to be created when no hardware-accelerated decoders
are available.

The list of available codecs is queried when initializing the codec after a
format change that requires a new codec to be instantiated. When a decoder fails
to initialize it is removed from the list of available decoders and won't be
tried again until the next format change (or until the renderer is disabled).

Note: this change does not affect the renderer capabilities API, as when
checking format support we don't know which codec will be used.

Issue: #273

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203242285
2018-07-06 14:30:16 +01:00
olly
c23910ad3a Exclude text streams from duration calculations
Issue: #4029

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202912333
2018-07-03 11:51:32 +01:00
olly
62b90c83df Fix application of styles for CEA-608
Issue: #4321

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202660712
2018-07-03 11:49:42 +01:00
tonihei
6f6c72266e Add addTransferListener method to DataSource and provide BaseDataSource.
The new method allows to add transfer listeners (e.g. the BandwidthMeter) after
the data source has been created. To simplify the implementation for
subclasses, this change also introduces a BaseDataSource which handles
the list of listeners and the listener registration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202649563
2018-07-03 11:48:28 +01:00
tonihei
98afaa60d0 Forward TransferListener to media sources.
In the future, this allows to register the BandwidthMeter (managed by the player)
as a listener to all media transfers related to this media source.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202643946
2018-07-03 11:47:15 +01:00
hoangtc
824c0b20a5 Add supports for Seeking in AMR format using a constant bitrate seekmap.
- Extract ConstantBitrateSeeker from Mp3 package into a more general
ConstantBitrateSeekMap.
- Use this seekmap to implement seeking for AMR format.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202638183
2018-07-03 11:46:03 +01:00
aquilescanta
efa714ab4f Support EXT-X-INDEPENDENT-SEGMENTS in the master playlist
From the spec:

If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Master
Playlist, it applies to every Media Segment in every Media
Playlist in the Master Playlist.

----

This requires propagation of attributes from the master
playlist to the media playlists. This CL only includes
independent segments, but other inheritable attributes
will be supported in following changes. Other inheritable
attributes include variable substitution definitions and
session keys.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202628422
2018-07-03 11:44:56 +01:00
Oliver Woodman
94784249eb Cleanup 2018-06-28 17:51:05 +01:00
tonihei
dd14500eba Add url (after redirection) to LoadEventInfo.
This url is readily available when creating media source events (from the
data source) but so far not published to external listeners. This change
adds a new field to LoadEventInfo which corresponds to DataSource.getUri().

Issue:#2054

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202459049
2018-06-28 16:18:50 +01:00
tonihei
236eb5cef6 Add some leeway for finding additional tracks in PsExtractor.
Currently we immediately stop searching after we found one video and one
audio track. This change adds some leeway to detect additional tracks.

Issue:#4406

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202455491
2018-06-28 16:18:50 +01:00
borrelli
4e35d1a47b MediaSession extension: Allow setting of custom errors.
Add methods setCustomErrorMessage(@Nullable CharSequence message)
and setCustomErrorMessage(@Nullable CharSequence message, int code)
to MediaSessionConnector to report errors to the MediaSession
which are not player errors.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202352083
2018-06-28 16:18:50 +01:00
eguven
93cbae5bff Use default Deserializers if non given to DownloadManager
Also moved shared code to SegmentDownloadAction between its subclasses.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202294880
2018-06-28 16:18:50 +01:00
tonihei
65a58ffcb5 Add DRM workaround for Asus Zenfone 2.
Issue: #4413

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202277924
2018-06-28 16:18:50 +01:00
olly
3ec0cae0b2 Update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202135484
2018-06-28 16:18:50 +01:00
tonihei
a494846a85 Fix release notes formatting.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202132623
2018-06-28 16:18:50 +01:00
andrewlewis
9a6a72521f Make ImaAdsLoader robust to calls after it's released
Issue: #3879

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202100576
2018-06-28 16:18:50 +01:00
aquilescanta
a1f89bec0d Allow configuration of the Loader retry delay
Issue:#3370

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201996109
2018-06-25 22:38:29 +01:00
tonihei
24c21a292f Deprecate DefaultAnalyticsListener in favor of default no-ops in interface.
The DefaultAnalyticsListener was added for selective overrides. Now that Java 8
support is enabled, these selective listener overrides can be implemented
more easily and more flexible using default methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201931770
2018-06-25 22:34:35 +01:00
tonihei
156e2317cc Deprecate Player.DefaultEventListener in favor of default no-ops in interface.
The DefaultEventListener was added for selective overrides. Now that Java 8
support is enabled, these selective listener overrides can be implemented
more easily and more flexible using default methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201695490
2018-06-22 17:49:25 +01:00
andrewlewis
a610857017 Fix download cancellation
Issue: #4403

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201525284
2018-06-22 17:37:41 +01:00
olly
6bdd184eab Fix release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201374393
2018-06-20 18:35:39 +01:00
bachinger
62ee13b11d allow apps to set custom metadata
[]

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201350930
2018-06-20 18:06:57 +01:00
tonihei
4f2b596062 Allow to specify player looper at the time of ExoPlayer creation.
Currently, the looper of the thread the player is created on is used (or the
main looper if this thread doesn't have a looper). To allow more control over
the threading, this change lets users specificy the looper which must be used
to call player methods and which is used for event callbacks.

Issue:#4278

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201331564
2018-06-20 18:05:52 +01:00
andrewlewis
a75b5fb6a9 Pass through all ID3 internal data from udta
Also switch from using a CommentFrame to a new InternalFrame type for ID3 data
stored with ID '----', to distinguish internal data from actual ID3 comments.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201315254
2018-06-20 18:03:01 +01:00
aquilescanta
d8a61aade7 Normalize timestamps in HlsChunkSource
Issue:#4394

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201178909
2018-06-20 18:01:31 +01:00
olly
9eedb8e855 Add isControllerVisible
Issue: #4385

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200986828
2018-06-18 15:39:20 +01:00
olly
5725a72783 Update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200972456
2018-06-18 13:41:45 +01:00
olly
afc19bf6db CEA608 - Add space when handling mid-row codes
Issue: #3906

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200526335
2018-06-18 11:16:59 +01:00
aquilescanta
943de70a15 Pass HTTP DataSource's response headers to HlsExtractorFactory
Issue:#2025

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200212344
2018-06-18 11:14:17 +01:00