MeiCam SDK For iOS  3.10.0
Instance Methods | List of all members
<NvsCustomVideoFxRenderer> Protocol Reference

Custom video effects renderer interface. More...

#import <NvsCustomVideoFx.h>

Inheritance diagram for <NvsCustomVideoFxRenderer>:

Instance Methods

(void) - didInit
 Meishe SDK calls this method on custom video effects to let the user initialize resources. More...
 
(void) - didCleanup
 Meishe SDK calls this method on custom video special effects to let users clean up resources. More...
 
(void) - didPreloadResources
 Meishe SDK calls this method on custom video effects to allow some resource preprocessing. More...
 
(void) - didRender:renderHelper:
 Meishe SDK calls this method to effect Fx on input video frame for customized video effects. More...
 
(void) - didClearCacheResources
 Meishe SDK calls this method on custom video effects to allow some resource preprocessing. More...
 

Detailed Description

Custom video effects renderer interface.

Warning
In the NvsCustomVideoFxRenderer class, all public APIs are used in the UI thread! ! !

Method Documentation

◆ didCleanup

- (void) didCleanup

Meishe SDK calls this method on custom video special 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 didInit. If the didInit is not called, it will not be called. This method is called in the special effect rendering thread of Meishe SDK, and the current thread has already bound EAGLContext.

◆ didClearCacheResources

- (void) didClearCacheResources
optional

Meishe SDK calls this method on custom video effects to allow some resource preprocessing.

This method is called when user call clearCacheResources in streamingContext. This method is called in the special effect rendering thread of Meishe SDK, and the current thread has already bound EAGLContext.

◆ didInit

- (void) didInit

Meishe SDK calls this method on custom video effects to let the user initialize 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 special effect rendering thread of Meishe SDK, and the current thread has already bound an EAGLContext.

◆ didPreloadResources

- (void) didPreloadResources

Meishe SDK calls this method on custom video effects to allow some resource preprocessing.

This method is called multiple times during the life cycle of a custom video effect, and will definitely be called after didInit, which is generally called before each timeline is played. In general, users need to do work such as building a shader program in this function. This method is called in the special effect rendering thread of Meishe SDK, and the current thread has already bound EAGLContext.

◆ didRender:renderHelper:

- (void) didRender: (struct NvsCustomVideoFxRenderContext *)  renderContext
renderHelper: (NvsCustomVideoFxRenderHelper *)  renderHelper 

Meishe SDK calls this method to effect Fx on input video frame for customized video effects.

The users apply 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 special 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, etc on the corresponding attachment point. Note: Be sure to reset the state of the OpenGL ES context to the default state after rendering is complete, such as glEnable(GL_BLEND) is called during user rendering. Then glDisable(GL_BLEND) must be called after rendering is completed, because the blend is off by default. About the default state of the OpenGL ES context, please refer to https://www.khronos.org/opengles/see https://www.khronos.org/opengles/. Warning: If the state of the OpenGL ES context is not reset to the default state after rendering is completed, it may cause an error in subsequent effects rendering!

Parameters
renderContextEffects rendering context object
renderHelperThe effect rendering interface. Pay attention and do not save this interface, users can only use it in the didRender!

The documentation for this protocol was generated from the following file: