628 Commits

Author SHA1 Message Date
Oliver Woodman
eba16e55b0 Support delayed loading by Loader. 2015-03-10 19:43:25 +00:00
Oliver Woodman
8c1088559e Generalize getPsshInfo to properly accomodate WebM.
- Rather than returning a map, return a DrmInitData object,
  with mapped and non-mapped implementations.
- Include a suitable mimeType to pass to the MediaDrm. Previously
  we were incorrectly passing the mimeType of the samples,
  where-as MediaDrm expects the container mimeType. Note that
  it doesn't matter whether the mimeType starts with "video" or
  "audio", hence using video mimeTypes everywhere.
2015-03-10 19:42:48 +00:00
Oliver Woodman
eec6458b43 Add handling of Extended Western European character set for CEA-608. 2015-03-10 19:37:47 +00:00
Oliver Woodman
4192ac56af WebM Extractor support for Encrypted content. 2015-03-10 19:36:37 +00:00
Oliver Woodman
1ebaaaebd5 Parse EXT-X-MEDIA tags with SUBTITLES type.
Not yet used by anything.

Issue: #151
2015-03-10 19:07:19 +00:00
Oliver Woodman
be103106cb HLS: Better stream selection at start of playback.
- Correctly handle bandwidth NO_ESTIMATE case.
- Don't consider switching without a previous chunk.
2015-03-10 19:06:07 +00:00
Oliver Woodman
489e99158f Remove getDurationUs from the SampleExtractor interface.
Set the duration on the MediaFormat instead.
2015-03-10 19:04:38 +00:00
Oliver Woodman
f3f9c845cd Add test for DefaultSampleSource. 2015-03-10 19:02:24 +00:00
Oliver Woodman
cdf19430ef Remove TrackInfo from the SampleExtractor interface. 2015-03-10 19:01:11 +00:00
Oliver Woodman
fbd0a57e5c Push tests. 2015-03-06 16:39:00 +00:00
Oliver Woodman
462fea3eaf Correctly resolve Uris according to RFC3986.
Issue: #327
2015-03-05 11:56:00 +00:00
Oliver Woodman
457557b56f Parse ISO8601 timestamps using UTC timezone. 2015-03-04 11:02:43 +00:00
Oliver Woodman
a1d4a5e154 Continue waiting for keys until the codec is flushed.
It was possible for a codec input buffer to be filled with two frames' worth of
data, if seekTo was called after populating a buffer, if waitingForKeys was true
and seeking did not trigger a flush. This caused the CryptoInfo to be configured
as if the input buffer contained a large amount of reconfiguration data as
cleartext.

Move resetting waitingForKeys to flushCodec, so that we don't try to read the
next sample from the source until the first one has been consumed or discarded.
2015-03-03 18:16:22 +00:00
Oliver Woodman
baea1cd12d Add ftyp atom def 2015-03-03 17:17:02 +00:00
Oliver Woodman
b9addf28b2 Formatting tweaks for enhanced ID3 support + support in demo app. 2015-03-03 17:16:13 +00:00
Oliver Woodman
0c6566bce7 Add flags to DataSpec. Support GZIP option.
Also remove uriIsFullStream. It's not doing anything particularly
useful, so I think it makes sense to remove it from the public API;
it's unlikely anyone is using it.

Issue: #329
2015-03-03 17:14:48 +00:00
Oliver Woodman
3868b1d4cb Clean up media playlist blacklisting / fix nits.
It seems fairly safe to assume a playlist wont be blacklisted
within 1ms of the device booting :).
2015-03-03 17:11:21 +00:00
Andrey Udovenko
2bb2e2c44f Merge pull request #324 from jeoliva/id3
Add support for GEOB and PRIV ID3 frames.
2015-03-03 00:23:59 -05:00
J. Oliva
b03c8a713b Mime type string always finish with a single 0 byte
Mime type string always finish with a single 0 byte
2015-02-28 00:47:42 +01:00
J. Oliva
88475e4fee Fixed issue in the calculation of size of objectData
- Fixed issue in the calculation of size of objectData
- Indentation fixes
2015-02-27 22:09:05 +01:00
J. Oliva
1739af685a Removed indexOfNot method
Removed the unused method indexOfNot
2015-02-27 11:02:37 +01:00
J. Oliva
f33cdd97e6 Fixed an issue when looking for termination string in UTF-16 and UTF-16BE
Modified parse method to take into account different lengths for the
termination character (1 for UTF-8 and ISO-8859-1; 2 for UTF-16 and
UTF-16BE).
2015-02-27 10:57:43 +01:00
J. Oliva
c135bb7a57 Fixes for correctly supporting UTF-16 and UTF-16BE charsets
For fields encoded using UTF-16 or UTF-16BE charsets when looking for
termination character we have to look for two zero consecutive bytes.

Otherwise, as many characters encoded with UTF-16 or UTF-16BE has one
of their 2 bytes set with the value zero, we will be truncating text
fields.
2015-02-26 21:54:29 +01:00
J. Oliva
ebbd022a52 Added new ID3 frames
- Added support for ID3 frames of types GEOB and PRIV.

 - GEOB type is commonly used by dynamic ads provider to include in the
stream information about the ads to be played.
 - PRIV type is commonly used for time synchronization (example:
synchronizing playback of a live stream and its webvtt captions) and
also by analytics companies to include tracking information in the
stream.

- Added a sample stream from Apple that contains ID3 metadata.
2015-02-26 16:49:05 +01:00
ojw28
ea95db2375 Merge pull request #316 from jeoliva/blackplaylist_management
Better management of blacklisted playlists
2015-02-25 14:33:26 +00:00
Oliver Woodman
006986cc58 Make NetworkLoadable use an injected HttpDataSource.
Note: I'm fairly confident that NetworkLoadable.Parser implementations
can live without the inputEncoding being specified. But not completely
100%...

Issue: #311
Issue: #56
2015-02-25 13:39:15 +00:00
Oliver Woodman
2ce17b601f Correctly bound search into segment indices.
The return value here assumed that the time being searched for
was beyond the start time of the last segment. This fix also
handles the case where the time is prior to the start of the
first segment.
2015-02-25 13:34:31 +00:00
Oliver Woodman
d2da3bbf8a Simplify NetworkLoader/Parser/ManifestParser
The only downside of this change is that MediaPresentationDescriptionParser
is no longer stateless.
2015-02-25 12:09:06 +00:00
Oliver Woodman
0fdcb3347c continueBuffering should return true when ended.
This issue didn't have any material impact on playbacks, but
fixing it anyway to be technically correct.
2015-02-25 11:48:55 +00:00
Oliver Woodman
d6ebd49c63 Two small fixes for HLS.
1. Clear prefixFlags when a NAL unit is found.
2. continueBuffering should return true if loading is finished.
2015-02-25 11:37:39 +00:00
J. Oliva
2ac7046ffc Clear stale blacklisted playlist when getting next variant index
Calling clearStaleBlacklistedPlaylist within getNextVariantIndex method.
2015-02-23 22:42:53 +01:00
J. Oliva
4fe62b9b0a Clear stale blacklist in getChunkOperation
Clear stale blacklist in getChunkOperation before getting next variant.
This ensures:
1.- Player resilience to failures, always trying to look for a working
playlist that allows player to non stop playback.
2.- High quality blacklisted playlists can be reused in case they go up
after a failure. Player always trying to provide the best user
experience.
2015-02-23 20:40:37 +01:00
J. Oliva
f8a9da90e8 Renaming methods and code formating
- Method evaluatePlayListBlackListedTimestamps renamed to
clearStaleBlacklistedPlaylists
- Code formatted to be consistent with style elsewhere.
2015-02-23 20:06:49 +01:00
J. Oliva
20a40f5d11 Better management of blacklisted playlists
Added an expiration time field to playlists blacklisted to allow
Exoplayer to continue playback when playlists that failed were
recovered from a bad state.

In live environments, some times occur that primary encoder stop
working for a while. In that cases, HLS failover mechanism in the
player should detect the situation and “switch” to playlists served by
the backup encoder (in case a backup encoder exists). This was well
managed before these changes.

However, and to ensure a playback experience that can recover itself
from temporary issues, we cannot blacklist a playlist forever. When
streaming live events using HLS, it is quite typical that the player
needs to switch from primary to backup playlists, and from backup to
primary ones, from time to time to have playback working when temporary
issues in the network/encoder are happening. Most of the issues are
recoverable, so what I have implemented is a mechanism that makes
blacklisted playlist to be available again after a while (60 seconds).

Evaluation of this algorithm should happen just when something fails.
If player is working with a backup playlist, it shouldn’t switch to the
primary one at least something fail.
2015-02-23 15:14:09 +01:00
Oliver Woodman
6d14fc3330 Implement UTC time synchronization for DASH Live.
Support is provided for the following schemes:

urn:mpeg:dash:utc:direct:2012
urn:mpeg:dash:utc:http-iso:2014
urn:mpeg:dash:utc:http-xsdate:2012
urn:mpeg:dash:utc:http-xsdate:2014
2015-02-20 15:10:25 +00:00
Oliver Woodman
4076b08e4b Naming tweak 2015-02-20 15:07:22 +00:00
Oliver Woodman
b510088689 Fix EIA-608 issues.
- Data needs to be unescaped before it's passed to SeiReader.
- SeiReader should loop over potentially multiple child messages.
- I also changed the sample passed to the EIA-608 renderer so that
  it's the entire sei message payload. The first 8 bytes are
  unnecessary, but it seems nicer conceptually to do it this way.

Issue: #295
2015-02-19 11:22:42 +00:00
ojw28
00ec7ef0c1 Merge pull request #307 from jeoliva/issue_codec_regex
Issue with regular expression for CODEC attribute
2015-02-19 10:59:50 +00:00
J. Oliva
e84bce6130 Fixed issue in CODEC regular expression
Previous regular expression for extracting codec information was wrong,
given a line that defines a variant it added information from “CODEC=“
text to the end of the line (including also information about
RESOLUTION or alternate rendition groups as part of the CODEC field).

This is not causing a functional problem (at least known by me)
although is making codecs field storing information that is not related
with the codec.
2015-02-19 01:17:35 +01:00
ojw28
f6a0cb963b Update CONTRIBUTING.md 2015-02-18 23:42:42 +00:00
ojw28
1649aa6381 Update CONTRIBUTING.md 2015-02-18 23:39:10 +00:00
Oliver Woodman
abac6b7dd6 Fix off-by-one-bug preventing NAL unit detection at the limit. 2015-02-18 19:11:52 +00:00
Oliver Woodman
b03c5c5753 Ensure we always seek after selecting a track.
Some extractor implementations underneath MediaExtractor require a seekTo
call after tracks are selected to ensure samples are read from the correct
position. De-duplicating logic was preventing this from happening in some
cases, causing issues like:

https://github.com/google/ExoPlayer/issues/301

Note that seeking all tracks a side effect of track selection sucks if
you already have one or more tracks selected, because it introduces
discontinuities to the already selected tracks. However, in general, it
*is* necessary to specify the position for the track being selected,
because the underlying extractor doesn't have enough information to know
where to start reading from. It can't determine this based on the read
positions of the already selected tracks, because the samples in these
tracks might be very sparse with respect to time.

I think a more optimal fix would be to change the SampleExtractor
interface to receive the current position as an argument to selectTrack.
For our own extractors, we'd seek the newly selected track to that
position, whilst the already enabled tracks would be left in their
current positions (if possible). For FrameworkSampleExtractor we'd
still have no choice but to call seekTo on the extractor to seek all
of the tracks. This solution ends up being more complex though, because:

- The SampleExtractor then needs a way of telling DefaultSampleSource
  which tracks were actually seeked, so that the pendingDiscontinuities
  flags can be set correctly.
- It's a weird API that requires the "current playback position to seek
  only the track being enabled"

So it may not be worth it! I think this fix is definitely good for now,
in any case.

Issue: #301
2015-02-18 15:15:20 +00:00
Oliver Woodman
cc7a15b79b Fix bad assertion 2015-02-18 15:09:45 +00:00
Oliver Woodman
526c64294a Handle the edge case of zero-length chunks.
Issue: #289
2015-02-17 16:04:44 +00:00
Oliver Woodman
a1e196fe20 Add support for elementary AAC/ADTS streams.
- This change:

1. Extracts HlsExtractor interface from TsExtractor.
2. Adds AdtsExtractor for AAC/ADTS streams, which turned out to be
   really easy.

Selection of the ADTS extractor relies on seeing the .aac extension.
This is at least guaranteed not to break anything that works already
(since no-one is going to be using .aac as the extension for something
that's not elementary AAC/ADTS).

Issue: #209
2015-02-17 15:42:38 +00:00
Oliver Woodman
b46d1fc7cc Bump dev version to 1.3.x 2015-02-16 22:30:28 +00:00
Oliver Woodman
3472e86c36 Correctly reset ADTSreader state 2015-02-16 22:22:25 +00:00
Oliver Woodman
40411269da Use C.SAMPLE_FLAG_SYNC 2015-02-13 20:36:27 +00:00
Oliver Woodman
9d480ecd20 Fix broken javadoc link 2015-02-13 20:34:30 +00:00