8574 Commits

Author SHA1 Message Date
samrobinson
37f0ff925a Improve Format propagation within the MediaCodecRenderer.
Handles pixel aspect ratio changes in playlists where video
resolution does not change.

Issue:#6646
PiperOrigin-RevId: 307817028
2020-04-27 10:40:01 +01:00
aquilescanta
5d3230d85a Add test for TS with h264 and DTS audio
PiperOrigin-RevId: 307789384
2020-04-27 10:40:01 +01:00
ibaker
11c24ac3e7 Split {Amr,Ogg}ExtractorTest into parameterized & non-parameterized
This avoids the non-parameterized tests being run repeatedly for every
combination of parameters.

PiperOrigin-RevId: 307785770
2020-04-27 10:40:01 +01:00
ibaker
cfa8e19f77 Use parameterization in most extractor tests
Part of what makes these tests hard to deal with (imo) is being
unable to easily run a specific config, or seeing exactly which one
failed (because you always see only the first failure).

I put the parameters as a method on ExtractorAsserts to
reduce the boiler-plate required in each test class.

I'll migrate the extension FlacExtractorTest in a follow-up CL

PiperOrigin-RevId: 307785380
2020-04-27 10:40:01 +01:00
aquilescanta
1b6a32f25a Add test for TsExtractor's FLAG_DETECT_ACCESS_UNITS
PiperOrigin-RevId: 307777265
2020-04-27 10:40:01 +01:00
tonihei
29392d2689 Make some TtmlDecoder methods static.
PiperOrigin-RevId: 307776363
2020-04-27 10:40:01 +01:00
tonihei
1031dae19b Change some annotations placement Checkerframework now warns about.
PiperOrigin-RevId: 307764457
2020-04-27 10:39:34 +01:00
olly
6f2891e5c4 Remove usages of deprecated CacheDataSourceFactory
PiperOrigin-RevId: 307684243
2020-04-27 10:39:34 +01:00
olly
4abaaf138c Remove DownloadConstructorHelper
Something that helps a constructor always seemed a bit strange.
It's now possible to use CacheDataSource.Factory directly instead.

PiperOrigin-RevId: 307661930
2020-04-27 10:39:34 +01:00
olly
722a5b2279 Move PriorityTaskManager inside CacheDataSource
In the same way it made sense to tie CacheKeyFactory and CacheDataSource
together in
7ea83d7167,
it makes sense to tie the PriorityTaskManager to the CacheDataSource as
well. This prevents error prone scenarios where one can end up being
passed around without (or with the wrong instance of) the other.

This change also internalizes use of PriorityDataSource directly into
CacheDataSource, rather than requiring the caller to chain things
themselves.

PiperOrigin-RevId: 307647290
2020-04-27 10:38:46 +01:00
olly
fab8087472 Sanitize CacheDataSource/CacheDataSink factories
PiperOrigin-RevId: 307636959
2020-04-27 10:19:33 +01:00
tonihei
96ccb893f2 Fix timestamp rounding error in fMP4 extractor.
The sample timestamps are currently rounded to milliseconds, only to
be multiplied by 1000 later. This causes rounding errors where the sample
timestamps don't match the timestamps in the seek table (which are already
in microseconds).

issue:#7086
PiperOrigin-RevId: 307630559
2020-04-27 10:19:23 +01:00
aquilescanta
7839955f31 Separate encryption data into a new TrackOutput method
Allows media parser to populate crypto data.

PiperOrigin-RevId: 307616083
2020-04-27 10:19:13 +01:00
olly
1ab5923f27 Fix nullness checker warnings
PiperOrigin-RevId: 307570994
2020-04-27 10:19:03 +01:00
gyumin
118f0b3938 Prevent StreamVolumeManager from being released twice
PiperOrigin-RevId: 307534335
2020-04-27 10:18:52 +01:00
bachinger
628234fd1f Read media items from intent
PiperOrigin-RevId: 307442976
2020-04-27 10:18:41 +01:00
ibaker
6a36574af3 Use anti-aliasing and bitmap filtering for bitmap subtitles
issue:#6950
PiperOrigin-RevId: 307411067
2020-04-27 10:18:31 +01:00
bachinger
8d0d31e15c Add key set id to MediaItem
PiperOrigin-RevId: 307390673
2020-04-27 10:18:20 +01:00
olly
cb51a1bfe6 Fix H265Reader to correctly output SEI and AUD NAL units
Issue: #7113
PiperOrigin-RevId: 307380133
2020-04-20 13:30:02 +01:00
olly
9a7290000c Noop naming generalization for H265Reader
This change generalizes the concept of "reading parameter sets" to
"reading prefix NAL units", ahead of a change that will treat AUD
and suffix SEI NAL units in the same way.

The change also introduces some static isXxxNalUnit methods for
clarity.

Issue: #7113
PiperOrigin-RevId: 307376967
2020-04-20 13:29:53 +01:00
ibaker
eb8c174b4c Update WebVttCueParser to parse position alignment values
Currently we assume these are "start", "center", "middle" or "end",
which was correct in a previous draft of the spec:
https://www.w3.org/TR/2014/WD-webvtt1-20141111/#dfn-webvtt-text-position-cue-setting

The released spec uses "line-left", "center" and "line-right":
https://www.w3.org/TR/webvtt1/#webvtt-position-cue-setting

PiperOrigin-RevId: 307371066
2020-04-20 13:29:44 +01:00
Oliver Woodman
ad3fb3d05c Merge pull request #7247 from vadimdolgachev:subtitle_track_name_for_matroska
PiperOrigin-RevId: 307368176
2020-04-20 13:29:34 +01:00
andrewlewis
ccdd1a43c2 Fix AdsMediaSource child sources not being released
Also add unit tests for AdsMediaSource.

PiperOrigin-RevId: 307365492
2020-04-20 13:29:23 +01:00
andrewlewis
02af670a0f Fix gapless playback
Audio processors are now flushed twice after reconfiguration.
The second flush call cleared the pending trim start bytes so
transitions between tracks were no longer gapless.

Fix this by removing logic to clear pending trim bytes on flush.
As a result we may trim data incorrectly if there is a flush
before any data has been handled for seeking to a non-zero
position, but this edge case will happen rarely and the effect
shouldn't be noticeable.

PiperOrigin-RevId: 307344357
2020-04-20 13:29:14 +01:00
olly
fea4376779 Merge trick play tracks into main track groups
Issue: #6054
PiperOrigin-RevId: 307285068
2020-04-20 13:29:05 +01:00
bachinger
8ea33e2315 Support ad tag with default media source
This is the missing attribute to support all features of the Sample with MediaItem. Hence PlayerActivity can use the setMediaItems() method directly without creating actual media sources in the app code.

PiperOrigin-RevId: 307102036
2020-04-20 13:28:56 +01:00
ibaker
9937744f0e Improve the error message when an extractor dump file is not found
PiperOrigin-RevId: 307078446
2020-04-20 13:28:47 +01:00
olly
7ea83d7167 Better tie injection of Cache/CacheDataSource/CacheKeyFactory
PiperOrigin-RevId: 307056661
2020-04-20 13:28:38 +01:00
Oliver Woodman
704993ce7c Merge pull request #7210 from nebyan:CacheKeyFactoryNotUsed
PiperOrigin-RevId: 307045655
2020-04-20 13:28:27 +01:00
tonihei
7350981ef9 Use higher level interface for method parameters where possible.
This makes it easier to use the helper methods because the player doesn't
have to be assigned to a SimpleExoPlayer in all cases.

PiperOrigin-RevId: 307039126
2020-04-20 13:28:16 +01:00
ibaker
ece8d22357 Remove a suppression introduced by the checker-framework 3.3.0 upgrade
Update the comment on a suppression of Field.get(null) which is safe
but blocked by the checker.

These suppressions were introduced in d1e0572448

PiperOrigin-RevId: 307036441
2020-04-20 13:28:07 +01:00
tonihei
ca2105d50c Wait with throwing stuck buffering error until pending load is finished
We currently check for shouldContinueLoading, which is the intention to load,
not playbackInfo.isLoading, which is the actual loading state, when detecting
stuck buffering issues.

They only differ if the LoadControl said stop loading (based on nextLoadPosition),
but there is still a load in flight (updating bufferedPosition). This may cause
the exception to be thrown in edge cases that are only temporary.

PiperOrigin-RevId: 307022608
2020-04-20 13:27:57 +01:00
ibaker
15bbd181e5 Add Format.label to the extractor test dumps
Needed to test issue:#7247

PiperOrigin-RevId: 307016276
2020-04-20 13:27:48 +01:00
bachinger
abadc76872 Merge pull request #7245 from Clement-Jean:silence-media-source-factory
PiperOrigin-RevId: 307010600
2020-04-17 10:44:42 +01:00
kimvde
63da73df00 Add tests for ID3 in Mp3Extractor
PiperOrigin-RevId: 306844582
2020-04-17 10:44:32 +01:00
andrewlewis
efaa98eecf Fix TeeAudioProcessor sink configuration
TeeAudioProcessor needs to configure its sink when it is initially set up.

PiperOrigin-RevId: 306808871
2020-04-17 10:44:24 +01:00
bachinger
d7280f096f Add custom cache key to media item
This is required to migrate the PlayerActivity away from Sample to MediaItem. It hence needs adding buildUpon to MediaItem to mix in the customCacheKey and streamKeys before playback.

PiperOrigin-RevId: 306710643
2020-04-17 10:44:16 +01:00
bachinger
88de774587 Merge pull request #6270 from TiVo:p-iframe-only-playlist
PiperOrigin-RevId: 306677468
2020-04-17 10:44:06 +01:00
kimvde
ed977d1429 Test and fix H265Reader
- Update H265Reader to output the same samples after a seek to 0.
- Add a TsExtractor test for H.265.

PiperOrigin-RevId: 306675050
2020-04-17 10:43:57 +01:00
vadim
fe733428de Add saving subtitle track name for MatroskaExtractor 2020-04-16 22:22:53 +07:00
Clement Jean
3c655981d4 Add tag and Factory to SilenceMediaSource 2020-04-16 22:28:48 +08:00
ibaker
7214ad2d6f Use FrameLayout instead of ViewGroup for Subtitle(Web)View
This is a more specific ViewGroup subclass that handles some of the
layout logic automatically. It's designed to work best with a single
child view, as used here.

PiperOrigin-RevId: 306654947
2020-04-15 17:42:19 +01:00
olly
ba0028ca2c Parse trick-play role flags from DASH manifests
Issue: #6054
PiperOrigin-RevId: 306641689
2020-04-15 17:42:19 +01:00
aquilescanta
50926658b6 Avoid throwing an exception for sample default values
Allows playback of content when the default value is
not valid, but not used for any samples.

Issue: #7207
PiperOrigin-RevId: 306631376
2020-04-15 17:42:19 +01:00
christosts
91690f06ed Add Clock#currentTimeMillis()
PiperOrigin-RevId: 306602043
2020-04-15 17:42:19 +01:00
tonihei
823419761f Allow custom playback session id generator.
This allows users to inject their own session id logic.

PiperOrigin-RevId: 306597785
2020-04-15 17:42:19 +01:00
aquilescanta
4d22121cde Capitalize r's in HlsMediaPlaylist byte ranges
PiperOrigin-RevId: 306504969
2020-04-15 17:42:19 +01:00
olly
6cff8a6ad0 Don't select trick-play tracks by default
Issue: #6054
Issue: #474
PiperOrigin-RevId: 306504362
2020-04-15 17:42:18 +01:00
olly
a99288a6fa Pass UriSample to DownloadTracker
PiperOrigin-RevId: 306469450
2020-04-15 17:42:18 +01:00
olly
66f1c04445 Fix capabilities check for low frame-rate content
Issue: #6054
Issue: #474
PiperOrigin-RevId: 306437452
2020-04-15 17:42:18 +01:00