797 Commits

Author SHA1 Message Date
kimvde
3f9e3107ec Fix extractor sniffing in FLAC extension
Assuming that a flac stream starts with bytes
['f', 'L', 'a', 'C', 0, 0, 0, 0x22] is not always correct as it could
also start with ['f', 'L', 'a', 'C', 0x80, 0, 0, 0x22]
(see https://xiph.org/flac/format.html#metadata_block_streaminfo).

PiperOrigin-RevId: 279080562
2019-11-17 04:33:52 +00:00
aquilescanta
6c7fbe8b52 Add shuffle and repeat modes to media session playback state invalidation
Which ensures both get updated when the MediaSessionConnector player
changes.

Issue:#6582
PiperOrigin-RevId: 277254889
2019-11-05 17:40:35 +00:00
olly
accb31e489 Reset MediaSession shuffle/repeat modes if player is null
- This is for consistency with PlayerControlView.

- Also update PlayerNotificationManager notification if shuffle
  mode changes. This is for consistency with what happens when
  the repeat mode changes. By default the notification will be
  unchanged, but custom implementations can extend and then
  override createNotification, and given these modes change
  infrequently it feels like we can just do this. The alternative
  for achieving consistency would be to remove handling of repeat
  mode changes.

Issue: #6582
PiperOrigin-RevId: 277925094
2019-11-05 17:39:01 +00:00
olly
acb84396d5 Fix incorrect anamorphic handling in Leanback extension
The leanback library doesn't know about non-square pixels. So if
we're playing content that uses non-square pixels, we need to adjust
the video dimensions that we provide to leanback such that it
renders the video with the correct aspect ratio.

PiperOrigin-RevId: 277042560
2019-11-05 17:35:34 +00:00
aquilescanta
6457a4ab80 Register cast module
PiperOrigin-RevId: 274568660
2019-10-14 14:58:08 +01:00
olly
97cfcb57e6 Cleanup: Only clamp seek positions for FFWD/RWND
It's confusing that seekTo(player, windowIndex, positionMs) does
clamping, because it only makes sense if windowIndex is the current
window.

Note: This doesn't actually fix anything (other than code clarity).
In cases where we were passing other windowIndices, we always
passed 0 as the position and so the clamping logic wouldn't have
had any effect.
PiperOrigin-RevId: 272857104
2019-10-13 12:18:23 +01:00
Oliver Woodman
02c344999c Merge pull request #6379 from wingyippp:flac-seek-map-two-points
PiperOrigin-RevId: 272856747
2019-10-13 12:18:12 +01:00
olly
5e090d81b4 Remove unnecessary DeleteLocalRef usage
Keeping the ones inside loops, because theoretically they
can be useful there (in practice, for this use case, it's
highly unlikely to make any difference).

PiperOrigin-RevId: 272834073
2019-10-13 12:17:45 +01:00
olly
32afc33313 Make factories return specific types
PiperOrigin-RevId: 272614917
2019-10-13 12:16:38 +01:00
ibaker
90b52123ce Simplify the ffmpeg build instructions a little
In-line EXOPLAYER_ROOT which only has one reference. And change
FFMPEG_EXT_PATH to always include "/jni"

PiperOrigin-RevId: 270866662
2019-10-13 11:59:25 +01:00
Oliver Woodman
47bfa0691e Remove Player.State annotation from 2.10.5 2019-09-20 11:57:40 -07:00
olly
ade65860e6 Remove stray line of code (it's duplicated below)
PiperOrigin-RevId: 270289374
2019-09-20 10:07:14 -07:00
tonihei
bbb739d1de Fix playback speed in MediaSessionConnector
The playback speed set in MediaSession's PlaybackStateCompat needs to be the
actual speed at which the playback position progresses and not the user-defined
target speed.

This fixed a bug where the position advances although the player lost audio
focus.

Issue:#6203
PiperOrigin-RevId: 269295249
2019-09-20 10:07:14 -07:00
tonihei
f8d81d05a4 Add Player.isPlaying and Player.getPlaybackSuppressionReason
The player may suppress playback when waiting for audio focus even if the
state==Player.READY. There is currently no getter or callback to obtain this
piece of information for UI updates or analytics.

Also, it's a important derived state to know whether the playback position is
advancing. Add isPlaying and the corresponding callback to allow retrieving
this information more easily.

Issue:#6203
PiperOrigin-RevId: 268921721
2019-09-20 10:07:10 -07:00
olly
480f73748d Upgrade to OkHttp 3.12.5
Issue: #4078
PiperOrigin-RevId: 268887744
2019-09-16 17:11:05 -07:00
bachinger
4eda96dd66 disable seekbar in media style notification for live stream
ISSUE: #6416
PiperOrigin-RevId: 268673895
2019-09-16 17:09:02 -07:00
olly
f05d67b7c7 Simplify androidTest manifests & fix links to use https
PiperOrigin-RevId: 266396506
2019-09-02 14:39:02 +01:00
olly
407dbf075e Add HttpDataSource.getResponseCode to provide the status code associated with the most recent HTTP response.
PiperOrigin-RevId: 266218104
2019-09-02 14:38:24 +01:00
andrewlewis
0085a7e761 Defer adsManager.init until the timeline has loaded
If the app seeks after we get an ads manager but before the player exposes the
timeline with ads, we would end up expecting to play a preroll even after the
seek request arrived. This caused the player to get stuck.

Wait until a non-empty timeline has been exposed via onTimelineChanged before
initializing IMA (at which point it can start polling the player position). Seek
requests are not handled while an ad is playing.

PiperOrigin-RevId: 265058325
2019-09-02 14:36:21 +01:00
tonihei
9e3bee89e1 Prevent NPE in ImaAdsLoader onPositionDiscontinuity.
Any seek before the first timeline becomes available will result in a NPE.
Change it to handle that case gracefully.

Issue:#5831
PiperOrigin-RevId: 264603061
2019-09-02 14:35:33 +01:00
andrewlewis
5b2b21da86 Fix handling of delayed AdsLoader.start
AdsMediaSource posts AdsLoader.start to the main thread during preparation, but
the app may call AdsLoader.setPlayer(null) before it actually runs (e.g., if
initializing then quickly backgrounding the player).

This is valid usage of the API so handle this case instead of asserting. Because
not calling setPlayer at all is a pitfall of the API, track whether setPlayer
has been called and still assert that in AdsLoader.start.

PiperOrigin-RevId: 264329632
2019-09-02 14:35:14 +01:00
Venkatarama NG. Avadhani
08bb42ddc5 Upgrade librtmp-client to 3.1.0 2019-09-02 14:33:51 +01:00
andrewlewis
4656196dae Upgrade IMA dependency version
PiperOrigin-RevId: 262511088
2019-09-02 14:32:46 +01:00
olly
921ff02c90 Only read from FormatHolder when a format has been read
I think we need to start clearing the holder as part of the
DRM rework. When we do this, it'll only be valid to read
from the holder immediately after it's been populated.

PiperOrigin-RevId: 262362725
2019-09-02 14:32:40 +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
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
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
8c1b60f2db Tweak Firebase JobDispatcher extension README
PiperOrigin-RevId: 260583198
2019-08-01 20:48:59 +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
Oliver Woodman
bba0a27cb6 Merge pull request #6151 from ittiam-systems:bug-5527
PiperOrigin-RevId: 257668797
2019-07-26 16:54:56 +01:00
olly
b5e3ae4542 Add Nullable annotations to CastPlayer
PiperOrigin-RevId: 256680382
2019-07-26 16:51:59 +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
bachinger
c4c7f4bafa MediaSessionConnector: Document how to provide metadata asynchronously
Issue: #6047
PiperOrigin-RevId: 255992898
2019-07-09 11:31:36 +01:00
bachinger
d3e7ea89d9 call setPlayWhenReady in any case
ISSUE: #6093
PiperOrigin-RevId: 255471282
2019-07-09 11:30:59 +01:00
andrewlewis
4703ce1b26 Fix ad pod index offset calculation without preroll
Issue: #5928
PiperOrigin-RevId: 254379085
2019-06-21 18:38:45 +01:00
aquilescanta
2f8c8b609f Fix detection of current window index in CastPlayer
Issue:#5955
PiperOrigin-RevId: 251616118
2019-06-06 17:41:27 +01:00
aquilescanta
83a6d51fd1 Use listener notification batching in CastPlayer
PiperOrigin-RevId: 251399230
2019-06-06 17:41:21 +01:00
olly
7cdcd89873 Update cast extension build
PiperOrigin-RevId: 250664791
2019-05-31 22:45:41 +01:00
andrewlewis
41ab7ef7c0 Fix video size reporting in surface YUV mode
In surface YUV output mode the width/height fields of the VpxOutputBuffer were
never populated. Fix this by adding a new method to set the width/height and
calling it from JNI like we do for GL YUV mode.

PiperOrigin-RevId: 250449734
2019-05-31 22:38:55 +01:00
andrewlewis
5d72942a49 Fix VP9 build setup
Update configuration script to use an external build, so we can remove use of
isysroot which is broken in the latest NDK r19c. Also switch from gnustl_static
to c++_static so that ndk-build with NDK r19c succeeds.

Issue: #5922
PiperOrigin-RevId: 250287551
2019-05-31 22:37:25 +01:00
eguven
b1ff911e6a Remove mistakenly left link in vp9 readme
PiperOrigin-RevId: 249417898
2019-05-31 22:33:21 +01:00