Skip to content

Commit

Permalink
update to v2.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ksvcci authored and Franken Zeng committed Jan 14, 2018
1 parent c81e203 commit 62a6e41
Show file tree
Hide file tree
Showing 118 changed files with 837 additions and 506 deletions.
4 changes: 2 additions & 2 deletions demo/KSYLiveDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.9.2</string>
<string>2.9.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.9.2.0</string>
<string>2.9.3.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
10 changes: 5 additions & 5 deletions demo/KSYLiveDemo/KSYDemoUI/KSYPresetCfgView.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (id) init {
self = [super init];
self.backgroundColor = [UIColor whiteColor];
// hostURL = rtmpSrv + streamName(随机数,避免多个demo推向同一个流
NSString *rtmpSrv = @"rtmp://test.uplive.ks-cdn.com/live";
NSString *rtmpSrv = @"rtmp://120.92.224.235/live";
NSString *devCode = [ [KSYUIView getUuid] substringToIndex:3];
NSString *url = [ NSString stringWithFormat:@"%@/%@", rtmpSrv, devCode];
_hostUrlUI = [self addTextField:url ];
Expand Down Expand Up @@ -229,7 +229,7 @@ - (void)getStreamerProfile:(KSYStreamerProfile)profile{
_videoCodecUI.selectedSegmentIndex = 0;
_videoKbpsUI.slider.value = 512;
_audioCodecUI.selectedSegmentIndex = 2;
_audioKbpsUI.selectedSegmentIndex = 3;
_audioKbpsUI.selectedSegmentIndex = 4;
_bwEstModeUI.selectedSegmentIndex = 0;
break;
case KSYStreamerProfile_360p_1:
Expand All @@ -239,7 +239,7 @@ - (void)getStreamerProfile:(KSYStreamerProfile)profile{
_videoCodecUI.selectedSegmentIndex = 0;
_videoKbpsUI.slider.value = 512;
_audioCodecUI.selectedSegmentIndex = 2;
_audioKbpsUI.selectedSegmentIndex = 3;
_audioKbpsUI.selectedSegmentIndex = 4;
_bwEstModeUI.selectedSegmentIndex = 0;
break;
case KSYStreamerProfile_360p_2:
Expand All @@ -249,7 +249,7 @@ - (void)getStreamerProfile:(KSYStreamerProfile)profile{
_videoCodecUI.selectedSegmentIndex = 0;
_videoKbpsUI.slider.value = 512;
_audioCodecUI.selectedSegmentIndex = 2;
_audioKbpsUI.selectedSegmentIndex = 3;
_audioKbpsUI.selectedSegmentIndex = 4;
_bwEstModeUI.selectedSegmentIndex = 0;
break;
case KSYStreamerProfile_360p_3:
Expand All @@ -259,7 +259,7 @@ - (void)getStreamerProfile:(KSYStreamerProfile)profile{
_videoCodecUI.selectedSegmentIndex = 0;
_videoKbpsUI.slider.value = 768;
_audioCodecUI.selectedSegmentIndex = 2;
_audioKbpsUI.selectedSegmentIndex = 3;
_audioKbpsUI.selectedSegmentIndex = 4;
_bwEstModeUI.selectedSegmentIndex = 0;
break;
case KSYStreamerProfile_540p_auto:
Expand Down
2 changes: 1 addition & 1 deletion demo/KSYLiveDemo/KSYDemoUI/KSYStateLableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ - (void) updateState:(KSYStreamerBase*)str {
NSString *uploadDateSize = [KSYUIVC sizeFormatted:curState.uploadKByte];
NSString* stateurl = [NSString stringWithFormat:@"%@\n", [str.hostURL absoluteString]];
//显示拉流地址
NSString *playUrl = @"http://test.hdllive.ks-cdn.com/live/";
NSString *playUrl = @"http://120.92.224.235:8080/live/";
if (![[str.hostURL scheme] isEqualToString:@"rtmp"]) {
//录制到本地
NSString *fileName = [[stateurl componentsSeparatedByString:@"/"]lastObject];
Expand Down
14 changes: 1 addition & 13 deletions demo/KSYLiveDemo/KSYDemoUI/KSYStreamerVC+Rotation.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,7 @@ - (void) onViewRotate { // 重写父类的方法, 参考父类 KSYUIView.m 中
return;
}
self.curCollection = self.traitCollection;

// 2.2 设置 logoRect
[self.kit setLogoRect:CGRectMake(self.kit.logoRect.origin.x, self.kit.logoRect.origin.y, self.kit.logoRect.size.height, self.kit.logoRect.size.width)];

// 根据text相对于logo的布局来计算text的Y值(text出于logo正下方)
CGFloat textY = (self.kit.textRect.origin.y - self.kit.logoRect.origin.y) / (self.kit.streamDimension.height / self.kit.streamDimension.width) + self.kit.logoRect.origin.y;
// width 根据推流分辨率计算
CGFloat textheight = self.kit.textRect.size.height / self.kit.streamDimension.height * self.kit.streamDimension.width;
// 2.3 设置 textRect
[self.kit setTextRect:CGRectMake(self.kit.textRect.origin.x,
textY,
self.kit.textRect.size.width,
textheight)];
[self setupLogoRect];
}
}

Expand Down
2 changes: 2 additions & 0 deletions demo/KSYLiveDemo/KSYDemoUI/KSYStreamerVC.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
- (void) onMenuBtnPress:(UIButton *)btn;
- (void) onQuit;

- (void) setupLogoRect;

#define SEL_VALUE(SEL_NAME) [NSValue valueWithPointer:@selector(SEL_NAME)]

@end
23 changes: 14 additions & 9 deletions demo/KSYLiveDemo/KSYDemoUI/KSYStreamerVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -264,26 +264,31 @@ - (NSString *) timeStr {
}
#pragma mark - logo setup
- (void) setupLogo{
CGFloat yPos = 0.05;
// 预览视图的scale
CGFloat scale = MAX(self.view.frame.size.width, self.view.frame.size.height) / self.view.frame.size.height;
CGFloat hgt = 0.1 * scale; // logo图片的高度是预览画面的十分之一

UIImage * logoImg = [UIImage imageNamed:@"ksvc"];
_logoPicure = [[GPUImagePicture alloc] initWithImage:logoImg];
_kit.logoPic = _logoPicure;
_logoOrientation = logoImg.imageOrientation;
[_kit setLogoOrientaion: _logoOrientation];
_kit.logoRect = CGRectMake(0.05, yPos, 0, hgt);
_kit.logoAlpha= 0.5;
yPos += hgt;
_miscView.alphaSl.normalValue = _kit.logoAlpha;
_kit.textLabel.numberOfLines = 2;
_kit.textLabel.textAlignment = NSTextAlignmentCenter;
NSString * timeStr = [self timeStr];
_kit.textLabel.text = [NSString stringWithFormat:@"ksyun\n%@", timeStr];
[_kit.textLabel sizeToFit];
_kit.textRect = CGRectMake(0.05, yPos, 0, 0.04 * scale); // 水印文字的高度为预览画面的 0.04倍
[_kit updateTextLabel];
[self setupLogoRect];
}
- (void) setupLogoRect{
CGFloat yPos = 0.05;
// 预览视图的scale
CGSize frameSz = self.view.frame.size;
CGFloat scale = MAX(frameSz.width, frameSz.height) / frameSz.height;
CGFloat hgt = 0.1 * scale; // logo图片的高度是预览画面的十分之一
_kit.logoRect = CGRectMake(0.05, yPos, 0, hgt);
yPos += hgt;
_kit.textRect = CGRectMake(0.05, yPos, 0, 0.04 * scale); // 水印文字的高度为预览画面的 0.04倍
}

- (void) updateLogoText {
Expand Down Expand Up @@ -406,7 +411,7 @@ - (void) defaultStramCfg{
_kit.streamerBase.logBlock = ^(NSString* str){
NSLog(@"%@", str);
};
_hostURL = [NSURL URLWithString:@"rtmp://test.uplive.ks-cdn.com/live/123"];
_hostURL = [NSURL URLWithString:@"rtmp://120.92.224.235/live/123"];
}
- (void) setStreamerCfg { // must set after capture
if (_kit.streamerBase == nil) {
Expand Down Expand Up @@ -958,7 +963,7 @@ - (void)onMiscBtns:(id)sender {
//推流地址对应的拉流地址
NSString * uuidStr =[[[UIDevice currentDevice] identifierForVendor] UUIDString];
NSString *devCode = [[uuidStr substringToIndex:3] lowercaseString];
NSString *streamPlaySrv = @"http://test.hdllive.ks-cdn.com/live";
NSString *streamPlaySrv = @"http://120.92.224.235:8080/live";
NSString *streamPlayPostfix = @".flv";
playUrlQRCodeVc.url = [ NSString stringWithFormat:@"%@/%@%@", streamPlaySrv, devCode,streamPlayPostfix];
}
Expand Down
4 changes: 2 additions & 2 deletions demo/KSYLiveDemo/KSYLiveVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ - (void)viewDidLoad {
NSString * uuidStr =[[[UIDevice currentDevice] identifierForVendor] UUIDString];
NSString *devCode = [[uuidStr substringToIndex:3] lowercaseString];
//推流地址
NSString *streamSrv = @"rtmp://test.uplive.ks-cdn.com/live";
NSString *streamSrv = @"rtmp://120.92.224.235/live";
NSString *streamUrl = [ NSString stringWithFormat:@"%@/%@", streamSrv, devCode];
_arrayStreamAddress = [NSMutableArray arrayWithObjects:streamUrl,nil];
//推流地址对应的拉流地址
NSString *streamPlaySrv = @"http://test.hdllive.ks-cdn.com/live";
NSString *streamPlaySrv = @"http://120.92.224.235:8080/live";
NSString *streamPlayPostfix = @".flv";
NSString *streamPlayUrl = [ NSString stringWithFormat:@"%@/%@%@", streamPlaySrv, devCode,streamPlayPostfix];
//拉流地址
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class KSYPresetCfgView: KSYUIView, UIImagePickerControllerDelegate, UINavigation
super.init()
backgroundColor = .white
// hostURL = rtmpSrv + streamName(随机数,避免多个demo推向同一个流
let rtmpSrv = "rtmp://test.uplive.ks-cdn.com/live"
let rtmpSrv = "rtmp://120.92.224.235/live"

let devCode = (KSYUIView.init().getUuid()! as NSString).substring(to: 3)
let url = "\(rtmpSrv)/\(devCode)"
Expand Down
2 changes: 1 addition & 1 deletion demo/KSYLiveDemo_Swift/KSYDemoUI_Swift/KSYStreamerVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class KSYStreamerVC: KSYUIVC, UIImagePickerControllerDelegate, UINavigationContr
kit?.streamerBase.logBlock = { (str) -> Void in
print(str ?? "")
}
hostURL = NSURL.init(string: "rtmp://test.uplive.ks-cdn.com/live/123")
hostURL = NSURL.init(string: "rtmp://120.92.224.235/live/123")
}

// 推流的参数设置 must set after capture
Expand Down
2 changes: 1 addition & 1 deletion demo/KSYLiveDemo_Swift/KSYLiveDemo_Swift/KSYLiveVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class KSYLiveVC: UIViewController {
view.backgroundColor = .white
_addressMulArray = [String]()
let devCode = (UIDevice.current.identifierForVendor!.uuidString as NSString).substring(to: 3)
let streamSrv = "rtmp://test.uplive.ksyun.com/live"
let streamSrv = "rtmp://120.92.224.235/live"
let streamUrl = "\(streamSrv)/\(devCode)"
let playUrl = "rtmp://live.hkstv.hk.lxdns.com/live/hks"
let recordFile = "RecordAv.mp4"
Expand Down
5 changes: 5 additions & 0 deletions demo/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ target 'KSYLiveDemo' do
pod 'ZipArchive', '~> 1.4'

pod 'GPUImage'
# KSYGPUResource 为基础版本的图片资源, 包含了美颜滤镜必须依赖的图片
pod 'libksygpulive/KSYGPUResource', :path => '../'
# KSYGPUResourceFull 为完整版本的图片资源, 包含了所有特效滤镜的图片
#pod 'libksygpulive/KSYGPUResourceFull', :path => '../'
## 请根据需要选择要添加的资源包, 完整版的资源引入的增量为3.1M

pod 'libksygpulive/libksygpulive', :path => '../'
# pod 'libksygpulive/libksygpulive_265', :path => '../'

Expand Down
2 changes: 1 addition & 1 deletion doc/docset-installed.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Documentation set was installed to Xcode!

Path: /Users/ksvc/Library/Developer/Shared/Documentation/DocSets/com.ksyun.KSYLive_iOS.docset
Time: 2017-11-02 11:59:23 +0000
Time: 2017-11-21 02:44:19 +0000
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ <h1 id="library-title">

<option value="//api/name/getMixVolume:rightVolume:of:">- getMixVolume:rightVolume:of:</option>

<option value="//api/name/getNumSamplesInBuffer:">- getNumSamplesInBuffer:</option>

<option value="//api/name/getTrackEnable:">- getTrackEnable:</option>

<option value="//api/name/processAudioData:nbSample:withFormat:timeinfo:of:">- processAudioData:nbSample:withFormat:timeinfo:of:</option>
Expand Down Expand Up @@ -627,7 +629,7 @@ <h4 class="method-subtitle parameter-title">Parameters</h4>
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>&lt;0, 表示查询失败
=0,表示残余的数据不足一次输出
>0, 表示可以buffer中的数据还可以输出n次
>0, 表示buffer中的数据还可以输出n次
*</p>
</div>

Expand All @@ -641,6 +643,68 @@ <h4 class="method-subtitle parameter-title">Return Value</h4>



<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">KSYAudioMixer.h</code></p>
</div>


</div>
</div>
</div><div class="section-method">
<a name="//api/name/getNumSamplesInBuffer:" title="getNumSamplesInBuffer:"></a>
<h3 class="method-title"><code><a href="#//api/name/getNumSamplesInBuffer:">&ndash;&nbsp;getNumSamplesInBuffer:</a></code>
</h3>

<div class="method-info">
<div class="pointy-thing"></div>

<div class="method-info-container">


<div class="method-subsection brief-description">
<p>查询track中缓存数据的samplebuffer数</p>
</div>



<div class="method-subsection method-declaration"><code>- (int)getNumSamplesInBuffer:(int)<em>trackId</em></code></div>



<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">

<tr>
<th scope="row" class="argument-name"><code>trackId</code></th>
<td><p>开关对应track</p></td>
</tr>

</table>
</div>



<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>&lt;0, 表示查询失败
=0,表示无残余的数据</p>

<blockquote><p>0, 表示buffer中sample数
*</p></blockquote>
</div>











<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">KSYAudioMixer.h</code></p>
Expand Down
Loading

0 comments on commit 62a6e41

Please sign in to comment.