238 Commits

Author SHA1 Message Date
aquilescanta
4a6a8553e9 Check #EXTM3U header is present in HLS playlists
Issue:#2301

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144334062
2017-01-13 17:27:25 +00:00
eguven
5c89bbedb7 Fix leftover bytes in cached content index file
Extra calls to CipherOutputStream.close() causes each time extra 16 bytes written to the
underlying OutputStream. Prevented close() is called more than once and also discarded any
data in ReusableBufferedOutputStream buffer on reset().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144063120
2017-01-13 17:01:37 +00:00
olly
f2634d11f5 Support emsg metadata decoding
Note: End to end emsg support is still non-functional.
There's some additional plumbing that still needs to
be done.

Issue: #2176

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143775147
2017-01-06 16:57:35 +00:00
eguven
9d5c750fe9 Support offline drm key downloading and restoring
Renamed StreamingDrmSessionManager to DefaultDrmSessionManager and added functionality to download, restore, renew and release offline keys. Added a utility class, OfflineLicenseHelper, to facilitate use of DefaultDrmSessionManager for downloading, renewing and releasing offline keys.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143769955
2017-01-06 16:56:31 +00:00
andrewlewis
b2a153d568 Add a player test for renderers reading ahead.
Also move timeline, manifest and format verifications into the test* methods.

Issue: #2252

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143761969
2017-01-06 16:55:09 +00:00
olly
5082d1f282 Some boilerplate for DASH EMSG support
- Parse EMSG leaf atoms during FMP4 extraction (although
  currently they're just discarded).
- Add readNullTerminatedString to ParsableByteArray.

Issue: #2176

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143555965
2017-01-04 23:07:58 +00:00
olly
2512bd6e77 Add test for decoding ID3 PRIV frame
I wrote this whilst investigating a user issue. It looks like
we don't need to do anything about the issue itself, but since
I wrote the test we may as well keep it!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143549697
2017-01-04 23:07:57 +00:00
olly
b774660989 Add multi-period ExoPlayer unit test
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143475824
2017-01-04 23:07:57 +00:00
Oliver Woodman
0b141aeeee Revert "Improving handling of atoms with size less than header in FragmentedMp4Extractor."
This reverts commit 71186ef16ee2f3dc07a4f9d1d696c273b1c6ca87.
2017-01-04 22:32:28 +00:00
cblay
71186ef16e Improving handling of atoms with size less than header in FragmentedMp4Extractor.
These currently lead to cryptic ArrayIndexOutOfBoundsExceptions being thrown from System.arraycopy() so my proposal is to throw a more useful ParserException instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142087132
2017-01-04 22:26:58 +00:00
olly
4bb8793203 Deduplicate reported position discontinuities
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142257743
2016-12-16 16:21:16 +00:00
olly
588124da76 Test playback of empty timeline completes successfully
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142157778
2016-12-16 16:21:16 +00:00
cblay
37317520f4 Improving handling of atoms with size less than header in FragmentedMp4Extractor.
These currently lead to cryptic ArrayIndexOutOfBoundsExceptions being thrown from System.arraycopy() so my proposal is to throw a more useful ParserException instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142087132
2016-12-16 16:21:16 +00:00
andrewlewis
f276eb2ce7 Add ClippingMediaSource.
ClippingMediaSource wraps a single period/window video-on-demand source and
exposes a specified time range within it.

Issue: #1988

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141991215
2016-12-14 14:23:38 +00:00
olly
e5bc00ea94 Fix DataSourceInputStream + add unit test
Issue: #2162

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141177715
2016-12-06 20:06:04 +00:00
olly
2db7c50d7c Fix test.
The definition of negative line indices was intentionally shifted
by one because the way VTT defines them doesn't appear to allow for
cues to be positioned at the very bottom of the screen in the case
that ANCHOR_TYPE_END is used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141168028
2016-12-06 20:05:23 +00:00
aquilescanta
931670957f Add support for multiple table sections in PSI section
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141073182
2016-12-06 20:01:13 +00:00
olly
bbbd61e319 Skip negative SubRip timecodes
Issue: #2145

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140868079
2016-12-02 19:37:14 +00:00
andrewlewis
45bc4a0374 Pass player and isTopLevelSource to MediaSource.prepareSource.
These additions are useful for sources that need to track the playback position
and control playback.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140828310
2016-12-02 19:23:35 +00:00
cdrolle
2753664c6b Fixed an error in the date and time parser's handling of time zones.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140400905
2016-11-30 21:57:29 +00:00
andrewlewis
f9c7343e76 Add basic unit test for ExoPlayer/ExoPlayerImplInternal.
The simple verifications in this test may be useful for smoke testing, but the
coverage of ExoPlayerImplInternal is low. The intention is to add tests for
more complex logic in ExoPlayerImplInternal in later changes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140327358
2016-11-30 21:54:05 +00:00
eguven
fa3d129b14 Fix some of the issues pointed by android lint tool
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139915885
2016-11-25 20:18:32 +00:00
andrewlewis
77715fbfbe Fix some analysis warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139901449
2016-11-25 20:18:32 +00:00
eguven
35054f8f7c Added ReusableBufferedOutputStream.
ReusableBufferedOutputStream is a subclass of BufferedOutputStream with a reset(OutputStream) that allows an instance to be re-used with another underlying output stream.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139505999
2016-11-18 12:52:46 +00:00
eguven
ff1a008817 Delete temporary test folders on test exit.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138860196
2016-11-18 12:43:48 +00:00
eguven
92a98d1ce2 Encrypt SimpleCache index file.
Clean up AtomicFile and make it return a custom FileOutputStream
for writing which handles IOException automatically during write
operations.

It also syncs the file descriptor and deletes the backup file on
close() call. This fixes the order of flush and close operations
when the fileoutputstream is wrapped by another OutputStream.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138779187
2016-11-10 21:15:35 +00:00
olly
7ac1cab2d5 Set language to null unless explicitly defined as "und" in container
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138758504
2016-11-10 21:15:35 +00:00
olly
aefc5165fd Fix cache upgrade
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138687623
2016-11-10 21:15:28 +00:00
aquilescanta
b1fe274df3 Replace java.text.ParseException for ExoPlayer's ParserException
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138628300
2016-11-10 21:15:20 +00:00
cdrolle
a4935a9ba0 Added support for multiple RawCC (CEA-608/CEA-708) tracks in DASH.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138392065
2016-11-10 21:14:57 +00:00
eguven
a6e2770116 Upgrade SimpleCacheSpan files during createCacheEntry call.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138379386
2016-11-10 21:14:29 +00:00
eguven
ff77d1e72c Add index file to hold header information for cached content.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138373878
2016-11-10 21:14:29 +00:00
aquilescanta
992cfdecc2 Feed timestamps from loaded chunks back to the playlist tracker
This is the first step towards allowing discontinuities in the
playlist tracking. Also changed durationSecs for durationUs in
MediaPlaylist.Segment.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138207732
2016-11-10 21:14:29 +00:00
zhihuichen
e2081f40fb move baseUrl from segments to representations: V2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138136090
2016-11-10 21:14:29 +00:00
aquilescanta
aaf38adc26 Add support for HLS live seeking
In order to expose the live window, it is necessary (unlike before) to refresh
the live playlists being played periodically so as to know where the user can
seek to. For this, the HlsPlaylistTracker is added, which is basically a map
from HlsUrl's to playlist. One of the playlists involved in the playback will
be chosen to define the live window. The playlist tracker it periodically.
The rest of the playilst will be loaded lazily. N.B: This means that for VOD,
playlists are not refreshed at all. There are three important features missing
in this CL(that will be added in later CLs):

* Blacklisting HlsUrls that point to resources that return 4xx response codes.
    As per [Internal: b/18948961].
* Allow loaded chunks to feed timestamps back to the tracker, to fix any
    drifting in live playlists.
* Dinamically choose the HlsUrl that points to the playlist that defines the
    live window.

Other features:
--------------

The tracker can also be used for keeping track of discontinuities. In the case
of single variant playlists, this is particularly useful. Might also work if
there is a that the live playlists are aligned (but this is more like working
around the issue, than actually solving it). For this, see [Internal: b/32166568]
and [Internal: b/28985320].

Issue:#87

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138054302
2016-11-10 20:54:03 +00:00
Oliver Woodman
8a89abcbf1 Merge branch 'dev-v2-id3' into dev-v2 2016-10-27 12:37:22 +01:00
aquilescanta
0b8e9754ca Pass initialization parameters to section readers
Unlike with PesReaders, sections don't have a standard way
of providing timestmaps or even generating tracks. We need
to pass this information so that readers decide what to do
with it.

Issue:#726

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137162494
2016-10-27 12:27:21 +01:00
aquilescanta
1809836c21 Provide a method for creating a reader for a particular PID
This allows the user to create section readers(usually) for reserved pids,
like SDT, EIT, CAT, etc.

Issue:#726

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137150853
2016-10-27 12:26:32 +01:00
Oliver Woodman
929620c189 Merge branch 'dev-v2' into dev-v2-id3 2016-10-24 18:49:43 +01:00
olly
99503e6e3a Fix playback of OGG with only a single payload page
Issue: #1976

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=137044583
2016-10-24 18:43:49 +01:00
aquilescanta
862552c2ed Convert ElementaryStreamReaderFactory into TsPayloadReaderFactory
In this CL:

* PesReader moves out of TsExtractor and becomes public.
* ElementaryStreamReaderFactory becomes TsPayloadReaderFactory and is
    moved to TsPayloadReader.
* The TsPayloadReaderFactory is in charge of wrapping any
    ElementaryStreamReaders with a PesReader.

Incoming:
* Extract SectionReader supperclass (analog to PesReader, but for
    sections) from Pat and Pmt readers.
* Add a ScteReader, wrapped by a section reader, and include it in
    the DefaultTsPayloadReaderFactory.

Issue:#726

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136707706
2016-10-24 11:44:49 +01:00
ojw28
6673483aca Merge pull request #1971 from google/dev-v2
Update dev-v2-id3
2016-10-20 12:43:38 +01:00
eguven
06fb29c939 Support caching of multi segment DASH, HLS and Smooth Streaming.
Use sha1 of content uri if a custom cache key or content id isn't provided.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136351830
2016-10-19 16:58:09 +01:00
Oliver Woodman
7e352295d7 Propagate ID3 data for MP3 2016-10-18 15:17:01 +01:00
ojw28
e2ff401ea1 Merge pull request #1958 from google/dev-v2
Merge dev-v2 into dev-v2-id3
2016-10-17 22:52:12 +01:00
aquilescanta
e685edc179 Make interface implementation consistent among ExtractorOutputs
The method track(int id) currently has different behaviours across
implementations. This CL maps ids to track outputs, which means
that successive calls with the same id will return the same
TrackOutput instance. Also fixes TsExtractor inconsistent behavior
after a seek.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136026721
2016-10-14 10:42:43 +01:00
aquilescanta
f18373eeb2 Decouple TsExtractor's readers from TrackOutputs
This allows the injectable reader factory to be a stateless factory, allows
the seeking to be consistent and will allow multiple CC channel support later
on.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135909712
2016-10-14 10:42:43 +01:00
Oliver Woodman
ba1da140c6 Further modifications to ID3 support
- Lots of misc cleanup
- Remove GaplessInfo from Metadata. IMO it doesn't quite belong there,
  and means it ends up being represented twice inside Format.
- Note: Changes untested, but will be tested in due course!
2016-10-09 16:27:58 +01:00
Oliver Woodman
5a097a4c9d Merge branch 'albumMetadataV2.1' of git://github.com/cbfiddle/ExoPlayer into cbfiddle-albumMetadataV2.1 2016-10-09 14:47:48 +01:00
aquilescanta
6306c26988 Add support for fragmented MP4 in HLS
This CL adds support for initialization segments in HLS. This is required mainly for(but not limited to) usage of fMP4. The fMP4 support only consists in creating the required extractor if the extension is .mp4, provided the initialization segment is correctly
loaded and passed to the extractor.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134997636
2016-10-04 23:38:47 +01:00