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
5be6eaa8
authored
Jun 30, 2020
by
olly
Committed by
Oliver Woodman
Jul 03, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make GL demo easier to understand
PiperOrigin-RevId: 319007693
parent
20820800
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
18 deletions
demos/gl/src/main/assets/bitmap_overlay_video_processor_fragment.glsl
demos/gl/src/main/assets/bitmap_overlay_video_processor_vertex.glsl
demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/BitmapOverlayVideoProcessor.java
demos/gl/src/main/res/layout/main_activity.xml
demos/gl/src/main/assets/bitmap_overlay_video_processor_fragment.glsl
View file @
5be6eaa8
...
@@ -32,4 +32,3 @@ void main() {
...
@@ -32,4 +32,3 @@ void main() {
gl_FragColor
=
videoColor
*
(
1
.
0
-
overlayColor
.
a
)
gl_FragColor
=
videoColor
*
(
1
.
0
-
overlayColor
.
a
)
+
overlayColor
*
overlayColor
.
a
;
+
overlayColor
*
overlayColor
.
a
;
}
}
demos/gl/src/main/assets/bitmap_overlay_video_processor_vertex.glsl
View file @
5be6eaa8
...
@@ -11,11 +11,10 @@
...
@@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
attribute
vec
4
a_position
;
attribute
vec
2
a_position
;
attribute
vec
3
a_texcoord
;
attribute
vec
2
a_texcoord
;
varying
vec2
v_texcoord
;
varying
vec2
v_texcoord
;
void
main
()
{
void
main
()
{
gl_Position
=
a_position
;
gl_Position
=
vec4
(
a_position
.
x
,
a_position
.
y
,
0
,
1
)
;
v_texcoord
=
a_texcoord
.
xy
;
v_texcoord
=
a_texcoord
;
}
}
demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/BitmapOverlayVideoProcessor.java
View file @
5be6eaa8
...
@@ -88,18 +88,9 @@ import javax.microedition.khronos.opengles.GL10;
...
@@ -88,18 +88,9 @@ import javax.microedition.khronos.opengles.GL10;
GlUtil
.
Uniform
[]
uniforms
=
GlUtil
.
getUniforms
(
program
);
GlUtil
.
Uniform
[]
uniforms
=
GlUtil
.
getUniforms
(
program
);
for
(
GlUtil
.
Attribute
attribute
:
attributes
)
{
for
(
GlUtil
.
Attribute
attribute
:
attributes
)
{
if
(
attribute
.
name
.
equals
(
"a_position"
))
{
if
(
attribute
.
name
.
equals
(
"a_position"
))
{
attribute
.
setBuffer
(
attribute
.
setBuffer
(
new
float
[]
{-
1
,
-
1
,
1
,
-
1
,
-
1
,
1
,
1
,
1
},
2
);
new
float
[]
{
-
1.0f
,
-
1.0f
,
0.0f
,
1.0f
,
1.0f
,
-
1.0f
,
0.0f
,
1.0f
,
-
1.0f
,
1.0f
,
0.0f
,
1.0f
,
1.0f
,
1.0f
,
0.0f
,
1.0f
,
},
4
);
}
else
if
(
attribute
.
name
.
equals
(
"a_texcoord"
))
{
}
else
if
(
attribute
.
name
.
equals
(
"a_texcoord"
))
{
attribute
.
setBuffer
(
attribute
.
setBuffer
(
new
float
[]
{
0
,
1
,
1
,
1
,
0
,
0
,
1
,
0
},
2
);
new
float
[]
{
0.0f
,
1.0f
,
1.0f
,
1.0f
,
1.0f
,
1.0f
,
0.0f
,
0.0f
,
1.0f
,
1.0f
,
0.0f
,
1.0f
,
},
3
);
}
}
}
}
this
.
attributes
=
attributes
;
this
.
attributes
=
attributes
;
...
...
demos/gl/src/main/res/layout/main_activity.xml
View file @
5be6eaa8
...
@@ -27,4 +27,3 @@
...
@@ -27,4 +27,3 @@
app:surface_type=
"none"
/>
app:surface_type=
"none"
/>
</FrameLayout>
</FrameLayout>
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