KSYGPUBrushStreamerKit.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // KSYGPUBrushStreamerKit.m
  3. // KSYStreamer
  4. //
  5. // Created by jiangdong on 28/12/16.
  6. // Copyright © 2016 ksyun. All rights reserved.
  7. //
  8. #import "KSYGPUBrushStreamerKit.h"
  9. @interface KSYGPUBrushStreamerKit ()
  10. @end
  11. @implementation KSYGPUBrushStreamerKit
  12. - (instancetype) initWithDefaultCfg {
  13. self = [super initWithDefaultCfg];
  14. _drawLayer = 5;
  15. _drawPic = nil;
  16. return self;
  17. }
  18. @synthesize drawPicRect = _drawPicRect;
  19. - (CGRect) drawPicRect {
  20. return [self.vStreamMixer getPicRectOfLayer:_drawLayer];
  21. }
  22. - (void) setDrawPicRect:(CGRect)drawPicRect{
  23. [self.vStreamMixer setPicRect:drawPicRect
  24. ofLayer:_drawLayer];
  25. }
  26. @synthesize drawPic = _drawPic;
  27. -(void) setDrawPic:(KSYGPUViewCapture *)drawPic{
  28. if (drawPic == nil && _drawPic){
  29. [_drawPic removeAllTargets];
  30. [self.vStreamMixer clearPicOfLayer:_drawLayer];
  31. [_drawPic stop];
  32. _drawPic = nil;
  33. return;
  34. }
  35. _drawPic = drawPic;
  36. [_drawPic removeAllTargets];
  37. [_drawPic addTarget:self.vStreamMixer atTextureLocation:_drawLayer];
  38. }
  39. - (void)dealloc {
  40. self.drawPic = nil;
  41. }
  42. @end