15321 Commits

Author SHA1 Message Date
ibaker
ac300c4a00 Add @code tags to DefaultDataSource javadoc
#minor-release

PiperOrigin-RevId: 461902089
2022-07-21 12:52:19 +00:00
huangdarwin
fd046bd2f6 HDR: Throw when unexpected color transfer encountered.
This may happen when a containers' color transfer incorrectly does not match
the video's color transfer.

An example of a file with such a mismatch is the current Transformer demo HDR10
sample file.

Manually tested by confirming that no errors are emitted for SDR and HLG sample
files, and that errors are emitted for our incorrect HDR10 sample file.

PiperOrigin-RevId: 461583532
2022-07-21 12:52:07 +00:00
tonihei
f9eec0c0e8 Add Util helper methods to work with Futures
This adds two methods that are helpful when working with Futures.
One is a version of postOrRun that can indicate completion by a
Future and the other is a simplified version of Guava's
Futures.transformAsync (which can't be used as it's in Beta).

PiperOrigin-RevId: 461896598
2022-07-21 12:51:22 +00:00
bachinger
5bf9e2fb31 Exclude tracks if COMMAND_GET_TRACKS is not available
Issue: androidx/media#102
#minor-release
PiperOrigin-RevId: 461891031
2022-07-21 12:50:29 +00:00
bachinger
5adf708b43 Remove okhttp related proguard rules
Issue: androidx/media#10310
#minor-release
PiperOrigin-RevId: 461889651
2022-07-21 12:49:32 +00:00
samrobinson
21016eaadf Don't include case statement if it falls through to default.
PiperOrigin-RevId: 461888238
2022-07-21 12:48:46 +00:00
bachinger
f828130caf Use the current overrides of the player as preset
Issue: google/ExoPlayer#10429
PiperOrigin-RevId: 461577039
2022-07-21 12:48:36 +00:00
huangdarwin
87198fe7f8 Only apply a MediaFormat-generated ColorInfo if it's valid.
Otherwise, invalid ColorInfo instances generated using faulty
MediaFormat#getInteger values could cause exceptions.

Confirmed that b/239435670 reproduces without this CL, and does not reproduce
with this CL.

PiperOrigin-RevId: 461862191
2022-07-21 12:46:55 +00:00
ibaker
e1fde5d530 Add fail-fast null checks to the stable Player API
This will help developers self-diagnose issues like Issue: google/ExoPlayer#10392
where the NPE occurs far from the original null value because a field
gets assigned to null.

This change aims to ensure that every stable method on Player,
ExoPlayer and ExoPlayer.Builder that takes a non-null type will fail
with an NPE before returning.

#minor-release

PiperOrigin-RevId: 461846580
2022-07-21 12:46:05 +00:00
bachinger
e8b5aad3d7 Remove unused argument
PiperOrigin-RevId: 461830378
2022-07-21 12:45:10 +00:00
tonihei
dee80788e4 Use Futures for MediaSession command queue instead of Runnables
Some commands may be asynchronous and subsequent commands need to
wait for them to complete before running. This change updates the
queue to use (and listen to) Futures instead of calling Runnables
directly. The commands are currently still added as Runanbles
though, so this change is a no-op.

Also moves the permission check in MediaSessionImpl to before
queueing the command because the permission should be check at
the time of calling the method.

When executing the comamnds in the queue, we need to be careful
to avoid recursion in the same thread (which happens when both
the Future is immediate and running on the correct thread already).
To avoid recursion, we detect this case and loop the commands
instead.

Issue: androidx/media#85
PiperOrigin-RevId: 461827264
2022-07-21 12:44:16 +00:00
andrewlewis
0db07c6791 Make minor fixes to HDR handling
- Update profile selection logic to pick an HDR-compatible profile when doing HDR editing on H.264/AVC videos.
- Handle doing the capabilities check for all MIME types that support HDR (not just H.265/HEVC).
- Fix a bug where we would pass an HDR input color format to the encoder when using tone-mapping.
- Tweak how `EncoderWrapper` works so decisions at made at construction time.

Manually tested cases:
- Transformation of an SDR video.
- Transformation of an HDR video to AVC (which triggers fallback/tone-mapping on a device that doesn't support HDR editing for AVC).
- Transformation of an HDR video with HDR editing.

PiperOrigin-RevId: 461572973
2022-07-21 12:44:14 +00:00
huangdarwin
ba9c9bb964 HDR: Use FP16 color representation for texture processors.
* Introduced `useHdr` for `GlEffect#toGlTextureProcessor`, so
  `TextureProcessor` implementations can decide how to handle HDR.
* Creating FP16 color textures for HDR input.

Tested via manual testing, adding a no-op GlEffectWrapper to the transformation to
force use of intermediate textures, adding a linear ramp to the fragment shader,
and trying to ascertain that there's a real reduction in posterization when
switching from 4-bit to 8-bit unsigned bytes, and again from 8-bit unsigned bytes
to 16-bit floating point.

PiperOrigin-RevId: 461613117
2022-07-21 12:42:32 +00:00
huangdarwin
9f7a159bc4 HDR: Throw when unexpected color transfer encountered.
This may happen when a containers' color transfer incorrectly does not match
the video's color transfer.

An example of a file with such a mismatch is the current Transformer demo HDR10
sample file.

Manually tested by confirming that no errors are emitted for SDR and HLG sample
files, and that errors are emitted for our incorrect HDR10 sample file.

PiperOrigin-RevId: 461583532
2022-07-21 12:41:33 +00:00
bachinger
9a895cd18f Implement getCurrentTracks in MediaController
After this change the current tracks are sent to the controller as part of
`PlayerInfo` and call `Listener.onTracksChanged()` in case of a change in tracks.

PiperOrigin-RevId: 461578695
2022-07-21 12:40:39 +00:00
andrewlewis
405be80fe5 Update demo HDR10 video URL
The old URL doesn't correctly signal the HDR10 color info in the container.

The new URL signals ST2084 (PQ) transfer function and BT.2020 color space as expected.

PiperOrigin-RevId: 461560107
2022-07-21 12:40:03 +00:00
bachinger
5c2aabca66 Use the current overrides of the player as preset
Issue: google/ExoPlayer#10429
PiperOrigin-RevId: 461577039
2022-07-21 12:39:46 +00:00
Jorge Antonio Diaz-Benito Soriano
28e32072b6
Cap concurrent removal DownloadManager.Tasks 2022-07-21 14:38:47 +02:00
andrewlewis
604ab7fcda Make minor fixes to HDR handling
- Update profile selection logic to pick an HDR-compatible profile when doing HDR editing on H.264/AVC videos.
- Handle doing the capabilities check for all MIME types that support HDR (not just H.265/HEVC).
- Fix a bug where we would pass an HDR input color format to the encoder when using tone-mapping.
- Tweak how `EncoderWrapper` works so decisions at made at construction time.

Manually tested cases:
- Transformation of an SDR video.
- Transformation of an HDR video to AVC (which triggers fallback/tone-mapping on a device that doesn't support HDR editing for AVC).
- Transformation of an HDR video with HDR editing.

PiperOrigin-RevId: 461572973
2022-07-21 12:38:41 +00:00
andrewlewis
794e366b36 Update demo HDR10 video URL
The old URL doesn't correctly signal the HDR10 color info in the container.

The new URL signals ST2084 (PQ) transfer function and BT.2020 color space as expected.

PiperOrigin-RevId: 461560107
2022-07-21 12:37:39 +00:00
Manisha Jajoo
ef57a061b7 Pass local copy of input to RtpH263ReaderTest's consume method
This change is done to keep the frame data unchanged.
RtpH263Reader changes the header data in input, so to send the same
RTP packet across multiple tests, each test copies the frame data
into a new packet and sends that to the reader.
2022-07-19 11:45:39 +05:30
Manisha Jajoo
c7fbf3437f Revert "Keep the input data constant in consume method"
This reverts commit 3bacb1646c9ecd01e403465c7643888e83a9e79d.
2022-07-19 11:40:01 +05:30
Manisha Jajoo
69a716f633 fix review comments in RtpH263ReaderTest 2022-07-18 10:44:51 +05:30
Manisha Jajoo
3bacb1646c Keep the input data constant in consume method
Earlier, the consume method of RtpH263Reader was changing the bytes of the
input bitstream during header parse. This commit copies the input into
local context and changes the local variable as per the specifications
thus keeping the input constant.
2022-07-18 10:43:41 +05:30
rohks
d24163ccea Update JavaDoc for 2.18.1
#minor-release

PiperOrigin-RevId: 461177918
(cherry picked from commit 7a10dd1580c3c960d746fcb575aad2b47b5a87ce)
2022-07-15 12:25:38 +00:00
rohks
7a10dd1580 Update JavaDoc for 2.18.1
#minor-release

PiperOrigin-RevId: 461177918
2022-07-15 12:19:34 +00:00
olly
9271572e95 Add TODOs for registerReceiver calls without flag
PiperOrigin-RevId: 461165173
2022-07-15 12:19:04 +00:00
olly
5a16376537 Add TODOs for registerReceiver calls without flag
PiperOrigin-RevId: 461165173
2022-07-15 12:15:54 +00:00
rohks
064bbbff41 Version bump to exoplayer:2.18.1 and media3:1.0.0-beta02
#minor-release

PiperOrigin-RevId: 461162552
(cherry picked from commit 6d27ff862b0e8bc99b43dcc59c1d99760f1b0946)
2022-07-15 10:37:41 +00:00
rohks
6d27ff862b Version bump to exoplayer:2.18.1 and media3:1.0.0-beta02
#minor-release

PiperOrigin-RevId: 461162552
2022-07-15 10:26:47 +00:00
samrobinson
d4653c335e Add additional video files.
These are providing more variety and complexity.

All files are okay to be public.

PiperOrigin-RevId: 460935247
2022-07-15 10:23:13 +00:00
rohks
be27daebc4 Version bump to exoplayer:2.18.1 and media3:1.0.0-beta02
#minor-release

PiperOrigin-RevId: 461162552
2022-07-15 10:20:58 +00:00
samrobinson
b87fa45fea Add additional video files.
These are providing more variety and complexity.

All files are okay to be public.

PiperOrigin-RevId: 460935247
2022-07-15 10:19:56 +00:00
Manisha Jajoo
da47771d10 Add test for Rtp H263 Reader
Change-Id: I57d57881ef5c158d41be1bf1e3714332d50cd3a9
2022-07-14 09:36:32 +05:30
hschlueter
db78a87fdc Use COLOR_Format32bitABGR2101010 for HDR encoder configuration.
Also remove VideoEncoderSettings.colorProfile as there are no
concrete use cases for customizing this and it clashes with picking
the color format automatically based on SDR vs. HDR.

PiperOrigin-RevId: 460746987
2022-07-13 18:25:50 +00:00
tonihei
6be0d6ea25 Fix setDataSourceFactory handling in DefaultMediaSourceFactory
The call doesn't currently reset the already loaded suppliers and
factories. Also fix the supplier loading code to use a local copy
of the current dataSourceFactory to avoid leaking an updated
instance to a later invocation.

Issue: androidx/media#116

#minor-release

PiperOrigin-RevId: 460721541
2022-07-13 18:22:23 +00:00
tonihei
1e8d163107 Use SingleThreadExecutor to release AudioTracks
We currently start a simple Thread to release AudioTracks
asynchronously. If many AudioTracks are released at the same
time, this may lead to OOM situations because we attempt to
create multiple new threads.

This can be improved by using a shared SingleThreadExecutor.
In the simple case of one simmultaneous release, it's exactly
the same behavior as before: create a thread and release it
as soon as it's done. For multiple simultanous releases we
get the advantage of sharing a single thread to avoid creating
more than one at the same time.

Issue: google/ExoPlayer#10057
PiperOrigin-RevId: 460698942
2022-07-13 18:18:51 +00:00
samrobinson
6ec18c8a20 Fix assertion error when using high quality targeting API.
Add test that verifies SSIM with API enabled.

#minor-release

PiperOrigin-RevId: 460692420
2022-07-13 18:15:17 +00:00
Rohit Singh
60437397f4 Merge pull request #10185 from TiVo:p-custom-logger
PiperOrigin-RevId: 460689252
2022-07-13 18:11:52 +00:00
samrobinson
e0b46ece4e Clarify format is supported by encoder.
#cleanup
#minor-release

PiperOrigin-RevId: 460688226
2022-07-13 18:07:51 +00:00
claincly
918550060f Fix two typos in RtpVp8Reader and test
PiperOrigin-RevId: 460662425
2022-07-13 18:04:18 +00:00
bachinger
d59334c56b Add migration script
Note: This was already reviewed in <unknown commit>. This doesn't mean we cannot apply further changes though.
PiperOrigin-RevId: 460542835
2022-07-13 18:01:06 +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
Rohit Singh
c75b6a3a88 Merge pull request #110 from ittiam-systems:rtp_vp8_test
PiperOrigin-RevId: 460513413
2022-07-13 17:54:35 +00:00
claincly
fa55078641 Fix a mis-match in encoder priority.
PiperOrigin-RevId: 460500666
2022-07-13 17:51:05 +00:00
hschlueter
7954eeb3c2 Use COLOR_Format32bitABGR2101010 for HDR encoder configuration.
Also remove VideoEncoderSettings.colorProfile as there are no
concrete use cases for customizing this and it clashes with picking
the color format automatically based on SDR vs. HDR.

PiperOrigin-RevId: 460746987
2022-07-13 17:49:24 +00:00
tonihei
adc50515e9 Fix setDataSourceFactory handling in DefaultMediaSourceFactory
The call doesn't currently reset the already loaded suppliers and
factories. Also fix the supplier loading code to use a local copy
of the current dataSourceFactory to avoid leaking an updated
instance to a later invocation.

Issue: androidx/media#116

#minor-release

PiperOrigin-RevId: 460721541
2022-07-13 17:48:16 +00:00
rohks
0f665fbeb8 Ignore reserved bit in parsing NAL unit type
`HevcConfig.parse` misreads reserved bit to determine NAL unit type. This is currently meant to be always set to 0, but could be given some kind of meaning in a future revision.

Issue: google/ExoPlayer#10366
PiperOrigin-RevId: 460487613
2022-07-13 17:47:51 +00:00
tonihei
9a616c0cee Use SingleThreadExecutor to release AudioTracks
We currently start a simple Thread to release AudioTracks
asynchronously. If many AudioTracks are released at the same
time, this may lead to OOM situations because we attempt to
create multiple new threads.

This can be improved by using a shared SingleThreadExecutor.
In the simple case of one simmultaneous release, it's exactly
the same behavior as before: create a thread and release it
as soon as it's done. For multiple simultanous releases we
get the advantage of sharing a single thread to avoid creating
more than one at the same time.

Issue: google/ExoPlayer#10057
PiperOrigin-RevId: 460698942
2022-07-13 17:47:20 +00:00
samrobinson
f903869eb8 Fix assertion error when using high quality targeting API.
Add test that verifies SSIM with API enabled.

#minor-release

PiperOrigin-RevId: 460692420
2022-07-13 17:46:38 +00:00