Compare commits

...

8 Commits

Author SHA1 Message Date
chenliming 41fe9d1070 update version 2016-07-13 17:30:51 +08:00
chenliming d7b981c516 fix 内存bug 2016-07-13 17:30:17 +08:00
chenliming 09a4627886 Revert "test"
This reverts commit a140408a6a.
2016-07-13 12:19:08 +08:00
chenliming a140408a6a test 2016-07-13 12:17:23 +08:00
chenliming 3539bae752 Revert "update"
This reverts commit 40b1f7d37f.
2016-07-13 12:01:14 +08:00
chenliming 40b1f7d37f update 2016-07-13 11:58:53 +08:00
chenliming 5d9bbd2b5b update 2016-07-12 17:17:26 +08:00
chenliming 909b49c8e9 声明。。。 2016-07-12 16:25:04 +08:00
5 changed files with 34 additions and 36 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
Pod::Spec.new do |s|
s.name = "LFLiveKit"
s.version = "1.6.2"
s.version = "1.6.7"
s.summary = "LaiFeng ios Live. LFLiveKit."
s.homepage = "https://github.com/chenliming777"
s.license = { :type => "MIT", :file => "LICENSE" }
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.6.2</string>
<string>1.6.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+1 -1
View File
@@ -282,7 +282,7 @@
- (id<LFStreamSocket>)socket{
if(!_socket){
if(self.liveType == LFLiveRTMP){
_socket = [[LFStreamRtmpSocket alloc] initWithStream:self.streamInfo];
_socket = [[LFStreamRtmpSocket alloc] initWithStream:self.streamInfo videoSize:self.videoConfiguration.videoSize reconnectInterval:self.reconnectInterval reconnectCount:self.reconnectCount];
}else if(self.liveType == LFLiveFLV){
_socket = [[LFStreamTcpSocket alloc] initWithStream:self.streamInfo videoSize:self.videoConfiguration.videoSize reconnectInterval:self.reconnectInterval reconnectCount:self.reconnectCount];
}
+31 -33
View File
@@ -46,7 +46,6 @@ SAVC(mp4a);
@property (nonatomic, weak) id<LFStreamSocketDelegate> delegate;
@property (nonatomic, strong) LFLiveStreamInfo *stream;
@property (nonatomic, strong) LFStreamingBuffer *buffer;
@property (nonatomic, strong) dispatch_queue_t socketQueue;
@property (nonatomic, strong) LFLiveDebug *debugInfo;
//错误信息
@property (nonatomic, assign) RTMPError error;
@@ -83,36 +82,31 @@ SAVC(mp4a);
}
- (void) start{
dispatch_async(self.socketQueue, ^{
if(!_stream) return;
if(_isConnecting) return;
if(_rtmp != NULL) return;
self.debugInfo.streamId = self.stream.streamId;
self.debugInfo.uploadUrl = self.stream.url;
self.debugInfo.isRtmp = YES;
[self clean];
[self RTMP264_Connect:(char*)[_stream.url cStringUsingEncoding:NSASCIIStringEncoding]];
});
if(!_stream) return;
if(_isConnecting) return;
if(_rtmp != NULL) return;
self.debugInfo.streamId = self.stream.streamId;
self.debugInfo.uploadUrl = self.stream.url;
self.debugInfo.isRtmp = YES;
[self clean];
[self RTMP264_Connect:(char*)[_stream.url cStringUsingEncoding:NSASCIIStringEncoding]];
}
- (void) stop{
dispatch_async(self.socketQueue, ^{
if(_rtmp != NULL){
PILI_RTMP_Close(_rtmp, &_error);
PILI_RTMP_Free(_rtmp);
_rtmp = NULL;
}
});
if(self.delegate && [self.delegate respondsToSelector:@selector(socketStatus:status:)]){
[self.delegate socketStatus:self status:LFLiveStop];
}
if(_rtmp != NULL){
PILI_RTMP_Close(_rtmp, &_error);
PILI_RTMP_Free(_rtmp);
_rtmp = NULL;
}
}
- (void) sendFrame:(LFFrame*)frame{
__weak typeof(self) _self = self;
dispatch_async(self.socketQueue, ^{
__strong typeof(_self) self = _self;
if(!frame) return;
[self.buffer appendObject:frame];
[self sendFrame];
});
if(!frame) return;
[self.buffer appendObject:frame];
[self sendFrame];
}
- (void) setDelegate:(id<LFStreamSocketDelegate>)delegate{
@@ -398,7 +392,10 @@ Failed:
int success = PILI_RTMP_SendPacket(_rtmp,packet,0,&_error);
if(success){
self.isSending = NO;
[self sendFrame];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self sendFrame];
});
}
return success;
}
@@ -461,7 +458,7 @@ void RTMPErrorCallback(RTMPError *error, void *userData){
socket.isConnected = NO;
socket.isConnecting = NO;
socket.isReconnecting = YES;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(socket.reconnectInterval * NSEC_PER_SEC)), socket.socketQueue, ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(socket.reconnectInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[socket reconnect];
});
}else if(socket.retryTimes4netWorkBreaken >= socket.reconnectCount){
@@ -480,12 +477,6 @@ void ConnectionTimeCallback(PILI_CONNECTION_TIME* conn_time, void *userData){
}
#pragma mark -- Getter Setter
- (dispatch_queue_t)socketQueue{
if(!_socketQueue){
_socketQueue = dispatch_queue_create("com.youku.LaiFeng.live.socketQueue", NULL);
}
return _socketQueue;
}
- (LFStreamingBuffer*)buffer{
if(!_buffer){
@@ -495,4 +486,11 @@ void ConnectionTimeCallback(PILI_CONNECTION_TIME* conn_time, void *userData){
return _buffer;
}
- (LFLiveDebug*)debugInfo{
if(!_debugInfo){
_debugInfo = [[LFLiveDebug alloc] init];
}
return _debugInfo;
}
@end