6675 Commits

Author SHA1 Message Date
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
olly
b5e3ae4542 Add Nullable annotations to CastPlayer
PiperOrigin-RevId: 256680382
2019-07-26 16:51:59 +01:00
olly
383c0adcca Remove more low hanging fruit from nullness blacklist
PiperOrigin-RevId: 256573352
2019-07-26 16:50:57 +01:00
olly
a2a1414623 Remove FlacExtractor from nullness blacklist
PiperOrigin-RevId: 256526365
2019-07-26 16:50:39 +01:00
olly
008efd10a4 Make FlacExtractor output methods static
This gives a caller greater confidence that the methods have no
side effects, and remove any nullness issues with these methods
accessing @Nullable member variables.

PiperOrigin-RevId: 256525739
2019-07-26 16:50:32 +01:00
olly
98714235ad Simplify FlacExtractor (step toward enabling nullness checking)
- Inline some unnecessarily split out helper methods
- Clear ExtractorInput from FlacDecoderJni data after usage
- Clean up exception handling for StreamInfo decode failures

PiperOrigin-RevId: 256524955
2019-07-26 16:50:10 +01:00
olly
67ad84f121 Remove more classes from nullness blacklist
PiperOrigin-RevId: 256202135
2019-07-26 16:48:00 +01:00
Oliver Woodman
f045bb2d07 Merge pull request #5617 from loki666:workmanager
PiperOrigin-RevId: 248533906
2019-07-26 16:41:57 +01:00
Oliver Woodman
51acd8150c
Merge pull request #6150 from google/dev-v2-r2.10.3
r2.10.3
2019-07-14 18:01:01 +01:00
olly
1275217bca Add missing file header
PiperOrigin-RevId: 257630168
2019-07-14 16:35:48 +01:00
bachinger
f314be583a fix typo in release notes
PiperOrigin-RevId: 257185017
2019-07-09 16:19:56 +01:00
aquilescanta
1273f18e80 Fix syntax error in publish.gradle
PiperOrigin-RevId: 257184313
2019-07-09 16:19:51 +01:00
olly
fdef76c843 Bump version to 2.10.3
PiperOrigin-RevId: 257161518
2019-07-09 11:58:15 +01:00
olly
be9fea89a6 Fix race condition in DownloadHelper
Sending MESSAGE_PREPARE_SOURCE should happen last in the constructor.
It was previously happening before initialization finished (and in
particular before pendingMediaPeriods was instantiated).

Issue: #6146
PiperOrigin-RevId: 257158275
2019-07-09 11:48:54 +01:00
tonihei
dbabb7c9a3 Apply playback parameters in a consistent way.
Currently, we sometimes apply new playback parameters directly and sometimes
through the list of playbackParameterCheckpoints. Only when using the checkpoints,
we also reset the offset and corresponding position for speedup position
calculation. However, these offsets need to be changed in all cases to prevent
calculation errors during speedup calculation[1].

This change channels all playback parameters changes through the checkpoints to
ensure the offsets get updated accordingly. This fixes an issue introduced in
31911ca54a.

[1] - The speed up is calculated using the ratio of input and output bytes in
SonicAudioProcessor.scaleDurationForSpeedUp. Whenever we set new playback
parameters to the audio processor these two counts are reset. If we don't reset
the offsets too, the scaled timestamp can be a large value compared to the input
and output bytes causing massive inaccuracies (like the +20 seconds in the
linked issue).

Issue:#6117
PiperOrigin-RevId: 256533780
2019-07-09 11:40:39 +01:00
andrewlewis
1d766c4603 Play out remaining data on reconfiguration
Before this change we'd release the audio track and create a new one as soon
as audio processors had drained when reconfiguring.

Fix this behavior by stop()ing the AudioTrack to play out all written data.

Issue: #2446
PiperOrigin-RevId: 244812402
2019-07-09 11:39:36 +01:00
Oliver Woodman
b3495dfe66 Update release notes 2019-07-09 11:36:42 +01:00
Oliver Woodman
6fd235f95a Merge pull request #5732 from ToxicBakery:feature/add-license-to-pom
PiperOrigin-RevId: 257138448
2019-07-09 11:33:31 +01:00
tonihei
d035f24e87 CEA608: Fix repeated Special North American chars.
We currently handle most the control code logic after handling special
characters. This includes filtering out repeated control codes and checking
for the correct channel. As the special character sets are control codes as well,
these checks should happen before parsing the characters.

Issue:#6133
PiperOrigin-RevId: 256993672
2019-07-09 11:33:21 +01:00
tonihei
1538e5d966 CEA608: no-op readability clean-up
PiperOrigin-RevId: 256676196
2019-07-09 11:33:15 +01:00
Oliver Woodman
91728d41de Merge pull request #5908 from sr1990:dev-v2
PiperOrigin-RevId: 256147805
2019-07-09 11:32:28 +01:00
olly
3d5d23778a FLV extractor fixes
1. Only output video starting from a keyframe
2. When calculating the timestamp offset to adjust live streams to start
   at t=0, use the timestamp of the first tag from which a sample is actually
   output, rather than just the first audio/video tag. The test streams in
   the referenced GitHub issue start with a video tag whose packet type is
   AVC_PACKET_TYPE_SEQUENCE_HEADER (i.e. does not contain a sample) and whose
   timestamp is set to 0 (i.e. isn't set). The timestamp is set correctly on
   tags that from which a sample is actually output.

Issue: #6111
PiperOrigin-RevId: 256147747
2019-07-09 11:32:05 +01:00
bachinger
c4c7f4bafa MediaSessionConnector: Document how to provide metadata asynchronously
Issue: #6047
PiperOrigin-RevId: 255992898
2019-07-09 11:31:36 +01:00
tonihei
71e0f2e81c Don't consume touch events if no controller is attached.
Issue:#6109
PiperOrigin-RevId: 255933121
2019-07-09 11:31:24 +01:00
andrewlewis
5365272b60 Use the floor of the frame rate for capability checks
PiperOrigin-RevId: 255584000
2019-07-09 11:31:11 +01:00
bachinger
d3e7ea89d9 call setPlayWhenReady in any case
ISSUE: #6093
PiperOrigin-RevId: 255471282
2019-07-09 11:30:59 +01:00