15162 Commits

Author SHA1 Message Date
claincly
a1be6d6eb3 Factor out RTP timestamp to sample time method
PiperOrigin-RevId: 465337074
2022-10-19 16:29:43 +00:00
yschimke
fe2b846552 Expose AudioOffload track state.
Adds a new event to AudioOffloadListener to get the offload state of the track, which indicates when software decoding is taking place.

PiperOrigin-RevId: 465264362
2022-10-19 16:26:07 +00:00
yschimke
2fbe1bbfb3 AudioOffload recovery.
Avoids disabling Offload on a write error, and instead relies on this being disabled on the AudioTrack init. It will no longer recover by disabling offload.

PiperOrigin-RevId: 465248917
2022-10-19 16:22:33 +00:00
leonwind
30fab8c008 Remove clamp function in contrast fragment shader.
* OpenGL automatically clamps the output colors to the [0, 1] interval.

PiperOrigin-RevId: 465071999
2022-10-19 16:18:51 +00:00
andrewlewis
40a28d5aee Avoid encoder default color info when tone-mapping
The encoder color info [defaults](https://cs.android.com/android/platform/superproject/+/master:frameworks/av/media/libstagefright/foundation/ColorUtils.cpp;l=377;drc=891c19ccfa4953b5e5f7b87118e007b994d8074c) to a value that depends on the input resolution, but when tone-mapping is enabled we should always get BT.709 color space. Hard-code this constant for now to avoid behavior depending on the resolution. A future change should use the decoder output media format to populate the color info.

PiperOrigin-RevId: 465070378
2022-10-19 16:14:44 +00:00
Googler
bbb7b1c0bc Fix saving previous debugSurfaceView in FinalMatrixTPWrapper.
PiperOrigin-RevId: 465067306
2022-10-19 16:11:06 +00:00
claincly
13e9ec9959 Clean up NOP constructor lines in RTP readers
PiperOrigin-RevId: 465067191
2022-10-19 16:07:30 +00:00
Googler
245326a043 Clean up FrameProcessor TODOs.
PiperOrigin-RevId: 465044342
2022-10-19 16:03:47 +00:00
Googler
707b061838 Move effects functionality out of transformer to effects module.
PiperOrigin-RevId: 465038852
2022-10-19 16:00:13 +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
Googler
26dcdcf1c0 Create effect module.
PiperOrigin-RevId: 464767396
2022-10-19 15:49:31 +00:00
leonwind
23f34f8d08 Implement RGBA color matrices processor
* Transform frame colors using a defined RGBA Matrix to apply filters.

PiperOrigin-RevId: 464523581
2022-10-19 15:46:01 +00:00
leonwind
ea213545e0 Migrate Contrast asset to emulator generated one.
PiperOrigin-RevId: 464519030
2022-10-19 15:42:30 +00:00
huangdarwin
1a22bcf1e5 HDR: Have @C.ColorTransfer check consider NO_VALUE as SDR.
Format.NO_VALUE is a placeholder value for an invalid @C.ColorTransfer, used
for example when the decoder doesn't support this transfer function.

When encountering this invalid value, interpret this as COLOR_TRANSFER_SDR.

Confirmed locally that an exception is thrown when transcoding on p4head, and no exception is thrown when transcoding with this CL.

PiperOrigin-RevId: 464135080
2022-10-19 15:38:43 +00:00
Googler
06d41c2775 Move FrameProcessor and related interfaces to common.
This will allow effects preview in ExoPlayer to use the
Effect and FrameProcessor interface (and the interfaces
they depend on) without depending on transformer or the
future effects module.

PiperOrigin-RevId: 464060047
2022-10-19 15:34:54 +00:00
leonwind
9df0d40583 Add slider option for contrast in demo app
PiperOrigin-RevId: 464050072
2022-10-19 15:31:03 +00:00
huangdarwin
810f451ec6 Transformer: Improve misc javadocs and exception logs.
PiperOrigin-RevId: 463971447
2022-10-19 15:27:24 +00:00
huangdarwin
44c42fef2a HDR: Centralize getting Colorinfo from MediaFormat
* Sets KEY_HDR_STATIC_INFO from MediaFormat in the DefaultCodec.
* Adds checks in mediaparser to ensure color space, range, and transfer are valid
  values.

PiperOrigin-RevId: 463921325
2022-10-19 15:23:34 +00:00
Marc Baechinger
9ed04ef842 Merge pull request #115 from ittiam-systems:rtp_vp9fix
PiperOrigin-RevId: 463852948
2022-10-19 15:19:39 +00:00
tonihei
3650c2970a Ignore stale events in StreamEventCallbackV29.
Despite unregistering the callback and clearing pending Handler
messages, the callback may still receive pending calls if they
are already triggered by the AudioTrack. Instead of asserting
that the track is correct, we should gracefully ignore stale
events.

PiperOrigin-RevId: 463851393
2022-10-19 15:15:35 +00:00
claincly
4d5d592c35 Fix VP8 reader fragment packet size
Merging c37a767fdf

PiperOrigin-RevId: 463826373
2022-10-19 15:11:52 +00:00
christosts
81d1dafec6 Support ApplicationVersion = 1 for HDR10+
MediaCodecRenderer allows passing HDR10+ out-of-bound metadata
with ApplicationVersion = 1.

PiperOrigin-RevId: 463822315
2022-10-19 15:08:06 +00:00
Marc Baechinger
3b5a53f1a6 Merge pull request #126 from stoyicker:cap_concurrent_remove_tasks
PiperOrigin-RevId: 463792127
2022-10-19 15:04:14 +00:00
Googler
bac323d346 Generalize frame processing error codes.
TransformationException error codes were previously tied to OpenGL
but other FrameProcessor implementations are possible. So this CL
renames the error codes.
Also, remove GL_INIT_FAILED error code, as FrameProcessor
implemenations may initialize resources on a background thread
after the factory method returns, so it's not obvious how to
distinguish between initialization failures and processing failures.

PiperOrigin-RevId: 463704902
2022-10-19 15:00:33 +00:00
Googler
66dde42989 Add Effect marker interface.
This allows non-GL effects to be passed to custom FrameProcessor
implementations.

PiperOrigin-RevId: 463696384
2022-10-19 14:56:44 +00:00
Googler
77f41d6fd4 Remove redundant interface from FinalMatrixTPWrapper.
PiperOrigin-RevId: 463646211
2022-10-19 14:53:00 +00:00
Googler
40e96d1534 Make FrameInfo and SurfaceInfo public.
Both are used in the public FrameProcessor interface, so they
should be public too.

PiperOrigin-RevId: 463454859
2022-10-19 14:49:07 +00:00
samrobinson
5f1ee86eb4 Add 8 new videos, representing lower resolutions.
Downsampled from 3840x2160 resolution videos using ffmpeg:

`ffmpeg -i <inputFilename> -filter:v scale=<width>:<height> -c:a copy <outputFilename>`

PiperOrigin-RevId: 463454628
2022-10-19 14:45:21 +00:00
samrobinson
e1b6ed3252 Add H265 as a parameter to SsimMapperTest.
PiperOrigin-RevId: 463452893
2022-10-19 14:41:30 +00:00
leonwind
03ff5246e7 Rename ContrastProcessorPixelTest and make contexts final
PiperOrigin-RevId: 463450395
2022-10-19 14:37:49 +00:00
samrobinson
63cddc9010 Add an SsimMapperTest, which binary searches for 95% ssim.
This is possible because SSIM increases monotonically with bitrate.

PiperOrigin-RevId: 463434373
2022-10-19 14:34:04 +00:00
huangdarwin
324fc5d7e8 Rename findEncoderWithClosestFormatSupport.
Just a misc nit, since I found the name a bit confusing, and figured
findEncoderWithClosestSupportedFormat might be more descriptive.

PiperOrigin-RevId: 463433646
2022-10-19 14:30:24 +00:00
Googler
ecbe9a502c Allow FrameProcessor.Factory to be set on Transformer.Builder.
Extract a FrameProcessor.Factory interface from GlEffectsFrameProcessor
and allow it to  be customized using a setter on Transformer.Builder.

PiperOrigin-RevId: 463433438
2022-10-19 14:26:43 +00:00
hmzh
3c2b54b5e3 Add seeking to arbitrary time points
PiperOrigin-RevId: 463328405
2022-10-19 14:23:02 +00:00
christosts
dc65aaef8e ExtractorAsserts: add comments on method arguments
PiperOrigin-RevId: 463320634
2022-10-19 14:19:24 +00:00
Googler
02eb6e96c5 DownloadService: Attempt to clarify the static map
PiperOrigin-RevId: 463315188
2022-10-19 14:15:42 +00:00
Googler
b994f8bfa0 Replace Size with Pair in effects.
Size requires API 21. Using Pair instead will allow effects to be
used from API 18 during previewing once they are moved out of
transformer.

PiperOrigin-RevId: 463206474
2022-10-19 14:11:40 +00:00
Googler
4ac177c337 Only recreate output EGLSurface when Surface changed.
PiperOrigin-RevId: 463193768
2022-10-19 14:07:58 +00:00
olly
6288182113 DASH: Parse and use EventStream.presentationTimeOffset
Issue: google/ExoPlayer#10460
#minor-release
PiperOrigin-RevId: 463163839
2022-07-25 22:33:59 +01:00
Oliver Woodman
92fc065bcd Merge pull request #119 from ittiam-systems:rtp_h263_test_and_fix
PiperOrigin-RevId: 463146426
2022-07-25 22:30:28 +01:00
bachinger
861196a63c Exclude Metadata from Format when bundling from TrackGroup
#minor-release

PiperOrigin-RevId: 463062454
2022-07-25 22:26:50 +01:00
hschlueter
46ab06b816 Allow stream offset passed to GlEffectsFrameProcessor to change.
This is needed for applying effects to a playlist.

The effects are applied based on the presentation time of the
frame in its corresponding media item and the offset is added
back before encoding.

Each time the offset changes, end of input stream is signalled
to the texture processors. This is needed because the texture
processors can expect monotonically increasing timestamp within
the same input stream but when the offset changes, the timstamps
jump back to 0.

PiperOrigin-RevId: 462714966
2022-07-25 22:23:20 +01:00
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
Rohit Singh
dae7a99875 Merge branch 'release-v2' into dev-v2 2022-07-22 09:44:48 +00:00
Rohit Kumar Singh
ab4d37f499
Merge pull request #10443 from google/dev-v2-r2.18.1
r2.18.1
2022-07-22 09:31:03 +00:00
olly
e5a1e00b36 Expand setOutputSurface workaround to more FireOS devices
Issue: google/ExoPlayer#10454
PiperOrigin-RevId: 462375294
2022-07-21 15:58:52 +01:00
rohks
1a650f2a86 Modify release date for 2.18.1 and media3:1.0.0-beta02
Also rearranged release notes to correctly show when the changes were released.

#minor-release

PiperOrigin-RevId: 462361982
(cherry picked from commit c6e69a35a86007762ad0b5e90759b994361d05a1)
2022-07-21 13:54:35 +00:00
rohks
c6e69a35a8 Modify release date for 2.18.1 and media3:1.0.0-beta02
Also rearranged release notes to correctly show when the changes were released.

#minor-release

PiperOrigin-RevId: 462361982
2022-07-21 13:26:49 +00:00
huangdarwin
1ecf1eb7bf HDR: Implement HLG EOTF and OETF.
This allows us to use BT.2020 RGB linear for intermediate shaders, which also
allows us to re-enable PeriodicVignetteProcessor, which should work properly in
linear color-spaces.

Manually tested by adding a GlEffectsWrapper, and confirming that HLG HDR editing still looks correct.

PiperOrigin-RevId: 462265821
2022-07-21 13:23:20 +00:00
olly
7ef41c7321 Add ContrastProcessor for contrast adjustments.
PiperOrigin-RevId: 462232813
2022-07-21 13:19:55 +00:00