Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2a05a504
authored
Aug 25, 2022
by
huangdarwin
Committed by
Marc Baechinger
Sep 30, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
HDR: Rename GL_COLOR_TRANSFER instances to COLOR_TRANSFER
PiperOrigin-RevId: 469959215
parent
84577949
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
libraries/effect/src/main/assets/shaders/fragment_shader_copy_external_yuv_es3.glsl
libraries/effect/src/main/assets/shaders/fragment_shader_oetf_es3.glsl
libraries/effect/src/main/java/androidx/media3/effect/MatrixTransformationProcessor.java
libraries/effect/src/main/assets/shaders/fragment_shader_copy_external_yuv_es3.glsl
View file @
2a05a504
...
...
@@ -20,7 +20,7 @@
// https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_YUV_target.txt,
// 2. Applies a YUV to RGB conversion using the specified color transform
// uYuvToRgbColorTransform, yielding electrical (HLG or PQ) BT.2020 RGB,
// 3. If uEotf
GlColorTransfer is GL_
COLOR_TRANSFER_NO_VALUE, outputs electrical
// 3. If uEotf
ColorTransfer is
COLOR_TRANSFER_NO_VALUE, outputs electrical
// (HLG or PQ) BT.2020 RGB. Otherwise, outputs optical linear BT.2020 RGB for
// intermediate shaders by applying the HLG or PQ EOTF.
// 4. Copies this converted texture color to the current output, with alpha = 1.
...
...
@@ -30,8 +30,8 @@
precision
mediump
float
;
uniform
__samplerExternal2DY2YEXT
uTexSampler
;
uniform
mat3
uYuvToRgbColorTransform
;
// C.java#
Gl
ColorTransfer value.
uniform
int
uEotf
Gl
ColorTransfer
;
// C.java#ColorTransfer value.
uniform
int
uEotfColorTransfer
;
in
vec2
vTexSamplingCoord
;
out
vec4
outColor
;
...
...
@@ -84,9 +84,9 @@ highp vec3 getOpticalColor(highp vec3 electricalColor) {
const
int
COLOR_TRANSFER_ST2084
=
6
;
const
int
COLOR_TRANSFER_HLG
=
7
;
if
(
uEotf
Gl
ColorTransfer
==
COLOR_TRANSFER_ST2084
)
{
if
(
uEotfColorTransfer
==
COLOR_TRANSFER_ST2084
)
{
return
pqEotf
(
electricalColor
);
}
else
if
(
uEotf
Gl
ColorTransfer
==
COLOR_TRANSFER_HLG
)
{
}
else
if
(
uEotfColorTransfer
==
COLOR_TRANSFER_HLG
)
{
return
hlgEotf
(
electricalColor
);
}
else
{
return
electricalColor
;
...
...
libraries/effect/src/main/assets/shaders/fragment_shader_oetf_es3.glsl
View file @
2a05a504
...
...
@@ -24,9 +24,9 @@ precision mediump float;
uniform
sampler2D
uTexSampler
;
in
vec2
vTexSamplingCoord
;
out
vec4
outColor
;
// C.java#
Gl
ColorTransfer value.
// Only
GL_COLOR_TRANSFER_ST2084 and GL_
COLOR_TRANSFER_HLG are allowed.
uniform
int
uOetf
Gl
ColorTransfer
;
// C.java#ColorTransfer value.
// Only
COLOR_TRANSFER_ST2084 and
COLOR_TRANSFER_HLG are allowed.
uniform
int
uOetfColorTransfer
;
uniform
mat3
uColorTransform
;
// TODO(b/227624622): Consider using mediump to save precision, if it won't lead
...
...
@@ -76,8 +76,8 @@ highp vec3 pqOetf(highp vec3 linearColor) {
// electrical signals. Input and output are both normalzied to [0, 1].
highp
vec3
getElectricalColor
(
highp
vec3
linearColor
)
{
// LINT.IfChange(color_transfer)
const
int
GL_
COLOR_TRANSFER_ST2084
=
6
;
return
(
uOetf
GlColorTransfer
==
GL_
COLOR_TRANSFER_ST2084
)
?
const
int
COLOR_TRANSFER_ST2084
=
6
;
return
(
uOetf
ColorTransfer
==
COLOR_TRANSFER_ST2084
)
?
pqOetf
(
linearColor
)
:
hlgOetf
(
linearColor
);
}
...
...
libraries/effect/src/main/java/androidx/media3/effect/MatrixTransformationProcessor.java
View file @
2a05a504
...
...
@@ -218,9 +218,9 @@ import java.util.Arrays;
// If electrical colors are both input and output, no EOTF is needed.
glProgram
.
setIntUniform
(
"uEotf
Gl
ColorTransfer"
,
outputElectricalColors
?
Format
.
NO_VALUE
:
colorTransfer
);
"uEotfColorTransfer"
,
outputElectricalColors
?
Format
.
NO_VALUE
:
colorTransfer
);
}
else
if
(
outputElectricalColors
)
{
glProgram
.
setIntUniform
(
"uOetf
Gl
ColorTransfer"
,
colorTransfer
);
glProgram
.
setIntUniform
(
"uOetfColorTransfer"
,
colorTransfer
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment