Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b73bfee6ac | |||
| 09398d0cb3 | |||
| f69b586d70 | |||
| cfb84d31fb | |||
| 984bcb8e15 | |||
| d7164f8b76 | |||
| fb7ad31bf0 | |||
| ec61b1f7ec | |||
| ba1280af3a | |||
| 9e99357113 | |||
| 8057a3e013 | |||
| 981b0dd2cd | |||
| d93d4b9bf5 | |||
| df6164fed1 | |||
| ba19663059 | |||
| 0967800b23 | |||
| d0ef23d887 | |||
| 807d83c263 | |||
| 28d20814f6 | |||
| 4c385f6e89 | |||
| 8708e04c0d | |||
| e47f3154a8 | |||
| 7062cdcf7c | |||
| bbe11292de | |||
| 2b51c69007 |
+2
-2
@@ -1,7 +1,7 @@
|
||||
language: objective-c
|
||||
osx_image: xcode7
|
||||
xcode_project: LFLiveKit.xcodeproj
|
||||
xcode_workspace: LFLiveKit.xcworkspace
|
||||
xcode_scheme: LFLiveKit
|
||||
|
||||
script:
|
||||
- xctool -project LFLiveKit.xcodeproj -scheme 'LFLiveKit' -configuration Release -sdk iphonesimulator -arch i386 build
|
||||
- xctool -workspace LFLiveKit.xcworkspace -scheme 'LFLiveKit' -configuration Release -sdk iphonesimulator -arch i386 build
|
||||
+1
-2
@@ -11,8 +11,7 @@ Pod::Spec.new do |s|
|
||||
s.ios.deployment_target = "7.0"
|
||||
s.source = { :git => "https://github.com/LaiFengiOS/LFLiveKit.git", :tag => "#{s.version}" }
|
||||
s.source_files = "LFLiveKit/**/*.{h,m,mm,cpp,c}"
|
||||
#s.public_header_files = "LFLiveKit/**/*.h"
|
||||
s.public_header_files = ['LFLiveKit/*.h', 'LFLiveKit/objects/*.h', 'LFLiveKit/configuration/*.h']
|
||||
s.public_header_files = "LFLiveKit/**/*.h"
|
||||
|
||||
s.frameworks = "VideoToolbox", "AudioToolbox","AVFoundation","Foundation","UIKit"
|
||||
s.libraries = "c++", "z"
|
||||
|
||||
@@ -415,15 +415,15 @@
|
||||
B289F1DF1D3DE77F00D9C7A5 /* LFStreamSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = B289F1D81D3DE77F00D9C7A5 /* LFStreamSocket.h */; };
|
||||
B289F1E01D3DE77F00D9C7A5 /* NSMutableArray+LFAdd.h in Headers */ = {isa = PBXBuildFile; fileRef = B289F1D91D3DE77F00D9C7A5 /* NSMutableArray+LFAdd.h */; };
|
||||
B289F1E11D3DE77F00D9C7A5 /* NSMutableArray+LFAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = B289F1DA1D3DE77F00D9C7A5 /* NSMutableArray+LFAdd.m */; };
|
||||
B2CD146D1D45F18B008082E8 /* LFAVEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14621D45F18B008082E8 /* LFAVEncoder.h */; };
|
||||
B2CD146E1D45F18B008082E8 /* LFAVEncoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2CD14631D45F18B008082E8 /* LFAVEncoder.mm */; };
|
||||
B2CD146D1D45F18B008082E8 /* AVEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14621D45F18B008082E8 /* AVEncoder.h */; };
|
||||
B2CD146E1D45F18B008082E8 /* AVEncoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2CD14631D45F18B008082E8 /* AVEncoder.mm */; };
|
||||
B2CD146F1D45F18B008082E8 /* LICENSE.markdown in Sources */ = {isa = PBXBuildFile; fileRef = B2CD14641D45F18B008082E8 /* LICENSE.markdown */; };
|
||||
B2CD14701D45F18B008082E8 /* LFMP4Atom.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14651D45F18B008082E8 /* LFMP4Atom.h */; };
|
||||
B2CD14711D45F18B008082E8 /* LFMP4Atom.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CD14661D45F18B008082E8 /* LFMP4Atom.m */; };
|
||||
B2CD14721D45F18B008082E8 /* LFNALUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2CD14671D45F18B008082E8 /* LFNALUnit.cpp */; };
|
||||
B2CD14731D45F18B008082E8 /* LFNALUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14681D45F18B008082E8 /* LFNALUnit.h */; };
|
||||
B2CD14741D45F18B008082E8 /* LFVideoEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14691D45F18B008082E8 /* LFVideoEncoder.h */; };
|
||||
B2CD14751D45F18B008082E8 /* LFVideoEncoder.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CD146A1D45F18B008082E8 /* LFVideoEncoder.m */; };
|
||||
B2CD14701D45F18B008082E8 /* MP4Atom.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14651D45F18B008082E8 /* MP4Atom.h */; };
|
||||
B2CD14711D45F18B008082E8 /* MP4Atom.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CD14661D45F18B008082E8 /* MP4Atom.m */; };
|
||||
B2CD14721D45F18B008082E8 /* NALUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2CD14671D45F18B008082E8 /* NALUnit.cpp */; };
|
||||
B2CD14731D45F18B008082E8 /* NALUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14681D45F18B008082E8 /* NALUnit.h */; };
|
||||
B2CD14741D45F18B008082E8 /* VideoEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD14691D45F18B008082E8 /* VideoEncoder.h */; };
|
||||
B2CD14751D45F18B008082E8 /* VideoEncoder.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CD146A1D45F18B008082E8 /* VideoEncoder.m */; };
|
||||
B2CD14761D45F18B008082E8 /* LFH264VideoEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CD146B1D45F18B008082E8 /* LFH264VideoEncoder.h */; };
|
||||
B2CD14771D45F18B008082E8 /* LFH264VideoEncoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2CD146C1D45F18B008082E8 /* LFH264VideoEncoder.mm */; };
|
||||
/* End PBXBuildFile section */
|
||||
@@ -851,15 +851,15 @@
|
||||
B289F1D81D3DE77F00D9C7A5 /* LFStreamSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LFStreamSocket.h; path = LFLiveKit/publish/LFStreamSocket.h; sourceTree = SOURCE_ROOT; };
|
||||
B289F1D91D3DE77F00D9C7A5 /* NSMutableArray+LFAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSMutableArray+LFAdd.h"; path = "LFLiveKit/publish/NSMutableArray+LFAdd.h"; sourceTree = SOURCE_ROOT; };
|
||||
B289F1DA1D3DE77F00D9C7A5 /* NSMutableArray+LFAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMutableArray+LFAdd.m"; path = "LFLiveKit/publish/NSMutableArray+LFAdd.m"; sourceTree = SOURCE_ROOT; };
|
||||
B2CD14621D45F18B008082E8 /* LFAVEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFAVEncoder.h; sourceTree = "<group>"; };
|
||||
B2CD14631D45F18B008082E8 /* LFAVEncoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LFAVEncoder.mm; sourceTree = "<group>"; };
|
||||
B2CD14621D45F18B008082E8 /* AVEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVEncoder.h; sourceTree = "<group>"; };
|
||||
B2CD14631D45F18B008082E8 /* AVEncoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVEncoder.mm; sourceTree = "<group>"; };
|
||||
B2CD14641D45F18B008082E8 /* LICENSE.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.markdown; sourceTree = "<group>"; };
|
||||
B2CD14651D45F18B008082E8 /* LFMP4Atom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFMP4Atom.h; sourceTree = "<group>"; };
|
||||
B2CD14661D45F18B008082E8 /* LFMP4Atom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LFMP4Atom.m; sourceTree = "<group>"; };
|
||||
B2CD14671D45F18B008082E8 /* LFNALUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LFNALUnit.cpp; sourceTree = "<group>"; };
|
||||
B2CD14681D45F18B008082E8 /* LFNALUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFNALUnit.h; sourceTree = "<group>"; };
|
||||
B2CD14691D45F18B008082E8 /* LFVideoEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFVideoEncoder.h; sourceTree = "<group>"; };
|
||||
B2CD146A1D45F18B008082E8 /* LFVideoEncoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LFVideoEncoder.m; sourceTree = "<group>"; };
|
||||
B2CD14651D45F18B008082E8 /* MP4Atom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP4Atom.h; sourceTree = "<group>"; };
|
||||
B2CD14661D45F18B008082E8 /* MP4Atom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP4Atom.m; sourceTree = "<group>"; };
|
||||
B2CD14671D45F18B008082E8 /* NALUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NALUnit.cpp; sourceTree = "<group>"; };
|
||||
B2CD14681D45F18B008082E8 /* NALUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NALUnit.h; sourceTree = "<group>"; };
|
||||
B2CD14691D45F18B008082E8 /* VideoEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoEncoder.h; sourceTree = "<group>"; };
|
||||
B2CD146A1D45F18B008082E8 /* VideoEncoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoEncoder.m; sourceTree = "<group>"; };
|
||||
B2CD146B1D45F18B008082E8 /* LFH264VideoEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LFH264VideoEncoder.h; sourceTree = "<group>"; };
|
||||
B2CD146C1D45F18B008082E8 /* LFH264VideoEncoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LFH264VideoEncoder.mm; sourceTree = "<group>"; };
|
||||
D0BB7E7CE5403C4911E026B9 /* Pods-LFLiveKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LFLiveKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LFLiveKit/Pods-LFLiveKit.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
@@ -1444,15 +1444,15 @@
|
||||
B2CD14611D45F18B008082E8 /* H264 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B2CD14621D45F18B008082E8 /* LFAVEncoder.h */,
|
||||
B2CD14631D45F18B008082E8 /* LFAVEncoder.mm */,
|
||||
B2CD14621D45F18B008082E8 /* AVEncoder.h */,
|
||||
B2CD14631D45F18B008082E8 /* AVEncoder.mm */,
|
||||
B2CD14641D45F18B008082E8 /* LICENSE.markdown */,
|
||||
B2CD14651D45F18B008082E8 /* LFMP4Atom.h */,
|
||||
B2CD14661D45F18B008082E8 /* LFMP4Atom.m */,
|
||||
B2CD14671D45F18B008082E8 /* LFNALUnit.cpp */,
|
||||
B2CD14681D45F18B008082E8 /* LFNALUnit.h */,
|
||||
B2CD14691D45F18B008082E8 /* LFVideoEncoder.h */,
|
||||
B2CD146A1D45F18B008082E8 /* LFVideoEncoder.m */,
|
||||
B2CD14651D45F18B008082E8 /* MP4Atom.h */,
|
||||
B2CD14661D45F18B008082E8 /* MP4Atom.m */,
|
||||
B2CD14671D45F18B008082E8 /* NALUnit.cpp */,
|
||||
B2CD14681D45F18B008082E8 /* NALUnit.h */,
|
||||
B2CD14691D45F18B008082E8 /* VideoEncoder.h */,
|
||||
B2CD146A1D45F18B008082E8 /* VideoEncoder.m */,
|
||||
);
|
||||
path = H264;
|
||||
sourceTree = "<group>";
|
||||
@@ -1499,9 +1499,8 @@
|
||||
843724F21D4F260A002B398B /* GPUImageView.h in Headers */,
|
||||
843724991D4F260A002B398B /* GPUImageSharpenFilter.h in Headers */,
|
||||
84001FDD1D0016380026C63F /* LFLiveVideoConfiguration.h in Headers */,
|
||||
B2CD14701D45F18B008082E8 /* LFMP4Atom.h in Headers */,
|
||||
849005B61D4B5C8400D2A3D5 /* error.h in Headers */,
|
||||
843724FB1D4F260A002B398B /* handshake.h in Headers */,
|
||||
B2CD14701D45F18B008082E8 /* MP4Atom.h in Headers */,
|
||||
843723F31D4F260A002B398B /* GPUImageFalseColorFilter.h in Headers */,
|
||||
843723B71D4F260A002B398B /* GPUImageCannyEdgeDetectionFilter.h in Headers */,
|
||||
843724151D4F260A002B398B /* GPUImageHazeFilter.h in Headers */,
|
||||
@@ -1511,7 +1510,6 @@
|
||||
843724AD1D4F260A002B398B /* GPUImageSolidColorGenerator.h in Headers */,
|
||||
8437244D1D4F260A002B398B /* GPUImageMaskFilter.h in Headers */,
|
||||
843723E91D4F260A002B398B /* GPUImageDivideBlendFilter.h in Headers */,
|
||||
B2CD14701D45F18B008082E8 /* LFMP4Atom.h in Headers */,
|
||||
84001FE31D0016380026C63F /* LFLiveSession.h in Headers */,
|
||||
843724411D4F260A002B398B /* GPUImageLookupFilter.h in Headers */,
|
||||
843724E91D4F260A002B398B /* GPUImageFramework.h in Headers */,
|
||||
@@ -1632,22 +1630,14 @@
|
||||
84001FE11D0016380026C63F /* LFGPUImageEmptyFilter.h in Headers */,
|
||||
843724B51D4F260A002B398B /* GPUImageStretchDistortionFilter.h in Headers */,
|
||||
84001FDA1D0016380026C63F /* LFVideoEncoding.h in Headers */,
|
||||
84001FE51D0016380026C63F /* LFAudioFrame.h in Headers */,
|
||||
84001FED1D0016380026C63F /* LFVideoFrame.h in Headers */,
|
||||
B2CD14741D45F18B008082E8 /* LFVideoEncoder.h in Headers */,
|
||||
B2CD14731D45F18B008082E8 /* LFNALUnit.h in Headers */,
|
||||
849005BF1D4B5C8400D2A3D5 /* rtmp_sys.h in Headers */,
|
||||
849005BE1D4B5C8400D2A3D5 /* rtmp.h in Headers */,
|
||||
843724BF1D4F260A002B398B /* GPUImageThreeInputFilter.h in Headers */,
|
||||
843724F71D4F260A002B398B /* dh.h in Headers */,
|
||||
B2CD14741D45F18B008082E8 /* VideoEncoder.h in Headers */,
|
||||
843725031D4F260A002B398B /* rtmp_sys.h in Headers */,
|
||||
843724691D4F260A002B398B /* GPUImageOpeningFilter.h in Headers */,
|
||||
843723C11D4F260A002B398B /* GPUImageColorBlendFilter.h in Headers */,
|
||||
8437249F1D4F260A002B398B /* GPUImageSketchFilter.h in Headers */,
|
||||
84001FE51D0016380026C63F /* LFAudioFrame.h in Headers */,
|
||||
84001FED1D0016380026C63F /* LFVideoFrame.h in Headers */,
|
||||
B2CD14741D45F18B008082E8 /* LFVideoEncoder.h in Headers */,
|
||||
B2CD14731D45F18B008082E8 /* LFNALUnit.h in Headers */,
|
||||
B2CD14731D45F18B008082E8 /* NALUnit.h in Headers */,
|
||||
84001FD81D0016380026C63F /* LFHardwareVideoEncoder.h in Headers */,
|
||||
843724A91D4F260A002B398B /* GPUImageSoftLightBlendFilter.h in Headers */,
|
||||
843723A91D4F260A002B398B /* GPUImageAverageColor.h in Headers */,
|
||||
@@ -1661,14 +1651,13 @@
|
||||
843724611D4F260A002B398B /* GPUImageNobleCornerDetectionFilter.h in Headers */,
|
||||
8437243D1D4F260A002B398B /* GPUImageLineGenerator.h in Headers */,
|
||||
84001FD51D0016380026C63F /* LFAudioEncoding.h in Headers */,
|
||||
B2CD146D1D45F18B008082E8 /* LFAVEncoder.h in Headers */,
|
||||
849005B11D4B5C8400D2A3D5 /* amf.h in Headers */,
|
||||
843723AB1D4F260A002B398B /* GPUImageAverageLuminanceThresholdFilter.h in Headers */,
|
||||
843723F71D4F260A002B398B /* GPUImageFilter.h in Headers */,
|
||||
8437240F1D4F260A002B398B /* GPUImageHalftoneFilter.h in Headers */,
|
||||
843723A11D4F260A002B398B /* GPUImageAdaptiveThresholdFilter.h in Headers */,
|
||||
843723CF1D4F260A002B398B /* GPUImageColorPackingFilter.h in Headers */,
|
||||
843723B91D4F260A002B398B /* GPUImageCGAColorspaceFilter.h in Headers */,
|
||||
B2CD146D1D45F18B008082E8 /* AVEncoder.h in Headers */,
|
||||
843724051D4F260A002B398B /* GPUImageGaussianBlurFilter.h in Headers */,
|
||||
843724B31D4F260A002B398B /* GPUImageStillCamera.h in Headers */,
|
||||
843724D51D4F260A002B398B /* GPUImageTwoPassTextureSamplingFilter.h in Headers */,
|
||||
@@ -1680,7 +1669,6 @@
|
||||
843724551D4F260A002B398B /* GPUImageMosaicFilter.h in Headers */,
|
||||
843723BD1D4F260A002B398B /* GPUImageChromaKeyFilter.h in Headers */,
|
||||
843724171D4F260A002B398B /* GPUImageHighlightShadowFilter.h in Headers */,
|
||||
B2CD146D1D45F18B008082E8 /* LFAVEncoder.h in Headers */,
|
||||
84001F8E1D0015D10026C63F /* LFLiveKit.h in Headers */,
|
||||
843724671D4F260A002B398B /* GPUImageOpacityFilter.h in Headers */,
|
||||
8437247F1D4F260A002B398B /* GPUImagePosterizeFilter.h in Headers */,
|
||||
@@ -1788,8 +1776,6 @@
|
||||
84001FE21D0016380026C63F /* LFGPUImageEmptyFilter.m in Sources */,
|
||||
843724C21D4F260A002B398B /* GPUImageThresholdEdgeDetectionFilter.m in Sources */,
|
||||
84001FE41D0016380026C63F /* LFLiveSession.m in Sources */,
|
||||
B2CD14711D45F18B008082E8 /* LFMP4Atom.m in Sources */,
|
||||
849005B81D4B5C8400D2A3D5 /* hashswf.c in Sources */,
|
||||
843724BA1D4F260A002B398B /* GPUImageSwirlFilter.m in Sources */,
|
||||
843723A41D4F260A002B398B /* GPUImageAddBlendFilter.m in Sources */,
|
||||
843723B01D4F260A002B398B /* GPUImageBoxBlurFilter.m in Sources */,
|
||||
@@ -1797,10 +1783,10 @@
|
||||
843724E41D4F260A002B398B /* GPUImageWhiteBalanceFilter.m in Sources */,
|
||||
843724101D4F260A002B398B /* GPUImageHalftoneFilter.m in Sources */,
|
||||
843724301D4F260A002B398B /* GPUImageKuwaharaFilter.m in Sources */,
|
||||
B2CD14711D45F18B008082E8 /* MP4Atom.m in Sources */,
|
||||
843724201D4F260A002B398B /* GPUImageHistogramFilter.m in Sources */,
|
||||
8437246E1D4F260A002B398B /* GPUImageOverlayBlendFilter.m in Sources */,
|
||||
843723A81D4F260A002B398B /* GPUImageAmatorkaFilter.m in Sources */,
|
||||
B2CD14711D45F18B008082E8 /* LFMP4Atom.m in Sources */,
|
||||
84001FE61D0016380026C63F /* LFAudioFrame.m in Sources */,
|
||||
843724C41D4F260A002B398B /* GPUImageThresholdedNonMaximumSuppressionFilter.m in Sources */,
|
||||
843724F91D4F260A002B398B /* error.c in Sources */,
|
||||
@@ -1812,10 +1798,7 @@
|
||||
84001FD41D0016380026C63F /* LFVideoCapture.m in Sources */,
|
||||
843723B81D4F260A002B398B /* GPUImageCannyEdgeDetectionFilter.m in Sources */,
|
||||
84001FE81D0016380026C63F /* LFFrame.m in Sources */,
|
||||
<<<<<<< HEAD
|
||||
B2CD14721D45F18B008082E8 /* LFNALUnit.cpp in Sources */,
|
||||
=======
|
||||
>>>>>>> rename h264 encode lib to avoid duplicate symbol error
|
||||
B2CD14721D45F18B008082E8 /* NALUnit.cpp in Sources */,
|
||||
843724CE1D4F260A002B398B /* GPUImageTransformFilter.m in Sources */,
|
||||
843723E81D4F260A002B398B /* GPUImageDissolveBlendFilter.m in Sources */,
|
||||
843723D81D4F260A002B398B /* GPUImageCropFilter.m in Sources */,
|
||||
@@ -1824,7 +1807,6 @@
|
||||
843723F21D4F260A002B398B /* GPUImageExposureFilter.m in Sources */,
|
||||
8437244E1D4F260A002B398B /* GPUImageMaskFilter.m in Sources */,
|
||||
843724841D4F260A002B398B /* GPUImageRawDataInput.m in Sources */,
|
||||
B2CD14721D45F18B008082E8 /* LFNALUnit.cpp in Sources */,
|
||||
B289F1DC1D3DE77F00D9C7A5 /* LFStreamingBuffer.m in Sources */,
|
||||
843723F01D4F260A002B398B /* GPUImageExclusionBlendFilter.m in Sources */,
|
||||
843724F31D4F260A002B398B /* GPUImageView.m in Sources */,
|
||||
@@ -1865,10 +1847,10 @@
|
||||
843724781D4F260A002B398B /* GPUImagePixellatePositionFilter.m in Sources */,
|
||||
8437245A1D4F260A002B398B /* GPUImageMotionDetector.m in Sources */,
|
||||
84001FD21D0016380026C63F /* LFAudioCapture.m in Sources */,
|
||||
B2CD14751D45F18B008082E8 /* LFVideoEncoder.m in Sources */,
|
||||
843724B81D4F260A002B398B /* GPUImageSubtractBlendFilter.m in Sources */,
|
||||
843724741D4F260A002B398B /* GPUImagePinchDistortionFilter.m in Sources */,
|
||||
843724D61D4F260A002B398B /* GPUImageTwoPassTextureSamplingFilter.m in Sources */,
|
||||
B2CD14751D45F18B008082E8 /* VideoEncoder.m in Sources */,
|
||||
843723DA1D4F260A002B398B /* GPUImageCrosshairGenerator.m in Sources */,
|
||||
843724A01D4F260A002B398B /* GPUImageSketchFilter.m in Sources */,
|
||||
843723A01D4F260A002B398B /* GPUImage3x3TextureSamplingFilter.m in Sources */,
|
||||
@@ -1878,7 +1860,6 @@
|
||||
843723D61D4F260A002B398B /* GPUImageContrastFilter.m in Sources */,
|
||||
843724BC1D4F260A002B398B /* GPUImageTextureInput.m in Sources */,
|
||||
843724521D4F260A002B398B /* GPUImageMissEtikateFilter.m in Sources */,
|
||||
B2CD14751D45F18B008082E8 /* LFVideoEncoder.m in Sources */,
|
||||
B2CD146F1D45F18B008082E8 /* LICENSE.markdown in Sources */,
|
||||
B289F1DE1D3DE77F00D9C7A5 /* LFStreamRtmpSocket.m in Sources */,
|
||||
843724CA1D4F260A002B398B /* GPUImageToneCurveFilter.m in Sources */,
|
||||
@@ -1986,14 +1967,13 @@
|
||||
843723AC1D4F260A002B398B /* GPUImageAverageLuminanceThresholdFilter.m in Sources */,
|
||||
843723FA1D4F260A002B398B /* GPUImageFilterGroup.m in Sources */,
|
||||
84001FE01D0016380026C63F /* LFGPUImageBeautyFilter.m in Sources */,
|
||||
B2CD146E1D45F18B008082E8 /* LFAVEncoder.mm in Sources */,
|
||||
843723FC1D4F260A002B398B /* GPUImageFilterPipeline.m in Sources */,
|
||||
843724441D4F260A002B398B /* GPUImageLowPassFilter.m in Sources */,
|
||||
B2CD146E1D45F18B008082E8 /* AVEncoder.mm in Sources */,
|
||||
843725011D4F260A002B398B /* rtmp.c in Sources */,
|
||||
843724221D4F260A002B398B /* GPUImageHistogramGenerator.m in Sources */,
|
||||
843724621D4F260A002B398B /* GPUImageNobleCornerDetectionFilter.m in Sources */,
|
||||
843724341D4F260A002B398B /* GPUImageLanczosResamplingFilter.m in Sources */,
|
||||
B2CD146E1D45F18B008082E8 /* LFAVEncoder.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
Generated
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -51,10 +51,10 @@
|
||||
/** The beautyFace control capture shader filter empty or beautiy */
|
||||
@property (nonatomic, assign) BOOL beautyFace;
|
||||
|
||||
/** The beautyLevel control beautyFace Level. Default is 0.5, between 0.0 ~ 1.0 */
|
||||
/** The beautyLevel control beautyFace Level, default 0.5, between 0.0 ~ 1.0 */
|
||||
@property (nonatomic, assign) CGFloat beautyLevel;
|
||||
|
||||
/** The brightLevel control brightness Level, Default is 0.5, between 0.0 ~ 1.0 */
|
||||
/** The brightLevel control brightness Level, default 0.5, between 0.0 ~ 1.0 */
|
||||
@property (nonatomic, assign) CGFloat brightLevel;
|
||||
|
||||
/** The torch control camera zoom scale default 1.0, between 1.0 ~ 3.0 */
|
||||
@@ -69,9 +69,6 @@
|
||||
/** The muted control callbackAudioData,muted will memset 0.*/
|
||||
@property (nonatomic, assign) BOOL muted;
|
||||
|
||||
/* The adaptiveBitrate control auto adjust bitrate. Default is NO */
|
||||
@property (nonatomic, assign) BOOL adaptiveBitrate;
|
||||
|
||||
/** The stream control upload and package*/
|
||||
@property (nullable, nonatomic, strong, readonly) LFLiveStreamInfo *streamInfo;
|
||||
|
||||
|
||||
+16
-24
@@ -11,7 +11,6 @@
|
||||
#import "LFAudioCapture.h"
|
||||
#import "LFHardwareVideoEncoder.h"
|
||||
#import "LFHardwareAudioEncoder.h"
|
||||
#import "LFH264VideoEncoder.h"
|
||||
#import "LFStreamRTMPSocket.h"
|
||||
#import "LFLiveStreamInfo.h"
|
||||
#import "LFGPUImageBeautyFilter.h"
|
||||
@@ -54,8 +53,6 @@
|
||||
|
||||
/** 时间戳 */
|
||||
#define NOW (CACurrentMediaTime()*1000)
|
||||
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
|
||||
|
||||
@interface LFLiveSession ()
|
||||
|
||||
@property (nonatomic, assign) uint64_t timestamp;
|
||||
@@ -73,8 +70,6 @@
|
||||
_audioConfiguration = audioConfiguration;
|
||||
_videoConfiguration = videoConfiguration;
|
||||
_lock = dispatch_semaphore_create(1);
|
||||
_adaptiveBitrate = NO;
|
||||
_isFirstFrame = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -125,7 +120,7 @@
|
||||
self.isFirstFrame = YES;
|
||||
self.uploading = YES;
|
||||
}
|
||||
} else if(status == LFLiveStop || status == LFLiveError){
|
||||
}else if(status == LFLiveStop || status == LFLiveError){
|
||||
self.uploading = NO;
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
@@ -156,20 +151,16 @@
|
||||
}
|
||||
|
||||
- (void)socketBufferStatus:(nullable id<LFStreamSocket>)socket status:(LFLiveBuffferState)status {
|
||||
if (self.adaptiveBitrate) {
|
||||
NSUInteger videoBitRate = [_videoEncoder videoBitRate];
|
||||
if (status == LFLiveBuffferDecline) {
|
||||
if (videoBitRate < _videoConfiguration.videoMaxBitRate) {
|
||||
videoBitRate = videoBitRate + 50 * 1000;
|
||||
[_videoEncoder setVideoBitRate:videoBitRate];
|
||||
NSLog(@"Increase bitrate %@", @(videoBitRate));
|
||||
}
|
||||
} else {
|
||||
if (videoBitRate > _videoConfiguration.videoMinBitRate) {
|
||||
videoBitRate = videoBitRate - 100 * 1000;
|
||||
[_videoEncoder setVideoBitRate:videoBitRate];
|
||||
NSLog(@"Decline bitrate %@", @(videoBitRate));
|
||||
}
|
||||
NSUInteger videoBitRate = [_videoEncoder videoBitRate];
|
||||
if (status == LFLiveBuffferDecline) {
|
||||
if (videoBitRate < _videoConfiguration.videoMaxBitRate) {
|
||||
videoBitRate = videoBitRate + 50 * 1000;
|
||||
[_videoEncoder setVideoBitRate:videoBitRate];
|
||||
}
|
||||
} else {
|
||||
if (videoBitRate > _videoConfiguration.videoMinBitRate) {
|
||||
videoBitRate = videoBitRate - 100 * 1000;
|
||||
[_videoEncoder setVideoBitRate:videoBitRate];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,11 +291,12 @@
|
||||
|
||||
- (id<LFVideoEncoding>)videoEncoder {
|
||||
if (!_videoEncoder) {
|
||||
if (SYSTEM_VERSION_LESS_THAN(@"8.0")) {
|
||||
if([[UIDevice currentDevice].systemVersion floatValue] < 8.0){
|
||||
_videoEncoder = [[LFH264VideoEncoder alloc] initWithVideoStreamConfiguration:_videoConfiguration];
|
||||
} else {
|
||||
}else{
|
||||
_videoEncoder = [[LFHardwareVideoEncoder alloc] initWithVideoStreamConfiguration:_videoConfiguration];
|
||||
}
|
||||
|
||||
[_videoEncoder setDelegate:self];
|
||||
}
|
||||
return _videoEncoder;
|
||||
@@ -328,9 +320,9 @@
|
||||
- (uint64_t)currentTimestamp {
|
||||
dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER);
|
||||
uint64_t currentts = 0;
|
||||
if (_isFirstFrame) {
|
||||
if (_isFirstFrame == true) {
|
||||
_timestamp = NOW;
|
||||
_isFirstFrame = NO;
|
||||
_isFirstFrame = false;
|
||||
currentts = 0;
|
||||
} else {
|
||||
currentts = NOW - _timestamp;
|
||||
|
||||
@@ -124,7 +124,6 @@ NSString *const LFAudioComponentFailedToCreateNotification = @"LFAudioComponentF
|
||||
dispatch_async(self.taskQueue, ^{
|
||||
self.isRunning = YES;
|
||||
NSLog(@"MicrophoneSource: startRunning");
|
||||
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
|
||||
AudioOutputUnitStart(self.componetInstance);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -12,17 +12,17 @@
|
||||
#import <AVFoundation/AVMediaFormat.h>
|
||||
#import <AVFoundation/AVVideoSettings.h>
|
||||
#import "sys/stat.h"
|
||||
#import "LFVideoEncoder.h"
|
||||
#import "LFMP4Atom.h"
|
||||
#import "VideoEncoder.h"
|
||||
#import "MP4Atom.h"
|
||||
|
||||
typedef int (^encoder_handler_t)(NSArray *data, CMTimeValue ptsValue);
|
||||
typedef int (^param_handler_t)(NSData *params);
|
||||
|
||||
@interface LFAVEncoder : NSObject
|
||||
@interface AVEncoder : NSObject
|
||||
|
||||
@property (atomic) NSUInteger bitrate;
|
||||
|
||||
+ (LFAVEncoder *)encoderForHeight:(int)height andWidth:(int)width bitrate:(int)bitrate;
|
||||
+ (AVEncoder *)encoderForHeight:(int)height andWidth:(int)width bitrate:(int)bitrate;
|
||||
|
||||
- (void)encodeWithBlock:(encoder_handler_t)block onParams:(param_handler_t)paramsHandler;
|
||||
- (void)encodeFrame:(CMSampleBufferRef)sampleBuffer;
|
||||
@@ -6,8 +6,8 @@
|
||||
// Copyright (c) 2013 GDCL http://www.gdcl.co.uk/license.htm
|
||||
//
|
||||
|
||||
#import "LFAVEncoder.h"
|
||||
#import "LFNALUnit.h"
|
||||
#import "AVEncoder.h"
|
||||
#import "NALUnit.h"
|
||||
|
||||
static void *AVEncoderContext = &AVEncoderContext;
|
||||
|
||||
@@ -19,14 +19,14 @@ static unsigned int to_host(unsigned char *p){
|
||||
#define MAX_FILENAME_INDEX 5 // filenames "capture1.mp4" wraps at capture5.mp4
|
||||
|
||||
|
||||
@interface LFAVEncoder ()
|
||||
@interface AVEncoder ()
|
||||
|
||||
{
|
||||
// initial writer, used to obtain SPS/PPS from header
|
||||
LFVideoEncoder *_headerWriter;
|
||||
VideoEncoder *_headerWriter;
|
||||
|
||||
// main encoder/writer
|
||||
LFVideoEncoder *_writer;
|
||||
VideoEncoder *_writer;
|
||||
|
||||
// writer output file (input to our extractor) and monitoring
|
||||
NSFileHandle *_inputFile;
|
||||
@@ -70,12 +70,12 @@ static unsigned int to_host(unsigned char *p){
|
||||
|
||||
@end
|
||||
|
||||
@implementation LFAVEncoder
|
||||
@implementation AVEncoder
|
||||
|
||||
@synthesize bitspersecond = _bitspersecond;
|
||||
|
||||
+ (LFAVEncoder *)encoderForHeight:(int)height andWidth:(int)width bitrate:(int)bitrate {
|
||||
LFAVEncoder *enc = [LFAVEncoder alloc];
|
||||
+ (AVEncoder *)encoderForHeight:(int)height andWidth:(int)width bitrate:(int)bitrate {
|
||||
AVEncoder *enc = [AVEncoder alloc];
|
||||
[enc initForHeight:height andWidth:width bitrate:bitrate];
|
||||
return enc;
|
||||
}
|
||||
@@ -91,12 +91,12 @@ static unsigned int to_host(unsigned char *p){
|
||||
_width = width;
|
||||
_bitrate = bitrate;
|
||||
NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:@"params.mp4"];
|
||||
_headerWriter = [LFVideoEncoder encoderForPath:path Height:height andWidth:width bitrate:self.bitrate];
|
||||
_headerWriter = [VideoEncoder encoderForPath:path Height:height andWidth:width bitrate:self.bitrate];
|
||||
_times = [NSMutableArray arrayWithCapacity:10];
|
||||
|
||||
// swap between 3 filenames
|
||||
_currentFile = 1;
|
||||
_writer = [LFVideoEncoder encoderForPath:[self makeFilename] Height:height andWidth:width bitrate:self.bitrate];
|
||||
_writer = [VideoEncoder encoderForPath:[self makeFilename] Height:height andWidth:width bitrate:self.bitrate];
|
||||
|
||||
[self addObserver:self forKeyPath:NSStringFromSelector(@selector(bitrate)) options:0 context:AVEncoderContext];
|
||||
}
|
||||
@@ -123,9 +123,9 @@ static unsigned int to_host(unsigned char *p){
|
||||
NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:path];
|
||||
struct stat s;
|
||||
fstat([file fileDescriptor], &s);
|
||||
LFMP4Atom *movie = [LFMP4Atom atomAt:0 size:s.st_size type:(OSType)('file') inFile:file];
|
||||
LFMP4Atom *moov = [movie childOfType:(OSType)('moov') startAt:0];
|
||||
LFMP4Atom *trak = nil;
|
||||
MP4Atom *movie = [MP4Atom atomAt:0 size:s.st_size type:(OSType)('file') inFile:file];
|
||||
MP4Atom *moov = [movie childOfType:(OSType)('moov') startAt:0];
|
||||
MP4Atom *trak = nil;
|
||||
if (moov != nil) {
|
||||
for (;; ) {
|
||||
trak = [moov nextChild];
|
||||
@@ -134,7 +134,7 @@ static unsigned int to_host(unsigned char *p){
|
||||
}
|
||||
|
||||
if (trak.type == (OSType)('trak')) {
|
||||
LFMP4Atom *tkhd = [trak childOfType:(OSType)('tkhd') startAt:0];
|
||||
MP4Atom *tkhd = [trak childOfType:(OSType)('tkhd') startAt:0];
|
||||
NSData *verflags = [tkhd readAt:0 size:4];
|
||||
unsigned char *p = (unsigned char *)[verflags bytes];
|
||||
if (p[3] & 1) {
|
||||
@@ -145,13 +145,13 @@ static unsigned int to_host(unsigned char *p){
|
||||
}
|
||||
}
|
||||
}
|
||||
LFMP4Atom *stsd = nil;
|
||||
MP4Atom *stsd = nil;
|
||||
if (trak != nil) {
|
||||
LFMP4Atom *media = [trak childOfType:(OSType)('mdia') startAt:0];
|
||||
MP4Atom *media = [trak childOfType:(OSType)('mdia') startAt:0];
|
||||
if (media != nil) {
|
||||
LFMP4Atom *minf = [media childOfType:(OSType)('minf') startAt:0];
|
||||
MP4Atom *minf = [media childOfType:(OSType)('minf') startAt:0];
|
||||
if (minf != nil) {
|
||||
LFMP4Atom *stbl = [minf childOfType:(OSType)('stbl') startAt:0];
|
||||
MP4Atom *stbl = [minf childOfType:(OSType)('stbl') startAt:0];
|
||||
if (stbl != nil) {
|
||||
stsd = [stbl childOfType:(OSType)('stsd') startAt:0];
|
||||
}
|
||||
@@ -159,9 +159,9 @@ static unsigned int to_host(unsigned char *p){
|
||||
}
|
||||
}
|
||||
if (stsd != nil) {
|
||||
LFMP4Atom *avc1 = [stsd childOfType:(OSType)('avc1') startAt:8];
|
||||
MP4Atom *avc1 = [stsd childOfType:(OSType)('avc1') startAt:8];
|
||||
if (avc1 != nil) {
|
||||
LFMP4Atom *esd = [avc1 childOfType:(OSType)('avcC') startAt:78];
|
||||
MP4Atom *esd = [avc1 childOfType:(OSType)('avcC') startAt:78];
|
||||
if (esd != nil) {
|
||||
// this is the avcC record that we are looking for
|
||||
_avcC = [esd readAt:0 size:esd.length];
|
||||
@@ -229,14 +229,14 @@ static unsigned int to_host(unsigned char *p){
|
||||
if (st.st_size > OUTPUT_FILE_SWITCH_POINT || self.bitrateChanged) {
|
||||
self.bitrateChanged = NO;
|
||||
_swapping = YES;
|
||||
LFVideoEncoder *oldVideo = _writer;
|
||||
VideoEncoder *oldVideo = _writer;
|
||||
|
||||
// construct a new writer to the next filename
|
||||
if (++_currentFile > MAX_FILENAME_INDEX) {
|
||||
_currentFile = 1;
|
||||
}
|
||||
//NSLog(@"Swap to file %d", _currentFile);
|
||||
_writer = [LFVideoEncoder encoderForPath:[self makeFilename] Height:_height andWidth:_width bitrate:self.bitrate];
|
||||
_writer = [VideoEncoder encoderForPath:[self makeFilename] Height:_height andWidth:_width bitrate:self.bitrate];
|
||||
|
||||
// to do this seamlessly requires a few steps in the right order
|
||||
// first, suspend the read source
|
||||
@@ -385,7 +385,7 @@ static unsigned int to_host(unsigned char *p){
|
||||
int naltype = pNal[0] & 0x1f;
|
||||
|
||||
if (_pendingNALU) {
|
||||
LFNALUnit nal(pNal, [nalu length]);
|
||||
NALUnit nal(pNal, [nalu length]);
|
||||
|
||||
// we have existing data —is this the same frame?
|
||||
// typically there are a couple of NALUs per frame in iOS encoding.
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// LFMP4Atom.h
|
||||
// MP4Atom.h
|
||||
// Encoder Demo
|
||||
//
|
||||
// Created by Geraint Davies on 15/01/2013.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface LFMP4Atom : NSObject
|
||||
@interface MP4Atom : NSObject
|
||||
|
||||
{
|
||||
NSFileHandle *_file;
|
||||
@@ -20,11 +20,11 @@
|
||||
@property OSType type;
|
||||
@property int64_t length;
|
||||
|
||||
+ (LFMP4Atom *)atomAt:(int64_t)offset size:(int)length type:(OSType)fourcc inFile:(NSFileHandle *)handle;
|
||||
+ (MP4Atom *)atomAt:(int64_t)offset size:(int)length type:(OSType)fourcc inFile:(NSFileHandle *)handle;
|
||||
- (BOOL)init:(int64_t)offset size:(int)length type:(OSType)fourcc inFile:(NSFileHandle *)handle;
|
||||
- (NSData *)readAt:(int64_t)offset size:(int)length;
|
||||
- (BOOL)setChildOffset:(int64_t)offset;
|
||||
- (LFMP4Atom *)nextChild;
|
||||
- (LFMP4Atom *)childOfType:(OSType)fourcc startAt:(int64_t)offset;
|
||||
- (MP4Atom *)nextChild;
|
||||
- (MP4Atom *)childOfType:(OSType)fourcc startAt:(int64_t)offset;
|
||||
|
||||
@end
|
||||
@@ -1,24 +1,24 @@
|
||||
//
|
||||
// LFMP4Atom.m
|
||||
// MP4Atom.m
|
||||
// Encoder Demo
|
||||
//
|
||||
// Created by Geraint Davies on 15/01/2013.
|
||||
// Copyright (c) 2013 GDCL http://www.gdcl.co.uk/license.htm
|
||||
//
|
||||
|
||||
#import "LFMP4Atom.h"
|
||||
#import "MP4Atom.h"
|
||||
|
||||
static unsigned int to_host(unsigned char *p){
|
||||
return (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];
|
||||
}
|
||||
|
||||
@implementation LFMP4Atom
|
||||
@implementation MP4Atom
|
||||
|
||||
@synthesize type = _type;
|
||||
@synthesize length = _length;
|
||||
|
||||
+ (LFMP4Atom *)atomAt:(int64_t)offset size:(int)length type:(OSType)fourcc inFile:(NSFileHandle *)handle {
|
||||
LFMP4Atom *atom = [LFMP4Atom alloc];
|
||||
+ (MP4Atom *)atomAt:(int64_t)offset size:(int)length type:(OSType)fourcc inFile:(NSFileHandle *)handle {
|
||||
MP4Atom *atom = [MP4Atom alloc];
|
||||
if (![atom init:offset size:length type:fourcc inFile:handle]) {
|
||||
return nil;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ static unsigned int to_host(unsigned char *p){
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (LFMP4Atom *)nextChild {
|
||||
- (MP4Atom *)nextChild {
|
||||
if (_nextChild <= (_length - 8)) {
|
||||
[_file seekToFileOffset:_offset + _nextChild];
|
||||
NSData *data = [_file readDataOfLength:8];
|
||||
@@ -73,14 +73,14 @@ static unsigned int to_host(unsigned char *p){
|
||||
int64_t offset = _nextChild + cHeader;
|
||||
_nextChild += len;
|
||||
len -= cHeader;
|
||||
return [LFMP4Atom atomAt:offset+_offset size:len type:fourcc inFile:_file];
|
||||
return [MP4Atom atomAt:offset+_offset size:len type:fourcc inFile:_file];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (LFMP4Atom *)childOfType:(OSType)fourcc startAt:(int64_t)offset {
|
||||
- (MP4Atom *)childOfType:(OSType)fourcc startAt:(int64_t)offset {
|
||||
[self setChildOffset:offset];
|
||||
LFMP4Atom *child = nil;
|
||||
MP4Atom *child = nil;
|
||||
do {
|
||||
child = [self nextChild];
|
||||
} while ((child != nil) && (child.type != fourcc));
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
|
||||
|
||||
#include "LFNALUnit.h"
|
||||
#include "NALUnit.h"
|
||||
|
||||
|
||||
// --- core NAL Unit implementation ------------------------------
|
||||
|
||||
LFNALUnit::LFNALUnit()
|
||||
NALUnit::NALUnit()
|
||||
: m_pStart(NULL),
|
||||
m_cBytes(0){
|
||||
}
|
||||
|
||||
bool
|
||||
LFNALUnit::GetStartCode(const BYTE *& pBegin, const BYTE *& pStart, int& cRemain){
|
||||
NALUnit::GetStartCode(const BYTE *& pBegin, const BYTE *& pStart, int& cRemain){
|
||||
// start code is any number of 00 followed by 00 00 01
|
||||
// We need to record the first 00 in pBegin and the first byte
|
||||
// following the startcode in pStart.
|
||||
@@ -54,7 +54,7 @@ LFNALUnit::GetStartCode(const BYTE *& pBegin, const BYTE *& pStart, int& cRemain
|
||||
}
|
||||
|
||||
bool
|
||||
LFNALUnit::Parse(const BYTE *pBuffer, int cSpace, int LengthSize, bool bEnd){
|
||||
NALUnit::Parse(const BYTE *pBuffer, int cSpace, int LengthSize, bool bEnd){
|
||||
// if we get the start code but not the whole
|
||||
// NALU, we can return false but still have the length property valid
|
||||
m_cBytes = 0;
|
||||
@@ -102,14 +102,14 @@ LFNALUnit::Parse(const BYTE *pBuffer, int cSpace, int LengthSize, bool bEnd){
|
||||
|
||||
// bitwise access to data
|
||||
void
|
||||
LFNALUnit::ResetBitstream(){
|
||||
NALUnit::ResetBitstream(){
|
||||
m_idx = 0;
|
||||
m_nBits = 0;
|
||||
m_cZeros = 0;
|
||||
}
|
||||
|
||||
void
|
||||
LFNALUnit::Skip(int nBits){
|
||||
NALUnit::Skip(int nBits){
|
||||
if (nBits < m_nBits) {
|
||||
m_nBits -= nBits;
|
||||
} else {
|
||||
@@ -129,7 +129,7 @@ LFNALUnit::Skip(int nBits){
|
||||
|
||||
// get the next byte, removing emulation prevention bytes
|
||||
BYTE
|
||||
LFNALUnit::GetBYTE(){
|
||||
NALUnit::GetBYTE(){
|
||||
if (m_idx >= m_cBytes) {
|
||||
return 0;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ LFNALUnit::GetBYTE(){
|
||||
}
|
||||
|
||||
unsigned long
|
||||
LFNALUnit::GetBit(){
|
||||
NALUnit::GetBit(){
|
||||
if (m_nBits == 0) {
|
||||
m_byte = GetBYTE();
|
||||
m_nBits = 8;
|
||||
@@ -161,7 +161,7 @@ LFNALUnit::GetBit(){
|
||||
}
|
||||
|
||||
unsigned long
|
||||
LFNALUnit::GetWord(int nBits){
|
||||
NALUnit::GetWord(int nBits){
|
||||
unsigned long u = 0;
|
||||
while (nBits > 0) {
|
||||
u <<= 1;
|
||||
@@ -172,7 +172,7 @@ LFNALUnit::GetWord(int nBits){
|
||||
}
|
||||
|
||||
unsigned long
|
||||
LFNALUnit::GetUE(){
|
||||
NALUnit::GetUE(){
|
||||
// Exp-Golomb entropy coding: leading zeros, then a one, then
|
||||
// the data bits. The number of leading zeros is the number of
|
||||
// data bits, counting up from that number of 1s as the base.
|
||||
@@ -188,7 +188,7 @@ LFNALUnit::GetUE(){
|
||||
}
|
||||
|
||||
long
|
||||
LFNALUnit::GetSE(){
|
||||
NALUnit::GetSE(){
|
||||
// same as UE but signed.
|
||||
// basically the unsigned numbers are used as codes to indicate signed numbers in pairs
|
||||
// in increasing value. Thus the encoded values
|
||||
@@ -206,7 +206,7 @@ LFNALUnit::GetSE(){
|
||||
}
|
||||
|
||||
// --- sequence params parsing ---------------
|
||||
LFSeqParamSet::LFSeqParamSet()
|
||||
SeqParamSet::SeqParamSet()
|
||||
: m_cx(0),
|
||||
m_cy(0),
|
||||
m_FrameBits(0){
|
||||
@@ -214,7 +214,7 @@ LFSeqParamSet::LFSeqParamSet()
|
||||
}
|
||||
|
||||
void
|
||||
ScalingList(int size, LFNALUnit *pnalu){
|
||||
ScalingList(int size, NALUnit *pnalu){
|
||||
long lastScale = 8;
|
||||
long nextScale = 8;
|
||||
for (int j = 0; j < size; j++) {
|
||||
@@ -228,8 +228,8 @@ ScalingList(int size, LFNALUnit *pnalu){
|
||||
}
|
||||
|
||||
bool
|
||||
LFSeqParamSet::Parse(LFNALUnit *pnalu){
|
||||
if (pnalu->Type() != LFNALUnit::NAL_Sequence_Params) {
|
||||
SeqParamSet::Parse(NALUnit *pnalu){
|
||||
if (pnalu->Type() != NALUnit::NAL_Sequence_Params) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -339,11 +339,11 @@ LFSeqParamSet::Parse(LFNALUnit *pnalu){
|
||||
|
||||
// --- slice header --------------------
|
||||
bool
|
||||
LFSliceHeader::Parse(LFNALUnit *pnalu){
|
||||
SliceHeader::Parse(NALUnit *pnalu){
|
||||
switch (pnalu->Type()) {
|
||||
case LFNALUnit::NAL_IDR_Slice:
|
||||
case LFNALUnit::NAL_Slice:
|
||||
case LFNALUnit::NAL_PartitionA:
|
||||
case NALUnit::NAL_IDR_Slice:
|
||||
case NALUnit::NAL_Slice:
|
||||
case NALUnit::NAL_PartitionA:
|
||||
// all these begin with a slice header
|
||||
break;
|
||||
|
||||
@@ -366,7 +366,7 @@ LFSliceHeader::Parse(LFNALUnit *pnalu){
|
||||
// --- SEI ----------------------
|
||||
|
||||
|
||||
LFSEIMessage::LFSEIMessage(LFNALUnit *pnalu){
|
||||
SEIMessage::SEIMessage(NALUnit *pnalu){
|
||||
m_pnalu = pnalu;
|
||||
const BYTE *p = pnalu->Start();
|
||||
p++; // nalu type byte
|
||||
@@ -387,7 +387,7 @@ LFSEIMessage::LFSEIMessage(LFNALUnit *pnalu){
|
||||
m_idxPayload = int(p - m_pnalu->Start());
|
||||
}
|
||||
|
||||
LFavcCHeader::LFavcCHeader(const BYTE *header, int cBytes){
|
||||
avcCHeader::avcCHeader(const BYTE *header, int cBytes){
|
||||
if (cBytes < 8) {
|
||||
return;
|
||||
}
|
||||
@@ -405,7 +405,7 @@ LFavcCHeader::LFavcCHeader(const BYTE *header, int cBytes){
|
||||
return;
|
||||
}
|
||||
if (i == 0) {
|
||||
LFNALUnit n(header, cThis);
|
||||
NALUnit n(header, cThis);
|
||||
m_sps = n;
|
||||
}
|
||||
header += cThis;
|
||||
@@ -417,7 +417,7 @@ LFavcCHeader::LFavcCHeader(const BYTE *header, int cBytes){
|
||||
if (cPPS > 0) {
|
||||
int cThis = (header[1] << 8) + header[2];
|
||||
header += 3;
|
||||
LFNALUnit n(header, cThis);
|
||||
NALUnit n(header, cThis);
|
||||
m_pps = n;
|
||||
}
|
||||
}
|
||||
@@ -18,25 +18,25 @@ typedef unsigned long ULONG;
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
class LFNALUnit
|
||||
class NALUnit
|
||||
{
|
||||
public:
|
||||
LFNALUnit();
|
||||
LFNALUnit(const BYTE* pStart, int len){
|
||||
NALUnit();
|
||||
NALUnit(const BYTE* pStart, int len){
|
||||
m_pStart = m_pStartCodeStart = pStart;
|
||||
m_cBytes = len;
|
||||
ResetBitstream();
|
||||
}
|
||||
virtual ~LFNALUnit() {
|
||||
virtual ~NALUnit() {
|
||||
}
|
||||
|
||||
// assignment copies a pointer into a fixed buffer managed elsewhere. We do not copy the data
|
||||
LFNALUnit(const LFNALUnit &r){
|
||||
NALUnit(const NALUnit &r){
|
||||
m_pStart = r.m_pStart;
|
||||
m_cBytes = r.m_cBytes;
|
||||
ResetBitstream();
|
||||
}
|
||||
const LFNALUnit& operator = (const LFNALUnit &r)
|
||||
const NALUnit& operator = (const NALUnit &r)
|
||||
{
|
||||
m_pStart = r.m_pStart;
|
||||
m_cBytes = r.m_cBytes;
|
||||
@@ -109,11 +109,11 @@ private:
|
||||
|
||||
|
||||
// simple parser for the Sequence parameter set things that we need
|
||||
class LFSeqParamSet
|
||||
class SeqParamSet
|
||||
{
|
||||
public:
|
||||
LFSeqParamSet();
|
||||
bool Parse(LFNALUnit *pnalu);
|
||||
SeqParamSet();
|
||||
bool Parse(NALUnit *pnalu);
|
||||
int FrameBits(){
|
||||
return m_FrameBits;
|
||||
}
|
||||
@@ -162,12 +162,12 @@ public:
|
||||
return m_Compatibility;
|
||||
}
|
||||
|
||||
LFNALUnit *NALU() {
|
||||
NALUnit *NALU() {
|
||||
return &m_nalu;
|
||||
}
|
||||
|
||||
private:
|
||||
LFNALUnit m_nalu;
|
||||
NALUnit m_nalu;
|
||||
int m_FrameBits;
|
||||
long m_cx;
|
||||
long m_cy;
|
||||
@@ -180,15 +180,15 @@ private:
|
||||
};
|
||||
|
||||
// extract frame num from slice headers
|
||||
class LFSliceHeader
|
||||
class SliceHeader
|
||||
{
|
||||
public:
|
||||
LFSliceHeader(int nBitsFrame)
|
||||
SliceHeader(int nBitsFrame)
|
||||
: m_framenum(0),
|
||||
m_nBitsFrame(nBitsFrame){
|
||||
}
|
||||
|
||||
bool Parse(LFNALUnit *pnalu);
|
||||
bool Parse(NALUnit *pnalu);
|
||||
int FrameNum(){
|
||||
return m_framenum;
|
||||
}
|
||||
@@ -199,10 +199,10 @@ private:
|
||||
};
|
||||
|
||||
// SEI message structure
|
||||
class LFSEIMessage
|
||||
class SEIMessage
|
||||
{
|
||||
public:
|
||||
LFSEIMessage(LFNALUnit* pnalu);
|
||||
SEIMessage(NALUnit* pnalu);
|
||||
int Type() {
|
||||
return m_type;
|
||||
}
|
||||
@@ -216,27 +216,27 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
LFNALUnit *m_pnalu;
|
||||
NALUnit *m_pnalu;
|
||||
int m_type;
|
||||
int m_length;
|
||||
int m_idxPayload;
|
||||
};
|
||||
|
||||
// avcC structure from MP4
|
||||
class LFavcCHeader
|
||||
class avcCHeader
|
||||
{
|
||||
public:
|
||||
LFavcCHeader(const BYTE* header, int cBytes);
|
||||
LFNALUnit *sps() {
|
||||
avcCHeader(const BYTE* header, int cBytes);
|
||||
NALUnit *sps() {
|
||||
return &m_sps;
|
||||
}
|
||||
|
||||
LFNALUnit *pps() {
|
||||
NALUnit *pps() {
|
||||
return &m_pps;
|
||||
}
|
||||
|
||||
private:
|
||||
LFNALUnit m_sps;
|
||||
LFNALUnit m_pps;
|
||||
NALUnit m_sps;
|
||||
NALUnit m_pps;
|
||||
};
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
#import "AVFoundation/AVMediaFormat.h"
|
||||
#import "AVFoundation/AVVideoSettings.h"
|
||||
|
||||
@interface LFVideoEncoder : NSObject
|
||||
@interface VideoEncoder : NSObject
|
||||
|
||||
|
||||
@property NSString *path;
|
||||
@property (nonatomic, readonly) NSUInteger bitrate;
|
||||
|
||||
+ (LFVideoEncoder *)encoderForPath:(NSString *)path Height:(int)height andWidth:(int)width bitrate:(int)bitrate;
|
||||
+ (VideoEncoder *)encoderForPath:(NSString *)path Height:(int)height andWidth:(int)width bitrate:(int)bitrate;
|
||||
|
||||
- (void)initPath:(NSString *)path Height:(int)height andWidth:(int)width bitrate:(int)bitrate;
|
||||
- (void)finishWithCompletionHandler:(void (^)(void))handler;
|
||||
@@ -1,14 +1,14 @@
|
||||
//
|
||||
// LFVideoEncoder.m
|
||||
// VideoEncoder.m
|
||||
// Encoder Demo
|
||||
//
|
||||
// Created by Geraint Davies on 14/01/2013.
|
||||
// Copyright (c) 2013 GDCL http://www.gdcl.co.uk/license.htm
|
||||
//
|
||||
|
||||
#import "LFVideoEncoder.h"
|
||||
#import "VideoEncoder.h"
|
||||
|
||||
@implementation LFVideoEncoder
|
||||
@implementation VideoEncoder
|
||||
{
|
||||
AVAssetWriter *_writer;
|
||||
AVAssetWriterInput *_writerInput;
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
@synthesize path = _path;
|
||||
|
||||
+ (LFVideoEncoder *)encoderForPath:(NSString *)path Height:(int)height andWidth:(int)width bitrate:(int)bitrate {
|
||||
LFVideoEncoder *enc = [LFVideoEncoder alloc];
|
||||
+ (VideoEncoder *)encoderForPath:(NSString *)path Height:(int)height andWidth:(int)width bitrate:(int)bitrate {
|
||||
VideoEncoder *enc = [VideoEncoder alloc];
|
||||
[enc initPath:path Height:height andWidth:width bitrate:bitrate];
|
||||
return enc;
|
||||
}
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#import <CoreMedia/CoreMedia.h>
|
||||
#import <mach/mach_time.h>
|
||||
#import "LFNALUnit.h"
|
||||
#import "LFAVEncoder.h"
|
||||
#import "NALUnit.h"
|
||||
#import "AVEncoder.h"
|
||||
#import "LFH264VideoEncoder.h"
|
||||
#import "LFVideoFrame.h"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
@property (nonatomic) NSInteger currentVideoBitRate;
|
||||
@property (nonatomic, strong) dispatch_queue_t sendQueue;
|
||||
|
||||
@property (nonatomic, strong) LFAVEncoder *encoder;
|
||||
@property (nonatomic, strong) AVEncoder *encoder;
|
||||
|
||||
@property (nonatomic, strong) NSData *naluStartCode;
|
||||
@property (nonatomic, strong) NSMutableData *videoSPSandPPS;
|
||||
@@ -60,7 +60,7 @@
|
||||
[self initForFilePath];
|
||||
#endif
|
||||
|
||||
_encoder = [LFAVEncoder encoderForHeight:_configuration.videoSize.height andWidth:_configuration.videoSize.width bitrate:_configuration.videoBitRate];
|
||||
_encoder = [AVEncoder encoderForHeight:_configuration.videoSize.height andWidth:_configuration.videoSize.width bitrate:_configuration.videoBitRate];
|
||||
[_encoder encodeWithBlock:^int(NSArray* dataArray, CMTimeValue ptsValue) {
|
||||
[self incomingVideoFrames:dataArray ptsValue:ptsValue];
|
||||
return 0;
|
||||
@@ -85,8 +85,8 @@
|
||||
if (!config) {
|
||||
return;
|
||||
}
|
||||
LFavcCHeader avcC((const BYTE*)[config bytes], [config length]);
|
||||
LFSeqParamSet seqParams;
|
||||
avcCHeader avcC((const BYTE*)[config bytes], [config length]);
|
||||
SeqParamSet seqParams;
|
||||
seqParams.Parse(avcC.sps());
|
||||
|
||||
NSData* spsData = [NSData dataWithBytes:avcC.sps()->Start() length:avcC.sps()->Length()];
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_DataRateLimits, (__bridge CFArrayRef)limit);
|
||||
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_RealTime, kCFBooleanFalse);
|
||||
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_ProfileLevel, kVTProfileLevel_H264_Main_AutoLevel);
|
||||
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanTrue);
|
||||
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanFalse);
|
||||
VTSessionSetProperty(compressionSession, kVTCompressionPropertyKey_H264EntropyMode, kVTH264EntropyMode_CABAC);
|
||||
VTCompressionSessionPrepareToEncodeFrames(compressionSession);
|
||||
|
||||
|
||||
-91
@@ -1,91 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0730"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B2D23E791D348F3D00B34CA8"
|
||||
BuildableName = "LFLiveKitDemo.app"
|
||||
BlueprintName = "LFLiveKitDemo"
|
||||
ReferencedContainer = "container:LFLiveKitDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B2D23E791D348F3D00B34CA8"
|
||||
BuildableName = "LFLiveKitDemo.app"
|
||||
BlueprintName = "LFLiveKitDemo"
|
||||
ReferencedContainer = "container:LFLiveKitDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B2D23E791D348F3D00B34CA8"
|
||||
BuildableName = "LFLiveKitDemo.app"
|
||||
BlueprintName = "LFLiveKitDemo"
|
||||
ReferencedContainer = "container:LFLiveKitDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "B2D23E791D348F3D00B34CA8"
|
||||
BuildableName = "LFLiveKitDemo.app"
|
||||
BlueprintName = "LFLiveKitDemo"
|
||||
ReferencedContainer = "container:LFLiveKitDemo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
<?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>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>LFLiveKitDemo.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>B2D23E791D348F3D00B34CA8</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
Generated
BIN
Binary file not shown.
Generated
BIN
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
BIN
Binary file not shown.
@@ -1,12 +1,10 @@
|
||||
LFLiveKit
|
||||
==============
|
||||

|
||||
|
||||
|
||||
[](https://travis-ci.org/LaiFengiOS/LFLiveKit)
|
||||
[](https://raw.githubusercontent.com/chenliming777/LFLiveKit/master/LICENSE)
|
||||
[](http://cocoapods.org/?q=LFLiveKit)
|
||||
[](https://www.apple.com/nl/ios/)
|
||||
[](https://www.apple.com/nl/ios/)
|
||||

|
||||
|
||||
|
||||
@@ -29,9 +27,6 @@ LFLiveKit
|
||||
- [x] Swift Support
|
||||
- [ ] ~~FLV package and send~~
|
||||
|
||||
## Requirements
|
||||
- iOS 7.0+
|
||||
- Xcode 7.3
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -39,7 +34,7 @@ LFLiveKit
|
||||
# To integrate LFLiveKit into your Xcode project using CocoaPods, specify it in your Podfile:
|
||||
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '7.0'
|
||||
platform :ios, '8.0'
|
||||
pod 'LFLiveKit'
|
||||
|
||||
# Then, run the following command:
|
||||
@@ -63,72 +58,77 @@ LFLiveKit
|
||||
* VideoToolbox
|
||||
* AudioToolbox
|
||||
* libz
|
||||
5. Add `LMGPUImage and pili-librtmp`(static library) to your Xcode project.
|
||||
|
||||
|
||||
|
||||
## Architecture:
|
||||
|
||||
capture: LFAudioCapture and LFVideoCapture
|
||||
encode: LFHardwareAudioEncoder and LFHardwareVideoEncoder
|
||||
publish: LFStreamRtmpSocket
|
||||
|
||||
## Usage example
|
||||
|
||||
## Usage:
|
||||
#### Objective-C
|
||||
|
||||
- (LFLiveSession*)session {
|
||||
if (!_session) {
|
||||
_session = [[LFLiveSession alloc] initWithAudioConfiguration:[LFLiveAudioConfiguration defaultConfiguration] videoConfiguration:[LFLiveVideoConfiguration defaultConfiguration]];
|
||||
_session.preView = self;
|
||||
_session.delegate = self;
|
||||
}
|
||||
return _session;
|
||||
}
|
||||
|
||||
- (void)startLive {
|
||||
LFLiveStreamInfo *streamInfo = [LFLiveStreamInfo new];
|
||||
streamInfo.url = @"your server rtmp url";
|
||||
[self.session startLive:streamInfo];
|
||||
```
|
||||
- (LFLiveSession*)session {
|
||||
if (!_session) {
|
||||
_session = [[LFLiveSession alloc] initWithAudioConfiguration:[LFLiveAudioConfiguration defaultConfiguration] videoConfiguration:[LFLiveVideoConfiguration defaultConfiguration]];
|
||||
_session.preView = self;
|
||||
_session.delegate = self;
|
||||
}
|
||||
return _session;
|
||||
}
|
||||
|
||||
- (void)startLive {
|
||||
LFLiveStreamInfo *streamInfo = [LFLiveStreamInfo new];
|
||||
streamInfo.url = @"your server rtmp url";
|
||||
[self.session startLive:streamInfo];
|
||||
}
|
||||
|
||||
- (void)stopLive {
|
||||
[self.session stopLive];
|
||||
}
|
||||
|
||||
//MARK: - CallBack:
|
||||
- (void)liveSession:(nullable LFLiveSession *)session liveStateDidChange: (LFLiveState)state;
|
||||
- (void)liveSession:(nullable LFLiveSession *)session debugInfo:(nullable LFLiveDebug*)debugInfo;
|
||||
- (void)liveSession:(nullable LFLiveSession*)session errorCode:(LFLiveSocketErrorCode)errorCode;
|
||||
- (void)stopLive {
|
||||
[self.session stopLive];
|
||||
}
|
||||
|
||||
//MARK: - CallBack:
|
||||
- (void)liveSession:(nullable LFLiveSession *)session liveStateDidChange: (LFLiveState)state;
|
||||
- (void)liveSession:(nullable LFLiveSession *)session debugInfo:(nullable LFLiveDebug*)debugInfo;
|
||||
- (void)liveSession:(nullable LFLiveSession*)session errorCode:(LFLiveSocketErrorCode)errorCode;
|
||||
|
||||
```
|
||||
#### Swift
|
||||
|
||||
// import LFLiveKit in [ProjectName]-Bridging-Header.h
|
||||
import <LFLiveKit.h>
|
||||
```
|
||||
// import LFLiveKit in [ProjectName]-Bridging-Header.h
|
||||
import <LFLiveKit.h>
|
||||
|
||||
//MARK: - Getters and Setters
|
||||
lazy var session: LFLiveSession = {
|
||||
let audioConfiguration = LFLiveAudioConfiguration.defaultConfiguration()
|
||||
let videoConfiguration = LFLiveVideoConfiguration.defaultConfigurationForQuality(LFLiveVideoQuality.Low3, landscape: false)
|
||||
let session = LFLiveSession(audioConfiguration: audioConfiguration, videoConfiguration: videoConfiguration)
|
||||
|
||||
session?.delegate = self
|
||||
session?.preView = self.view
|
||||
return session!
|
||||
}()
|
||||
//MARK: - Getters and Setters
|
||||
lazy var session: LFLiveSession = {
|
||||
let audioConfiguration = LFLiveAudioConfiguration.defaultConfiguration()
|
||||
let videoConfiguration = LFLiveVideoConfiguration.defaultConfigurationForQuality(LFLiveVideoQuality.Low3, landscape: false)
|
||||
let session = LFLiveSession(audioConfiguration: audioConfiguration, videoConfiguration: videoConfiguration)
|
||||
|
||||
session?.delegate = self
|
||||
session?.preView = self.view
|
||||
return session!
|
||||
}()
|
||||
|
||||
//MARK: - Event
|
||||
func startLive() -> Void {
|
||||
let stream = LFLiveStreamInfo()
|
||||
stream.url = "your server rtmp url";
|
||||
session.startLive(stream)
|
||||
}
|
||||
//MARK: - Event
|
||||
func startLive() -> Void {
|
||||
let stream = LFLiveStreamInfo()
|
||||
stream.url = "your server rtmp url";
|
||||
session.startLive(stream)
|
||||
}
|
||||
|
||||
func stopLive() -> Void {
|
||||
session.stopLive()
|
||||
}
|
||||
|
||||
//MARK: - Callback
|
||||
func liveSession(session: LFLiveSession?, debugInfo: LFLiveDebug?)
|
||||
func liveSession(session: LFLiveSession?, errorCode: LFLiveSocketErrorCode)
|
||||
func liveSession(session: LFLiveSession?, liveStateDidChange state: LFLiveState)
|
||||
|
||||
|
||||
## Release History
|
||||
* 2.0.0
|
||||
* CHANGE: modify bugs,support ios7 live.
|
||||
func stopLive() -> Void {
|
||||
session.stopLive()
|
||||
}
|
||||
|
||||
//MARK: - Callback
|
||||
func liveSession(session: LFLiveSession?, debugInfo: LFLiveDebug?)
|
||||
func liveSession(session: LFLiveSession?, errorCode: LFLiveSocketErrorCode)
|
||||
func liveSession(session: LFLiveSession?, liveStateDidChange state: LFLiveState)
|
||||
```
|
||||
|
||||
## License
|
||||
**LFLiveKit is released under the MIT license. See LICENSE for details.**
|
||||
|
||||
Reference in New Issue
Block a user