FUVideoDecoder.h 856 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // FUVideoDecoder.h
  3. // FULiveDemo
  4. //
  5. // Created by 孙慕 on 2019/12/20.
  6. // Copyright © 2019 FaceUnity. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <CoreVideo/CoreVideo.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. typedef void(^videoDecoderCallBack)(CVPixelBufferRef pixelBuffer);
  12. @interface FUVideoDecoder : NSObject
  13. /// 初始化
  14. /// @param url 视频URL
  15. /// @param fps 回调的帧率
  16. /// @param repeat 是否重复播放
  17. /// @param callback 回调
  18. -(instancetype)initWithVideoDecodeUrl:(NSURL *)url fps:(int)fps repeat:(BOOL)repeat callback:(videoDecoderCallBack)callback;
  19. /* 开始解码 */
  20. -(void)videoStartReading;
  21. /* 结束解码,注意 解码需要调用该函数,类对象才会销毁 */
  22. -(void)videoStopRending;
  23. -(void)setupVideoDecoder:(NSURL *)url;
  24. /* 继续 */
  25. -(void)continueReading;
  26. @end
  27. NS_ASSUME_NONNULL_END