KSYUIRecorderKit.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // KSYUIRecorderKit.h
  3. // playerRecorder
  4. //
  5. // Created by ksyun on 16/10/26.
  6. // Copyright © 2016年 ksyun. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <AVFoundation/AVFoundation.h>
  10. #import <UIKit/UIKit.h>
  11. #import <libksygpulive/libksygpulive.h>
  12. #define WeakObj(o) try{}@finally{} __weak typeof(o) o##Weak = o;
  13. /*!
  14. * @abstract 录制方案
  15. */
  16. typedef NS_ENUM(NSUInteger, KSYPlayRecordScheme) {
  17. /// UI+Video混合方案
  18. KSYPlayerRecord_PicMix_Scheme = 0,
  19. /// 截屏式方案
  20. KSYPlayerRecord_ScreenShot_Scheme,
  21. };
  22. @class KSYMoviePlayerController;
  23. @class KSYGPUYUVInput;
  24. @interface KSYUIRecorderKit : NSObject
  25. - (instancetype) initWithScheme:(KSYPlayRecordScheme)scheme;
  26. /* ui图层*/
  27. @property (nonatomic,readwrite) UIView* contentView;
  28. /* 视频输入*/
  29. -(void) processWithTextureId:(GLuint)InputTexture
  30. TextureSize:(CGSize)TextureSize
  31. Time:(CMTime)time;
  32. /* 音频输入*/
  33. -(void) processAudioSampleBuffer:(CMSampleBufferRef) buf;
  34. -(void) processVideoSampleBuffer:(CVPixelBufferRef)pixelBuffer timeInfo:(CMTime)timeStamp;
  35. /*开始录制*/
  36. -(void)startRecord:(NSURL*) path;
  37. /*停止录制*/
  38. -(void)stopRecord;
  39. /*是否开启录屏*/
  40. @property BOOL bPlayRecord;
  41. /*录制视频文件*/
  42. @property (nonatomic,readwrite) KSYMovieWriter* writer;
  43. @end