Skip to content

Commit

Permalink
添加demo
Browse files Browse the repository at this point in the history
  • Loading branch information
chenliming committed Oct 20, 2016
1 parent 47f3505 commit 1d7b1f7
Show file tree
Hide file tree
Showing 301 changed files with 11,480 additions and 295 deletions.
281 changes: 228 additions & 53 deletions FrameWork/LFLiveKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions FrameWork/LFLiveKitFramework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
26 changes: 26 additions & 0 deletions FrameWork/LFLiveKitFramework/LFLiveKitFramework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// LFLiveKitFramework.h
// LFLiveKitFramework
//
// Created by admin on 2016/10/20.
// Copyright © 2016年 admin. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for LFLiveKitFramework.
FOUNDATION_EXPORT double LFLiveKitFrameworkVersionNumber;

//! Project version string for LFLiveKitFramework.
FOUNDATION_EXPORT const unsigned char LFLiveKitFrameworkVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <LFLiveKitFramework/PublicHeader.h>

#import <LFLiveKit/LFLiveSession.h>
#import <LFLiveKit/LFLiveAudioConfiguration.h>
#import <LFLiveKit/LFLiveVideoConfiguration.h>
#import <LFLiveKit/LFAudioFrame.h>
#import <LFLiveKit/LFFrame.h>
#import <LFLiveKit/LFLiveStreamInfo.h>
#import <LFLiveKit/LFVideoFrame.h>
#import <LFLiveKit/LFLiveDebug.h>
7 changes: 0 additions & 7 deletions FrameWork/Podfile

This file was deleted.

14 changes: 4 additions & 10 deletions LFLiveKit/LFLiveKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@
// Copyright © 2016年 LaiFeng All rights reserved.
//

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFLiveSession.h>
#import <LFLiveKit/LFLiveAudioConfiguration.h>
#import <LFLiveKit/LFLiveVideoConfiguration.h>
#import <LFLiveKit/LFAudioFrame.h>
#import <LFLiveKit/LFFrame.h>
#import <LFLiveKit/LFLiveStreamInfo.h>
#import <LFLiveKit/LFVideoFrame.h>
#import <LFLiveKit/LFLiveDebug.h>
#else
#ifndef LFLiveKit_h
#define LFLiveKit_h

#import "LFLiveSession.h"
#import "LFLiveAudioConfiguration.h"
#import "LFLiveVideoConfiguration.h"
Expand All @@ -24,5 +17,6 @@
#import "LFLiveStreamInfo.h"
#import "LFVideoFrame.h"
#import "LFLiveDebug.h"

#endif

10 changes: 0 additions & 10 deletions LFLiveKit/LFLiveSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,13 @@

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFLiveStreamInfo.h>
#import <LFLiveKit/LFAudioFrame.h>
#import <LFLiveKit/LFVideoFrame.h>
#import <LFLiveKit/LFLiveAudioConfiguration.h>
#import <LFLiveKit/LFLiveVideoConfiguration.h>
#import <LFLiveKit/LFLiveDebug.h>
#else
#import "LFLiveStreamInfo.h"
#import "LFAudioFrame.h"
#import "LFVideoFrame.h"
#import "LFLiveAudioConfiguration.h"
#import "LFLiveVideoConfiguration.h"
#import "LFLiveDebug.h"

#endif



typedef NS_ENUM(NSInteger,LFLiveCaptureType) {
Expand Down
5 changes: 0 additions & 5 deletions LFLiveKit/capture/LFAudioCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFLiveAudioConfiguration.h>
#else
#import "LFLiveAudioConfiguration.h"
#endif

#pragma mark -- AudioCaptureNotification
/** compoentFialed will post the notification */
Expand Down
5 changes: 0 additions & 5 deletions LFLiveKit/capture/LFVideoCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFLiveVideoConfiguration.h>
#else
#import "LFLiveVideoConfiguration.h"
#endif

@class LFVideoCapture;
/** LFVideoCapture callback videoData */
Expand Down
5 changes: 0 additions & 5 deletions LFLiveKit/coder/H264/LFAVEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@
#import <AVFoundation/AVVideoSettings.h>
#import <sys/stat.h>

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFVideoEncoder.h>
#import <LFLiveKit/LFMP4Atom.h>
#else
#import "LFVideoEncoder.h"
#import "LFMP4Atom.h"
#endif



Expand Down
5 changes: 0 additions & 5 deletions LFLiveKit/coder/LFAudioEncoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFAudioFrame.h>
#import <LFLiveKit/LFLiveAudioConfiguration.h>
#else
#import "LFAudioFrame.h"
#import "LFLiveAudioConfiguration.h"
#endif



Expand Down
4 changes: 0 additions & 4 deletions LFLiveKit/coder/LFH264VideoEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Copyright © 2016年 LaiFeng All rights reserved.
//

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFVideoEncoding.h>
#else
#import "LFVideoEncoding.h"
#endif

@interface LFH264VideoEncoder : NSObject <LFVideoEncoding> {

Expand Down
4 changes: 0 additions & 4 deletions LFLiveKit/coder/LFHardwareAudioEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Copyright © 2016年 LaiFeng All rights reserved.
//

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFAudioEncoding.h>
#else
#import "LFAudioEncoding.h"
#endif

@interface LFHardwareAudioEncoder : NSObject<LFAudioEncoding>

Expand Down
5 changes: 0 additions & 5 deletions LFLiveKit/coder/LFHardwareAudioEncoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,12 @@ - (BOOL)createAudioConvert { //根据输入样本初始化一个编码转换器
OSStatus result = AudioConverterNewSpecific(&inputFormat, &outputFormat, 2, requestedCodecs, &m_converter);;
UInt32 outputBitrate = _configuration.audioBitrate;
UInt32 propSize = sizeof(outputBitrate);
// UInt32 outputPacketSize = 0;


if(result == noErr) {
result = AudioConverterSetProperty(m_converter, kAudioConverterEncodeBitRate, propSize, &outputBitrate);
}

// if(result == noErr) {
// AudioConverterGetProperty(m_converter, kAudioConverterPropertyMaximumOutputPacketSize, &propSize, &outputPacketSize);
// }

return YES;
}

Expand Down
4 changes: 0 additions & 4 deletions LFLiveKit/coder/LFHardwareVideoEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Copyright © 2016年 LaiFeng All rights reserved.
//

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFVideoEncoding.h>
#else
#import "LFVideoEncoding.h"
#endif

@interface LFHardwareVideoEncoder : NSObject<LFVideoEncoding>

Expand Down
2 changes: 1 addition & 1 deletion LFLiveKit/coder/LFHardwareVideoEncoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ - (void)resetCompressionSession {

_currentVideoBitRate = _configuration.videoBitRate;
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_MaxKeyFrameInterval, (__bridge CFTypeRef)@(_configuration.videoMaxKeyframeInterval));
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration, (__bridge CFTypeRef)@(_configuration.videoMaxKeyframeInterval));
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_MaxKeyFrameIntervalDuration, (__bridge CFTypeRef)@(_configuration.videoMaxKeyframeInterval/_configuration.videoFrameRate));
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_ExpectedFrameRate, (__bridge CFTypeRef)@(_configuration.videoFrameRate));
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_AverageBitRate, (__bridge CFTypeRef)@(_configuration.videoBitRate));
NSArray *limit = @[@(_configuration.videoBitRate * 1.5/8), @(1)];
Expand Down
7 changes: 0 additions & 7 deletions LFLiveKit/coder/LFVideoEncoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@
//

#import <Foundation/Foundation.h>

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFVideoFrame.h>
#import <LFLiveKit/LFLiveVideoConfiguration.h>
#else
#import "LFVideoFrame.h"
#import "LFLiveVideoConfiguration.h"
#endif


@protocol LFVideoEncoding;
/// 编码器编码后回调
Expand Down
5 changes: 2 additions & 3 deletions LFLiveKit/filter/LFGPUImageBeautyFilter.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#if __has_include(<GPUImage/GPUImage.h>)
#import <GPUImage/GPUImage.h>
#elif __has_include(<GPUImage/GPUImageFramework.h>)
#if __has_include(<GPUImage/GPUImageFramework.h>)
#import <GPUImage/GPUImageFramework.h>
#else
#import "GPUImage.h"
#endif

@interface LFGPUImageBeautyFilter : GPUImageFilter {
}

Expand Down
6 changes: 2 additions & 4 deletions LFLiveKit/filter/LFGPUImageEmptyFilter.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#if __has_include(<GPUImage/GPUImage.h>)
#import <GPUImage/GPUImage.h>
#elif __has_include("GPUImage/GPUImage.h")
#import "GPUImage/GPUImage.h"
#if __has_include(<GPUImage/GPUImageFramework.h>)
#import <GPUImage/GPUImageFramework.h>
#else
#import "GPUImage.h"
#endif
Expand Down
4 changes: 0 additions & 4 deletions LFLiveKit/objects/LFAudioFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Copyright © 2016年 LaiFeng All rights reserved.
//

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFFrame.h>
#else
#import "LFFrame.h"
#endif

@interface LFAudioFrame : LFFrame

Expand Down
6 changes: 0 additions & 6 deletions LFLiveKit/objects/LFLiveStreamInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@
//

#import <Foundation/Foundation.h>

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFLiveAudioConfiguration.h>
#import <LFLiveKit/LFLiveVideoConfiguration.h>
#else
#import "LFLiveAudioConfiguration.h"
#import "LFLiveVideoConfiguration.h"
#endif



Expand Down
4 changes: 0 additions & 4 deletions LFLiveKit/objects/LFVideoFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Copyright © 2016年 LaiFeng All rights reserved.
//

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFFrame.h>
#else
#import "LFFrame.h"
#endif


@interface LFVideoFrame : LFFrame
Expand Down
4 changes: 0 additions & 4 deletions LFLiveKit/publish/LFStreamRTMPSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
// Copyright © 2016年 LaiFeng All rights reserved.
//

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFStreamSocket.h>
#else
#import "LFStreamSocket.h"
#endif

@interface LFStreamRTMPSocket : NSObject<LFStreamSocket>

Expand Down
3 changes: 0 additions & 3 deletions LFLiveKit/publish/LFStreamRtmpSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#if __has_include(<pili-librtmp/rtmp.h>)
#import <pili-librtmp/rtmp.h>
#elif __has_include("pili-librtmp/rtmp.h")
#import "pili-librtmp/rtmp.h"
#else
#import "rtmp.h"
#endif
Expand Down Expand Up @@ -541,7 +539,6 @@ void RTMPErrorCallback(RTMPError *error, void *userData) {
}

void ConnectionTimeCallback(PILI_CONNECTION_TIME *conn_time, void *userData) {
LFStreamRTMPSocket *socket = (__bridge LFStreamRTMPSocket*)userData;
}

#pragma mark -- LFStreamingBufferDelegate
Expand Down
7 changes: 0 additions & 7 deletions LFLiveKit/publish/LFStreamSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@
//

#import <Foundation/Foundation.h>

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFLiveStreamInfo.h>
#import <LFLiveKit/LFStreamingBuffer.h>
#import <LFLiveKit/LFLiveDebug.h>
#else
#import "LFLiveStreamInfo.h"
#import "LFStreamingBuffer.h"
#import "LFLiveDebug.h"
#endif



Expand Down
6 changes: 0 additions & 6 deletions LFLiveKit/publish/LFStreamingBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@
//

#import <Foundation/Foundation.h>

#if __has_include(<LFLiveKit/LFLiveKit.h>)
#import <LFLiveKit/LFAudioFrame.h>
#import <LFLiveKit/LFVideoFrame.h>
#else
#import "LFAudioFrame.h"
#import "LFVideoFrame.h"
#endif


/** current buffer status */
Expand Down

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 1d7b1f7

Please sign in to comment.