1690 Commits

Author SHA1 Message Date
christosts
f86948f01c Suppress warnings in ImaUtil
ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden,
which causes lint errors with gradle.

#minor-release

PiperOrigin-RevId: 504306210
2023-01-25 20:09:04 +00:00
bachinger
26e1a28176 Clarify what default settings are being used for SSAI AdsLoader
PiperOrigin-RevId: 502388865
2023-01-17 03:26:30 +00:00
bachinger
0ba0c0ed43 Add AdsLoader.focusSkipButton()
This method allows to call through to `StreamManager.focus()` of the currently playing SSAI stream.

PiperOrigin-RevId: 501399144
2023-01-17 02:23:33 +00:00
bachinger
d2898b70ea Add focusSkipButtonWhenAvailable to focus UI on ATV
For TV devices the skip button needs to have the focus to be accessible with
the remote control. This property makes this configurable while being set to
true by default.

PiperOrigin-RevId: 501077608
2023-01-17 01:47:37 +00:00
rohks
d49437c6e1 Initialise fields used for bundling as String directly
Initialising the fields as Integer and then getting a String on compute time is slow. Instead we directly initialise these fields as String. Improves the time taken in bundling PlayerInfo further to less than 200ms from ~300ms.

Also modified a test to improve productive coverage.

PiperOrigin-RevId: 500003935
2023-01-10 20:20:08 +00:00
bachinger
965606f7a7 Remove player listener on the application thread of the player
PiperOrigin-RevId: 497183220
2023-01-04 19:03:42 +00:00
bachinger
8ed515880a Bump IMA SDK version to 3.29.0
Issue: google/ExoPlayer#10845
PiperOrigin-RevId: 496947392
2023-01-04 18:25:18 +00:00
ibaker
d2a3d8f6fa Fix Dackka error due to param name mismatch
https://developer.android.com/reference/androidx/leanback/media/PlayerAdapter#seekTo(long)

#minor-release

PiperOrigin-RevId: 496378709
2022-12-21 16:51:52 +00:00
tonihei
a1c0b10482 Clarify behavior for out-of-bounds indices and align implementations
Some Player methods operate relative to existing indices in the
playlist (add,remove,move,seek). As these operations may be issued
from a place with a stale playlist (e.g. a controller that sends
a command while the playlist is changing), we have to handle out-
of-bounds indices gracefully. In most cases this is already
documented and implemented correctly. However, some cases are not
documented and the existing player implementations don't handle
these cases consistently (or in some cases not even correctly).

PiperOrigin-RevId: 495856295
2022-12-21 16:16:54 +00:00
tonihei
6e0f1f10b3 Forward seek command details to seekTo method in BasePlayer
BasePlayer simplifies implementations by handling all the various
seek methods and forwarding to a single method that can then be
implemented by subclasses. However, this loses the information about
the concrete entry point used for seeking, which is relevant when
the subclass wants to verify or filter by Player.Command. This
can be improved by adding the command as a new parameter. Since
we have to change the method anyway, we can also incorporate the
boolean flag about whether the current item is repeated to avoid
the separate method.

PiperOrigin-RevId: 494948094
2022-12-15 16:04:59 +00:00
ibaker
c006575d43 Add javadoc links to README files
Fix some other link titles and destinations spotted along the way.

#minor-release

PiperOrigin-RevId: 493276172
2022-12-12 13:07:19 +00:00
bachinger
04f031d168 Bump cast sdk version and remove workaround for live duration
The fix for b/171657375 (internal) has been shipped with 21.1.0 already (see https://developers.google.com/cast/docs/release-notes#august-8,-2022).

PiperOrigin-RevId: 491583727
2022-11-29 19:34:59 +00:00
Rohit Singh
c827e46c3d Merge pull request #10799 from OxygenCobalt:id3v2-multi-value
PiperOrigin-RevId: 491289028
2022-11-29 19:04:05 +00:00
christosts
202e03fc64 Fix compilation error in ffmpeg JNI layer
PiperOrigin-RevId: 490263003
2022-11-22 18:00:24 +00:00
ibaker
f834419744 Add set -eu to all shell scripts
These flags ensure that any errors cause the script to exit (instead of
just carrying on) (`-e`) and that any unrecognised substitution variables
cause an error instead of silently resolving to an empty string (`-u`).

Issues like Issue: google/ExoPlayer#10791 should be more quickly resolved with
`set -e` because the script will clearly fail with an error like
`make: command not found` which would give the user a clear pointer
towards the cause of the problem.

#minor-release

PiperOrigin-RevId: 490001419
2022-11-22 09:51:36 +00:00
Alexander Capehart
157f1f0787
Rework ID3v2 text frame values interface
Rework the interface for ID3v2 text frames by:
- Switching from a mutable array to ImmutableList
- Never leaving the array empty, instead filling it with "" if there
are no values

This makes the surface safer and more in line with the rest of the
module.
2022-11-21 11:35:05 -07:00
ibaker
058cba95d4 Remove @hide javadoc annotation from ExoPlayer GitHub
This tag is only understood by Dackka, which is used to generate the media3 javadoc.

PiperOrigin-RevId: 489233200
2022-11-21 15:12:52 +00:00
kimvde
ea7e8cff3a Refactor transformation completion
PiperOrigin-RevId: 488929446
2022-11-21 14:27:00 +00:00
Alexander Capehart
4510210ad7
Merge branch 'multi-value-id3v2' into dev-v2 2022-11-20 18:05:45 -07:00
Alexander Capehart
d8729e552c
Fix second-order issues
Fix second-order issues stemming from the addition of multi-value tags.
2022-11-20 18:02:45 -07:00
tonihei
8438daca1f Rename getVideoSurfaceSize to getSurfaceSize
This better matches the callback name (onSurfaceSizeChanged) and
probably cause less confusion with getVideoSize.

PiperOrigin-RevId: 488669786
2022-11-16 12:32:35 +00:00
samrobinson
52f3ee81d4 Handle buffers in DefaultAudioSink with AudioProcessingPipeline.
PiperOrigin-RevId: 488412695
2022-11-16 12:10:21 +00:00
ibaker
4949fbe5ed Add missing IntDef on MediaSource.Factory.getSupportedTypes overrides
Without this the annotation isn't shown in javadoc (same in Dackka)

No annotation:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.html#getSupportedTypes()

Annotation present:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/MediaSource.Factory.html#getSupportedTypes()

#minor-release

PiperOrigin-RevId: 487498450
2022-11-10 16:12:02 +00:00
ibaker
14e23d34e1 Fix Dackka parameter name error in Gav1Decoder and VpxDecoder
These aren't caught by presubmit because the classes are annotated
`@VisibleForTesting` and are therefore stripped out by Metalava. However
Metalava doesn't run when we're generating javadoc for real.

#minor-release

PiperOrigin-RevId: 487476260
2022-11-10 15:38:06 +00:00
ibaker
1cd488ac9a Fix Dackka/Metalava errors in av1, flac, ffmpeg, midi, and opus modules
This uses `@hide` on `protected final` methods to hide them from Dackka
javadoc generation, since these methods are inaccessible to developers
anyway. These symbols will still (currently) be included in artefacts
distributed on Maven (because we don't run Metalava as part of
generating these artefacts).

In some cases I had to change the visibility/finality of methods to make
them `protected final` before adding the `@hide` annotation (but
the impact should be very low, since most of these methods were either
already unusable by app developers, or they shouldn't have been used).

#minor-release

PiperOrigin-RevId: 487472907
2022-11-10 15:26:45 +00:00
ibaker
10c4a4dfc1 Fix Dackka/Metalava errors in the ExoPlayer module
This makes two types of fix:
1. Align parameter names on overridden methods where the superclass
   has `@param` javadoc.
2. Use `@hide` on `protected final` methods that refer to package-private
   types. This will hide these symbols from Dackka javadoc generation
   but not (currently) from the artefacts distributed on Maven. These
   methods are currently unusable outside their package anyway (e.g. by
   external developers) because of the dependency on a package-private
   type.

This also changes some HLS, SmoothStreaming, and IMA code where I've renamed
parameters of overridden methods to be consistent across the type
hierarchy.

#minor-release

PiperOrigin-RevId: 487472665
2022-11-10 15:15:25 +00:00
Tolriq
6d2e7a1b57 Merge Issue: google/ExoPlayer#10762: Fix ffmpeg jni wrapper returning invalid result codes
Imported from GitHub PR Issue: google/ExoPlayer#10762

This ensure that ffmpeg error code are properly translated to values that the ExoPlayer decoder understand.
The main gain is that it allows the decoder to properly ignore more cases of invalid data and recover.
The second gain is that the other errors are now proper ExoPlayer errors and no more obscure buffer ones.

Fixes: Issue: google/ExoPlayer#10760
Merge 82ceeb77d6df71f5ffb0474db66a36fd6eb8e51a into 972e169bd85b14848dcae75e34f9e95fe87e1f4b
COPYBARA_INTEGRATE_REVIEW=go/exoghi/10762 from Tolriq:ffmpeg_error_code 82ceeb77d6df71f5ffb0474db66a36fd6eb8e51a
PiperOrigin-RevId: 487189910
2022-11-10 14:47:17 +00:00
Googler
39d28304af Add 'Player.getVideoSurfaceSize' that returns the size of the surface
on which the video is rendered.

Design Doc: go/aaos-mu-media-dd

PiperOrigin-RevId: 485884772
2022-11-08 14:09:54 +00:00
rohks
55b82ff8ae Disable failing tests of FlacExtractorSeekTest
PiperOrigin-RevId: 485061783
2022-11-01 16:19:10 +00:00
bachinger
136addf640 Make adding ad live breaks more robust
This change makes adding ad events in live streams more robust by allowing ad
groups to grow in number of ads if more ad events are received than initially
announced by the SDK.

With the IMA prefetch feature, an AdPod can grow in size in certain conditions
like from initially 2 ads to 4 ads being part of the ad group. With this change,
if an additional ad event arrives while the ad group is still being played,
the ad group is expanded. If the event arrives late and the ad group is already
completed, a new group is created for the remaining ads.

This also covers the case where we join the live stream while an ad is being
played and we missed at least one LOADED event from the SDK. Ads of the group
before the first LOADED event are ignored in such a case.

PiperOrigin-RevId: 484214760
2022-10-31 16:29:48 +00:00
samrobinson
dda17db261 Move AudioProcessor to common.
PiperOrigin-RevId: 483699606
2022-10-31 16:03:50 +00:00
Rohit Singh
a413b478f7 Merge pull request #10618 from vishnuchilakala:fix/do_not_send_content_complete_if_midroll_skipped
PiperOrigin-RevId: 482481703
2022-10-24 10:51:21 +00:00
bachinger
325e973ace Add manifest to make gradle build work
PiperOrigin-RevId: 481606248
2022-10-20 02:35:14 +00:00
rohks
6015f052ba Fix instrumentation tests not working via Gradle
PiperOrigin-RevId: 475560401
2022-10-19 22:54:45 +00:00
bachinger
072f376b48 Add withAvailableAd for server side inserted ad groups
#minor-release

PiperOrigin-RevId: 472714732
2022-10-19 21:33:13 +00:00
bachinger
60a3ea48b8 Bump IMA SDK version for gradle
PiperOrigin-RevId: 472500789
2022-10-19 21:22:12 +00:00
Googler
dfdcf76daf Fix 1 ErrorProneStyle finding:
* Non-standard parameter comment; prefer `/* paramName= */ arg`
  (see http://go/bugpattern/ParameterComment)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.
PiperOrigin-RevId: 472252461
2022-10-19 20:48:24 +00:00
rohks
142d1c062c Switch incorrectly configured native multidex to legacy
Native multidex can only be used for binaries with minSdkVersion of 21 or higher, but minSdkVersion was specified to 16.

PiperOrigin-RevId: 470003836
2022-10-19 19:39:59 +00:00
rohks
f01896af15 Replace usage of android_binary with build_test for libraries
`android_binary` is only required when building an application.

PiperOrigin-RevId: 469413752
2022-10-19 19:13:34 +00:00
bachinger
d6442f63fa Add device info to CastPlayer
Issue: androidx/media#142
PiperOrigin-RevId: 468666737
2022-10-19 19:02:04 +00:00
tonihei
29208ec1ed Define CueGroup.EMPTY_TIME_ZERO for convenience
We create an empty CueGroup in many places as default or
where none is needed. Instead, we can define a constant
for this purpose and reuse it.

PiperOrigin-RevId: 467944841
2022-10-19 18:30:47 +00:00
tonihei
80b635e7ab Update CMake version for AV1 extension
The specified CMake version doesn't work with the latest
Android Studio releases. Updating to a more recent version
fixes the problem.

Issue: google/ExoPlayer#9933
PiperOrigin-RevId: 467634063
2022-10-19 18:15:44 +00:00
tonihei
6ea1d0ecf0 Add additional build flags for ffmpeg on "arm64-v8a"
From NDK 23.1.7779620 and above, the arm64-v8a ABI needs additional
build flags to correctly link the ffmpeg libraries.

Issue: google/ExoPlayer#9933
PiperOrigin-RevId: 467161973
2022-10-19 17:57:17 +00:00
tonihei
91fc5c4f3c Add timeout for ad to load.
In some cases, the IMA SDK fails to call the expected loadAd
event to load the next ad to play. This is (potentially) the
only remaining case where playback can get stuck due to missing
calls from IMA as the player doesn't even have a MediaSource at
this stage and is only waiting for IMA to provide the ad URL.

We can reuse the existing adPreloadTimeoutMs that was added for
a similar purpose (when preloading the first ad in the group).
The JavaDoc matches this purpose as well and the default timeout
is appropriate since we expect to get the loadAd call immediately.

Issue: google/ExoPlayer#10510
PiperOrigin-RevId: 466953617
2022-10-19 17:53:39 +00:00
Googler
a3de13c9a9 Update Leanback library from androidx-platform-dev with build#8803384
TGP: https://fusion2.corp.google.com/presubmit/tap/459592967/OCL:459592967:BASE:464692555:1659412331108:1ed6eb4e/targets

If you need additional help investigating this issue, please consider using g/androidx-discuss to reach the wider Jetpack library owner and client community. For general questions about prebuilt drops, refer to go/androidx/g3_faq

PiperOrigin-RevId: 464852576
2022-10-19 15:56:41 +00:00
Vishnu Chilakala
b9b30c4669 Do not send content complete if any midroll is skipped 2022-10-18 18:20:55 +05:30
ibaker
21cab6124d Annotate methods that always return this with @CanIgnoreReturnValue
It's always safe to ignore the result of these methods, because the
caller already has a reference to the returned value.

PiperOrigin-RevId: 462388947
2022-07-25 22:19:11 +01:00
bachinger
759de7d612 Remove okhttp related proguard rules
Issue: androidx/media#10310
#minor-release
PiperOrigin-RevId: 461889651
2022-07-21 13:09:23 +00:00
bachinger
9d87c0db78 Don't set the tag in CastTimeline
Leaving the media item that has been passed in unchanged, ensures that the
media item in the timeline is equal to the media item that the user has
passed into the player. The value of the tag is the uid of the window,
meaning this is redundant information.

#minor-release

PiperOrigin-RevId: 460542246
2022-07-13 17:57:48 +00:00
bachinger
d6659e92df Enable onMediaMetadataChanged in CastPlayer
Issue: androidx/media#25
PiperOrigin-RevId: 460476841
2022-07-13 17:40:54 +00:00