外置滤镜相关回调
More...
#include "AlivcLivePusher.h"
◆ onCreate:context:
通知外置滤镜创建回调
- Parameters
-
pusher | 推流引擎对象 |
context | 上下文环境 |
◆ onDestory:
◆ onProcess:texture:textureWidth:textureHeight:extra:
- (int) onProcess: |
|
(AlivcLivePusher *) |
pusher |
texture: |
|
(int) |
texture |
textureWidth: |
|
(int) |
width |
textureHeight: |
|
(int) |
height |
extra: |
|
(long) |
extra |
|
|
| |
|
required |
通知外置滤镜处理回调(纹理回调)
- Parameters
-
pusher | 推流引擎对象 |
texture | 纹理ID |
width | 图像宽 |
height | 图像高 |
extra | 额外信息 |
- Returns
- 返回处理后的纹理ID
- Note
- 互动模式下默认是回抛CVPixelBuffer用于美颜,如果想要回调纹理ID,需要设置enableLocalVideoTexture,设置后,互动模式会回抛纹理ID
◆ onProcessVideoSampleBuffer:sampleBuffer:
通知外置滤镜处理回调,当前版本SDK在互动模式下默认回抛CVPixelBuffer,需要使用onProcessVideoSampleBuffer处理美颜,如果想要回抛纹理ID,需要设置enableLocalVideoTexture
- Parameters
-
- Note
- 美颜SDK有两种处理方式:1.在SDK抛出的sampleBuffer.pixelBuffer上直接处理数据,不生成新的pixbuffer; 2.生成新的newPixelBuffer,在新的newPixelBuffer上处理美颜,这种情况需要将新生成的newPixelBuffer写会SDK,可以参考如下示例代码:
- (BOOL)onProcessVideoSampleBuffer:(AlivcLivePusher *)pusher sampleBuffer:(AlivcLiveVideoDataSample *)sampleBuffer{ CVPixelBufferRef newPixelBuffer = thirdparty_process(sampleBuffer.pixelBuffer); sampleBuffer.pixelBuffer = newPixelBuffer; return YES; }
- Returns
- YES: 需要写回SDK
- NO: 不需要写回SDK
- Note
- 此回调只在livePushMode为AlivcLivePushInteractiveMode,即只在直播SDK工作在互动模式下才回回调
The documentation for this protocol was generated from the following file: