62 Commits

Author SHA1 Message Date
Googler
6b4d174cde Avoid spinning in between intermediate texture processors.
This change adds a new method onReadyToAcceptInputFrame to
GlTextureProcesssor.InputListener and changes maybeQueueInputFrame
to queueInputFrame, removing the boolean return value.
This avoids the re-trying in ChainingGlTextureProcessorListener
by allowing it to only feed frames from the producing to the consuming
GlTextureProcessor when there is capacity.

MediaPipeProcessor still needs re-trying when processing isn't 1:1.

PiperOrigin-RevId: 466626369
(cherry picked from commit 97e6a86d2b1f72de9f95658f90ea40d1e1e4fac2)
2022-08-10 09:56:24 +00:00
Googler
ccef3950ca Remove times(1) from effect and transformer tests as it is the default.
PiperOrigin-RevId: 466324322
(cherry picked from commit 1bdc252d2cfac5499306584fd68a2b1f33f05cc4)
2022-08-09 12:08:39 +00:00
huangdarwin
00749d9d26 HDR: Rename ColorInfo#isHdr to isTransferHdr.
While HDR is most closely tied to the color transfer (ex.
COLOR_TRANSFER_SDR is the only one explicitly mentioning dynamic
range), technically color spaces may be associated with HDR as well,
like BT.2020 commonly being used for HDR rather than BT.709 for SDR.

Therefore, it's more specific to mention just that the transfer is HDR.

PiperOrigin-RevId: 466316960
(cherry picked from commit 35161c748956d96e8e83cee007143615ef6f9d07)
2022-08-09 11:28:31 +00:00
Googler
cdd47ff703 Split GlTextureProcessor.Listener into input/output/error listener.
This simplifies ChainingGlTextureProcessor as it now only connects a
consuming and a producing GlTextureProcessor rather than a previous,
current, and next GlTextureProcessor.

Also use default no-op implementations of the listeners in
SingleFrameGlTextureProcessor and MediaPipeProcessor to avoid
null-checks.

PiperOrigin-RevId: 466301642
(cherry picked from commit 7dc05edbab233dcd631a4a78ad65f1c30a1e9734)
2022-08-09 10:05:14 +00:00
huangdarwin
37274c91de HDR: Input ColorInfo to the FrameProcessor.
This allows the GlEffectsFrameProcessor to later handle HLG and PQ
differently, or limited and full color range differently.

No functional change intended in this CL.

PiperOrigin-RevId: 466070764
(cherry picked from commit 536d42c865fd692c1d1799082077906287a2c3f0)
2022-08-08 16:55:22 +00:00
leonwind
1bbb5df410 Switch @param to @code tags in RgbAdjustment.
PiperOrigin-RevId: 465591877
(cherry picked from commit fe0cf0528318abf1a9a7a8f75bcce402235f961a)
2022-08-05 17:20:54 +00:00
leonwind
d34ed7a5e1 Add RgbAdjustment class to build RgbaMatrices
* Add RgbaMatrix interface implementation.
* Add Builder class for easy adjustments.
* Adjust existing RgbaMatrixPixelTests to use new RgbAdjustment class.

PiperOrigin-RevId: 465545429
(cherry picked from commit a76dbfd363e2d167b13d2bcd978979bcfd69b071)
2022-08-05 12:56:26 +00:00
leonwind
46f267700f Remove clamp function in contrast fragment shader.
* OpenGL automatically clamps the output colors to the [0, 1] interval.

PiperOrigin-RevId: 465071999
(cherry picked from commit 2347db5d7484b161f6389846e6cde5b0ac1ed7a6)
2022-08-03 16:14:30 +00:00
hschlueter
110c442758 Fix saving previous debugSurfaceView in FinalMatrixTPWrapper.
PiperOrigin-RevId: 465067306
(cherry picked from commit a28a508d2dd10ac2858c334a1a0fe0ff1350e98c)
2022-08-03 15:52:24 +00:00
hschlueter
89edfbc12b Clean up FrameProcessor TODOs.
PiperOrigin-RevId: 465044342
(cherry picked from commit c5d1940fbab430ede4b158300bbb381c032498bf)
2022-08-03 13:53:53 +00:00
hschlueter
8b9203a3ea Move effects functionality out of transformer to effects module.
PiperOrigin-RevId: 465038852
(cherry picked from commit 22725ddfa8f5c39c83b792a176339700364b724e)
2022-08-03 13:19:15 +00:00
hschlueter
93bb191cb1 Create effect module.
PiperOrigin-RevId: 464767396
(cherry picked from commit 4d09ca66986a3c862b09f42a06a5bb031dce46f8)
2022-08-02 12:36:47 +00:00