1812 Commits

Author SHA1 Message Date
olly
894ae1a310 Improve SimpleExoPlayer flexibility
- Allow extension and overriding of renderer creation.
  Several developers have asked for this, so that they
  can use their own renderers (typically extensions to
  the core ones) without losing the ability to use
  SimpleExoPlayer.
- Add option to not attempt extension renderer creation,
  for efficiency.
- Align build variants for internal and external demo
  apps. This is slightly unfortunate, but convergence
  seems necessary for useExtensionRenderers.
- Fix DASH playback tests to use the debug video
  renderer.

Issue #2102

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140140915
2016-11-25 20:18:32 +00:00
olly
62bdb1b93a Fix failure when a seek is performed with no enabled tracks
This issue affects ExtractorMediaSource only. We shouldn't
start loading in the case that we're prepared and have no
enabled tracks, since there's nothing that we need to load.
This was causing an assertion failure in startLoading.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140030650
2016-11-25 20:18:32 +00:00
aquilescanta
a7dff14d3c Keep TS packets with no continuity counter increase and no payload
This behavior is defined in ISO-13818-1, section 2.4.3.3(continuity_counter).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140029161
2016-11-25 20:18:32 +00:00
olly
eb62d00ea4 ExoPlayerImplInternal cleanup
- Fix handling of the currently playing period being
  removed. This didn't do the right thing at all.
- Relax rule on seekToPeriodPosition re-using an
  existing holder.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140014791
2016-11-25 20:18:32 +00:00
olly
b3726cf761 Support DASH multi-segment fetches
Note that multi-segment fetching is only possible in the
case that segments in a representation are defined to have
the same Uri and adjacent ranges (this is very rarely true
for live streams, but is quite often true for on-demand).
In the case that merging is requested but not possible,
the implementation will request one at a time.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140012443
2016-11-25 20:18:32 +00:00
eguven
b29ff0cf51 Make CacheDataSink use ReusableBufferedOutputStream
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140010664
2016-11-25 20:18:32 +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
aquilescanta
6101450302 Merge initialization chunk into HlsMediaChunk
This will allow creating the extractor in the HlsMediaChunk.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139915713
2016-11-25 20:18:32 +00:00
aquilescanta
9ac7f64c84 Fix search to end of stream in HLS
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139905590
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
e84fa5835d Use ReusableBufferedOutputStream for cache index file write operation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139889957
2016-11-25 20:18:32 +00:00
olly
42fadfe083 Allow SsMediaSource to take an optional SsManifest
Also allow custom SsManifestParser injection.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139813660
2016-11-25 20:18:32 +00:00
olly
81ce6bba7a Allow DashMediaSource to take an optional DashManifest
Also allow custom DashManifestParser injection, to
support parsing of custom elements and attributes that
service providers may wish to include in their manifests
(e.g. #2058).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139813108
2016-11-25 20:18:32 +00:00
olly
4f3ab7b22d ExoPlayerImplInternal: Some more minor cleanup
- This should be a no-op change
- Inline attemptRestart
- Clean up processing of pending seeks

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139804630
2016-11-21 19:15:13 +00:00
olly
9d7d8adc9c Allow changing of video scaling mode
Issue #2016

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139803888
2016-11-21 19:14:39 +00:00
andrewlewis
ae0ac55b8d Add support for resetting the AudioTrack stream type.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139797714
2016-11-21 19:13:34 +00:00
olly
060ca4aecc ExoPlayerImplInternal cleanup
- Make handleSourceInfoRefreshed clearer.
- Remove bufferAheadPeriodCount. Seems error prone.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139774580
2016-11-21 19:13:02 +00:00
dsantoro
adc9dd1c75 Add null checks to closeQuietly calls.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139738429
2016-11-21 19:12:26 +00:00
ccwu
6dbfdecbe0 Let the mp4 extractor support "camm" metadata tracks.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139626848
2016-11-21 19:11:43 +00:00
olly
4a30dff524 Fix NPE in TextTrackRenderer
Issue: #2081

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139566990
2016-11-18 12:54:36 +00:00
aquilescanta
cafe603694 Allow regressing media sequence numbers in HLS media playlists
This is techically not allowed by the spec[1] but might still occur in
certain scenarios. New playlists with older media sequence numbers are
ignored.

[1]: HLS draft version 20, section-6.2.1

Issue:#2059

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139564889
2016-11-18 12:54:03 +00:00
olly
d890c2f48f Fix infinite loop -> ANR at end of HLS playbacks
continueLoading shouldn't return true unless it's done
something. Always returning true if endOfStream was
causing CompositeSequenceableLoader.continueLoading to
loop forever.

It looks like the same issue exists in ChunkSampleStream
as well, although I can't seem to provoke DASH or SS
playbacks into doing anything bad as a result.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139559834
2016-11-18 12:53:24 +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
olly
f57434006f Fix potential NPE in ExoPlayerImplInternal
I'll have a more thorough refactor of some of this class
fairly soon!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139451693
2016-11-18 12:51:22 +00:00
olly
61c9c16954 Make sure we report video size after Surface is set
Issue: #2077

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139451511
2016-11-18 12:50:41 +00:00
eguven
051be5c588 Use buffers to speed up cache index file io.
Use BufferedOutputStream and BufferedInputStream while writing / reading.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139446039
2016-11-18 12:50:04 +00:00
aquilescanta
a8a2ef4a24 Blacklist HLS media playlists that return 4xx error codes
Issue:#87

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139443476
2016-11-18 12:49:24 +00:00
yutingtseng
2add12d5f7 Update CacheDataSink to optionally use a BufferedOutputStream for writing
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139381958
2016-11-18 12:48:41 +00:00
cblay
92d34cd877 Add flag to CacheDataSource to disable caching unset length requests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139377417
2016-11-18 12:48:09 +00:00
aquilescanta
d6eb9cb79f Allow playlists of different size in HlsPlaylistTracker playlist adjustment
Issue:#2059

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139331670
2016-11-18 12:47:36 +00:00
andrewlewis
0effffb89f Add support for reading .mp3 boxes in stsd.
This is used by Quicktime for MP3 tracks.

Issue: #2066

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139209989
2016-11-18 12:47:02 +00:00
aquilescanta
21e3361dfe Move 3 private methods to the end of the class
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139204000
2016-11-18 12:46:31 +00:00
andrewlewis
348b58021d Move underrun detection into AudioTrack.
This removes duplication from SimpleDecoderAudioRenderer and
MediaCodecAudioRenderer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139187254
2016-11-18 12:45:58 +00:00
andrewlewis
bcc6c9ef43 Fix a typo.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138871293
2016-11-18 12:44:21 +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
cblay
16ddc84d93 Make PriorityTaskManager constructor public.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138759164
2016-11-10 21:15:35 +00:00
olly
8cc7dfda7d Fix threading issues between ExoPlayerImpl/ExoPlayerImplInternal
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138758739
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
2620045b0d Add debug logging when codec support checks fail
Issue: #2034

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138698239
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
andrewlewis
8236efe6a5 Provide an overlay FrameLayout in SimpleExoPlayerView.
This can be used by the app for showing arbitrary UI on top of the player (for
example, UI elements associated with an ad).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138610733
2016-11-10 21:15:20 +00:00
olly
d5cbb101ed SimpleExoPlayerView: Remove a bit of dead code
These variables are never read, since the underlying control
view reads them directly from the attrs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138528246
2016-11-10 21:15:20 +00:00
olly
7b0effc2d0 Project default start pos to fix VOD->Live transitions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138493584
2016-11-10 21:15:20 +00:00
olly
89ad5e6db3 Fix ExoPlayerImplInternal timestamp conversions
This fixes VOD->Live transitions, with the caveat that
the Live portion still ends up further behind the live
edge than intended. This will be fixed in a following
change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138407066
2016-11-10 21:15:20 +00:00
olly
3c8db3b9cb Pass Timeline back with seek position
This change fixes the race condition where the internal
timeline is different to the externally visible timeline
when a seek is performed. We now resolve the seek position
using the externally visible timeline, then adjust the
period index as required for the internal timeline. If the
period is missing we follow similar logic for the existing
case where the playing period is removed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138402076
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
aquilescanta
0354ef24d4 Add support for splice info section reading in TS
This CL adds a SpliceInfoDecoder for the most common SCTE35 commands for splcing.
So far, it only includes TransportStreams, but porting it to HLS and DASH should be
fairly easy.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138389807
2016-11-10 21:14:57 +00:00
hoangtc
4cd8c77053 Add layer of indirection for DRM.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138383979
2016-11-10 21:14:29 +00:00