4330 Commits

Author SHA1 Message Date
Oliver Woodman
aa43556b79 Merge branch 'dev-v2-dvbsubs-leftovers' of git://github.com/tresvecesseis/ExoPlayer into tresvecesseis-dev-v2-dvbsubs-leftovers 2017-04-24 15:31:19 +01:00
Oliver Woodman
860eb26301 Misc cleanup for merged pull requests 2017-04-21 18:09:01 +01:00
ojw28
5381b4ec56 Merge pull request #2683 from tylerjroach/dev-v2
Added mp3 support to FLV extractor
2017-04-21 17:57:18 +01:00
ojw28
4c096505d3 Merge pull request #2688 from tylerjroach/dev-v2-NALU-OOM-Fix
Fix potential OOM that can occur reading first NAL packet before seq header
2017-04-21 17:56:49 +01:00
olly
86ed73e744 Use method arguments instead of member variables
This is a no-op cleanup change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153830409
2017-04-21 17:48:28 +01:00
olly
1506b6d2b7 Pragmatic fix for Concat(source1, Looping(source2))
Issue: #2680

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153827243
2017-04-21 17:48:28 +01:00
cblay
3280dc8777 Make SonicAudioProcessor public
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153762476
2017-04-21 17:47:54 +01:00
Sergio Moreno Mozota
3b7f47551c Add support for multiple subtitle tracks per PID and subtitle type identification 2017-04-20 21:32:59 +02:00
olly
ecb62cccd5 Delete broken PriorityHandlerThread class
This class is unnecessary; you can simply pass a thread
priority to HandlerThread's own constructor. It's also
broken, since HandlerThread.run() immediately overrides
the priority being set!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153461225
2017-04-18 19:44:50 +01:00
olly
8be85d4d2f Consolidate version codes in root gradle file
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153453768
2017-04-18 19:42:27 +01:00
andrewlewis
e87e2318d8 Fully reset AudioProcessors on releasing AudioTrack
Issue: #2675

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153445372
2017-04-18 19:40:05 +01:00
andrewlewis
835839456f Apply playback parameters when uninitialized
If AudioTrack.setPlaybackParameters was called before initialization (for
example, when an audio renderer is enabled) the parameters would actually be
dropped, because configure calls reset, which didn't apply draining playback
parameters if the track was not initialized. It would then overwrite the
draining parameters with the current parameters.

Set the playback parameters directly (without draining) for uninitialized tracks
so that the call to setPlaybackParameters in configure is a no-op.

Also, reset the stored channel count and sample rate when the audio processor
is released so that configure returns true when it is next used, which makes
sure that it gets flushed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153078759
2017-04-18 19:37:26 +01:00
tonihei
0a7011b390 Support default style in Tx3g decoder.
The track initialization data of Tx3g includes default style values for
font styles, colour, and font family. Additionally the decoder now supports
vertical subtitle placements other than the Tx3g default of 85% video height.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152930057
2017-04-18 19:33:30 +01:00
olly
85adecf948 Remove reflection + make it easy to set extractor flags
The idea of using reflection was so that a developer could
delete a package they didn't want and have everything else
still compile. However, a developer doing this is likely
building from source, in which case editing the factories
too is pretty trivial.

Removing the reflection makes specifying extractor flags
via the default factory easy, and removes the need for
special proguard config.

Issue: #2657

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152810423
2017-04-18 19:29:56 +01:00
tonihei
1dc8bb5bb1 Support 'styl' in Tx3g decoder.
Extended Tx3gDecoder to read additional information after subtitle text.
Currently parses font face, font size, and foreground colour.

Font identifier and other information provided in subtitle sample description
not yet supported.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152793774
2017-04-18 19:28:42 +01:00
Tyler Roach
3b4d981891 If hasOutputFormat is true, nalUnitLengthFieldLengthDiff will never be 0 2017-04-18 09:32:40 -04:00
Rohit Krishnan
329b8910ca Remove unnecessary check. sampleRateIndex is masked with 0x03 so it is constrained to be between 0 and 3. 2017-04-17 22:07:33 -04:00
Rohit Krishnan
896f63a3c3 Fixes OOM that can occur from reading first NAL packet before sequence header 2017-04-14 12:11:04 -04:00
Tyler Roach
59c44af4cb Added mp3 support to FLV extractor 2017-04-13 14:56:22 -04:00
aquilescanta
f36500c200 Add support for audio adaptation
When no video tracks or renderers are present, attempt audio adaptation.

Issue:#1975

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152708422
2017-04-11 12:15:04 +01:00
aquilescanta
2a4df60b01 Add pattern information to ExoPlayer's CryptoInfo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152708351
2017-04-11 12:15:04 +01:00
olly
0aee235e0a Make ID3 parser more robust (again)
I've also removed unnecessary "empty" cases, since to add them
everywhere would bloat the code quite a lot. Note that
new String(new byte[0], 0, 0, encoding) is valid and will produce
and empty string.

Issue: #2663

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152697288
2017-04-11 12:15:04 +01:00
aquilescanta
c185963355 Add IntDef to reader internal state and default branch
Adding the default branch prevents linting warnings.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152675789
2017-04-11 12:15:04 +01:00
aquilescanta
8da2e2c8d5 Track format changes in (E-)AC-3 syncframes
This allows propagating format changes to the track output.

Issue:#2552

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152672983
2017-04-11 12:15:04 +01:00
andrewlewis
d8c71df255 On re-preparation, suppress source info refresh until ack'ed
ExoPlayerImpl.prepare() replaces the timeline with an empty timeline. After this
happens, MSG_SOURCE_INFO_REFRESHED could be handled on the main thread and
could relate to the old source, so the player could expose a stale timeline.

Count pending prepares in ExoPlayerImpl so that source info refreshes can be
suppressed until preparation actually completes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152496255
2017-04-11 12:15:04 +01:00
Oliver Woodman
156bc52c8f Clean up DVB support
- Removed the PES_STRIPPED flag. It's unnecessary. We can strip
  PES in the TS extractor instead.
- Made nearly all of the object classes in DvbParser immutable.
  Else it's non-obvious that none of this state can be mutated.
- Made a a lot of the methods in DvbParser static for the same
  reason.
- Removed unnecessary null checks, code that was never executed,
  unused fields etc.
- Add proper flushing of DvbParser, to prevent corrupt output
  following a seek.
2017-04-06 19:16:31 +01:00
Oliver Woodman
538e71c090 Merge branch 'dev-v2-dvbsubs' of git://github.com/tresvecesseis/ExoPlayer into tresvecesseis-dev-v2-dvbsubs 2017-04-06 19:02:51 +01:00
andrewlewis
8208a75f0a Improve multi-window playback controls behavior.
Only enable multi-window mode when the duration of every period in the timeline
is known. Also, remove the warning logged when there are too many windows as it
doesn't add much.

The player's current period index was not masked while there were
unacknowledged seeks. This led to the displayed position jumping, between when
seekTo was called (after which the position would be masked but not the period
index) and the seek being acknowledged (at which point the time bar's position
would jump back to the seek position, due to the period index being resolved).
Mask the period index, like the window index, to fix this behavior.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152116040
2017-04-06 18:53:10 +01:00
eguven
dd2914f580 Generalize manifest parser parameters in DASH and SmoothStreaming MediaSources
This allows custom parsers to be used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152005477
2017-04-06 18:50:44 +01:00
olly
5ee122cac8 Add VERSION_SLASHY to ExoPlayerLibraryInfo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151994281
2017-04-06 18:48:27 +01:00
Sergio Moreno Mozota
38779de225 Add support for multiple subtitle tracks per PID and for naming hearing impaired subtitles 2017-04-04 17:17:10 +02:00
Oliver Woodman
757999758b Cleanup for merged pull requests 2017-03-31 19:38:41 +01:00
ojw28
c3fa6d8943 Merge pull request #2612 from dessatel/dev-v2
Disables codecIsAdaptive for Odroid-XU4
2017-03-31 19:32:17 +01:00
olly
8e76790823 Remove deprecated readSource method
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151840862
2017-03-31 19:17:35 +01:00
eguven
64188748f4 Move cache related generic methods from DashDownloader to CacheUtil
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151818564
2017-03-31 19:16:24 +01:00
olly
77e6d75bdd Fix FLV parser to skip metadata we're not interested in
Issue: #2634

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151816597
2017-03-31 19:15:24 +01:00
andrewlewis
f7fff0d583 Apply parameter adjustments with resetting.
Start draining the audio processors when the playback parameters change,
and when draining completes use the written frame count and next input
buffer presentation timestamp as an offset for applying the new playback
speed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151800074
2017-03-31 19:14:22 +01:00
olly
035fab225d Rename skipToKeyframeBefore -> skipData and allow skipping to EOS
This change also ensures that format changes are read whilst the
renderer is enabled but without a codec. This is necessary to
ensure the drm session is updated (or replaced).

Updating the format is also needed so that the up-to-date format is
used in the case that the codec is initialized later due to the
surface being set. Previously, if an ABR change occurred between
the format being read and the surface being attached, we would
instantiate the codec and then immediately have to reconfigure it
when as a result of reading the up-to-date format. For a non-adaptive
codec this resulted in the codec being immediately released and
instantiated again!

Issue: #2582

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151608096
2017-03-31 19:11:08 +01:00
olly
9bc20d23a8 Print when frame is rendered in EventLogger + tidying
This is the boring part of a larger change that fixes
how video renderers behave when surfaces are attached and
detached whilst they're enabled or started.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151563031
2017-03-31 19:10:07 +01:00
eguven
68b8a5e542 Downgrade jacoco to 0.7.4.201502262128 as a workaround for 'stuck in endless loop' issue
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151554130
2017-03-31 19:09:01 +01:00
eguven
103c3b631b Add DashDownloader helper class to download dash streams
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151456161
2017-03-31 19:07:59 +01:00
eguven
2f9e082fe1 Enable gradle test code coverage for the library modules that aren't affected by 'stuck in endless loop' issue
'library-core' is still affected by https://code.google.com/p/android/issues/detail?id=226070

Code coverage report can be generated for the rest of the modules by:
./gradlew :[module name]:createDebugCoverageReport
Report is generated under:
[module folder]/buildout/reports/coverage/debug

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151448536
2017-03-31 19:06:58 +01:00
olly
e7a4c28dde Fix missing NonNull annotations for overriding methods
If the super method has the annotation on an argument, then
the overriding method should have it too.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151440313
2017-03-31 19:05:54 +01:00
andrewlewis
1dcfae452a Avoid input/output copies in SonicAudioProcessor.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151431376
2017-03-31 19:04:36 +01:00
andrewlewis
422c2d0ab7 Support escaped AAC AOTs.
Issue: #2514

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151418949
2017-03-31 19:03:27 +01:00
olly
21eecb679d Make ID3 parsing more robust
- Validate frames for majorVersion 2 and 3 as well as 4
- Don't throw if top bit of frameSize is non-zero.

Issue: #2604

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151348836
2017-03-31 19:02:22 +01:00
olly
5ebb3d4481 Correct allowTimeBeyondBuffer values for skipToKeyframeBefore calls
The only case where we should pass false is if we want to know
whether the passed time is within the buffered media. This is
relevant within seekTo implementations only.

This is related to (but does not fix) issue #2582

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151315676
2017-03-31 19:00:06 +01:00
andrewlewis
abcd177e8a Remove some unused Sonic functionality.
Also move it closer to the ExoPlayer code style.

Note: This change is intended to be purely cosmetic.

Issue: #26

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151307575
2017-03-31 18:58:50 +01:00
andrewlewis
9d20a8d41c Add a custom time bar view.
Also add an isAd flag to Timeline.Period so that periods can be declared as
containing ads. The times of these periods are indicated using ad markers in
the new TimeBar.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151116208
2017-03-31 18:57:42 +01:00
Alex Telitsine
d84733c9cf Disables Adaptive workaround for Odroid-XU4 up to SDK 19 in Samsung's Exynos AVC and AVC secure decoders 2017-03-30 19:53:19 -07:00