TXVideoCustomProcessDelegate.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // TXVideoCustomProcessDelegate.h
  3. // TXRTMPSDK
  4. //
  5. // Created by annidyfeng on 2017/3/20.
  6. //
  7. //
  8. #import <Foundation/Foundation.h>
  9. #if TARGET_OS_IPHONE
  10. #include <OpenGLES/ES2/gl.h>
  11. #include <OpenGLES/ES2/glext.h>
  12. #elif TARGET_OS_MAC
  13. #import <OpenGL/OpenGL.h>
  14. #import <OpenGL/gl.h>
  15. #endif
  16. @protocol TXVideoCustomProcessDelegate <NSObject>
  17. @optional
  18. #pragma mark - Pusher & UGC Record
  19. /**
  20. * 在OpenGL线程中回调,在这里可以进行采集图像的二次处理
  21. * @param texture 纹理ID
  22. * @param width 纹理的宽度
  23. * @param height 纹理的高度
  24. * @return 返回给SDK的纹理
  25. * 说明:SDK回调出来的纹理类型是GL_TEXTURE_2D,接口返回给SDK的纹理类型也必须是GL_TEXTURE_2D; 该回调在SDK美颜之后. 纹理格式为GL_RGBA
  26. */
  27. - (GLuint)onPreProcessTexture:(GLuint)texture width:(CGFloat)width height:(CGFloat)height;
  28. /**
  29. * 在OpenGL线程中回调,可以在这里释放创建的OpenGL资源
  30. */
  31. - (void)onTextureDestoryed;
  32. /**
  33. * 人脸数据回调(增值版且启用了pitu模块才有效)
  34. * @prama points 人脸坐标
  35. * 说明:开启pitu模块必须是打开动效或大眼瘦脸。此回调在onPreProcessTexture:width:height:之前
  36. */
  37. - (void)onDetectFacePoints:(NSArray *)points;
  38. #pragma mark - Player
  39. /**
  40. * 视频渲染对象回调
  41. * @param pixelBuffer 渲染图像
  42. * @return 返回YES则SDK不再显示;返回NO则SDK渲染模块继续渲染
  43. * 说明:渲染图像的数据类型为config中设置的renderPixelFormatType
  44. */
  45. - (BOOL)onPlayerPixelBuffer:(CVPixelBufferRef)pixelBuffer;
  46. @end