美摄SDK For iOS  3.16.2
NvsCustomVideoFx.h
浏览该文件的文档.
1 //================================================================================
2 //
3 // (c) Copyright Meishe Co. Ltd, 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: Meishe 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 
26 };
27 
36  int64_t effectTime;
37  int64_t effectStartTime;
38  int64_t effectEndTime;
39  int64_t mediaStreamTime;
40 };
41 
42 #define NVS_CUSTOM_VIDE_FX_REQUIREMENT_OUTPUT_TEXTURE_COLOR_TRANSFER @"output-texture-color-transfer"
43 #define NVS_CUSTOM_VIDE_FX_REQUIREMENT_OUTPUT_TEXTURE_COLOR_PRIMARIES @"output-texture-color-primaries"
44 #define NVS_CUSTOM_VIDE_FX_REQUIREMENT_BUDDY_FRAME_FORMAT @"buddy-frame-pixel-format"
45 
47 
56 @protocol NvsCustomVideoFxRenderer <NSObject>
57 
70 - (void)didInit;
71 
84 - (void)didCleanup;
85 
100 - (void)didPreloadResources;
101 
130 - (void)didRender:(struct NvsCustomVideoFxRenderContext *)renderContext
131  renderHelper:(NvsCustomVideoFxRenderHelper *)renderHelper;
132 
133 @optional
134 
147 - (void)didClearCacheResources;
148 
163 - (bool)needInputBuddyFrame;
164 
179 - (NSDictionary*)didGetRequirement;
180 @end
181 
189 
204 - (int)allocateRGBATexture:(NvsSize)texSize;
205 
222 - (int)allocateRGBATexture:(NvsSize)texSize format:(NvsGpuVideoFrameFormat)fmt;
223 
232 - (void)reclaimTexture:(int)texId;
233 
244 - (BOOL)uploadHostBufferToOpenGLTexture:(NvsVideoFrameInfo*)hostBuffer textureId:(int)tId;
245 
256 - (BOOL)uploadHostBufferToOpenGLTexture:(NvsVideoFrameInfoExt*)hostBuffer gpuVideoFrame:(struct NvsCustomVideoFxVideoFrame*)tex;
257 
258 @end
259 
NvsCustomVideoFxRenderContext::inputVideoFrame
struct NvsCustomVideoFxVideoFrame inputVideoFrame
输入视频帧
Definition: NvsCustomVideoFx.h:29
NvsVideoFrameColorPrimaries
NvsVideoFrameColorPrimaries
Definition: NvsCommonDef.h:265
NvsCustomVideoFxVideoFrame::texId
int texId
视频帧的纹理ID
Definition: NvsCustomVideoFx.h:19
NvsVideoFrameColorTransfer
NvsVideoFrameColorTransfer
Definition: NvsCommonDef.h:245
NvsCustomVideoFxVideoFrame::proxyScale
NvsRational proxyScale
Definition: NvsCustomVideoFx.h:23
-[NvsCustomVideoFxRenderer-p didGetRequirement]
NSDictionary * didGetRequirement()
美摄SDK对自定义视频特效调用此方法以便确认CustomVideoFx是否需要侣视频帧。
NvsCustomVideoFxVideoFrame::isUpsideDownTexture
BOOL isUpsideDownTexture
值为YES表示这个视频帧中的纹理是上下颠倒的。用户在渲染时需对纹理坐标进行处理。
Definition: NvsCustomVideoFx.h:22
NvsVideoFrameInfo
视频帧信息
Definition: NvsCommonDef.h:472
NvsCustomVideoFxRenderContext::effectEndTime
int64_t effectEndTime
特效终止时间(单位微秒)
Definition: NvsCustomVideoFx.h:38
-[NvsCustomVideoFxRenderer-p didCleanup]
void didCleanup()
美摄SDK对自定义视频特效调用此方法以便让用户清理资源
-[NvsCustomVideoFxRenderer-p didClearCacheResources]
void didClearCacheResources()
美摄SDK对自定义视频特效调用此方法以便让进行资源清理。
NvsRational
比例值
Definition: NvsCommonDef.h:350
NvsCustomVideoFxRenderContext
Definition: NvsCustomVideoFx.h:28
NvsCustomVideoFxRenderContext::hasBuddyVideoFrame
bool hasBuddyVideoFrame
表示伴侣视频帧是否存在,伴侣视频帧只有在采集的时,而且设置了STREAMING_ENGINE_CAPTURE_FLAG_CAPTURE_BUDDY_HOST_VIDEO_FRAME才会存在
Definition: NvsCustomVideoFx.h:30
NvsCustomVideoFxVideoFrame::width
int width
视频帧的宽度
Definition: NvsCustomVideoFx.h:20
NvsCustomVideoFxRenderContext::mediaStreamTime
int64_t mediaStreamTime
特效终止时间(单位微秒)
Definition: NvsCustomVideoFx.h:39
NvsCustomVideoFxRenderContext::effectStartTime
int64_t effectStartTime
特效起始时间(单位微秒)
Definition: NvsCustomVideoFx.h:37
NvsCustomVideoFxRenderContext::inputBuddyVideoFrame
NvsVideoFrameInfo inputBuddyVideoFrame
输入视频帧在Host Memory中数据和信息
Definition: NvsCustomVideoFx.h:31
NvsCustomVideoFxRenderer-p
自定义视频特效渲染器接口
Definition: NvsCustomVideoFx.h:56
-[NvsCustomVideoFxRenderer-p needInputBuddyFrame]
bool needInputBuddyFrame()
美摄SDK对自定义视频特效调用此方法以便确认CustomVideoFx是否需要侣视频帧。
NvsCustomVideoFxRenderContext::inputBuddyVideoFrameColorMatrix
NvsVideoFrameYUVColorMatrix inputBuddyVideoFrameColorMatrix
Definition: NvsCustomVideoFx.h:32
NvsCustomVideoFxRenderContext::outputVideoFrame
struct NvsCustomVideoFxVideoFrame outputVideoFrame
输出视频帧
Definition: NvsCustomVideoFx.h:35
NvsCustomVideoFxVideoFrame::height
int height
视频帧的高度
Definition: NvsCustomVideoFx.h:21
NvsCustomVideoFxRenderHelper
自定义视频特效的辅助方法接口
Definition: NvsCustomVideoFx.h:189
NvsVideoFrameYUVColorMatrix
NvsVideoFrameYUVColorMatrix
Definition: NvsCommonDef.h:227
NVS_EXPORT
#define NVS_EXPORT
Definition: NvsCommonDef.h:20
-[NvsCustomVideoFxRenderer-p didPreloadResources]
void didPreloadResources()
美摄SDK对自定义视频特效调用此方法以便让进行一些资源预处理
NvsCustomVideoFxVideoFrame::texFormat
NvsGpuVideoFrameFormat texFormat
Definition: NvsCustomVideoFx.h:25
-[NvsCustomVideoFxRenderer-p didInit]
void didInit()
美摄SDK对自定义视频特效调用此方法以便让用户初始化一些资源
NvsCommonDef.h
NvsGpuVideoFrameFormat
NvsGpuVideoFrameFormat
视频帧像素格式
Definition: NvsCommonDef.h:212
NvsCustomVideoFxRenderContext::inputBuddyVideoFrameColorPrimaries
NvsVideoFrameColorPrimaries inputBuddyVideoFrameColorPrimaries
Definition: NvsCustomVideoFx.h:34
NvsCustomVideoFxVideoFrame
Definition: NvsCustomVideoFx.h:18
NvsCustomVideoFxRenderContext::effectTime
int64_t effectTime
特效时间(单位微秒)
Definition: NvsCustomVideoFx.h:36
NvsCustomVideoFxRenderContext::inputBuddyVideoFrameColorTransfer
NvsVideoFrameColorTransfer inputBuddyVideoFrameColorTransfer
Definition: NvsCustomVideoFx.h:33
NvsSize
尺寸
Definition: NvsCommonDef.h:361
NvsVideoFrameInfoExt
视频帧扩展信息
Definition: NvsCommonDef.h:492