KSYGPUPipStreamerKit.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // KSYGPUPipStreamerKit.h
  3. // KSYStreamer
  4. //
  5. // Created by jaingdong on 28/12/16.
  6. // Copyright © 2016 ksyun. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <AVFoundation/AVFoundation.h>
  10. #import <libksygpulive/KSYGPUStreamerKit.h>
  11. @interface KSYGPUPipStreamerKit : KSYGPUStreamerKit
  12. /**
  13. @abstract 画中画通道
  14. */
  15. @property (nonatomic, readonly) int pipTrack;
  16. /**
  17. @abstract 背景图片图层
  18. */
  19. @property (nonatomic, readonly) NSInteger bgPicLayer;
  20. /**
  21. @abstract 画中画图层
  22. */
  23. @property (nonatomic, readonly) NSInteger pipLayer;
  24. /**
  25. @abstract 开启画中画
  26. @param playerUrl:播放视频的url
  27. @param bgUrl:背景图片的url
  28. */
  29. -(void)startPipWithPlayerUrl:( NSURL* _Nullable )playerUrl
  30. bgPic:( NSURL* _Nullable )bgUrl;
  31. /**
  32. @abstract 停止画中画
  33. **/
  34. -(void)stopPip;
  35. /**
  36. @abstract 背景播放器
  37. */
  38. @property (nonatomic, readonly) KSYMoviePlayerController * _Nonnull player;
  39. /**
  40. @abstract 背景图片
  41. */
  42. @property (nonatomic, strong) GPUImagePicture * _Nullable bgPic;
  43. /**
  44. @abstract 画中画图像输入
  45. @discussion 用于衔接画中画播放器和图像混合器 (KSYPicPipLayer = 1)
  46. @discussion 主要用于将图像的原始数据上传到GPU
  47. */
  48. @property (nonatomic, readonly)KSYGPUPicInput * _Nonnull yuvInput;
  49. /**
  50. @abstract 背景图片的位置和大小
  51. @discussion 位置和大小的单位为预览视图的百分比, 左上角为(0,0), 右下角为(1.0, 1.0)
  52. @discussion 如果宽为0, 则根据图像的宽高比, 和设置的高度比例, 计算得到宽度的比例
  53. @discussion 如果高为0, 方法同上
  54. */
  55. @property (nonatomic, readwrite) CGRect bgPicRect;
  56. /**
  57. @abstract 画中画的位置和大小
  58. @discussion 位置和大小的单位为预览视图的百分比, 左上角为(0,0), 右下角为(1.0, 1.0)
  59. @discussion 如果宽为0, 则根据图像的宽高比, 和设置的高度比例, 计算得到宽度的比例
  60. @discussion 如果高为0, 方法同上
  61. */
  62. @property (nonatomic, readwrite) CGRect pipRect;
  63. /**
  64. @abstract 相机的位置和大小
  65. @discussion 位置和大小的单位为预览视图的百分比, 左上角为(0,0), 右下角为(1.0, 1.0)
  66. @discussion 如果宽为0, 则根据图像的宽高比, 和设置的高度比例, 计算得到宽度的比例
  67. @discussion 如果高为0, 方法同上
  68. */
  69. @property (nonatomic, readwrite) CGRect cameraRect;
  70. /**
  71. @abstract 获取状态对应的字符串
  72. @param stat 状态
  73. */
  74. - (NSString*_Nonnull) getPipStateName : (MPMoviePlaybackState) stat;
  75. /**
  76. @abstract 获取当前状态对应的字符串
  77. */
  78. - (NSString*_Nonnull) getCurPipStateName;
  79. /**
  80. @abstract  播放状态
  81. */
  82. @property (nonatomic, readonly) MPMoviePlaybackState PipState;
  83. @end