Skip to content

Commit

Permalink
Update to v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
0dayZh committed Jan 11, 2016
1 parent a49b8f8 commit c39a3ce
Show file tree
Hide file tree
Showing 21 changed files with 174 additions and 84 deletions.
8 changes: 8 additions & 0 deletions APIDiffs/api-diffs-1.1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PLCameraStreamingKit 1.1.0 to 1.1.1 API Differences

## General Headers

```PLStreamingSession.h```

- *Modified* property `@property (nonatomic, copy) PLVideoStreamingConfiguration *videoConfiguration;` from `strong` to `copy`
- *Added* method `+ (NSString *)versionInfo;`
3 changes: 2 additions & 1 deletion Example/PLStreamingKit/PLViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
@interface PLViewController : UIViewController
<
AVCaptureVideoDataOutputSampleBufferDelegate,
PLStreamingSessionDelegate
PLStreamingSessionDelegate,
PLStreamingSendingBufferDelegate
>

@property (nonatomic, strong) PLStreamingSession *session;
Expand Down
15 changes: 15 additions & 0 deletions Example/PLStreamingKit/PLViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ - (void)viewDidLoad {

self.session = [[PLStreamingSession alloc] initWithVideoConfiguration:videoConfiguration audioConfiguration:audioConfiguration stream:stream];
self.session.delegate = self;
self.session.bufferDelegate = self;

[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(handleInterruption:)
Expand Down Expand Up @@ -137,6 +138,16 @@ - (IBAction)actionButtonPressed:(id)sender {
}
}

#pragma mark - <PLStreamingSendingBufferDelegate>

- (void)streamingSessionSendingBufferDidEmpty:(id)session {
NSLog(@"Sending buffer empty");
}

- (void)streamingSessionSendingBufferDidFull:(id)session {
NSLog(@"Sending buffer full");
}

#pragma mark - <PLCameraStreamingSessionDelegate>

- (void)streamingSession:(PLStreamingSession *)session streamStateDidChange:(PLStreamState)state {
Expand All @@ -155,6 +166,10 @@ - (void)streamingSession:(PLStreamingSession *)session didDisconnectWithError:(N
[self.actionButton setTitle:@"Start" forState:UIControlStateNormal];
}

- (void)streamingSession:(PLStreamingSession *)session streamStatusDidUpdate:(PLStreamStatus *)status {
NSLog(@"%@", status);
}

#pragma mark - <AVCaptureVideoDataOutputSampleBufferDelegate>

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PODS:
- HappyDNS (0.2.3)
- PLStreamingKit (1.1.0):
- PLStreamingKit (1.1.1):
- HappyDNS
- PLStreamingKit/precompiled (= 1.1.0)
- PLStreamingKit/precompiled (1.1.0):
- PLStreamingKit/precompiled (= 1.1.1)
- PLStreamingKit/precompiled (1.1.1):
- HappyDNS

DEPENDENCIES:
Expand All @@ -15,6 +15,6 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
HappyDNS: 6d85942e64c28b4fa61f8c76580398f52d6d1d11
PLStreamingKit: 3d80f1fac348c8123696234c2762c49b7cdd8769
PLStreamingKit: 22964059d92e91dd64f644bac6621722039b2fef

COCOAPODS: 0.39.0

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions Example/Pods/Local Podspecs/PLStreamingKit.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 28 additions & 26 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions PLStreamingKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "PLStreamingKit"
s.version = "1.1.0"
s.version = "1.1.1"
s.summary = "Pili iOS streaming framework via RTMP."
s.homepage = "https://github.com/pili-engineering/PLStreamingKit"
s.license = 'Apache License, Version 2.0'
Expand All @@ -31,6 +31,5 @@ Pod::Spec.new do |s|
ss.preserve_paths = "Pod/Library/include/**/*.h", 'Pod/Library/lib/*.a'
ss.vendored_libraries = 'Pod/Library/lib/*.a'
ss.libraries = 'PLStreamingKit'
ss.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/PLStreamingKit/lib/include" }
end
end
8 changes: 5 additions & 3 deletions Pod/Library/include/PLStreamingKit/PLBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
@protocol PLStreamingSendingBufferDelegate <NSObject>

@optional
- (void)streamingSessionSendingBufferFillDidLowerThanLowThreshold:(id)session;
- (void)streamingSessionSendingBufferFillDidHigherThanHighThreshold:(id)session;
- (void)streamingSessionSendingBufferDidEmpty:(id)session;
- (void)streamingSessionSendingBufferDidFull:(id)session;
- (void)streamingSession:(id)session sendingBufferDidDropItems:(NSArray *)items;

/// 已弃用
- (void)streamingSessionSendingBufferFillDidLowerThanLowThreshold:(id)session DEPRECATED_ATTRIBUTE;
- (void)streamingSessionSendingBufferFillDidHigherThanHighThreshold:(id)session DEPRECATED_ATTRIBUTE;
- (void)streamingSession:(id)session sendingBufferDidDropItems:(NSArray *)items DEPRECATED_ATTRIBUTE;

@end

Expand Down
24 changes: 24 additions & 0 deletions Pod/Library/include/PLStreamingKit/PLStreamStatus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// PLStreamStatus.h
// PLStreamingKit
//
// Created by 0dayZh on 16/1/9.
// Copyright © 2016年 pili-engineering. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface PLStreamStatus : NSObject <NSCopying>

/// video frame per second
@property (nonatomic, assign, readonly) double videoFPS;
/// audio frame per second
@property (nonatomic, assign, readonly) double audioFPS;
/// video and audio bitrate in bps(Bit Per Second)
@property (nonatomic, assign, readonly) double totalBitrate;

- (instancetype)initWithVideoFPS:(double)vfps
audioFPS:(double)afps
totalBitrate:(double)totalBitrate;

@end
1 change: 1 addition & 0 deletions Pod/Library/include/PLStreamingKit/PLStreamingKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
#import "PLAudioStreamingConfiguration.h"
#import "PLStream.h"
#import "PLBuffer.h"
#import "PLStreamStatus.h"

#endif /* PLStreamingKit_h */
30 changes: 24 additions & 6 deletions Pod/Library/include/PLStreamingKit/PLStreamingSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import "PLTypeDefines.h"
#import "PLStream.h"
#import "PLBuffer.h"
#import "PLStreamStatus.h"

@class PLStreamingSession;
@class QNDnsManager;
Expand All @@ -28,12 +29,15 @@
/// @abstract 因产生了某个 error 而断开时的回调
- (void)streamingSession:(PLStreamingSession *)session didDisconnectWithError:(NSError *)error;

/// @abstract 当开始推流时,会每间隔 3s 调用该回调方法来反馈该 3s 内的流状态,包括视频帧率、音频帧率、音视频总码率
- (void)streamingSession:(PLStreamingSession *)session streamStatusDidUpdate:(PLStreamStatus *)status;

@end

@interface PLStreamingSession : NSObject

/// 视频编码及推流配置
@property (nonatomic, PL_STRONG) PLVideoStreamingConfiguration *videoConfiguration;
@property (nonatomic, copy) PLVideoStreamingConfiguration *videoConfiguration;

/// 音频编码及推流配置
@property (nonatomic, PL_STRONG) PLAudioStreamingConfiguration *audioConfiguration;
Expand All @@ -57,6 +61,9 @@
/// 推流 URL,只读属性
@property (nonatomic, PL_STRONG, readonly) NSURL *pushURL; // rtmp only now.

/// 默认为 3s,可设置范围为 [1..20] 秒
@property (nonatomic, assign) NSTimeInterval statusUpdateInterval;

/*!
* 初始化方法
*
Expand Down Expand Up @@ -152,16 +159,19 @@

@property (nonatomic, PL_WEAK) id<PLStreamingSendingBufferDelegate> bufferDelegate;

/// 最低阈值, [0..1], 不可超出这个范围, 默认为 0.5
@property (nonatomic, assign) CGFloat lowThreshold;

/// 最高阈值, [0..1], 不可超出这个范围, 默认为 1
@property (nonatomic, assign) CGFloat highThreshold;
/// [0..1], 不可超出这个范围, 默认为 0.5
@property (nonatomic, assign) CGFloat threshold;

/// 默认为 300
@property (nonatomic, assign) NSUInteger maxCount;
@property (nonatomic, assign, readonly) NSUInteger currentCount;

/// 已弃用,请使用 threshold 属性
@property (nonatomic, assign) CGFloat lowThreshold DEPRECATED_ATTRIBUTE;

/// 已弃用,请使用 threshold 属性
@property (nonatomic, assign) CGFloat highThreshold DEPRECATED_ATTRIBUTE;

@end

#pragma mark - Categroy (Application)
Expand All @@ -175,4 +185,12 @@

@property (nonatomic, assign, getter=isIdleTimerDisable) BOOL idleTimerDisable; // default as YES.

@end

#pragma mark - Category (Info)

@interface PLStreamingSession (Info)

+ (NSString *)versionInfo;

@end
Binary file modified Pod/Library/lib/libPLStreamingKit.a
Binary file not shown.
Loading

0 comments on commit c39a3ce

Please sign in to comment.