#include <video_capture.h>
◆ AllocateAndStart()
virtual void AVE::VideoFilter::AllocateAndStart |
( |
Client * |
client | ) |
|
|
pure virtual |
初始化采集使用的资源,例如启动线程,保存SDK传递的回调
- Parameters
-
- Note
- SDK启动摄像头时调用,触发的时机包括StartPreview、SetFrontCam、StartPublish
-
接口调用顺序:1、VideoFilterFactory::Create 2、VideoFilter::AllocateAndStart
-
一定要实现
◆ GetInterface()
获取不同滤镜处理模型对应的接口
- Note
- VideoFilter::SupportBufferType返回BUFFER_TYPE_MEM时,GetInterface返回VideoBufferPool*,
-
VideoBufferPool::GetInputBuffer需要返回uint8_t*, 色彩空间windows、ios、mac为BGRA,android为RGBA,线程模型为异步
-
VideoFilter::SupportBufferType返回BUFFER_TYPE_ASYNC_PIXEL_BUFFER时,GetInterface返回VideoBufferPool*,
-
VideoBufferPool::GetInputBuffer需要返回CVPixelBufferRef, 色彩空间为BGRA,线程模型为异步
-
VideoFilter::SupportBufferType返回BUFFER_TYPE_SYNC_PIXEL_BUFFER时,GetInterface返回VideoFilterCallback*,
-
色彩空间为BGRA,线程模型为同步
-
VideoFilter::SupportBufferType返回BUFFER_TYPE_SURFACE_TEXTURE时,GetInterface返回VideoBufferPool*
-
VideoBufferPool::GetInputBuffer需要返回SurfaceTexture对应的jobject, 线程模型为异步
-
VideoFilter::SupportBufferType返回BUFFER_TYPE_HYBRID_MEM_GL_TEXTURE_2D时,GetInterface返回VideoBufferPool*
-
VideoBufferPool::GetInputBuffer需要返回uint8_t*, 色彩空间android为RGBA,线程模型为异步
-
VideoFilter::SupportBufferType返回BUFFER_TYPE_SYNC_GL_TEXTURE_2D时,GetInterface返回VideoFilterCallback*
-
VideoFilterCallback::OnProcess的入参buffer为纹理id转成的int*, 线程模型为同步
-
VideoFilter::SupportBufferType返回BUFFER_TYPE_ASYNC_I420_MEM时,GetInterface返回VideoBufferPool*,
-
VideoBufferPool::GetInputBuffer需要返回uint8_t*, 色彩空间为I420,线程模型为异步
-
VideoFilter::SupportBufferType返回BUFFER_TYPE_ASYNC_I420_PIXEL_BUFFER时,GetInterface返回VideoBufferPool*
-
VideoBufferPool::GetInputBuffer需要返回CVPixelBufferRef, 色彩空间为I420,线程模型为异步
◆ StopAndDeAllocate()
virtual void AVE::VideoFilter::StopAndDeAllocate |
( |
| ) |
|
|
pure virtual |
停止并且释放采集占用的资源,同时调用client的Destroy方法,这里的client指的是AllocateAndStart传递的client
- Note
- SDK停止使用摄像头时调用,如果是异步实现,实现者必须保证AllocateAndStart()和StopAndDeAllocate()在同一个线程执行
-
接口调用顺序:1、VideoFilter::StopAndDeAllocate 2、VideoFilterFactory::Destroy
-
一定要实现
◆ SupportBufferType()
获取滤镜处理类型,SDK会根据此类型,使用对应的接口传输数据
- Note
- SDK会在AllocateAndStart前先调用此接口实例化对应的client,再调用AllocateAndStart
-
一定要实现
The documentation for this class was generated from the following file: