NIMSDK-AOS  9.16.0
Public 成员函数 | 所有成员列表
com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer类 参考abstract

继承该类,实现自定义外部视频数据输入 更多...

类 com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer 继承关系图:
com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturer

Public 成员函数

abstract void startCapture (int width, int height, int frameRate)
 开始预览 更多...
 
abstract void stopCapture () throws InterruptedException
 关闭预览 更多...
 
abstract void changeCaptureFormat (int width, int height, int frameRate)
 修改采集的参数 更多...
 
abstract void dispose ()
 销毁 更多...
 
IVideoCapturer asVideoCapturer ()
 
void onCapturerStarted (boolean success)
 外部调用,用于通知SDK外部是否已经成功开启视频数据提交 更多...
 
void onCapturerStopped ()
 外部调用,用于通知SDK外部已经停止视频数据提交 更多...
 
int onByteBufferFrameCaptured (byte[] data, int dataLen, int width, int height, int rotation, int frameRate, int format, long timeStamp, boolean mirror)
 外部调用,用于提交每一帧视频数据 更多...
 

详细描述

继承该类,实现自定义外部视频数据输入

在文件 AVChatExternalVideoCapturer.java24 行定义.

成员函数说明

◆ asVideoCapturer()

IVideoCapturer com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.asVideoCapturer ( )

◆ changeCaptureFormat()

abstract void com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.changeCaptureFormat ( int  width,
int  height,
int  frameRate 
)
abstract

修改采集的参数

参数
width采集宽
height采集高
frameRate采集分辨率

◆ dispose()

abstract void com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.dispose ( )
abstract

销毁

◆ onByteBufferFrameCaptured()

int com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.onByteBufferFrameCaptured ( byte []  data,
int  dataLen,
int  width,
int  height,
int  rotation,
int  frameRate,
int  format,
long  timeStamp,
boolean  mirror 
)

外部调用,用于提交每一帧视频数据

参数
data视频数据
dataLen视频数据宽度
width视频数据高度
height视频数据高度
rotation视频画面旋转角度,为90度倍数,以顺时针为正方向
frameRate输入的帧率,大于0,如果帧率过大,内部会做丢帧处理
format视频数据格式 AVChatImageFormat#I420AVChatImageFormat#NV21
timeStamp视频帧时间戳,以AVChatManager#enableRtc()创建时刻为开始的基准时间,使用SystemClock#elapsedRealtime()即可
mirror是否需要镜像,如果设置为
true
,在旋转之后进行
返回
视频帧数据是否提交成功,0成功,其他失败。

-1-数据为空或长度不合法;

-2-长宽不合法,如超过最大分辨率1920*1080或长宽和数据长度不匹配;

-3-旋转角度不合法;

-4-帧率不合法;

-5-数据格式不合法;

-10-其他错误;

在文件 AVChatExternalVideoCapturer.java107 行定义.

◆ onCapturerStarted()

void com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.onCapturerStarted ( boolean  success)

外部调用,用于通知SDK外部是否已经成功开启视频数据提交

参数
success是否成功开启

在文件 AVChatExternalVideoCapturer.java68 行定义.

◆ onCapturerStopped()

void com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.onCapturerStopped ( )

外部调用,用于通知SDK外部已经停止视频数据提交

在文件 AVChatExternalVideoCapturer.java79 行定义.

◆ startCapture()

abstract void com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.startCapture ( int  width,
int  height,
int  frameRate 
)
abstract

开始预览

参数
width采集宽
height采集高
frameRate采集分辨率

◆ stopCapture()

abstract void com.netease.nimlib.sdk.avchat.video.AVChatExternalVideoCapturer.stopCapture ( ) throws InterruptedException
abstract

关闭预览

异常
InterruptedException

该类的文档由以下文件生成: