6800 Commits

Author SHA1 Message Date
tonihei
acdb19e99d Clean up documentation of DefaultTrackSelector.ParametersBuilder.
We don't usually refer to other classes when documenting method parameters
but rather duplicate the actual definition.

PiperOrigin-RevId: 262102714
2019-09-02 14:32:21 +01:00
tonihei
c4ac166f2f Add allowAudioMixedChannelCountAdaptiveness parameter to DefaultTrackSelector.
We already allow mixed mime type and mixed sample rate adaptation on request,
so for completeness, we can also allow mixed channel count adaptation.

Issue:#6257
PiperOrigin-RevId: 261930046
2019-09-02 14:32:10 +01:00
ibaker
9f486336be Migrate literal usages of 1000 to (new) C.MILLIS_PER_SECOND
This only covers calls to scaleLargeTimestamp()

PiperOrigin-RevId: 261878019
2019-09-02 14:31:21 +01:00
ibaker
97183ef558 Add inband emsg-v1 support to FragmentedMp4Extractor
This also decouples EventMessageEncoder's serialization schema from the emesg spec (it happens to still match the emsg-v0 spec, but this is no longer required).

PiperOrigin-RevId: 261877918
2019-09-02 14:31:15 +01:00
Oliver Woodman
85c10b0256
Merge pull request #6279 from google/dev-v2-r2.10.4
r2.10.4
2019-08-09 21:01:05 +01:00
tonihei
d1ac2727a6 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:36:04 +01:00
tonihei
936a7789c9 Check if controller is used when performing click directly.
Issue:#6260
PiperOrigin-RevId: 261647858
2019-08-05 20:35:56 +01:00
olly
b0c2b1a0fa Bump annotations dependency
PiperOrigin-RevId: 261353271
2019-08-02 19:08:20 +01:00
olly
f3e5aaae3d Upgrade dependency versions
PiperOrigin-RevId: 261341256
2019-08-02 18:56:03 +01:00
olly
f2cff05c69 Remove obsolete workaround
PiperOrigin-RevId: 261340526
2019-08-02 18:55:58 +01:00
olly
cd7fe05db7 Constraint seek targetGranule within bounds + simplify tests
PiperOrigin-RevId: 261328701
2019-08-02 17:31:26 +01:00
olly
f497bb9610 Move DefaultOggSeeker tests into a single class
PiperOrigin-RevId: 261320318
2019-08-02 17:31:20 +01:00
olly
1da5689ea0 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:31:14 +01:00
olly
3c8c5a3346 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:31:07 +01:00
andrewlewis
80bc50b647 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-02 17:26:19 +01:00
Oliver Woodman
88b68e5902 Fix ExoPlayerTest 2019-08-01 21:06:56 +01:00
olly
f5e92134af Shorten data length if it exceeds length of input
Issue: #6241
PiperOrigin-RevId: 261126968
2019-08-01 21:05:24 +01:00
olly
6d20a5cf0c WavExtractor: Skip to data start position if position reset to 0
PiperOrigin-RevId: 260970865
2019-08-01 21:04:45 +01:00
olly
c373ff0a1c Don't print warning when skipping RIFF and FMT chunks
They're not unexpected!

PiperOrigin-RevId: 260907687
2019-08-01 21:04:37 +01:00
andrewlewis
7ec7aab320 Move E-AC3 workaround out of MediaCodecUtil
PiperOrigin-RevId: 244173887
2019-08-01 21:02:52 +01:00
olly
7162bd8153 Propagate non-standard MIME type aliases
Issue: #5938
PiperOrigin-RevId: 261150349
2019-08-01 21:01:12 +01:00
olly
23ace19369 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:52:22 +01:00
olly
520275ec71 Make OggSeeker.startSeek take a granule rather than a time
PiperOrigin-RevId: 261102180
2019-08-01 20:52:15 +01:00
olly
740502103f Some no-op cleanup for DefaultOggSeeker
PiperOrigin-RevId: 261102008
2019-08-01 20:52:09 +01:00
bachinger
4438cdb282 return lg specific mime type as codec supported type for OMX.lge.alac.decoder
ISSUE: #5938
PiperOrigin-RevId: 261097045
2019-08-01 20:52:01 +01:00
Oliver Woodman
309d043cee Merge pull request #6239 from ittiam-systems:vorbis-picture-parse
PiperOrigin-RevId: 261087432
2019-08-01 20:51:40 +01:00
olly
e159e3acd0 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:50:53 +01:00
olly
3e99e7af54 Clean up some Ogg comments & document granulePosition
PiperOrigin-RevId: 260947018
2019-08-01 20:50:37 +01:00
olly
b5ca187e85 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:50:29 +01:00
olly
58e70e8351 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:49:45 +01:00
olly
8c1b60f2db Tweak Firebase JobDispatcher extension README
PiperOrigin-RevId: 260583198
2019-08-01 20:48:59 +01:00
andrewlewis
f5980a54a3 Ensure the SilenceMediaSource position is in range
Issue: #6229
PiperOrigin-RevId: 260500986
2019-07-29 22:34:21 +01:00
Oliver Woodman
d279c3d281
Update README.md 2019-07-28 20:29:55 +01:00
Oliver Woodman
d395db97df
Update README.md 2019-07-28 20:29:29 +01:00
Oliver Woodman
e56deba9fe
Update README.md 2019-07-28 20:27:35 +01:00
Oliver Woodman
926ad19822
Update README.md 2019-07-28 20:26:55 +01:00
eguven
9c88e54837 Deprecate JobDispatcherScheduler
PiperOrigin-RevId: 249250184
2019-07-28 19:37:51 +01:00
olly
d76bf4bfca Bump version to 2.10.4
PiperOrigin-RevId: 260164426
2019-07-27 23:01:22 +01:00
andrewlewis
95d2988490 Fix handling of channel count changes with speed adjustment
When using speed adjustment it was possible for playback to get stuck at a
period transition when the channel count changed: SonicAudioProcessor would be
drained at the point of the period transition in preparation for creating a new
AudioTrack with the new channel count, but during draining the incorrect (new)
channel count was used to calculate the output buffer size for pending data from
Sonic. This meant that, for example, if the channel count changed from stereo to
mono we could have an output buffer size that stored an non-integer number of
audio frames, and in turn this would cause writing to the AudioTrack to get
stuck as the AudioTrack would prevent writing a partial audio frame.

Use Sonic's current channel count when draining output to fix the issue.

PiperOrigin-RevId: 260156541
2019-07-27 22:57:11 +01:00
Oliver Woodman
70978cee78 Update release notes 2019-07-26 17:01:47 +01:00
Oliver Woodman
0b756a9646 Merge pull request #6042 from Timbals:dev-v2
PiperOrigin-RevId: 258812820
2019-07-26 17:01:18 +01:00
olly
78d6393213 Add A10-70L to output surface workaround
Issue: #6222
PiperOrigin-RevId: 260146226
2019-07-26 16:59:46 +01:00
olly
97e98ab4ed Cast: Remove obsolete flavor dimension
PiperOrigin-RevId: 259582498
2019-07-26 16:58:41 +01:00
tonihei
40fd11d9e8 Further language normalization tweaks for API < 21.
1. Using the Locale on API<21 doesn't make any sense because it's a no-op
   anyway. Slightly restructured the code to avoid that.
2. API<21 often reports languages with non-standard underscores instead of
   dashes. Normalize that too.
3. Some invalid language tags on API>21 get normalized to "und". Use original
   tag in such a case.

Issue:#6153
PiperOrigin-RevId: 258773463
2019-07-26 16:58:07 +01:00
tonihei
f82920926d Switch language normalization to 2-letter language codes.
2-letter codes (ISO 639-1) are the standard Android normalization and thus we
should prefer them to 3-letter codes (although both are technically allowed
according the BCP47).

This helps in two ways:
 1. It simplifies app interaction with our normalized language codes as the
    Locale class makes it easy to convert a 2-letter to a 3-letter code but
    not the other way round.
 2. It better normalizes codes on API<21 where we previously had issues with
    language+country codes (see tests).
 3. It allows us to normalize both ISO 639-2/T and ISO 639-2/B codes to the same
    language.

PiperOrigin-RevId: 258729728
2019-07-26 16:57:40 +01:00
aquilescanta
e181d4bd35 Fix DataSchemeDataSource re-opening and range requests
Issue:#6192
PiperOrigin-RevId: 258592902
2019-07-26 16:57:24 +01:00
tonihei
962d5e7040 Keep default start position (TIME_UNSET) as content position for preroll ads.
If we use the default start position, we currently resolve it immediately
even if we need to play an ad first, and later try to project forward again
if we believe that the default start position should be used.

This causes problems if a specific start position is set and the later
projection after the preroll ad shouldn't take place.

The problem is solved by keeping the content position as TIME_UNSET (= default
position) if an ad needs to be played first. The content after the ad can
then be resolved to its current default position if needed.

PiperOrigin-RevId: 258583948
2019-07-26 16:56:01 +01:00
olly
fa691035d3 Extend RK video_decoder workaround to newer API levels
Issue: #6184
PiperOrigin-RevId: 258527533
2019-07-26 16:55:01 +01:00
Oliver Woodman
bba0a27cb6 Merge pull request #6151 from ittiam-systems:bug-5527
PiperOrigin-RevId: 257668797
2019-07-26 16:54:56 +01:00
olly
b6777e030e Remove some UI classes from nullness blacklist
PiperOrigin-RevId: 256751627
2019-07-26 16:52:05 +01:00