Commit graph

3871 commits

Author SHA1 Message Date
Oliver Woodman
f8c76f62e4 Fix ClippingSampleStream 2018-01-03 13:50:24 +00:00
olly
f657893973 Make SsaDecoder more robust against malformed content
Issue: #3645

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180559196
2018-01-03 13:38:16 +00:00
hoangtc
ad95a147d2 Fix a bug that makes ClippingMediaSource not stop in some occasions.
If ClippingMediaSource contains a child MediaSource with embedded metadata
stream, and the embedded stream is being used, it can lead to
ClippingMediaSource not be able to stop after the clipping end point. The
reason being the metadata stream cannot read anymore sample, but it's also not
end of source at that point. This CL fix this by changing the condition to
check if the child stream cannot read anymore sample and it has read past the
clipping end point.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179918038
2018-01-03 13:38:03 +00:00
olly
16ad280817 Bump version to 2.6.1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179227114
2017-12-15 20:50:54 +00:00
olly
3fae0b8e6e Fix analyze/lint errors
- Lint doesn't like a static import of something not available on
  the minimum API level.
- The method linked to in the Javadoc was incorrect (wrong signature).
  I couldn't really work out why it was there, so I got rid of it
  rather than updating.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179222587
2017-12-15 20:29:00 +00:00
tonihei
1e36c76654 Allow to configure maximum buffer size in DefaultLoadControl.
This adds a parameter to configure a maximum buffer size in bytes. If left
at its default of C.LENGTH_UNSET, the target buffer is determined using a
overridable method based on the track selection. Also adding a parameter
to decide whether to prioritize time or size constraints.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179048554
2017-12-15 16:27:32 +00:00
andrewlewis
236df9a571 Remove DefaultLoadControl buffer time state
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176515168
2017-12-15 16:27:15 +00:00
andrewlewis
ab7503843c Use playAd/stopAd to control position updates switching
Previously the ad/content progress updates were toggled based on whether the
player was playing ads or content. After this change, we switch based on
whether playAd/stopAd has been called instead.

This seems to resolve an issue where occasionally the player would get stuck at
the start of an ad, but as I don't have a root cause for that issue and it's
only sporadically reproducible I'm not certain this is a reliable fix.

Issue: #3525

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179169296
2017-12-15 16:25:27 +00:00
olly
52794e749d Fix typo
Issue #3594

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179167738
2017-12-15 16:25:21 +00:00
andrewlewis
04108eec48 Fix condition for detecting that an ad has ended
onEnded was being called also for content finishing, as in this case the playing
ad index changed (from INDEX_UNSET to 0). Fix this test so we only detect ads
finishing.

Also add logging for onEnded callbacks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179167737
2017-12-15 16:25:16 +00:00
andrewlewis
b97ce44182 Pass -1 not C.TIME_UNSET when duration is unknown
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179165479
2017-12-15 16:25:10 +00:00
olly
403f773f87 Add missing attrs to SimpleExoplayerView
They worked without being present in the declare-styleable,
but they need to be present for Android Studio auto-complete
to suggest them.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179047478
2017-12-15 16:24:16 +00:00
olly
67b94a72a5 Update SingleSampleMediaSource with factory/listener changes
- Convert the Builder into a Factory
- Have it use MediaSourceEventListener
- Also made some misc related fixes to other sources

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178906521
2017-12-15 16:23:19 +00:00
tonihei
8a6c375c53 Check if native libraries are available in tests.
If the library is not available, no tracks can be selected and the
tests silently run through by immediately switching to ended state
without error.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178904347
2017-12-15 16:18:43 +00:00
olly
ae514b68ff Update release notes for current 2.6.1 feature set
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178877884
2017-12-15 16:18:23 +00:00
olly
65ccff2448 Update release notes to reflect builder -> factory change
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178866131
2017-12-15 16:17:17 +00:00
bachinger
bf9a919005 Propagate extras from queue item to metadata item.
norelnotes=true

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178785377
2017-12-15 15:29:18 +00:00
andrewlewis
b223988e30 Add Builder for ImaAdsLoader and allow early requestAds
Also fix propagation of ad errors that occur when no player
is attached.

Issue: #3548
Issue: #3556

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178767997
2017-12-12 22:01:56 +00:00
andrewlewis
7a089c3a29 Support non-extractor ads in AdsMediaSource and demo apps
Issue: #3302

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178615074
2017-12-12 22:01:46 +00:00
andrewlewis
f31696b79a Make ExtractorMediaSource.Builder a factory for ExtractorMediaSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178605481
2017-12-12 22:01:28 +00:00
andrewlewis
babd5750e3 Use surfaceless context in DummySurface, if available
Issue: #3558

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178604607
2017-12-12 22:00:55 +00:00
andrewlewis
42b612a49f Make HlsMediaSource.Builder a factory for HlsMediaSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178384204
2017-12-12 22:00:31 +00:00
andrewlewis
4c71d6361d Make SsMediaSource.Builder a factory for SsMediaSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178380856
2017-12-12 21:58:36 +00:00
andrewlewis
a0d42b53b7 Make DashMediaSource.Builder a factory for DashMediaSources
This is in preparation for supporting non-extractor MediaSources for ads in
AdsMediaSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178377627
2017-12-12 21:57:19 +00:00
andrewlewis
3e9c86fcb5 Add an option to turn off hiding controls during ads
Issue: #3532

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178372763
2017-12-12 21:50:20 +00:00
olly
88d012bad0 Treat captions that are wider than expected as middle aligned
Issue: #3534

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178364353
2017-12-12 21:50:08 +00:00
andrewlewis
a99295b364 Fix ad loading when there is no preroll
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178234009
2017-12-12 21:49:59 +00:00
olly
f677d1309d Blacklist Moto Z from using secure DummySurface.
Issue: #3215

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178218535
2017-12-12 21:49:44 +00:00
andrewlewis
a4a02f7449 Skip ads before the initial player position
Issue: #3527

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178218391
2017-12-12 21:49:36 +00:00
andrewlewis
e7d4524c27 Use mappedTrackInfo local
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178216750
2017-12-12 21:49:29 +00:00
olly
39e8f07566 Add missing Nullable annotation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178117289
2017-12-12 21:49:22 +00:00
olly
02e32a1838 Hide subtitles when switching player in SimpleExoPlayerView
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177941993
2017-12-12 21:48:59 +00:00
olly
9cb0c2f702 Remove self @link
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177938212
2017-12-12 21:48:54 +00:00
andrewlewis
3c0bb7263b Invoke onLoadCanceled/Completed for ExtractorMediaSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177936271
2017-12-12 21:48:47 +00:00
andrewlewis
82122b9f3b Make one ad request in ImaAdsLoader
This fixes an issue where quickly detaching and reattaching the player might
cause ads to be requested multiple times with both responses handled.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177922167
2017-12-12 21:48:27 +00:00
amesbah
aef9063e94 Add @SuppressWarnings("ComparableType") for instances of a class implementing 'Comparable<T>' where T is not compatible with the type of the class.
In order to facilitate enabling a compile-time error check, we are suppressing these existing instances. Once the compile-time error is enabled, we will file bugs to clean up any unfixed instances in [].

Note that this CL should result in no effective changes to the code, but the code as currently-written might contain a real bug. If you'd prefer to fix the bug now, please either reply with edits, or accept this CL then follow up with a change that fixes the underlying issue.

Tested:
    tap_presubmit: []    Some tests failed; test failures are believed to be unrelated to this CL

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177836122
2017-12-12 21:48:16 +00:00
olly
13a7037c82 Fix playback of FLV live streams with no audio track
Issue: #3188

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177811487
2017-12-12 21:48:01 +00:00
andrewlewis
bc7bfb4e7c Fix setting supported ad MIME types without preloading
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177810991
2017-12-12 21:47:55 +00:00
olly
29f6351b19 Support timezone offsets in ISO8601 timestamps
Issue: #3524

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177808106
2017-12-12 21:47:45 +00:00
olly
a8298b4c56 Tentative fix for roll-up row count
Issue: #3513

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177804505
2017-12-12 21:46:33 +00:00
Oliver Woodman
10b24be6f0 Fix build 2017-12-12 21:46:02 +00:00
andrewlewis
e759462af8 Update internal usages of deprecated AdaptiveMediaSourceEventListener
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177786580
2017-12-12 21:40:21 +00:00
andrewlewis
393a762563 Use AdaptiveMediaSourceEventListener for ExtractorMediaSource
This is a step towards harmonizing the MediaSource Builders and (potentially)
providing MediaSource factories.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177783157
2017-12-12 21:33:59 +00:00
olly
b61d09c416 Fix mp3 extractor test
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177458840
2017-12-12 21:33:40 +00:00
olly
0ea8c8bfa0 Fix VBRI and XING seekers
- Remove skipping of the VBRI/XING frame before calculating position
  offsets. This was incorrect. Instead, a constraint is used to ensure
  we don't return positions within these frames, the difference being
  that the constraint adjusts only positions that would fall within
  the frames, where-as the previous approach shifted positions through
  the whole stream.
- Excluded last entry in the VBRI table because it has an invalid
  position (the length of the stream).
- Give variables in XingSeeker descriptive names.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177451295
2017-12-12 21:33:34 +00:00
andrewlewis
022b85a625 Move resetting audio processors to initialize()
The set of active audio processors was only updated on reconfiguration and when
draining playback parameters completed. Draining playback parameters are cleared
in reset(), so if parameters were set while paused then the sink was quickly
reset, without draining completing, the set of active audio processors wouldn't
be updated. This means that a switch to or from speed or pitch = 1 would not be
handled correctly if made while paused and followed by a seek.

Move resetting active audio processors from configure (where if the active audio
processors were reset we'd always initialize a new AudioTrack) to initialize().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177442098
2017-12-12 21:33:18 +00:00
olly
8fbc2a5c9b Snap to frame boundary in ConstantBitrateSeeker
- This change snaps the seek position for constant bitrate MP3s
  to the nearest frame boundary, avoiding the need to skip one
  byte at a time to re-synchronize (this may still happen if the
  MP3 does not really have fixed size frames).
- Tweaked both ConstantBitrateSeeker and WavHeader to ensure the
  returned positions are valid.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177441798
2017-12-12 21:32:40 +00:00
andrewlewis
4e8b9282f5 Add a notice that NDK <= version 15c is required for VP9
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177430827
2017-12-12 21:31:26 +00:00
andrewlewis
315a6c3558 Update getPosition(0) positions for FragmentedMp4Extractor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177424314
2017-12-12 21:31:17 +00:00
andrewlewis
9526e8586a Use a MediaSource factory internally in AdsMediaSource
Support ad MediaSources that aren't prepared immediately by using
DeferredMediaPeriod, moved up from DynamicConcatenatingMediaSource.

In a later change the new interfaces will be made public so that apps
can provide their own MediaSource factories.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177424172
2017-12-12 21:31:02 +00:00