15624 Commits

Author SHA1 Message Date
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
huangdarwin
8bdd2784d3 HDR: Implement ForceInterpretHdrVideoAsSdr
Also, document that we tone map when no HDR features are explicitly set

PiperOrigin-RevId: 487310971
2022-11-10 15:09:41 +00:00
claincly
d6c8e3a8af Set HDR color info on FrameworkMuxer
Not setting the color info results in a missing "colr" box in the produced
container, under file/moov/trak/mdia/minf/stbl/stsd/hvc1. This means extractors
will not be able to find out the transcoded file is HDR.

In `Transformer`, this means it can't transcode this transcoded file, because
it currently relies on the container bearing HDR info to construct the
transcoding sample pipeline.

PiperOrigin-RevId: 487276712
2022-11-10 15:04:06 +00:00
sheenachhabra
4598cc9248 Change UnsupportedEncodingException to IllegalArgumentException
In startTransformation method we were throwing UnsupportedEncodingException (IOException) when mediaItem with unsupported arguments is passed.
Changed this to IllegalArgumentException which seems more logical here.

PiperOrigin-RevId: 487259296
2022-11-10 14:58:34 +00:00
kimvde
5d1cab0cf5 Add ExoPlayerAssetLoader
Just move some code around for now, to start setting up the overall
structure.

PiperOrigin-RevId: 487229329
2022-11-10 14:52:53 +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
kimvde
b59fdf5e98 Move slow mo logic to sample pipelines
This is to avoid having this logic in TransformerInternal once it is
added.

PiperOrigin-RevId: 487159941
2022-11-10 14:39:11 +00:00
bachinger
2172466528 Set targetSdkVersion of main demo app back to 29
#minor-release

PiperOrigin-RevId: 486969194
2022-11-10 14:35:26 +00:00
kimvde
d8754b6642 Move muxing inside sample pipelines
This logic is currently in the player renderers. With multi-asset, the
renderers will go into the AssetLoader, which shouldn't be responsible
for muxing.

PiperOrigin-RevId: 486860502
2022-11-08 14:37:35 +00:00
sheenachhabra
b10b4e6d46 Move muxer initialization off application thread
Problem: We are initialising muxer as soon as we start the transformation. Now the startTransformation() method can be called from main thread, but muxer creation is an I/O operation and should be not be done on main thread.

Solution: Added lazy initialisation of muxer object. The actual transformation happens on background thread so the muxer will be initialised lazily from background thread only.

Another way was to provide an initialize() method on MuxerWrapper which will explicitly initialise muxer object but with this approach the caller need to call the initialise method before calling anything else. With current implementation the renderers are calling MuxerWrapper methods on various callbacks (Not sequentially) and also we are sharing same muxer with multiple renderers so It might become confusing for the caller on when to call the initialise() method. Also there are few methods on MuxerWrapper which dont really need muxer object. So in short it might make MuxerWrapper APIs more confusing.

Validation: Verified the transformation from demo app.
PiperOrigin-RevId: 486735787
2022-11-08 14:33:40 +00:00
huangdarwin
0b7e5bbad2 HDR: Set decoder codec profile and level if available.
This should be necessary to ensure decoders see fewer errors.

Setting this resulted in removing native_dequeueOutputBuffer errors on OMX.MTK decoders for in-app tone mapping prototyping.

PiperOrigin-RevId: 486715941
2022-11-08 14:29:43 +00:00
huangdarwin
0b53c934d8 HDR: Update test FileUtil to handle null ColorInfo.
PiperOrigin-RevId: 486706595
2022-11-08 14:25:45 +00:00
Googler
88445d213a Add @SuppressWarnings to unblock T SDK for <unknown commit>
LSC: https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

TESTED=NA
BEGIN_PUBLIC/END_PUBLIC
PiperOrigin-RevId: 486180995
2022-11-08 14:21:44 +00:00
yschimke
36a51ac916 Disable publishing block when media3 included in another build.
From https://github.com/androidx/media/pull/127/files

PiperOrigin-RevId: 485921271
2022-11-08 14:17:43 +00:00
huangdarwin
bd4e58d68b HDR Test: Add link to tested method.
PiperOrigin-RevId: 485890141
2022-11-08 14:13:49 +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
ibaker
b8e5d708fc Fix Dackka javadoc errors in protected methods
If there's an @param javadoc tag in a supertype then all overrides
of this method that don't also override the javadoc must use the same
parameter name.

PiperOrigin-RevId: 485857711
2022-11-08 14:05:57 +00:00
ibaker
3fdfe585ff Fix Dackka/Metalava errors in the effects module
Public methods may only refer to public types in their signature. This
change ensures that by switching to a public supertype everywhere.

PiperOrigin-RevId: 485568625
2022-11-08 14:02:00 +00:00
huangdarwin
2ddd645a34 Apply tone mapping workaround to Pixel Watch as well.
Not sure what BUILD.ID the fix will first be applied on though.

PiperOrigin-RevId: 485389618
2022-11-08 13:54:19 +00:00
tianyifeng
624238c6b6 Load bitmaps for MediaMetadataCompat and handle the metadata updates.
* Add `Listener` in `MediaSession` with method `onNotificationRefreshRequired(MediaSession)`.
* Add `MediaSessionService` as the listener of the `MediaSession` when `MediaSession` is added to `MediaSessionService`
* Load bitmap when update metadata in `MediaSessionLegacyStub` and call `onNotificationRefreshRequired` when bitmap asynchronously arrives.

PiperOrigin-RevId: 485376145
2022-11-08 13:50:25 +00:00
huangdarwin
6de5d9336d HDR: Generalize Pixel 6 workaround to TP
PiperOrigin-RevId: 485366659
2022-11-08 13:46:35 +00:00
michaelkatz
972e169bd8 Removed move transformation for exoplayer2 audio package-info.java
dda17db261 creation of audio/package-info.java introduced a copybara conflict with the exoplayer2/audio/package-info.java move transformation in copy.bara.sky. Solution was to remove original package-info-common-audio.java and the move transformation as dda17db261 now covers it.

Tested with a copybara push to exoplayer github

PiperOrigin-RevId: 485329674
2022-11-01 16:26:43 +00:00
tonihei
23d39caea0 Enfore minCompileSdk version when depending on ExoPlayer/Media3 libs
If an app sets a compileSdkVersion that is lower than the one used to
create AARs of its dependencies, the build process may produce invalid
outputs, for example by stripping methods from the APK that are only
called when the app is running on a new API version.

To avoid this issue, we can enforce that the compileSdk of apps or
libraries depending on ExoPlayer/Media3 is at least the same as the
one we used for compilation when creating the AAR.

Issue: google/ExoPlayer#10684
PiperOrigin-RevId: 485100067
2022-11-01 16:22:55 +00:00
rohks
55b82ff8ae Disable failing tests of FlacExtractorSeekTest
PiperOrigin-RevId: 485061783
2022-11-01 16:19:10 +00:00
rohks
8030a492ff Tighten the wording for sending a pull request.
PiperOrigin-RevId: 485036120
2022-10-31 16:47:57 +00:00
bachinger
1bbe7c11f8 Bump appTargetSDKVersion to 33
#minor-release

PiperOrigin-RevId: 484514123
2022-10-31 16:44:23 +00:00
samrobinson
2390322a00 Disable the muxer watchdog if all tracks have ended.
PiperOrigin-RevId: 484512661
2022-10-31 16:40:45 +00:00
andrewlewis
fc1eca10f4 Upgrade dackka and fix some generation errors
#minor-release

PiperOrigin-RevId: 484483080
2022-10-31 16:37:04 +00:00
kimvde
42057cc9f8 Add test for muxer watchdog timer
PiperOrigin-RevId: 484298261
2022-10-31 16:33:25 +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
kimvde
376ee77f52 Add muxer timer to detect when generating an output sample is too slow
This allows to throw when the Transformer is stuck or is too slow.

PiperOrigin-RevId: 484179037
2022-10-31 16:22:31 +00:00
samrobinson
c9585d0154 Add AudioProcessor.AudioFormat equals method.
PiperOrigin-RevId: 483983486
2022-10-31 16:18:55 +00:00
Googler
8181b3c6a1 Mute input video player in transformer demo
PiperOrigin-RevId: 483969411
2022-10-31 16:15:17 +00:00
ibaker
7c6d492ff1 Fix Cea608Decoder handling of service switch commands in field 2
From ANSI-CTA-608-E R-2014 section 8.4:
> When closed captioning is used on line 21, field 2, it shall conform
> to all of the applicable specifications and recommended practices as
> defined for field 1 services with the following differences:
> 1. The non-printing character of the miscellaneous control-character
>    pairs that fall in the range of 0x14, 0x20 to 0x14, 0x2F in field 1,
>    shall be replaced with 0x15, 0x20 to 0x15, 0x2F when used in field
>    2.
> 2. The non-printing character of the miscellaneous control-character
>    pairs that fall in the range of 0x1C, 0x20 to 0x1C, 0x2F in field
>    1, shall be replaced with 0x1D, 0x20 to 0x1D, 0x2F when used in
>    field 2.

This basically means that `cc1=0x15` in field 2 should be interpreted as
`cc1=0x14` in field 1, and same for `0x1D -> 0x1C`.

The `isMiscCode`  method above already handles this by ignoring the LSB
(the only difference between `0x14` and `0x15`, and `0x1C` and `0x1D`)
by AND-ing with `0xF6` instead of `0xF7`. This change uses the same
trick in `isServiceSwitchCommand`.

Issue: google/ExoPlayer#10666
#minor-release
PiperOrigin-RevId: 483927506
2022-10-31 16:11:03 +00:00
samrobinson
ad52b68c73 Move DefaultAudioSink.AudioProcessorChain to AudioProcessorChain
Split inner interface into separate file, which will go in common
module. The old interface will be deprecated and extends the new.

#cleanup

PiperOrigin-RevId: 483732226
2022-10-31 16:07:28 +00:00
samrobinson
dda17db261 Move AudioProcessor to common.
PiperOrigin-RevId: 483699606
2022-10-31 16:03:50 +00:00
claincly
f5ad4e098d Add GL utility methods to get 4x4 identity and set identity
PiperOrigin-RevId: 483671580
2022-10-31 16:00:16 +00:00
ibaker
eaf1f2153a Clarify sideloaded subtitle example
#minor-release

PiperOrigin-RevId: 483633564
2022-10-31 15:56:37 +00:00
ibaker
3d0f43a149 Use int for an unsigned byte value in Cea608Decoder
This is a no-op, but it's more 'correct' because it avoids any potential
sign mix-ups that come from storing an unsigned byte (with a
potentially set MSB) in a signed java byte variable.

PiperOrigin-RevId: 483409798
2022-10-31 15:53:01 +00:00
samrobinson
a7bfa12eec Add CanIgnoreReturnValue to AudioProcessor#configure + implementations
Although it can be useful to check the output format, it's not required or needed.

For some AudioProcessor implementations, it is stated/obvious that
the output format will match the input, in which case there is no
a need to check the return value.

#cleanup

PiperOrigin-RevId: 483403679
2022-10-31 15:49:17 +00:00
Googler
bec504f1ac Add tofunmi to copy.bara.sky
PiperOrigin-RevId: 483386971
2022-10-31 15:45:40 +00:00
ibaker
6dcb9aaaa8 Fix some incorrect comments in Cea608DecoderTest
Also used all-caps consistently

PiperOrigin-RevId: 483317405
2022-10-24 11:03:20 +00:00
bachinger
a8e6894ad6 Add DAI specific methods to AdPlaybackState
PiperOrigin-RevId: 482755468
2022-10-24 10:59:21 +00:00
Rohit Singh
fd2ba37b1d Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
2022-10-24 10:55:19 +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
michaelkatz
0eb30eacc7 Change areSizeAndRateSupported to use PerfomancePoint.covers
PiperOrigin-RevId: 482461219
2022-10-24 10:47:23 +00:00
kimvde
e3f28421fd Remove muxerFactory dependency on playerListener
This listener will need to be passed to the MuxerWrapper to throw when
the Transformer is stuck.

PiperOrigin-RevId: 482433552
2022-10-24 10:43:32 +00:00
Googler
897722071e Corrected ordering of javadoc params
PiperOrigin-RevId: 482231370
2022-10-24 10:39:27 +00:00
huangdarwin
9e1adee4cb HDR: Support RGBA_1010102 in GlUtil as a parameter.
Make it easier to support use of RGBA_101012 rather than RGBA_8888 for EGL
contexts, displays, and surfaces.

This tangentially supports adding HDR tests, by slightly simplifying the color
selection logic we'd have to add in HDR tests.

PiperOrigin-RevId: 482219428
2022-10-24 10:35:28 +00:00
kimvde
d213b93958 Make Muxer public
The reason for making the Muxer public is that we want to add an option
to disable or configure the timer that will throw when the muxer doesn't
receive any data for a given period of time.

PiperOrigin-RevId: 482199360
2022-10-24 10:31:25 +00:00