22053 Commits

Author SHA1 Message Date
Oliver Woodman
04cead415a Merge branch 'dev' of https://github.com/google/ExoPlayer into dev 2015-03-12 19:44:18 +00:00
Oliver Woodman
12807a7d4b Simplify encryption handling in HLS. 2015-03-12 19:44:06 +00:00
Oliver Woodman
fb36f85e0d Simplify encryption handling in HLS. 2015-03-12 19:42:00 +00:00
ojw28
fabd470550 Merge pull request #354 from canatella/aes-iv-fix
Fix AES decryption of HLS streams.
2015-03-12 16:43:24 +00:00
Damien Merenne
94dd9c41f4 Fix AES decryption of HLS streams.
As per http://tools.ietf.org/html/draft-pantos-http-live-streaming-04#section-5.2,
the initializaton vector (IV) of the AES decryption algorithm should be set to:
- the IV attribute value if present,
- the sequence number otherwise.

Currently, the IV is set once and use over all next media sequences
where the IV attribute is not set. The fix is to use the provided IV if
given or use the current media sequence number.
2015-03-12 13:34:58 +01:00
Oliver Woodman
5ca2e0fd95 First step toward extractor unification.
- It's probably easiest to think of this as a standalone HLS change, which is splitting out the "loading" and "consuming" sides of HlsExtractor and a good structural change in its own right. To do this, HlsExtractorWrapper becomes a final class implementing the consuming side. HlsExtractor becomes an interface defining the loading side.

- The bigger picture is that, hopefully, HlsExtractor will become a lightweight extractor interface that can be used throughout the library. Because it doesn't need to implement the consuming side, we'll save on having to re-implement the consuming side for every extractor (we'll probably need one consuming side implementation for HLS/DASH/SmoothStreaming, and a second one for everything else, both of which will use SampleQueue). It's expected that the HlsExtractor interface will need to change to accommodate all use cases.

- The next step in unification will be to try and have FragmentedMp4Extractor implement HlsExtractor (which will need renaming). Once this is done, I'll try and move the chunk package over to use the HlsExtractor interface.
2015-03-11 19:21:33 +00:00
Oliver Woodman
becc6fca4c Enhance SampleQueue/RollingSampleBuffer to support other use cases.
- This is a step toward hopefully converging HLS and CHUNK packages.
- Add support for encrypted samples.
- Add support for appending from a DataSource.
2015-03-11 15:49:53 +00:00
Oliver Woodman
5d0457152d Remove need for InlinedApi with a few more C constants. 2015-03-11 15:48:12 +00:00
Oliver Woodman
56a509d8e4 Clean up handling of encrypted samples in fmp4/webm extractors.
- The fmp4 extractor was reading from sampleEncryptionData even
  for not-encrypted samples, which I'm pretty sure isn't right.
  Fixed this. For all encrypted content I've seen, this change
  will be a no-op because isEncrypted is always true if there's
  an encryptionBox present.
- Made webm extractor only set cryptoInfo if isEncrypted is true.
- Align variable naming in the two extractors, for clarity.
2015-03-10 21:44:20 +00:00
Oliver Woodman
5e11b9f008 Add DrmInitData (missed from a previous commit). 2015-03-10 19:48:41 +00:00
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
ojw28
5dedf5d930 Merge pull request #340 from google/dev
dev -> dev-webm-vp9-opus
2015-03-06 16:44:18 +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
Sergio Moreno Mozota
9208c655d1 fix false positives in sync word detection thanks to @jeoliva 2015-03-04 20:46:22 +01: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
Sergio Moreno Mozota
2ce938d650 Added MPEG audio support to TsExtractor v.2 2015-02-27 14:29:21 +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
Sergio Moreno Mozota
1545a052f0 Added MPEG audio support to TsExtractor 2015-02-26 19:12:58 +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
07855aadcf Fix build after pull from dev 2015-02-25 14:13:04 +00:00
ojw28
7f70db9765 Merge pull request #321 from google/dev
dev -> dev-webm-vp9-opus
2015-02-25 14:04:48 +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