MeiCam SDK For Android
3.14.0
|
Custom video effects' renderer interface. User-implemented custom video effects must implement this interface. More...
Public Member Functions | |
void | onInit () |
Meishe SDK calls this method on custom video effects to let the user initialize some resources. More... | |
void | onCleanup () |
Meishe SDK calls this method on custom video effects to let users clean up resources. More... | |
void | onPreloadResources () |
Meishe SDK calls this method on custom video effects to allow preprocessing of some resources. More... | |
void | onRender (RenderContext renderContext) |
Meishe SDK calls this method on custom video effects to apply effect special effects on input video frames. More... | |
Custom video effects' renderer interface. User-implemented custom video effects must implement this interface.
void com.meicam.sdk.NvsCustomVideoFx.Renderer.onCleanup | ( | ) |
Meishe SDK calls this method on custom video effects to let users clean up resources.
This method will only be called once at most in the life cycle of a custom video effect, and will definitely be called after onInit. If onInit is not called, it will not be called. This method is called in the effect rendering thread of Meishe SDK, and the current thread has already bound an EGL Context.
void com.meicam.sdk.NvsCustomVideoFx.Renderer.onInit | ( | ) |
Meishe SDK calls this method on custom video effects to let the user initialize some resources.
This method will only be called at most once during the life cycle of a custom video effect. If the effect has never been used, this method will not be called. This method is called in the effect rendering thread of Meishe SDK, and the current thread has already bound an EGL Context.
void com.meicam.sdk.NvsCustomVideoFx.Renderer.onPreloadResources | ( | ) |
Meishe SDK calls this method on custom video effects to allow preprocessing of some resources.
This method will be called multiple times during the life cycle of a custom video effect, and will definitely be called after onInit, which is generally called before each timeline is played. In general, users need to do works such as building a shader program in this function. This method is called in the effect rendering thread of Meishe SDK, and the current thread has already bound an EGL Context.
void com.meicam.sdk.NvsCustomVideoFx.Renderer.onRender | ( | RenderContext | renderContext | ) |
Meishe SDK calls this method on custom video effects to apply effect special effects on input video frames.
The user implements this method to process the input video frame and write the result to the output video frame to complete the effect rendering. This method is called in the effect rendering thread of Meishe SDK, and the current thread has already bound an EGL Context. The current thread has already bound an FBO, and the user only needs to bind the color buffer, depth buffer... on the corresponding attachment point. Note: Be sure to reset the state of the OpenGL ES context to the default state when rendering is completed, such as glEnable(GL_BLEND) being called during user rendering. Then users must call glDisable(GL_BLEND) after the rendering is completed, because the blend is off by default. For the default state of the OpenGL ES context, Please refer to https://www.khronos.org/opengles/ Warning:If the state of the OpenGL ES context is not reset to the default state after rendering, it may cause an error in subsequent effect rendering!
renderContext | Effects rendering context object |