Kotlin
Creating shader for color inversion
Now our rendererer needs shader let's implement it
- Add fragmentShaderCode to the MyRenderer class:
To render the video frames, the renderer class uses
OpenGLshaders. In this sample shader produces the inverted color effect, more precisely this is achieved by this liney = 1.0 - 1.1643 * (y - 0.0625);which is inside thefragmentShaderCodeFor full implementation of the renderer check the sample app implementation here
Basic video rendering
Learn how to use a custom video renderer in Kotlin to display a black-and-white version of a video stream using the Vonage Video Android SDK.
手順
1
Introduction2
Getting Started3
Creating a new project4
Adding the Android SDK5
Setting up authentication6
Requesting permissions7
Creating the Inverted Video Renderer8
Creating a custom Renderer (MyRenderer)9
Publishing a stream to the session10
Connecting Custom Renderer to Publisher/Subscriber11
Running the app12
Conclusion