1125 Commits

Author SHA1 Message Date
aquilescanta
53283ecb52 Add CastPlayer tests for repeatMode masking
PiperOrigin-RevId: 279091742
2019-11-15 05:12:42 +00:00
kimvde
d1da3d925b Fix FLAC bit rate computation
PiperOrigin-RevId: 279088193
2019-11-15 05:12:34 +00:00
kimvde
a226bd0d69 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-15 05:12:25 +00:00
olly
355ed11a3c Suppress warnings emitted by Checker Framework version 2.11.1
More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:278915274:BASE:278884711:1573074344615:a6701677
PiperOrigin-RevId: 279080514
2019-11-15 05:12:17 +00:00
kimvde
29d110b7eb Fix FLAC extension tests
- Add @Test annotations.
- Fix seeking to ignore potential placeholders
  (see https://xiph.org/flac/format.html#metadata_block_seektable).

PiperOrigin-RevId: 279074092
2019-11-15 05:12:09 +00:00
kimvde
c8170e18d0 Update AndroidX Test versions to latest
Split the version of the sublibraries because their latest version
number is different. See
https://developer.android.com/jetpack/androidx/releases/test#1.2.0.

PiperOrigin-RevId: 278585090
2019-11-05 16:18:38 +00:00
olly
46d58b5eda Add missing IntDef case in switch
PiperOrigin-RevId: 278332276
2019-11-05 16:17:54 +00:00
olly
880b879e8c Suppress warnings emitted by Checker Framework version 2.11.1
More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP train for global presubmit queue
    http://test/OCL:278152710:BASE:278144052:1572760370662:22459c12
PiperOrigin-RevId: 278241536
2019-11-05 16:17:39 +00:00
olly
c5c50078d7 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 16:16:45 +00:00
andrewlewis
a4e7274cca Update audio extension build configurations
- Fix FLAC extension build (currently broken due to use of std::array,
  but fixed by migrating to NDK r20).
- Move opus and ffmpeg extensions to NDK r20. For ffmpeg, upgrade to
  release 4.2 which requires using libswresample and updates to the
  build script.

Issue: #6601
PiperOrigin-RevId: 277924119
2019-11-05 16:16:38 +00:00
andrewlewis
656556b828 Clean up naming for GLSurfaceViews
PiperOrigin-RevId: 277896757
2019-11-05 16:15:29 +00:00
olly
981008f76e Fix field-can-be-local warnings
PiperOrigin-RevId: 277732159
2019-11-05 16:15:06 +00:00
aquilescanta
0f312561e5 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-10-30 08:51:35 +00:00
aquilescanta
bae2b1e4bc Add tests for playWhenReady masking
PiperOrigin-RevId: 277057328
2019-10-30 08:51:05 +00:00
olly
8ec6cf154c 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-10-30 08:50:49 +00:00
ibaker
7277df3547 Remove @NonNull where it's implied by @NonNullApi
Also remove it from all tests, these aren't covered by the null-checker

Covered by the following package-info.java files:
- j/c/g/a/exoplayer2/ext/mediasession/package-info.java
- j/c/g/a/exoplayer2/package-info.java
- j/c/g/a/exoplayer2/offline/package-info.java
- j/c/g/a/exoplayer2/video/package-info.java
- j/c/g/a/exoplayer2/ui/package-info.java

PiperOrigin-RevId: 277038916
2019-10-30 08:50:42 +00:00
aquilescanta
fc12457c7e Set internal state before setting up cast dependencies
Prevents access of fields before initialization. Also set
remoteMediaClient in the constructor by using setRemoteMediaClient
instead of assigning the field directly, which will (if possible)
pull the state of the receiver in the constructor.

PiperOrigin-RevId: 276660004
2019-10-30 08:49:40 +00:00
olly
47423b3100 Fix code triggering [-Werror, -Wreorder].
Otherwise, it will be a build error once we turn on the error.
Sponge: https://sponge.corp.google.com/target?id=8e88bd90-a716-40f7-9599-b70e9193b297&target=//third_party/java_src/android_libs/exoplayer/v2/extensions/flac/src/main:binary.
PiperOrigin-RevId: 276461029
2019-10-30 08:49:17 +00:00
aquilescanta
101746934f Guard repeatMode masking against regular status updates
PiperOrigin-RevId: 276035838
2019-10-30 08:48:07 +00:00
andrewlewis
51e4f7b260 Fix supplemental data handling with dropped frames
PiperOrigin-RevId: 276024935
2019-10-30 08:47:52 +00:00
aquilescanta
a0843d0e2f Guard playWhenReady masking against regular status updates
PiperOrigin-RevId: 275863101
2019-10-30 08:47:28 +00:00
olly
7ccbc4c436 Remove VR code
- Leaving GvrAudioProcessor for now.
- Removing GvrPlayerActivity because it was never released. Also removing
  related UI classes. These were released, but it's unlikely anyone would
  have been using them directly.

PiperOrigin-RevId: 275822516
2019-10-30 08:47:06 +00:00
bachinger
e6e2dcc58d Rollback of 36f8bd78f7
*** Original commit ***

Rollback of 4ad4e3e4fc

*** Original commit ***

Rollback of 3b22db33ba

*** Original commit ***

add top-level playlist API to ExoPlayer

Public design doc:
https://docs.google.com/document/d/11...

***

PiperOrigin-RevId: 275813737
2019-10-30 08:46:42 +00:00
olly
3150591b0a Minor CastPlayer Javadoc cleanup
PiperOrigin-RevId: 275439892
2019-10-18 17:42:58 +01:00
olly
64786c6ce4 Refactor GlViewGroup to ViewRenderer
GlViewGroup doesn't work properly as an actual ViewGroup. For example,
it doesn't support addition of child views after instantiation. This
change turns the class into a renderer, which is also more consistent
with other classes in the package.

PiperOrigin-RevId: 275322295
2019-10-18 17:42:19 +01:00
bachinger
36f8bd78f7 Rollback of 4ad4e3e4fc
*** Original commit ***

Rollback of 3b22db33ba

*** Original commit ***

add top-level playlist API to ExoPlayer

Public design doc:
https://docs.google.com/document/d/11h0S91KI5TB3NNZUtsCzg0S7r6nyTnF_tDZZAtmY93g

Issue: #6161

***

***

PiperOrigin-RevId: 275276158
2019-10-18 17:42:03 +01:00
olly
7dede17d97 Make GvrPlayerActivity call its subclass to instantiate a player
It's more explicit and simpler than having the subclass call up into
the activity.

PiperOrigin-RevId: 274881350
2019-10-15 23:08:38 +01:00
olly
5e538a2a28 Clean up GvrPlayerActivity
PiperOrigin-RevId: 274845045
2019-10-15 23:08:23 +01:00
tonihei
a95f0643b9 Set isLive flag in CastTimeline based on MediaInfo.
Issue:#2668
PiperOrigin-RevId: 274793644
2019-10-15 23:08:08 +01:00
kimvde
f133766b40 Improve ffmpeg build instructions
- Simplify the supported formats configuration by moving it to a
  separate variable, therefore avoiding updating the COMMON_OPTIONS
  variable in the ffmpeg build command.
- Move the ffmpeg build command to a shell script.

PiperOrigin-RevId: 274778232
2019-10-15 23:07:45 +01:00
olly
bc75b9904c Fix test coverage failure for G3 exoplayer
Generates a manifest to have Google3InstrumentationTestRunner in order to fix the error in Zapfhahn (service to measure test coverage)

PiperOrigin-RevId: 274754720
2019-10-15 23:07:38 +01:00
aquilescanta
c996391b83 Register cast module
PiperOrigin-RevId: 274568660
2019-10-14 14:48:21 +01:00
andrewlewis
1c66010b4a Add MediaFormat on video frame metadata listener
This is useful for apps that want to access HDR metadata that MediaCodec puts
in its output format.

PiperOrigin-RevId: 274169985
2019-10-13 12:41:47 +01:00
sofijajvc
d01d8f0344 Use google cpu_features library
Currently, ndk cpu-features is being used.
This is now deprecated and google open-source
cpu_features library is recommended.

PiperOrigin-RevId: 273987647
2019-10-10 18:55:50 +01:00
sofijajvc
62618f24ec Remove copybara exclusions and add extension to the demo app
Issue: #3353
PiperOrigin-RevId: 273949689
2019-10-10 14:46:16 +01:00
sofijajvc
ad50f62eec Remove method for setting custom gav1 libraries
PiperOrigin-RevId: 273929000
2019-10-10 14:45:49 +01:00
sofijajvc
f098562208 Fix comments in AV1 extension
PiperOrigin-RevId: 273928626
2019-10-10 14:45:40 +01:00
andrewlewis
3574345960 Fail av1 extension build if CMake is missing
If a user has checked out libgav1 they almost certainly want to
build the extension, so fail if CMake is not present but
libgav1 is present. Also add a note to the README linking to
instructions for installing CMake.

Also remove the NDK check, as ndk.dir is apparently deprecated
and Android Studio appears to install this automatically anyway.

PiperOrigin-RevId: 273918142
2019-10-10 14:45:23 +01:00
sofijajvc
5cf82a5079 Support GL rendering with SimpleExoPlayer and PlayerView
PiperOrigin-RevId: 273760294
2019-10-10 14:45:14 +01:00
aquilescanta
a35a0925ed Mask repeatMode in CastPlayer
When the user calls setRepeatMode, the state modifications are
observed as immediate, in spite of being sent to the receiver app
as asynchronous operations.

PiperOrigin-RevId: 273754931
2019-10-10 14:45:06 +01:00
aquilescanta
5775a47010 Remove maybe prefix for cast setting methods
Also move the masking internal state update before the message
dispatch, so as to ensure the result of the operation prevails
over the masking state.

PiperOrigin-RevId: 273740585
2019-10-10 14:44:57 +01:00
sofijajvc
1312a54295 Avoid sync failures if libgav1 isn't present
PiperOrigin-RevId: 273734495
2019-10-10 14:44:48 +01:00
sofijajvc
70abbb9689 Add test AV1 video to demo app
PiperOrigin-RevId: 273706425
2019-10-10 14:44:20 +01:00
aquilescanta
dddce4307b Mask playWhenReady state in CastPlayer
When the user calls setPlayWhenReady, the state modifications are
observed as immediate, in spite of being sent to the receiver app
as asynchronous operations.

PiperOrigin-RevId: 273289768
2019-10-07 16:32:19 +01:00
aquilescanta
29eebca5c5 Fix section comments in CastPlayer
PiperOrigin-RevId: 273270892
2019-10-07 16:32:11 +01:00
sofijajvc
8f3a363dd2 Add OpenGL support to av1 extension: Libgav1VideoRenderer
Move reusable code from LibvpxVideoRenderer to SimpleDecoderVideoRenderer.
Pass outputBuffer to renderOutputBuffer method instead of keeping the reference in the renderer.

PiperOrigin-RevId: 272899549
2019-10-07 16:31:39 +01:00
olly
efe6e6408a 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-04 13:33:09 +01:00
Oliver Woodman
6e65a71806 Merge pull request #6379 from wingyippp:flac-seek-map-two-points
PiperOrigin-RevId: 272856747
2019-10-04 13:32:59 +01:00
olly
8453d07f54 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-04 13:32:42 +01:00
olly
3c235dfc1f Make factories return specific types
PiperOrigin-RevId: 272614917
2019-10-04 13:31:40 +01:00