18400 Commits

Author SHA1 Message Date
tonihei
2cbab10419 Deprecate onPlayerCommandRequest
This method doesn't really serve a purpose that isn't handled
elsewhere. The return value is also not forwarded to anyone.

PiperOrigin-RevId: 527283166
2023-04-27 12:24:39 +01:00
bachinger
7938978b51 Allow MediaLibraryService to reject the resumption notification
To reliably reject the System UI playback resumption notification on
all API levels (specifically API 30), the backward compatibility layer
needs to return `null` for the library root.

This is not possible in the Media3 implementation. This change allows
an app to return a `LibraryResult.ofError(RESULT_ERROR_NOT_SUPPORTED)`
that then is translated to return null by the backwards compatibility
layer.

Issue: androidx/media#355
Issue: androidx/media#167
Issue: androidx/media#27

See https://developer.android.com/guide/topics/media/media-controls#mediabrowserservice_implementation

PiperOrigin-RevId: 527276529
2023-04-27 12:23:26 +01:00
tofunmi
178a323897 Update sdr internal fsh to accept input color transfer
PiperOrigin-RevId: 527271212
2023-04-27 12:22:24 +01:00
tonihei
3693ca4bbb Add MediaSession.getControllerForCurrentRequest
This is a helper method that can used to obtain information about
the controller that is currently calling a Player method.

PiperOrigin-RevId: 527268994
2023-04-27 12:21:19 +01:00
Ian Baker
fab134f0b3 Merge pull request #313 from pengbins:fix_ts_h265reader_parse_sps
PiperOrigin-RevId: 527259619
2023-04-26 15:53:58 +01:00
tonihei
9128244dc3 Use Util method for common UI play/pause button logic.
This ensures the logic is consistent and can also be easily
used from custom UIs.

PiperOrigin-RevId: 527249127
2023-04-26 15:52:50 +01:00
huangdarwin
97272c139c Effects: Output to texture without surface in VFP.
Allow the VideoFrameProcessor to output to a texture without an output surface.

Tested by updating texture output tests to no longer output to a surface.

PiperOrigin-RevId: 527244605
2023-04-26 15:51:06 +01:00
tonihei
889f435a49 Update dependencies to latest versions
The only dependencies that are not updated are the ones that need
to be kept in sync with other system (like Android source tree) or
would require a Kotlin dependency in common or exoplayer modules.

As a side effect, some demo apps now need a Kotlin config and some
additional modules require desugaring/multidex logic. To simplify
the setup, the desugaring and multidex steps are added to the common
config.

PiperOrigin-RevId: 527243950
2023-04-26 15:49:57 +01:00
huangdarwin
d8cf4449a4 Transformer: Reduce scope of createSupportedTransformationRequest
This was only used in EncoderWrapper, so move createSupportedTransformationRequest
from VideoSamplePipeline to EncoderWrapper to reduce its scope.

PiperOrigin-RevId: 527226578
2023-04-26 15:48:50 +01:00
claincly
19b979d817 Allow setting individual offset for bitmaps.
PiperOrigin-RevId: 527001582
2023-04-26 15:47:31 +01:00
tofunmi
8612d2820d Update image transcoding pipeline to signal input COLOR_TRANSFER_SRGB
The production code changes are in transformer, but the tests in effect have also been updated to confirm the is no color regression `inputColorInfo.colorTransfer=C.COLOR_TRANSFER_SRGB`

PiperOrigin-RevId: 526950435
2023-04-26 15:46:21 +01:00
tofunmi
42c9c28daf Update VideoSamplePipeline to take account of decoder colors
PiperOrigin-RevId: 526940261
2023-04-26 15:44:52 +01:00
claincly
c539cb8575 Add default impl for some InputHandler methods.
And minor fixes.

PiperOrigin-RevId: 526717927
2023-04-26 15:43:46 +01:00
sheenachhabra
67639cafd7 Open source muxer module
PiperOrigin-RevId: 526683141
2023-04-26 15:42:39 +01:00
huangdarwin
324115f6cf Effects: Allow BT2020 colors with SDR transfers
Previously, I assumed that SDR contents must be BT709, and HDR contents must be
BT2020. Turns out BT2020 is just wide-gamut, and SDR contents / transfers may be
represented in BT2020 color spaces.

Relax the check, so that we don't throw when valid BT2020 SMPTE 170M contents
are input into effects.

PiperOrigin-RevId: 526668347
2023-04-26 15:41:33 +01:00
sheenachhabra
b11dd106ae Replace MediaFormat with Format class in muxer module
PiperOrigin-RevId: 526655859
2023-04-26 15:40:40 +01:00
tofunmi
f1d9a0a819 Add nullness-compat-qual dependency for android tests
PiperOrigin-RevId: 526652129
2023-04-26 15:38:22 +01:00
claincly
f3c0256bb4 Abstract the interface of DefaultVideoFrameProcessor's input.
PiperOrigin-RevId: 526642898
2023-04-26 15:37:12 +01:00
ibaker
2d968a5d97 Rollback of 8d17faea33
*** Original commit ***

Rollback of d7983f9485

*** Original commit ***

Bump Guava version to 31.1

***

***

PiperOrigin-RevId: 526601244
2023-04-26 15:36:00 +01:00
claincly
fcec5a29c1 Fix not ignoring invalid color info.
PiperOrigin-RevId: 526595567
2023-04-26 15:34:52 +01:00
Ian Baker
171c224bc6 Add a release note for MPEG-TS H.265 SPS parsing fix
Also clean-up a comment about skipping the NAL start code
2023-04-25 18:17:44 +01:00
Ian Baker
e88fa7c52e Reformat with google-java-format 2023-04-25 09:15:26 +01:00
peng bin
d7acae20c0 Use parseH265SpsNalUnit instead of parseH265SpsNalUnitPayload
To consistent with the other callsites of NalUnitUtil for parsing H265 SPS
2023-04-25 09:15:26 +01:00
peng bin
6ae8c8c041 Use NalUnitUtil.parseH265SpsNalUnitPayload when parsing MPEG-TS files
This implicitly fixes a bug by removing the buggy implementation in H265Reader in favour of a working one. This change also adds tests to confirm the parsing bug is fixed.
2023-04-25 09:15:25 +01:00
peng bin
114020c2d8 Fix previousNumDeltaPocs in skipShortTermRefPicSets 2023-04-25 09:15:25 +01:00
Ian Baker
75d81c7630 Derive previousNumDeltaPocs from numNegativePics and numPositivePics
This more closely matches the equations in equations 7-61 and 7-62 in
See H.265/HEVC (2014) section 7.4.8.
2023-04-25 09:15:25 +01:00
peng bin
a65b5a5c2b Fix previousNumDeltaPocs in skipShortTermRefPicSets 2023-04-25 09:15:25 +01:00
peng bin
b08120d752 Fix used_by_curr_pic_flag to align with H.265 spec 2023-04-25 09:15:25 +01:00
peng bin
bc0dc01a69 Add a test sample for ts+h265 2023-04-25 09:15:25 +01:00
ibaker
6aacbc6bbb Ensure DrmSessionManager.setPlayer() is called before prepare()
`prepare()` now logs a warning if it's called before `setPlayer()`
because it's not possible to tell if it's being called on the wrong
thread (since 3480a27994).

This change finds all the places one is called immediately after the
other and flips the order to be more correct.

Issue: androidx/media#350

#minor-release

PiperOrigin-RevId: 526582294
2023-04-24 11:40:19 +01:00
huangdarwin
de32536e20 HDR: Remove exportUnexpectedColorInfo test.
PiperOrigin-RevId: 526086973
2023-04-24 11:39:09 +01:00
rohks
8a73d8d3fe Add support to fetch ColorInfo from avcC box in AtomParsers
#minor-release

PiperOrigin-RevId: 526082823
2023-04-24 11:37:55 +01:00
claincly
a0fe3b29c2 Allow customizing VideoFrameProcessor input and output colors in MCVR.
PiperOrigin-RevId: 526081541
2023-04-24 11:37:07 +01:00
claincly
bb0c4a468a Fix MCVR is not able to find FrameProcessor.Factory constructor.
The constructor is removed in 316a2ce0ee.

PiperOrigin-RevId: 526068585
2023-04-24 11:36:20 +01:00
tonihei
0bac4e24e4 Add routing controller id to DeviceInfo
And forward the id to the VolumeProviderCompat and read it from the platform
MediaController for compatibility.

PiperOrigin-RevId: 526046892
2023-04-24 11:35:08 +01:00
ibaker
8d17faea33 Rollback of d7983f9485
*** Original commit ***

Bump Guava version to 31.1

***

PiperOrigin-RevId: 526046600
2023-04-24 11:34:24 +01:00
tonihei
d9fd8f4310 Add Builder for DeviceInfo
This simplifies the addition of new fields in the future.

Also do some misc clean up for the volume limit values:
 - Add some documentation to mention assumed defaults
 - Add the IntRange annotations to match the ones we have in Player
   already
 - Mention the limits in the relevant Player methods
 - Avoid bundling default values
 - Improve range checks for masking in MediaController

PiperOrigin-RevId: 526029619
2023-04-24 11:33:13 +01:00
tonihei
186f3d5c77 Clarify threading requirement for MediaController.releaseFuture
And remove unnecessary check for isDone.

Issue: androidx/media#345
PiperOrigin-RevId: 525999615
2023-04-24 11:32:02 +01:00
tonihei
79fab6783e Update available commands when MediaSessionCompat actions change
This is a bug currently, where commands are created once but never
updated again if the actions in MediaSessionCompat are changed.

PiperOrigin-RevId: 525999084
2023-04-24 11:31:15 +01:00
tonihei
2de89ca2ce Remove unnecessary Activity method overrides in session demo app
The PlayerView methods are documented to only be needed for sphrerical
playbacks, which we are not using in the session demo app.

PiperOrigin-RevId: 525986709
2023-04-24 11:29:46 +01:00
michaelkatz
affbb7c57e Render last frame even if have not read BUFFER_FLAG_END_OF_STREAM
If the limited number of input buffers causes reading of all samples except the last one conveying end of stream, then the last frame will not be rendered.

PiperOrigin-RevId: 525974445
2023-04-24 11:29:00 +01:00
claincly
353523bb07 Simplify end of stream signaling again
Whenever a frame is queued to the shader, it's guaranteed that there will be a
subsequent `onInputFrameProcessed` callback, so we can pass on the
end-of-stream signal there.

PiperOrigin-RevId: 525850141
2023-04-24 11:28:14 +01:00
claincly
acbd340e84 Rename INPUT_TYPE_TEXID, and cleanup.
PiperOrigin-RevId: 525761936
2023-04-24 11:27:07 +01:00
ibaker
d7983f9485 Bump Guava version to 31.1
PiperOrigin-RevId: 525756451
2023-04-24 11:25:54 +01:00
sheenachhabra
546b25bbc9 Set default value 0 for compressorname
PiperOrigin-RevId: 525734520
2023-04-24 11:24:48 +01:00
tofunmi
0c4b486081 Add context sharing capabilities to the default GlObjectsProvider
Creates a way for apps to provide their EGLContext to DefaultVideoFrameProcessor, so that we can attach their context to the one we create. See [the EGL docs for more information about how contexts are shared in GL](https://registry.khronos.org/EGL/sdk/docs/man/html/eglCreateContext.xhtml)

PiperOrigin-RevId: 525708652
2023-04-24 11:23:37 +01:00
tofunmi
e020e159d4 Add video/raw to MimeTypes
PiperOrigin-RevId: 525693833
2023-04-24 11:22:28 +01:00
tofunmi
0f8fa232e7 Change isInputTextureExternal boolean parameter to inputType intDef
PiperOrigin-RevId: 525690361
2023-04-24 11:21:41 +01:00
huangdarwin
3bc0172188 Remove extra param from createForVideoFrameProcessingException
This arg was always the same value, so it can be simplified.

PiperOrigin-RevId: 525677735
2023-04-24 11:20:32 +01:00
tofunmi
316a2ce0ee Remove deprecated constructor in DefaultVideoFrameProcessor.Factory
Remove deprecated factory constructor and replace all call instances of it.

PiperOrigin-RevId: 525476062
2023-04-24 11:19:49 +01:00