MeiCam SDK For iOS  3.10.0
NvsCustomVideoFx.h
Go to the documentation of this file.
1 //================================================================================
2 //
3 // (c) Copyright China Digital Video (Beijing) Limited, 2017. All rights reserved.
4 //
5 // This code and information is provided "as is" without warranty of any kind,
6 // either expressed or implied, including but not limited to the implied
7 // warranties of merchantability and/or fitness for a particular purpose.
8 //
9 //--------------------------------------------------------------------------------
10 // Birth Date: Jul 20. 2017
11 // Author: NewAuto video team
12 //================================================================================
13 #pragma once
14 
15 #import <Foundation/Foundation.h>
16 #import "NvsCommonDef.h"
17 
19  int texId;
20  int width;
21  int height;
24 };
25 
31  int64_t effectTime;
32  int64_t effectStartTime;
33  int64_t effectEndTime;
34  int64_t mediaStreamTime;
35 };
36 
38 
47 @protocol NvsCustomVideoFxRenderer <NSObject>
48 
61 - (void)didInit;
62 
75 - (void)didCleanup;
76 
91 - (void)didPreloadResources;
92 
121 - (void)didRender:(struct NvsCustomVideoFxRenderContext *)renderContext
122  renderHelper:(NvsCustomVideoFxRenderHelper *)renderHelper;
123 
124 @optional
125 
138 - (void)didClearCacheResources;
139 
140 @end
141 
149 
164 - (int)allocateRGBATexture:(NvsSize)texSize;
165 
174 - (void)reclaimTexture:(int)texId;
175 
186 - (BOOL)uploadHostBufferToOpenGLTexture:(NvsVideoFrameInfo*)hostBuffer textureId:(int)tId;
187 
188 @end
189 
NvsCustomVideoFxRenderContext::inputVideoFrame
struct NvsCustomVideoFxVideoFrame inputVideoFrame
Inputs video frame.
Definition: NvsCustomVideoFx.h:27
NvsCustomVideoFxVideoFrame::texId
int texId
The texture ID of the video frame.
Definition: NvsCustomVideoFx.h:19
NvsCustomVideoFxVideoFrame::proxyScale
NvsRational proxyScale
Definition: NvsCustomVideoFx.h:23
NvsCustomVideoFxVideoFrame::isUpsideDownTexture
BOOL isUpsideDownTexture
YES means that the texture in this video frame is upside down. The user needs to deal with the textur...
Definition: NvsCustomVideoFx.h:22
NvsVideoFrameInfo
Video frame information.
Definition: NvsCommonDef.h:377
NvsCustomVideoFxRenderContext::effectEndTime
int64_t effectEndTime
Effect ending time (in microseconds).
Definition: NvsCustomVideoFx.h:33
-[NvsCustomVideoFxRenderer-p didCleanup]
void didCleanup()
Meishe SDK calls this method on custom video special effects to let users clean up resources.
-[NvsCustomVideoFxRenderer-p didClearCacheResources]
void didClearCacheResources()
Meishe SDK calls this method on custom video effects to allow some resource preprocessing.
NvsRational
Rational value.
Definition: NvsCommonDef.h:270
NvsCustomVideoFxRenderContext
Definition: NvsCustomVideoFx.h:26
NvsCustomVideoFxRenderContext::hasBuddyVideoFrame
bool hasBuddyVideoFrame
Indicates that whether the buddy video frame exists or not.Buddy video frames will only exist which s...
Definition: NvsCustomVideoFx.h:28
NvsCustomVideoFxVideoFrame::width
int width
The width of the video frame.
Definition: NvsCustomVideoFx.h:20
NvsCustomVideoFxRenderContext::mediaStreamTime
int64_t mediaStreamTime
Effect ending time (in microseconds).
Definition: NvsCustomVideoFx.h:34
NvsCustomVideoFxRenderContext::effectStartTime
int64_t effectStartTime
Effect starting time (in microseconds).
Definition: NvsCustomVideoFx.h:32
NvsCustomVideoFxRenderContext::inputBuddyVideoFrame
NvsVideoFrameInfo inputBuddyVideoFrame
Data and information of the input video frame in Host Memory.
Definition: NvsCustomVideoFx.h:29
NvsCustomVideoFxRenderer-p
Custom video effects renderer interface.
Definition: NvsCustomVideoFx.h:47
NvsCustomVideoFxRenderContext::outputVideoFrame
struct NvsCustomVideoFxVideoFrame outputVideoFrame
Output video frame.
Definition: NvsCustomVideoFx.h:30
NvsCustomVideoFxVideoFrame::height
int height
The height of the video frame.
Definition: NvsCustomVideoFx.h:21
NvsCustomVideoFxRenderHelper
Auxiliary method interface for custom video effects.
Definition: NvsCustomVideoFx.h:149
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
-[NvsCustomVideoFxRenderer-p didPreloadResources]
void didPreloadResources()
Meishe SDK calls this method on custom video effects to allow some resource preprocessing.
-[NvsCustomVideoFxRenderer-p didInit]
void didInit()
Meishe SDK calls this method on custom video effects to let the user initialize resources.
NvsCommonDef.h
NvsCustomVideoFxVideoFrame
Definition: NvsCustomVideoFx.h:18
NvsCustomVideoFxRenderContext::effectTime
int64_t effectTime
Special effect duration (in microseconds).
Definition: NvsCustomVideoFx.h:31
NvsSize
Size.
Definition: NvsCommonDef.h:281