7073 Commits

Author SHA1 Message Date
tonihei
346f8e670a Turn on non-null-by-default for most extensions.
PiperOrigin-RevId: 261700729
2019-08-05 20:27:43 +01:00
tonihei
17a9030e1d Update stale TrackSelections in chunk sources when keeping the streams.
If we keep streams in chunk sources after selecting new tracks, we also keep
a reference to a stale disabled TrackSelection object. Fix this by updating
the TrackSelection object when keeping the stream. The static part of the
selection (i.e. the subset of selected tracks) stays the same in all cases.

Issue:#6256
PiperOrigin-RevId: 261696082
2019-08-05 20:27:24 +01:00
sofijajvc
b6441a02f5 Introduce common output buffer class for video decoders
PiperOrigin-RevId: 261693054
2019-08-05 20:27:04 +01:00
olly
c9b73cba8c Update release notes
PiperOrigin-RevId: 261651655
2019-08-05 20:26:44 +01:00
tonihei
790deb71db Check if controller is used when performing click directly.
Issue:#6260
PiperOrigin-RevId: 261647858
2019-08-05 10:55:23 +01:00
tonihei
d6e74bc19b Ensure position reset keep window sequence number.
We currently keep the sequence number if we don't reset the position. However,
the sequence number should be kept if we don't reset the state. Otherwise
re-prepare with position reset is counted as new playback although it's still
the same.

PiperOrigin-RevId: 261644924
2019-08-05 10:55:04 +01:00
olly
fb0481c520 Bump annotations dependency + update release notes
PiperOrigin-RevId: 261353271
2019-08-02 19:04:56 +01:00
olly
6f014749b3 Upgrade dependency versions
PiperOrigin-RevId: 261341256
2019-08-02 18:55:09 +01:00
olly
818ef62fb0 Remove obsolete workaround
PiperOrigin-RevId: 261340526
2019-08-02 18:54:50 +01:00
olly
f179feb292 Constraint seek targetGranule within bounds + simplify tests
PiperOrigin-RevId: 261328701
2019-08-02 17:16:45 +01:00
olly
173eadc70e Move DefaultOggSeeker tests into a single class
PiperOrigin-RevId: 261320318
2019-08-02 17:16:07 +01:00
olly
5e98d76e8b Improve extractor tests based on ExtractorAsserts
- Test seeking to (timeUs=0, position=0), which should always work
  and produce the same output as initially reading from the start
  of the stream.
- Reset the input when testing seeking, to ensure IO errors are
  simulated for this case.

PiperOrigin-RevId: 261317898
2019-08-02 17:15:47 +01:00
olly
91c62ea26f Fix DefaultOggSeeker seeking
- When in STATE_SEEK with targetGranule==0, seeking would exit
  without checking that the input was positioned at the correct
  place.
- Seeking could fail due to trying to read beyond the end of the
  stream.
- Seeking was not robust against IO errors during the skip phase
  that occurs after the binary search has sufficiently converged.

PiperOrigin-RevId: 261317035
2019-08-02 17:15:28 +01:00
olly
90ab05c574 Add DRM samples to Cast demo app
PiperOrigin-RevId: 261312509
2019-08-02 17:15:08 +01:00
tonihei
851218aca9 Fix AnalyticsCollectorTest flakiness.
Two tests have very low propability flakiness (1:1000) due to not waiting for
a seek in one case and the chance of already being ended in another case.

Fix these and also adjust wrong comments about state changes.

PiperOrigin-RevId: 261309976
2019-08-02 17:14:48 +01:00
sofijajvc
4482db40e1 Move output modes to constants file
PiperOrigin-RevId: 261295173
2019-08-02 17:14:29 +01:00
sofijajvc
39317048e9 Add video decoder exception class
This will be used in common video renderer and decoder classes.

PiperOrigin-RevId: 261287124
2019-08-02 17:14:09 +01:00
tonihei
0887ab059c Remove nullablity of track groups and selections in MediaPeriodHolder.
These values can easily default to the empty track group and the empty
selection. As a result we can remove restrictions about not calling
holder.getTrackGroups before the period finished preparation.

PiperOrigin-RevId: 261280927
2019-08-02 17:13:50 +01:00
andrewlewis
5eab519925 Revert to using header bitrate for CBR MP3s
A previous change switched to calculation of the bitrate based on the
first MPEG audio header in the stream. This had the effect of fixing
seeking to be consistent with playing from the start for streams where
every frame has the same padding value, but broke streams where the
encoder (correctly) modifies the padding value to match the declared
bitrate in the header.

Issue: #6238
PiperOrigin-RevId: 261163904
2019-08-01 20:40:10 +01:00
olly
42d3ca273b Propagate non-standard MIME type aliases
Issue: #5938
PiperOrigin-RevId: 261150349
2019-08-01 20:39:51 +01:00
olly
4c40878b6b Shorten data length if it exceeds length of input
Issue: #6241
PiperOrigin-RevId: 261126968
2019-08-01 20:39:33 +01:00
aquilescanta
79b86de619 Use per-media source DRM in the Cast demo app
PiperOrigin-RevId: 261125341
2019-08-01 20:39:14 +01:00
olly
cb8983afd1 Standardize ALAC initialization data
Android considers ALAC initialization data to consider of the magic
cookie only, where-as FFmpeg requires a full atom. Standardize around
the Android definition, since it makes more sense (the magic cookie
being contained within an atom is container specific, where-as the
decoder shouldn't care what container the media stream is carried in)

Issue: #5938
PiperOrigin-RevId: 261124155
2019-08-01 20:38:55 +01:00
olly
95ed5ce65d Make OggSeeker.startSeek take a granule rather than a time
PiperOrigin-RevId: 261102180
2019-08-01 20:38:37 +01:00
olly
cbc1385fd3 Some no-op cleanup for DefaultOggSeeker
PiperOrigin-RevId: 261102008
2019-08-01 20:38:18 +01:00
bachinger
1bb0703f2b return lg specific mime type as codec supported type for OMX.lge.alac.decoder
ISSUE: #5938
PiperOrigin-RevId: 261097045
2019-08-01 20:37:59 +01:00
sofijajvc
b2c71e8b3f Extract VpxInputBuffer to a common class
This class will be shared by both vp9 and av1 extension.

PiperOrigin-RevId: 261089225
2019-08-01 20:37:40 +01:00
Oliver Woodman
b57aa34b66 Merge pull request #6239 from ittiam-systems:vorbis-picture-parse
PiperOrigin-RevId: 261087432
2019-08-01 20:37:21 +01:00
olly
a2cf427b4b Mp3Extractor: Avoid outputting non-zero position seek frame as a sample
Checking inputPosition == 0 isn't sufficient because the synchronization
at the top of read() may advance the input (i.e. in the case where there's
some garbage prior to the seek frame).

PiperOrigin-RevId: 261086901
2019-08-01 20:36:58 +01:00
tonihei
561949a225 Remove AnalyticsCollector.Factory.
This factory was only needed in the past when we didn't have
AnalyticsCollector.setPlayer. Code becomes easier to use without this factory.

PiperOrigin-RevId: 261081860
2019-08-01 20:36:40 +01:00
olly
526cc72e04 WavExtractor: Skip to data start position if position reset to 0
PiperOrigin-RevId: 260970865
2019-08-01 20:36:21 +01:00
olly
288aa52dec Clean up some Ogg comments & document granulePosition
PiperOrigin-RevId: 260947018
2019-08-01 20:36:02 +01:00
olly
80ab74748d Mp3Extractor: Avoid outputting seek frame as a sample
This could previously occur when seeking back to position=0

PiperOrigin-RevId: 260933636
2019-08-01 20:35:43 +01:00
olly
af8f67c068 Don't print warning when skipping RIFF and FMT chunks
They're not unexpected!

PiperOrigin-RevId: 260907687
2019-08-01 20:35:25 +01:00
tonihei
6f2e24915d Add @NonNullApi and annotate two packages with it.
This new annotation declares everything as non-null by default and can be
used as a package annotation in package-info.java.

In this change the core lib offline package and the mediasession extension is
annotated that way as initial example usage.

PiperOrigin-RevId: 260894548
2019-08-01 20:35:06 +01:00
olly
78350cd17d Update javadoc for TrackOutput#sampleData to make it more clear that implementors aren't expected to rewind with setPosition()
PiperOrigin-RevId: 260718614
2019-08-01 20:34:47 +01:00
tonihei
ce2e2797cb Improve DefaultMediaClock behaviour.
DefaultMediaClock has currently two non-ideal behaviours:
1. One part of checking if it should use the renderer clock is checking whether
   the associated renderer finished reading its stream. This only makes sense
   if the renderer isn't already reading ahead into the next period. This can
   be solved by forwarding if we are reading ahead to the sync command.
2. When switching from stand-alone to renderer clock we assume they are
   exactly at the same position. This is true in theory, but in practise there
   may be small differences due to the different natures of these clocks. To
   prevent jumping backwards in time, we can temporarily stop the stand-alone
   clock and only switch once the renderer clock reached the same position.

PiperOrigin-RevId: 260690468
2019-08-01 20:34:28 +01:00
tonihei
39d5867c97 Make blocking fixed track bandwidth the default and remove experimental flag.
PiperOrigin-RevId: 260682878
2019-08-01 20:34:08 +01:00
aquilescanta
40926618ad Return the removed media source from ConcatenatingMediaSource.removeMediaSource
PiperOrigin-RevId: 260681773
2019-08-01 20:33:48 +01:00
olly
58006ac3ad Tweak Firebase JobDispatcher extension README
PiperOrigin-RevId: 260583198
2019-08-01 20:33:29 +01:00
Venkatarama NG. Avadhani
27a4f96cb1 Clean up FLAC picture parsing 2019-07-30 12:15:36 +05:30
olly
8be78d47ac Cast: Add JSON serialization/deserialization for MediaItem
This will allow the Cast extension to reconstruct MediaItems from MediaQueueItems
obtained from the receiver's queue.

PiperOrigin-RevId: 260554381
2019-07-29 21:29:23 +01:00
aquilescanta
46855884f5 Fix samples' text in Cast demo app
PiperOrigin-RevId: 260553467
2019-07-29 21:29:04 +01:00
olly
961adb7e36 Cast: Add MediaItemConverter
For now this just moves some code from the demo app to the extension.
Eventually the goal would be to have CastPlayer playlist methods take
MediaItem, have CastPlayer convert them internally to MediaQueueItem
for sending to the Cast SDK, and also allow reverse conversion so we
can reconstruct MediaItems from the Cast SDK's queue.

PiperOrigin-RevId: 260548020
2019-07-29 21:28:45 +01:00
aquilescanta
06f9481505 Support different drm schemes in playlists in the demo app
This CL changes PlayerActivity's VIEW_LIST action intent contract:
Each media item configuration is provided by indexing the entries.
For example, the URI of the first item is passed as "uri_0", the
second one is "uri_1", etc. Optionally, the extra parameters, like
the extensions, are passed as "extension_1", where the intent extras
with matching indices, refer to the same media sample.

The VIEW action's contract remains unchanged.

PiperOrigin-RevId: 260518118
2019-07-29 21:28:26 +01:00
andrewlewis
3051e5e9ad Ensure the SilenceMediaSource position is in range
Issue: #6229
PiperOrigin-RevId: 260500986
2019-07-29 21:28:06 +01:00
olly
d77d661e52 Default viewport constraints to match primary display
PiperOrigin-RevId: 260479923
2019-07-29 21:27:46 +01:00
tonihei
7703676c87 Swap reading and playing media period updates.
Both periods are rarely updated in the same iteration. If they are, advancing
the reading period first seems more logical and also more efficient as it may
avoid one extra doSomeWork iteration.

PiperOrigin-RevId: 260463735
2019-07-29 21:27:25 +01:00
tonihei
846e0666df Restructure updatePeriods code for better readability.
Moved update of reading and playing periods in their own respective method.
This is a no-op change.

PiperOrigin-RevId: 260463668
2019-07-29 21:27:06 +01:00
Venkatarama NG. Avadhani
ea64ecf2c4 Parse Picture Metadata in FLAC 2019-07-29 14:34:35 +05:30