- 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_HIGH)
+ 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_OFF)
@@ -837,7 +839,53 @@ &nb
Discussion
- sampleBuffer 为采集到的音频数据
+ sampleBuffer 为采集到的音频数据
与pcmProcessingCallback两者只能二选一, 设置 audioProcessingCallback 会清空pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYAUAudioCapture.h
+
+
+
+
+
+
+
+ pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ 采集数据输出回调函数
+
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ pData 和 len 为采集数据和长度 (目前只支持单声道, 只有pData[0]为有效数据指针 )
与audioProcessingCallback两者只能二选一, 设置 pcmProcessingCallback 会清空audioProcessingCallback
diff --git a/doc/docset/Contents/Resources/Documents/Classes/KSYAudioMixer.html b/doc/docset/Contents/Resources/Documents/Classes/KSYAudioMixer.html
index 52fb6f8..4da9c32 100644
--- a/doc/docset/Contents/Resources/Documents/Classes/KSYAudioMixer.html
+++ b/doc/docset/Contents/Resources/Documents/Classes/KSYAudioMixer.html
@@ -66,6 +66,8 @@
+
+
@@ -590,12 +592,12 @@ Parameters
pData
- 原始数据
+ 原始数据指针数组,单通道仅pData[0]有效 当输入为多通道且非交织时, pData[i]分别表示各个通道的数据
len
- 数据的长度,单位为字节
+ 数据的长度,单位为sample (bytes / sizeof(sample))
@@ -675,7 +677,53 @@ &nb
Discussion
- sampleBuffer 混音后的音频数据
请注意本函数的执行时间,如果太长可能导致不可预知的问题
请参考 CMSampleBufferRef
+ sampleBuffer 混音后的音频数据
请注意本函数的执行时间,如果太长可能导致不可预知的问题
请参考 CMSampleBufferRef
与pcmProcessingCallback两者只能二选一, 设置 audioProcessingCallback 会清空 pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYAudioMixer.h
+
+
+
+
+
+
+
+ pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ 音频处理回调接口
+
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int nbSample , CMTime pts ) pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ pData 为数据指针 (双通道时, 数据为交织格式), 仅pData[0] 有效
nbSample 为数据长度, 单位为sample (bytes / sizeof(sample)/channels)
请注意本函数的执行时间,如果太长可能导致不可预知的问题
与audioProcessingCallback两者只能二选一, 设置 pcmProcessingCallback 会清空audioProcessingCallback
@@ -767,7 +815,7 @@ bStereo
Discussion
- 如果输入数据都不是双声道则输出数据左右耳内容一样
+ 如果输入数据都不是双声道则输出数据左右耳内容一样
输出立体声的数据格式一定是交织的
@@ -893,11 +941,6 @@ outFm
-
- Discussion
- 暂时为固定一种格式 (44.1KHz, S16)
-
-
diff --git a/doc/docset/Contents/Resources/Documents/Classes/KSYGPUBrushStreamerKit.html b/doc/docset/Contents/Resources/Documents/Classes/KSYGPUBrushStreamerKit.html
index cfbdbea..fc0946b 100644
--- a/doc/docset/Contents/Resources/Documents/Classes/KSYGPUBrushStreamerKit.html
+++ b/doc/docset/Contents/Resources/Documents/Classes/KSYGPUBrushStreamerKit.html
@@ -68,8 +68,6 @@
@@ -217,7 +215,7 @@ drawPic
- @property (nonatomic, readwrite) GPUImagePicture *drawPic
+ @property (nonatomic, readwrite) GPUImageUIElement *drawPic
@@ -238,47 +236,6 @@ Discussion
-
- Declared In
- KSYGPUBrushStreamerKit.h
-
-
-
-
-
-
-
- – addDrawLayer:
-
-
-
-
-
-
-
-
-
- 添加画笔图层
-
-
-
-
- - (void)addDrawLayer:(UIImage *)img
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Declared In
KSYGPUBrushStreamerKit.h
diff --git a/doc/docset/Contents/Resources/Documents/Classes/KSYGPUStreamerKit.html b/doc/docset/Contents/Resources/Documents/Classes/KSYGPUStreamerKit.html
index 1908345..93cd0ea 100644
--- a/doc/docset/Contents/Resources/Documents/Classes/KSYGPUStreamerKit.html
+++ b/doc/docset/Contents/Resources/Documents/Classes/KSYGPUStreamerKit.html
@@ -66,6 +66,8 @@
+
+
@@ -112,6 +114,8 @@
+
+
@@ -192,6 +196,8 @@
+
+
@@ -2600,7 +2606,117 @@ &nb
Discussion
- sampleBuffer 原始采集到的音频数据
对sampleBuffer内的pcm数据的修改将传递到观众端
请注意本函数的执行时间,如果太长可能导致不可预知的问题
请参考 CMSampleBufferRef
+ sampleBuffer 原始采集到的音频数据
对sampleBuffer内的pcm数据的修改将传递到观众端
请注意本函数的执行时间,如果太长可能导致不可预知的问题
当audioDataType 为KSYAudioData_CMSampleBuffer时才会被触发回调
请参考 CMSampleBufferRef
+
+
+
+
+
+
+
+ See Also
+
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYGPUStreamerKit.h
+
+
+
+
+
+
+
+ pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ 音频处理回调接口
+
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ pData len为原始采集到的音频数据
当audioDataType 为KSYAudioData_RawPCM时才会被触发回调
请注意本函数的执行时间,如果太长可能导致不可预知的问题
+
+
+
+
+
+
+
+ See Also
+
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYGPUStreamerKit.h
+
+
+
+
+
+
+
+ audioDataType
+
+
+
+
+
+
+
+
+
+ 音频处理通路数据类型 (默认为 KSYAudioData_CMSampleBuffer)
+
+
+
+
+ @property (nonatomic, assign) KSYAudioDataType audioDataType
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ 音频数据转为 CMSampleBuffer时有格式开销, 使用RawPCM资源消耗会少一些
内部组件对KSYAudioData_RawPCM可能不完善, 目前仅保证基本通路能工作
@@ -3073,6 +3189,59 @@ Discussion
+
+ Declared In
+ KSYGPUStreamerKit.h
+
+
+
+
+
+
+
+ – setLogoOrientaion:
+
+
+
+
+
+
+
+
+
+ 设置水印图片的朝向
+
+
+
+
+ - (void)setLogoOrientaion:(UIImageOrientation)orien
+
+
+
+
+ Parameters
+
+
+
+ orien
+ 图片的朝向
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Declared In
KSYGPUStreamerKit.h
diff --git a/doc/docset/Contents/Resources/Documents/Classes/KSYStreamerBase.html b/doc/docset/Contents/Resources/Documents/Classes/KSYStreamerBase.html
index 810480f..43f6ea1 100644
--- a/doc/docset/Contents/Resources/Documents/Classes/KSYStreamerBase.html
+++ b/doc/docset/Contents/Resources/Documents/Classes/KSYStreamerBase.html
@@ -94,6 +94,8 @@
+
+
@@ -182,6 +184,8 @@
+
+
@@ -2302,7 +2306,69 @@ Parameters
Discussion
- 应当在开始推流前定期调用此接口,与processVideoSampleBuffer 交错进行
Warning: 目前只支持 单通道 S16 格式的PCM数据
+ 应当在开始推流前定期调用此接口,与processVideoSampleBuffer 交错进行
Warning: 目前只支持 S16 格式的PCM数据
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYStreamerBase.h
+
+
+
+
+
+
+
+ – processAudioData:nbSample:withFormat:timeinfo:
+
+
+
+
+
+
+
+
+
+ 处理一段音频数据
+
+
+
+
+ - (void)processAudioData:(uint8_t **)pData nbSample:(int)len withFormat:(const AudioStreamBasicDescription *)fmt timeinfo:(CMTime *)pts
+
+
+
+
+ Parameters
+
+
+
+ pData
+ 原始数据指针数组
+
+
+
+ len
+ 数据的长度,单位为字节
+
+
+
+ fmt
+ 原始数据的格式 (必须保证一次推流过程中数据格式不变)
+
+
+
+ pts
+ 原始数据的时间戳
+
+
+
@@ -2311,6 +2377,12 @@ Discussion
+
+
+
+
+
+
Declared In
KSYStreamerBase.h
@@ -2412,6 +2484,53 @@ client
+
+ Declared In
+ KSYStreamerBase.h
+
+
+
+
+
+
+
+ expireDate
+
+
+
+
+
+
+
+
+
+ 获取当前SDK过期时间
+
+
+
+
+ @property (nonatomic, assign) NSDate *expireDate
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ 为nil时,可以永久使用不会过期
+@warnning sdk自行解析得到, 外部赋值无效
+
+
+
+
+
+
+
+
Declared In
KSYStreamerBase.h
diff --git a/doc/docset/Contents/Resources/Tokens2.xml b/doc/docset/Contents/Resources/Tokens2.xml
index 30af696..db54d2e 100644
--- a/doc/docset/Contents/Resources/Tokens2.xml
+++ b/doc/docset/Contents/Resources/Tokens2.xml
@@ -163,7 +163,7 @@
//apple_ref/occ/instm/KSYAUAudioCapture/setNoiseSuppressionLevel:
- 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_HIGH)
+ 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_OFF)
KSYAUAudioCapture.h
@property (nonatomic, assign) KSYAudioNoiseSuppress noiseSuppressionLevel
@@ -175,7 +175,7 @@
//apple_ref/occ/instm/KSYAUAudioCapture/noiseSuppressionLevel
- 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_HIGH)
+ 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_OFF)
KSYAUAudioCapture.h
@property (nonatomic, assign) KSYAudioNoiseSuppress noiseSuppressionLevel
@@ -187,7 +187,7 @@
//apple_ref/occ/instp/KSYAUAudioCapture/noiseSuppressionLevel
- 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_HIGH)
+ 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_OFF)
KSYAUAudioCapture.h
@property (nonatomic, assign) KSYAudioNoiseSuppress noiseSuppressionLevel
@@ -413,6 +413,42 @@
+
+ //apple_ref/occ/instm/KSYAUAudioCapture/setPcmProcessingCallback:
+ 采集数据输出回调函数
+ KSYAUAudioCapture.h
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
+
+ //apple_ref/occ/instm/KSYAUAudioCapture/pcmProcessingCallback
+ 采集数据输出回调函数
+ KSYAUAudioCapture.h
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
+
+ //apple_ref/occ/instp/KSYAUAudioCapture/pcmProcessingCallback
+ 采集数据输出回调函数
+ KSYAUAudioCapture.h
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
//apple_ref/occ/instm/KSYAUAudioCapture/setCustomPlayCallback:
用户可以自定义播放的内容,直接把数据填入ioData
diff --git a/doc/docset/Contents/Resources/Tokens21.xml b/doc/docset/Contents/Resources/Tokens21.xml
index 19e2ce8..5bcfd30 100644
--- a/doc/docset/Contents/Resources/Tokens21.xml
+++ b/doc/docset/Contents/Resources/Tokens21.xml
@@ -89,7 +89,7 @@
绘制的图片
KSYGPUBrushStreamerKit.h
- @property (nonatomic, readwrite) GPUImagePicture *drawPic
+ @property (nonatomic, readwrite) GPUImageUIElement *drawPic
//api/name/drawPic
@@ -101,7 +101,7 @@
绘制的图片
KSYGPUBrushStreamerKit.h
- @property (nonatomic, readwrite) GPUImagePicture *drawPic
+ @property (nonatomic, readwrite) GPUImageUIElement *drawPic
//api/name/drawPic
@@ -113,25 +113,13 @@
绘制的图片
KSYGPUBrushStreamerKit.h
- @property (nonatomic, readwrite) GPUImagePicture *drawPic
+ @property (nonatomic, readwrite) GPUImageUIElement *drawPic
//api/name/drawPic
-
- //apple_ref/occ/instm/KSYGPUBrushStreamerKit/addDrawLayer:
- 添加画笔图层
- KSYGPUBrushStreamerKit.h
-
- - (void)addDrawLayer:(UIImage *)img
-
-
- //api/name/addDrawLayer:
-
-
-
//apple_ref/occ/instm/KSYGPUBrushStreamerKit/removeDrawLayer
去掉画笔图层
diff --git a/doc/docset/Contents/Resources/Tokens29.xml b/doc/docset/Contents/Resources/Tokens29.xml
index b80043d..887516d 100644
--- a/doc/docset/Contents/Resources/Tokens29.xml
+++ b/doc/docset/Contents/Resources/Tokens29.xml
@@ -1423,6 +1423,11 @@
音频处理回调接口
KSYGPUStreamerKit.h
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/audioDataType
+
+
+
@property (nonatomic, copy) void ( ^ ) ( CMSampleBufferRef sampleBuffer ) audioProcessingCallback
@@ -1435,6 +1440,11 @@
音频处理回调接口
KSYGPUStreamerKit.h
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/audioDataType
+
+
+
@property (nonatomic, copy) void ( ^ ) ( CMSampleBufferRef sampleBuffer ) audioProcessingCallback
@@ -1447,6 +1457,11 @@
音频处理回调接口
KSYGPUStreamerKit.h
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/audioDataType
+
+
+
@property (nonatomic, copy) void ( ^ ) ( CMSampleBufferRef sampleBuffer ) audioProcessingCallback
@@ -1454,6 +1469,93 @@
+
+ //apple_ref/occ/instm/KSYGPUStreamerKit/setPcmProcessingCallback:
+ 音频处理回调接口
+ KSYGPUStreamerKit.h
+
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/audioDataType
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
+
+ //apple_ref/occ/instm/KSYGPUStreamerKit/pcmProcessingCallback
+ 音频处理回调接口
+ KSYGPUStreamerKit.h
+
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/audioDataType
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/pcmProcessingCallback
+ 音频处理回调接口
+ KSYGPUStreamerKit.h
+
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/audioDataType
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
+
+ //apple_ref/occ/instm/KSYGPUStreamerKit/setAudioDataType:
+ 音频处理通路数据类型 (默认为 KSYAudioData_CMSampleBuffer)
+ KSYGPUStreamerKit.h
+
+ @property (nonatomic, assign) KSYAudioDataType audioDataType
+
+
+ //api/name/audioDataType
+
+
+
+
+ //apple_ref/occ/instm/KSYGPUStreamerKit/audioDataType
+ 音频处理通路数据类型 (默认为 KSYAudioData_CMSampleBuffer)
+ KSYGPUStreamerKit.h
+
+ @property (nonatomic, assign) KSYAudioDataType audioDataType
+
+
+ //api/name/audioDataType
+
+
+
+
+ //apple_ref/occ/instp/KSYGPUStreamerKit/audioDataType
+ 音频处理通路数据类型 (默认为 KSYAudioData_CMSampleBuffer)
+ KSYGPUStreamerKit.h
+
+ @property (nonatomic, assign) KSYAudioDataType audioDataType
+
+
+ //api/name/audioDataType
+
+
+
//apple_ref/occ/instm/KSYGPUStreamerKit/setInterruptCallback:
摄像头采集被打断的消息通知
@@ -1752,6 +1854,23 @@
+
+ //apple_ref/occ/instm/KSYGPUStreamerKit/setLogoOrientaion:
+ 设置水印图片的朝向
+ KSYGPUStreamerKit.h
+
+ - (void)setLogoOrientaion:(UIImageOrientation)orien
+
+
+ orien
+ 图片的朝向
+
+
+
+ //api/name/setLogoOrientaion:
+
+
+
//apple_ref/occ/instm/KSYGPUStreamerKit/setTextPic:
文字内容的图片
diff --git a/doc/docset/Contents/Resources/Tokens42.xml b/doc/docset/Contents/Resources/Tokens42.xml
index a136d7c..29c4de1 100644
--- a/doc/docset/Contents/Resources/Tokens42.xml
+++ b/doc/docset/Contents/Resources/Tokens42.xml
@@ -1304,6 +1304,32 @@
+
+ //apple_ref/occ/instm/KSYStreamerBase/processAudioData:nbSample:withFormat:timeinfo:
+ 处理一段音频数据
+ KSYStreamerBase.h
+
+ - (void)processAudioData:(uint8_t **)pData nbSample:(int)len withFormat:(const AudioStreamBasicDescription *)fmt timeinfo:(CMTime *)pts
+
+
+ pData
+ 原始数据指针数组
+
+ len
+ 数据的长度,单位为字节
+
+ fmt
+ 原始数据的格式 (必须保证一次推流过程中数据格式不变)
+
+ pts
+ 原始数据的时间戳
+
+
+
+ //api/name/processAudioData:nbSample:withFormat:timeinfo:
+
+
+
//apple_ref/occ/instm/KSYStreamerBase/processMessageData:
处理一个消息
@@ -1360,6 +1386,42 @@
+
+ //apple_ref/occ/instm/KSYStreamerBase/setExpireDate:
+ 获取当前SDK过期时间
+ KSYStreamerBase.h
+
+ @property (nonatomic, assign) NSDate *expireDate
+
+
+ //api/name/expireDate
+
+
+
+
+ //apple_ref/occ/instm/KSYStreamerBase/expireDate
+ 获取当前SDK过期时间
+ KSYStreamerBase.h
+
+ @property (nonatomic, assign) NSDate *expireDate
+
+
+ //api/name/expireDate
+
+
+
+
+ //apple_ref/occ/instp/KSYStreamerBase/expireDate
+ 获取当前SDK过期时间
+ KSYStreamerBase.h
+
+ @property (nonatomic, assign) NSDate *expireDate
+
+
+ //api/name/expireDate
+
+
+
//apple_ref/occ/instm/KSYStreamerBase/setStreamID:
查询当前推流的事件ID
diff --git a/doc/docset/Contents/Resources/Tokens8.xml b/doc/docset/Contents/Resources/Tokens8.xml
index 26137b3..88c11d1 100644
--- a/doc/docset/Contents/Resources/Tokens8.xml
+++ b/doc/docset/Contents/Resources/Tokens8.xml
@@ -151,10 +151,10 @@
pData
- 原始数据
+ 原始数据指针数组,单通道仅pData[0]有效 当输入为多通道且非交织时, pData[i]分别表示各个通道的数据
len
- 数据的长度,单位为字节
+ 数据的长度,单位为sample (bytes / sizeof(sample))
fmt
原始数据的格式
@@ -207,6 +207,42 @@
+
+ //apple_ref/occ/instm/KSYAudioMixer/setPcmProcessingCallback:
+ 音频处理回调接口
+ KSYAudioMixer.h
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int nbSample , CMTime pts ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
+
+ //apple_ref/occ/instm/KSYAudioMixer/pcmProcessingCallback
+ 音频处理回调接口
+ KSYAudioMixer.h
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int nbSample , CMTime pts ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
+
+ //apple_ref/occ/instp/KSYAudioMixer/pcmProcessingCallback
+ 音频处理回调接口
+ KSYAudioMixer.h
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int nbSample , CMTime pts ) pcmProcessingCallback
+
+
+ //api/name/pcmProcessingCallback
+
+
+
//apple_ref/occ/instm/KSYAudioMixer/setMainTrack:
主轨的trackId (默认为0)
diff --git a/doc/docset/Contents/Resources/docSet.dsidx b/doc/docset/Contents/Resources/docSet.dsidx
index df4ccff..48af3a7 100644
Binary files a/doc/docset/Contents/Resources/docSet.dsidx and b/doc/docset/Contents/Resources/docSet.dsidx differ
diff --git a/doc/docset/Contents/Resources/docSet.dsidx-shm b/doc/docset/Contents/Resources/docSet.dsidx-shm
index 651627a..508ff17 100644
Binary files a/doc/docset/Contents/Resources/docSet.dsidx-shm and b/doc/docset/Contents/Resources/docSet.dsidx-shm differ
diff --git a/doc/docset/Contents/Resources/docSet.dsidx-wal b/doc/docset/Contents/Resources/docSet.dsidx-wal
index b214650..982c213 100644
Binary files a/doc/docset/Contents/Resources/docSet.dsidx-wal and b/doc/docset/Contents/Resources/docSet.dsidx-wal differ
diff --git a/doc/docset/Contents/Resources/docSet.skidx b/doc/docset/Contents/Resources/docSet.skidx
index 7950441..4455e95 100644
Binary files a/doc/docset/Contents/Resources/docSet.skidx and b/doc/docset/Contents/Resources/docSet.skidx differ
diff --git a/doc/docset/Contents/Resources/docSet.toc b/doc/docset/Contents/Resources/docSet.toc
index 1317ae2..8aafb7b 100644
Binary files a/doc/docset/Contents/Resources/docSet.toc and b/doc/docset/Contents/Resources/docSet.toc differ
diff --git a/doc/docset/Contents/Resources/docSet.tokencache b/doc/docset/Contents/Resources/docSet.tokencache
index 24c81d0..33c7289 100644
Binary files a/doc/docset/Contents/Resources/docSet.tokencache and b/doc/docset/Contents/Resources/docSet.tokencache differ
diff --git a/doc/html/Classes/KSYAUAudioCapture.html b/doc/html/Classes/KSYAUAudioCapture.html
index dd6c566..c1003e7 100644
--- a/doc/html/Classes/KSYAUAudioCapture.html
+++ b/doc/html/Classes/KSYAUAudioCapture.html
@@ -76,6 +76,8 @@
+
+
@@ -540,7 +542,7 @@  
- 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_HIGH)
+ 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_OFF)
@@ -837,7 +839,53 @@ &nb
Discussion
- sampleBuffer 为采集到的音频数据
+ sampleBuffer 为采集到的音频数据
与pcmProcessingCallback两者只能二选一, 设置 audioProcessingCallback 会清空pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYAUAudioCapture.h
+
+
+
+
+
+
+
+ pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ 采集数据输出回调函数
+
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ pData 和 len 为采集数据和长度 (目前只支持单声道, 只有pData[0]为有效数据指针 )
与audioProcessingCallback两者只能二选一, 设置 pcmProcessingCallback 会清空audioProcessingCallback
diff --git a/doc/html/Classes/KSYAudioMixer.html b/doc/html/Classes/KSYAudioMixer.html
index 52fb6f8..4da9c32 100644
--- a/doc/html/Classes/KSYAudioMixer.html
+++ b/doc/html/Classes/KSYAudioMixer.html
@@ -66,6 +66,8 @@
+
+
@@ -590,12 +592,12 @@ Parameters
pData
- 原始数据
+ 原始数据指针数组,单通道仅pData[0]有效 当输入为多通道且非交织时, pData[i]分别表示各个通道的数据
len
- 数据的长度,单位为字节
+ 数据的长度,单位为sample (bytes / sizeof(sample))
@@ -675,7 +677,53 @@ &nb
Discussion
- sampleBuffer 混音后的音频数据
请注意本函数的执行时间,如果太长可能导致不可预知的问题
请参考 CMSampleBufferRef
+ sampleBuffer 混音后的音频数据
请注意本函数的执行时间,如果太长可能导致不可预知的问题
请参考 CMSampleBufferRef
与pcmProcessingCallback两者只能二选一, 设置 audioProcessingCallback 会清空 pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYAudioMixer.h
+
+
+
+
+
+
+
+ pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ 音频处理回调接口
+
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int nbSample , CMTime pts ) pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ pData 为数据指针 (双通道时, 数据为交织格式), 仅pData[0] 有效
nbSample 为数据长度, 单位为sample (bytes / sizeof(sample)/channels)
请注意本函数的执行时间,如果太长可能导致不可预知的问题
与audioProcessingCallback两者只能二选一, 设置 pcmProcessingCallback 会清空audioProcessingCallback
@@ -767,7 +815,7 @@ bStereo
Discussion
- 如果输入数据都不是双声道则输出数据左右耳内容一样
+ 如果输入数据都不是双声道则输出数据左右耳内容一样
输出立体声的数据格式一定是交织的
@@ -893,11 +941,6 @@ outFm
-
- Discussion
- 暂时为固定一种格式 (44.1KHz, S16)
-
-
diff --git a/doc/html/Classes/KSYGPUBrushStreamerKit.html b/doc/html/Classes/KSYGPUBrushStreamerKit.html
index cfbdbea..fc0946b 100644
--- a/doc/html/Classes/KSYGPUBrushStreamerKit.html
+++ b/doc/html/Classes/KSYGPUBrushStreamerKit.html
@@ -68,8 +68,6 @@
@@ -217,7 +215,7 @@ drawPic
- @property (nonatomic, readwrite) GPUImagePicture *drawPic
+ @property (nonatomic, readwrite) GPUImageUIElement *drawPic
@@ -238,47 +236,6 @@ Discussion
-
- Declared In
- KSYGPUBrushStreamerKit.h
-
-
-
-
-
-
-
- – addDrawLayer:
-
-
-
-
-
-
-
-
-
- 添加画笔图层
-
-
-
-
- - (void)addDrawLayer:(UIImage *)img
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Declared In
KSYGPUBrushStreamerKit.h
diff --git a/doc/html/Classes/KSYGPUStreamerKit.html b/doc/html/Classes/KSYGPUStreamerKit.html
index 1908345..93cd0ea 100644
--- a/doc/html/Classes/KSYGPUStreamerKit.html
+++ b/doc/html/Classes/KSYGPUStreamerKit.html
@@ -66,6 +66,8 @@
+
+
@@ -112,6 +114,8 @@
+
+
@@ -192,6 +196,8 @@
+
+
@@ -2600,7 +2606,117 @@ &nb
Discussion
- sampleBuffer 原始采集到的音频数据
对sampleBuffer内的pcm数据的修改将传递到观众端
请注意本函数的执行时间,如果太长可能导致不可预知的问题
请参考 CMSampleBufferRef
+ sampleBuffer 原始采集到的音频数据
对sampleBuffer内的pcm数据的修改将传递到观众端
请注意本函数的执行时间,如果太长可能导致不可预知的问题
当audioDataType 为KSYAudioData_CMSampleBuffer时才会被触发回调
请参考 CMSampleBufferRef
+
+
+
+
+
+
+
+ See Also
+
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYGPUStreamerKit.h
+
+
+
+
+
+
+
+ pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+ 音频处理回调接口
+
+
+
+
+ @property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int len , const AudioStreamBasicDescription *fmt , CMTime timeInfo ) pcmProcessingCallback
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ pData len为原始采集到的音频数据
当audioDataType 为KSYAudioData_RawPCM时才会被触发回调
请注意本函数的执行时间,如果太长可能导致不可预知的问题
+
+
+
+
+
+
+
+ See Also
+
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYGPUStreamerKit.h
+
+
+
+
+
+
+
+ audioDataType
+
+
+
+
+
+
+
+
+
+ 音频处理通路数据类型 (默认为 KSYAudioData_CMSampleBuffer)
+
+
+
+
+ @property (nonatomic, assign) KSYAudioDataType audioDataType
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ 音频数据转为 CMSampleBuffer时有格式开销, 使用RawPCM资源消耗会少一些
内部组件对KSYAudioData_RawPCM可能不完善, 目前仅保证基本通路能工作
@@ -3073,6 +3189,59 @@ Discussion
+
+ Declared In
+ KSYGPUStreamerKit.h
+
+
+
+
+
+
+
+ – setLogoOrientaion:
+
+
+
+
+
+
+
+
+
+ 设置水印图片的朝向
+
+
+
+
+ - (void)setLogoOrientaion:(UIImageOrientation)orien
+
+
+
+
+ Parameters
+
+
+
+ orien
+ 图片的朝向
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Declared In
KSYGPUStreamerKit.h
diff --git a/doc/html/Classes/KSYStreamerBase.html b/doc/html/Classes/KSYStreamerBase.html
index 810480f..43f6ea1 100644
--- a/doc/html/Classes/KSYStreamerBase.html
+++ b/doc/html/Classes/KSYStreamerBase.html
@@ -94,6 +94,8 @@
+
+
@@ -182,6 +184,8 @@
+
+
@@ -2302,7 +2306,69 @@ Parameters
Discussion
- 应当在开始推流前定期调用此接口,与processVideoSampleBuffer 交错进行
Warning: 目前只支持 单通道 S16 格式的PCM数据
+ 应当在开始推流前定期调用此接口,与processVideoSampleBuffer 交错进行
Warning: 目前只支持 S16 格式的PCM数据
+
+
+
+
+
+
+
+
+
+ Declared In
+ KSYStreamerBase.h
+
+
+
+
+
+
+
+ – processAudioData:nbSample:withFormat:timeinfo:
+
+
+
+
+
+
+
+
+
+ 处理一段音频数据
+
+
+
+
+ - (void)processAudioData:(uint8_t **)pData nbSample:(int)len withFormat:(const AudioStreamBasicDescription *)fmt timeinfo:(CMTime *)pts
+
+
+
+
+ Parameters
+
+
+
+ pData
+ 原始数据指针数组
+
+
+
+ len
+ 数据的长度,单位为字节
+
+
+
+ fmt
+ 原始数据的格式 (必须保证一次推流过程中数据格式不变)
+
+
+
+ pts
+ 原始数据的时间戳
+
+
+
@@ -2311,6 +2377,12 @@ Discussion
+
+
+
+
+
+
Declared In
KSYStreamerBase.h
@@ -2412,6 +2484,53 @@ client
+
+ Declared In
+ KSYStreamerBase.h
+
+
+
+
+
+
+
+ expireDate
+
+
+
+
+
+
+
+
+
+ 获取当前SDK过期时间
+
+
+
+
+ @property (nonatomic, assign) NSDate *expireDate
+
+
+
+
+
+
+
+
+
+
+ Discussion
+ 为nil时,可以永久使用不会过期
+@warnning sdk自行解析得到, 外部赋值无效
+
+
+
+
+
+
+
+
Declared In
KSYStreamerBase.h
diff --git a/libksygpulive.podspec b/libksygpulive.podspec
index 2cd6c17..77342e5 100644
--- a/libksygpulive.podspec
+++ b/libksygpulive.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'libksygpulive'
- s.version = '2.6.0'
+ s.version = '2.6.1'
s.license = {
:type => 'Proprietary',
:text => <<-LICENSE
diff --git a/prebuilt/include/KSYPlayer/KSYNetTracker.h b/prebuilt/include/KSYPlayer/KSYNetTracker.h
index a53d03b..fe8fbf5 100644
--- a/prebuilt/include/KSYPlayer/KSYNetTracker.h
+++ b/prebuilt/include/KSYPlayer/KSYNetTracker.h
@@ -8,9 +8,9 @@
#import
-FOUNDATION_EXPORT NSString * const KSYNetTrackerOnceDoneNotification;
-FOUNDATION_EXPORT NSString * const KSYNetTrackerFinishedNotification;
-FOUNDATION_EXPORT NSString * const KSYNetTrackerErrorNotification;
+FOUNDATION_EXPORT NSString * _Nonnull const KSYNetTrackerOnceDoneNotification;
+FOUNDATION_EXPORT NSString * _Nonnull const KSYNetTrackerFinishedNotification;
+FOUNDATION_EXPORT NSString * _Nonnull const KSYNetTrackerErrorNotification;
/**
* 探测方式
@@ -31,7 +31,7 @@ typedef NS_ENUM(NSInteger, KSY_NETTRACKER_ACTION){
@abstract 链路上每个节点的ip地址
@discussion 如果每个探测报文对应的路径不同,则每一跳上会存在多个不同ip
*/
-@property (nonatomic, readonly) NSMutableArray *ips;
+@property (nonatomic, readonly) NSMutableArray * _Nullable ips;
/**
@abstract 所有探测报文的rtt最大值
@@ -122,6 +122,6 @@ typedef NS_ENUM(NSInteger, KSY_NETTRACKER_ACTION){
/**
@abstract 链路状况
*/
-@property (nonatomic, readonly) NSMutableArray *routerInfo;
+@property (nonatomic, readonly) NSMutableArray * _Nullable routerInfo;
@end
diff --git a/prebuilt/include/KSYStreamer/KSYAUAudioCapture.h b/prebuilt/include/KSYStreamer/KSYAUAudioCapture.h
index b20050f..44a24fe 100644
--- a/prebuilt/include/KSYStreamer/KSYAUAudioCapture.h
+++ b/prebuilt/include/KSYStreamer/KSYAUAudioCapture.h
@@ -98,7 +98,7 @@ typedef NS_ENUM(NSInteger, KSYAudioNoiseSuppress){
@property(nonatomic, assign) BOOL enableVoiceProcess;
/**
- @abstract 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_HIGH)
+ @abstract 噪声抑制处理的等级(默认为KSYAudioNoiseSuppress_OFF)
@discussion 当启用噪声抑制处理后, 内部会进行输出音频数据的
*/
@property(nonatomic, assign) KSYAudioNoiseSuppress noiseSuppressionLevel;
@@ -140,9 +140,17 @@ typedef NS_ENUM(NSInteger, KSYAudioNoiseSuppress){
/**
@abstract 采集数据输出回调函数
@discussion sampleBuffer 为采集到的音频数据
+ @discussion 与pcmProcessingCallback两者只能二选一, 设置 audioProcessingCallback 会清空pcmProcessingCallback
*/
@property(nonatomic, copy) void(^audioProcessingCallback)(CMSampleBufferRef sampleBuffer);
+/**
+ @abstract 采集数据输出回调函数
+ @discussion pData 和 len 为采集数据和长度 (目前只支持单声道, 只有pData[0]为有效数据指针 )
+ @discussion 与audioProcessingCallback两者只能二选一, 设置 pcmProcessingCallback 会清空audioProcessingCallback
+ */
+@property(nonatomic, copy) void(^pcmProcessingCallback)(uint8_t** pData, int len, const AudioStreamBasicDescription* fmt, CMTime timeInfo);
+
/**
@abstract 用户可以自定义播放的内容,直接把数据填入ioData
@discussion ioData 目前只支持int16 的单声道数据
diff --git a/prebuilt/include/KSYStreamer/KSYAudioMixer.h b/prebuilt/include/KSYStreamer/KSYAudioMixer.h
index b5faba4..754b3ee 100644
--- a/prebuilt/include/KSYStreamer/KSYAudioMixer.h
+++ b/prebuilt/include/KSYStreamer/KSYAudioMixer.h
@@ -79,8 +79,8 @@
/**
@abstract 输入音频PCM
- @param pData 原始数据
- @param len 数据的长度,单位为字节
+ @param pData 原始数据指针数组,单通道仅pData[0]有效 当输入为多通道且非交织时, pData[i]分别表示各个通道的数据
+ @param len 数据的长度,单位为sample (bytes / sizeof(sample))
@param fmt 原始数据的格式
@param pts 原始数据的时间戳
@param trackId 设置对应track的
@@ -98,8 +98,17 @@
@discussion sampleBuffer 混音后的音频数据
@discussion 请注意本函数的执行时间,如果太长可能导致不可预知的问题
@discussion 请参考 CMSampleBufferRef
+ @discussion 与pcmProcessingCallback两者只能二选一, 设置 audioProcessingCallback 会清空 pcmProcessingCallback
*/
@property(nonatomic, copy) void(^audioProcessingCallback)(CMSampleBufferRef sampleBuffer);
+/**
+ @abstract 音频处理回调接口
+ @discussion pData 为数据指针 (双通道时, 数据为交织格式), 仅pData[0] 有效
+ @discussion nbSample 为数据长度, 单位为sample (bytes / sizeof(sample)/channels)
+ @discussion 请注意本函数的执行时间,如果太长可能导致不可预知的问题
+ @discussion 与audioProcessingCallback两者只能二选一, 设置 pcmProcessingCallback 会清空audioProcessingCallback
+ */
+@property(nonatomic, copy) void(^pcmProcessingCallback)(uint8_t** pData, int nbSample, CMTime pts);
/**
@abstract 主轨的trackId (默认为0)
@@ -110,6 +119,7 @@
/**
@abstract 输出音频是否为双声道立体声 (默认为NO)
@discussion 如果输入数据都不是双声道则输出数据左右耳内容一样
+ @discussion 输出立体声的数据格式一定是交织的
*/
@property(nonatomic, assign) BOOL bStereo;
@@ -124,7 +134,6 @@
@property (nonatomic, assign) int sampleRate;
/**
@abstract 混音后输出PCM的格式
- @discussion 暂时为固定一种格式 (44.1KHz, S16)
*/
@property (nonatomic, readonly) AudioStreamBasicDescription* outFmtDes;
diff --git a/prebuilt/include/KSYStreamer/KSYStreamerBase.h b/prebuilt/include/KSYStreamer/KSYStreamerBase.h
index fb3fa99..9d139f1 100644
--- a/prebuilt/include/KSYStreamer/KSYStreamerBase.h
+++ b/prebuilt/include/KSYStreamer/KSYStreamerBase.h
@@ -323,15 +323,26 @@ FOUNDATION_EXPORT NSString *const KSYNetStateEventNotification NS_AVAILABLE_IOS(
timeInfo:(CMTime)timeStamp
onComplete:(void (^)(BOOL))completion;
-
/**
@abstract 处理一段音频数据
@param sampleBuffer Buffer to process
@discussion 应当在开始推流前定期调用此接口,与processVideoSampleBuffer 交错进行
- @warning 目前只支持 单通道 S16 格式的PCM数据
+ @warning 目前只支持 S16 格式的PCM数据
*/
- (void)processAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer;
+/**
+ @abstract 处理一段音频数据
+ @param pData 原始数据指针数组
+ @param len 数据的长度,单位为字节
+ @param fmt 原始数据的格式 (必须保证一次推流过程中数据格式不变)
+ @param pts 原始数据的时间戳
+ */
+- (void)processAudioData:(uint8_t**)pData
+ nbSample:(int)len
+ withFormat:(const AudioStreamBasicDescription*)fmt
+ timeinfo:(CMTime*)pts;
+
/**
@abstract 处理一个消息
@param message message to process
@@ -347,6 +358,13 @@ FOUNDATION_EXPORT NSString *const KSYNetStateEventNotification NS_AVAILABLE_IOS(
*/
@property (nonatomic, assign) NSString *clientAk;
+/**
+ @abstract 获取当前SDK过期时间
+ @discussion 为nil时,可以永久使用不会过期
+ @warnning sdk自行解析得到, 外部赋值无效
+ */
+@property (nonatomic, assign) NSDate *expireDate;
+
/**
@abstract 查询当前推流的事件ID
@discussion md5(hostURL+timestamp) 对本次推流活动的标识
diff --git a/prebuilt/include/KSYStreamer/libksystreamerbase.h b/prebuilt/include/KSYStreamer/libksystreamerbase.h
index e818d5d..0d81bfd 100644
--- a/prebuilt/include/KSYStreamer/libksystreamerbase.h
+++ b/prebuilt/include/KSYStreamer/libksystreamerbase.h
@@ -14,5 +14,5 @@
#import "KSYMessage.h"
#import "KSYTranscoder.h"
-#define KSYSTREAMERBASE_VER 2.6.0
-#define KSYSTREAMERBASE_ID 19b2aea7b764ca6fbdcea013d5db0a34c84774aa
+#define KSYSTREAMERBASE_VER 2.6.1
+#define KSYSTREAMERBASE_ID a51488cc47fe3c1c43db96eb4912d5f3d2a3a340
diff --git a/releaseFramework/release-libKSYLive.sh b/releaseFramework/release-libKSYLive.sh
index 304a4f5..7fce9bf 100755
--- a/releaseFramework/release-libKSYLive.sh
+++ b/releaseFramework/release-libKSYLive.sh
@@ -86,7 +86,7 @@ function xDownload() {
ZIP_FILE=${DST_DIR}/${SUB_DIR}${FILE_NAME}.zip
if [ ! -d "${DST_DIR}/${FILE_NAME}.framework" ]; then
- echo "download ${FILE_NAME}.framework to ${DST_DIR}"
+ echo "download ${FILE_NAME}.framework(${IOS_URL}) to ${DST_DIR}"
curl ${IOS_URL} -o ${ZIP_FILE}
unzip -q ${ZIP_FILE} -d ${DST_DIR}/
rm ${ZIP_FILE}
diff --git a/resource/KSYGPUResource.bundle/0_hongrun2.png b/resource/KSYGPUResource.bundle/0_hongrun2.png
index 68b4b49..2441467 100644
Binary files a/resource/KSYGPUResource.bundle/0_hongrun2.png and b/resource/KSYGPUResource.bundle/0_hongrun2.png differ
diff --git a/resource/KSYGPUResource.bundle/0_pink.png b/resource/KSYGPUResource.bundle/0_pink.png
index 0646038..6514e86 100644
Binary files a/resource/KSYGPUResource.bundle/0_pink.png and b/resource/KSYGPUResource.bundle/0_pink.png differ
diff --git a/resource/KSYGPUResource.bundle/13_ziran.png b/resource/KSYGPUResource.bundle/13_ziran.png
index f6c01ad..a8d1b44 100644
Binary files a/resource/KSYGPUResource.bundle/13_ziran.png and b/resource/KSYGPUResource.bundle/13_ziran.png differ
diff --git a/source/KSYGPUBrushStreamerKit.h b/source/KSYGPUBrushStreamerKit.h
index 7a9bb3f..4b95591 100644
--- a/source/KSYGPUBrushStreamerKit.h
+++ b/source/KSYGPUBrushStreamerKit.h
@@ -1,8 +1,8 @@
//
-// KSYGPUPipStreamerKit.h
+// KSYGPUBrushStreamerKit.h
// KSYStreamer
//
-// Created by jaingdong on 28/12/16.
+// Created by jiangdong on 28/12/16.
// Copyright © 2016 ksyun. All rights reserved.
//
#import
@@ -28,12 +28,7 @@
@abstract 绘制的图片
@discussion 设置为nil为清除内容图片
*/
-@property (nonatomic, readwrite) GPUImagePicture *drawPic;
-
-/**
- @abstract 添加画笔图层
- */
-- (void) addDrawLayer:(UIImage*)img;
+@property (nonatomic, readwrite) GPUImageUIElement *drawPic;
/**
@abstract 去掉画笔图层
diff --git a/source/KSYGPUBrushStreamerKit.m b/source/KSYGPUBrushStreamerKit.m
index 6ddf19b..6622018 100644
--- a/source/KSYGPUBrushStreamerKit.m
+++ b/source/KSYGPUBrushStreamerKit.m
@@ -1,8 +1,8 @@
//
-// KSYGPUPipStreamerKit.m
+// KSYGPUBrushStreamerKit.m
// KSYStreamer
//
-// Created by jaingdong on 28/12/16.
+// Created by jiangdong on 28/12/16.
// Copyright © 2016 ksyun. All rights reserved.
//
#import "KSYGPUBrushStreamerKit.h"
@@ -28,14 +28,15 @@ - (void) setDrawPicRect:(CGRect)drawPicRect{
ofLayer:_drawLayer];
}
-// 添加图层到 vMixer 中
-- (void) addDrawPic:(GPUImageOutput*)pic ToMixerAt: (NSInteger)idx{
- if (pic == nil){
+@synthesize drawPic = _drawPic;
+-(void) setDrawPic:(GPUImageUIElement *)drawPic{
+ _drawPic = drawPic;
+ if (_drawPic == nil){
+ [self.vStreamMixer clearPicOfLayer:_drawLayer];
return;
}
- [pic removeAllTargets];
- [self.vStreamMixer clearPicOfLayer:idx];
- [pic addTarget:self.vStreamMixer atTextureLocation:idx];
+ [_drawPic removeAllTargets];
+ [_drawPic addTarget:self.vStreamMixer atTextureLocation:_drawLayer];
}
- (void)dealloc {
@@ -47,13 +48,4 @@ - (void)removeDrawLayer{
[self.vStreamMixer clearPicOfLayer:_drawLayer];
}
-/**
- @abstract 添加画笔图层
- */
-- (void) addDrawLayer:(UIImage*)img{
- _drawPic = [[GPUImagePicture alloc] initWithImage:img];
- [self addDrawPic:_drawPic ToMixerAt:_drawLayer];
- [_drawPic processImage];
-}
-
@end
diff --git a/source/KSYGPUPipStreamerKit.m b/source/KSYGPUPipStreamerKit.m
index 8a6dc87..ca71849 100644
--- a/source/KSYGPUPipStreamerKit.m
+++ b/source/KSYGPUPipStreamerKit.m
@@ -71,12 +71,13 @@ -(void) setLayerRect{
-(void)startPipWithPlayerUrl:( NSURL* _Nullable )playerUrl
bgPic:( NSURL* _Nullable )bgUrl
{
+ if (_player) {
+ [self stopPip];
+ }
+
if(playerUrl) {
[self.aMixer setTrack:_pipTrack enable:YES];
[self.aMixer setMixVolume:1 of:_pipTrack];
- if (_player) {
- [self stopPip];
- }
BOOL shouldUseHWCodec = YES;
BOOL shouldAutoplay = YES;
BOOL shouldMute = NO;
diff --git a/source/KSYGPUStreamerKit.h b/source/KSYGPUStreamerKit.h
index 53e1c16..bcbd882 100644
--- a/source/KSYGPUStreamerKit.h
+++ b/source/KSYGPUStreamerKit.h
@@ -403,10 +403,36 @@ FOUNDATION_EXPORT NSString *const KSYCaptureStateDidChangeNotification NS_AVAILA
@discussion sampleBuffer 原始采集到的音频数据
@discussion 对sampleBuffer内的pcm数据的修改将传递到观众端
@discussion 请注意本函数的执行时间,如果太长可能导致不可预知的问题
+ @discussion 当audioDataType 为KSYAudioData_CMSampleBuffer时才会被触发回调
@discussion 请参考 CMSampleBufferRef
+ @see audioDataType
*/
@property(nonatomic, copy) void(^audioProcessingCallback)(CMSampleBufferRef sampleBuffer);
+/**
+ @abstract 音频处理回调接口
+ @discussion pData len为原始采集到的音频数据
+ @discussion 当audioDataType 为KSYAudioData_RawPCM时才会被触发回调
+ @discussion 请注意本函数的执行时间,如果太长可能导致不可预知的问题
+ @see audioDataType
+ */
+@property(nonatomic, copy) void(^pcmProcessingCallback)(uint8_t** pData, int len, const AudioStreamBasicDescription* fmt, CMTime timeInfo);
+
+/** 音频通路数据类型 */
+typedef NS_ENUM(NSInteger, KSYAudioDataType){
+ /// 音频数据采用CMSampleBuffer传递
+ KSYAudioData_CMSampleBuffer,
+ /// 音频数据直接使用原始的PCM数据指针传递
+ KSYAudioData_RawPCM,
+};
+
+/**
+ @abstract 音频处理通路数据类型 (默认为 KSYAudioData_CMSampleBuffer)
+ @discussion 音频数据转为 CMSampleBuffer时有格式开销, 使用RawPCM资源消耗会少一些
+ @discussion 内部组件对KSYAudioData_RawPCM可能不完善, 目前仅保证基本通路能工作
+ */
+@property (nonatomic, assign) KSYAudioDataType audioDataType;
+
/**
@abstract 摄像头采集被打断的消息通知
@discussion bInterrupt 为YES, 表明被打断, 摄像头采集暂停
@@ -466,6 +492,13 @@ FOUNDATION_EXPORT NSString *const KSYCaptureStateDidChangeNotification NS_AVAILA
*/
@property (nonatomic, readwrite) GPUImagePicture *logoPic;
+/**
+ 设置水印图片的朝向
+
+ @param orien 图片的朝向
+ */
+- (void) setLogoOrientaion:(UIImageOrientation) orien;
+
/**
@abstract 文字内容的图片
@discussion 设置为nil为清除内容图片
diff --git a/source/KSYGPUStreamerKit.m b/source/KSYGPUStreamerKit.m
index ddedbc2..854b35a 100644
--- a/source/KSYGPUStreamerKit.m
+++ b/source/KSYGPUStreamerKit.m
@@ -80,6 +80,7 @@ - (instancetype) initInterrupt:(BOOL) bInter {
_interruptCallback = nil;
_gpuOutputPixelFormat = kCVPixelFormatType_32BGRA;
_capturePixelFormat = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
+ _audioDataType = KSYAudioData_CMSampleBuffer;
_autoRetryCnt = 0;
_maxAutoRetry = 0;
@@ -342,12 +343,25 @@ - (void) mixAudio:(CMSampleBufferRef)buf to:(int)idx{
- (void) setupAudioPath {
weakObj(self);
//1. 音频采集, 语音数据送入混音器
- _aCapDev.audioProcessingCallback = ^(CMSampleBufferRef buf){
- if ( selfWeak.audioProcessingCallback ){
- selfWeak.audioProcessingCallback(buf);
- }
- [selfWeak mixAudio:buf to:selfWeak.micTrack];
- };
+ if (_audioDataType == KSYAudioData_CMSampleBuffer) {
+ _aCapDev.audioProcessingCallback = ^(CMSampleBufferRef buf){
+ if ( selfWeak.audioProcessingCallback ){
+ selfWeak.audioProcessingCallback(buf);
+ }
+ [selfWeak mixAudio:buf to:selfWeak.micTrack];
+ };
+ }
+ else {
+ _aCapDev.pcmProcessingCallback = ^(uint8_t **pData, int len, const AudioStreamBasicDescription *fmt, CMTime timeInfo) {
+ if ( selfWeak.pcmProcessingCallback ){
+ selfWeak.pcmProcessingCallback(pData, len, fmt, timeInfo);
+ }
+ if (![selfWeak.streamerBase isStreaming]){
+ return;
+ }
+ [selfWeak.aMixer processAudioData:pData nbSample:len withFormat:fmt timeinfo:timeInfo of:selfWeak.micTrack];
+ };
+ }
//2. 背景音乐播放,音乐数据送入混音器
_bgmPlayer.audioDataBlock = ^ BOOL(uint8_t** pData, int len, const AudioStreamBasicDescription* fmt, CMTime pts){
if ([selfWeak.streamerBase isStreaming]) {
@@ -360,12 +374,25 @@ - (void) setupAudioPath {
return YES;
};
// 混音结果送入streamer
- _aMixer.audioProcessingCallback = ^(CMSampleBufferRef buf){
- if (![selfWeak.streamerBase isStreaming]){
- return;
- }
- [selfWeak.streamerBase processAudioSampleBuffer:buf];
- };
+ if (_audioDataType == KSYAudioData_CMSampleBuffer) {
+ _aMixer.audioProcessingCallback = ^(CMSampleBufferRef buf){
+ if (![selfWeak.streamerBase isStreaming]){
+ return;
+ }
+ [selfWeak.streamerBase processAudioSampleBuffer:buf];
+ };
+ }
+ else {
+ _aMixer.pcmProcessingCallback = ^(uint8_t **pData, int nbSample, CMTime pts) {
+ if (![selfWeak.streamerBase isStreaming]){
+ return;
+ }
+ [selfWeak.streamerBase processAudioData:pData
+ nbSample:nbSample
+ withFormat:selfWeak.aMixer.outFmtDes
+ timeinfo:&pts];
+ };
+ }
// mixer 的主通道为麦克风,时间戳以main通道为准
_aMixer.mainTrack = _micTrack;
[_aMixer setTrack:_micTrack enable:YES];
@@ -886,6 +913,22 @@ -(void) setLogoPic:(GPUImagePicture *)pic{
_logoPic = pic;
[self addPic:_logoPic ToMixerAt:_logoPicLayer];
}
+static GPUImageRotationMode KSYImage2GPURotate[] = {
+ kGPUImageNoRotation,// UIImageOrientationUp, // default orientation
+ kGPUImageRotate180,//UIImageOrientationDown, // 180 deg rotation
+ kGPUImageRotateLeft, //UIImageOrientationLeft, // 90 deg CCW
+ kGPUImageRotateRight,//UIImageOrientationRight, // 90 deg CW
+ kGPUImageFlipHorizonal,//UIImageOrientationUpMirrored, // as above but image mirrored along other axis. horizontal flip
+ kGPUImageFlipHorizonal,//UIImageOrientationDownMirrored, // horizontal flip
+ kGPUImageFlipVertical,//UIImageOrientationLeftMirrored, // vertical flip
+ kGPUImageRotateRightFlipVertical//UIImageOrientationRightMirrored, // vertical flip
+};
+- (void) setLogoOrientaion:(UIImageOrientation) orien{
+ [_vPreviewMixer setPicRotation:KSYImage2GPURotate[orien]
+ ofLayer:_logoPicLayer];
+ [_vStreamMixer setPicRotation:KSYImage2GPURotate[orien]
+ ofLayer:_logoPicLayer];
+}
@synthesize aePic = _aePic;
-(void) setAePic:(GPUImageUIElement *)aePic{
_aePic = aePic;
@@ -968,12 +1011,12 @@ - (void)setGpuOutputPixelFormat: (OSType) fmt {
if ([_streamerBase isStreaming]){
return;
}
- if( fmt != kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange ||
+ if( fmt != kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange &&
fmt != kCVPixelFormatType_420YpCbCr8Planar ){
fmt = kCVPixelFormatType_32BGRA;
}
_gpuOutputPixelFormat = fmt;
- _gpuToStr =[[KSYGPUPicOutput alloc] initWithOutFmt:_gpuOutputPixelFormat];
+ _gpuToStr =[[KSYGPUPicOutput alloc] initWithOutFmt:fmt];
[self setupVideoPath];
[self updateStrDimension:self.videoOrientation];
}
@@ -1073,7 +1116,7 @@ -(void)internalRotatePreviewTo: (UIInterfaceOrientation) orie
{
_previewOrientation = orie;
UIView* view = [_preview superview];
- if (UIInterfaceOrientationPortrait == orie || view == nil) {
+ if (_videoOrientation == orie || view == nil) {
for (UIView *v in _vPreviewMixer.targets) {
v.transform = CGAffineTransformIdentity;
}