diff --git a/LFLiveKit.podspec b/LFLiveKit.podspec index af296e3a..f1c64879 100644 --- a/LFLiveKit.podspec +++ b/LFLiveKit.podspec @@ -17,6 +17,6 @@ Pod::Spec.new do |s| s.libraries = "c++", "z" s.requires_arc = true - s.dependency 'LMGPUImage' + s.dependency 'GPUImage' s.dependency 'pili-librtmp', '1.0.3.1' end diff --git a/LFLiveKit/capture/LFVideoCapture.m b/LFLiveKit/capture/LFVideoCapture.m index c14bdf0d..deec28dc 100755 --- a/LFLiveKit/capture/LFVideoCapture.m +++ b/LFLiveKit/capture/LFVideoCapture.m @@ -271,10 +271,12 @@ - (void)processVideo:(GPUImageOutput *)output { __weak typeof(self) _self = self; @autoreleasepool { GPUImageFramebuffer *imageFramebuffer = output.framebufferForOutput; - CVPixelBufferRef pixelBuffer = [imageFramebuffer pixelBuffer]; + CVPixelBufferRef pixelBuffer = NULL; + CVPixelBufferCreateWithBytes(kCFAllocatorDefault, _self.configuration.videoSize.width, _self.configuration.videoSize.height, kCVPixelFormatType_32BGRA, [imageFramebuffer byteBuffer], _self.configuration.videoSize.width * 4, NULL, NULL, NULL, &pixelBuffer); if (pixelBuffer && _self.delegate && [_self.delegate respondsToSelector:@selector(captureOutput:pixelBuffer:)]) { [_self.delegate captureOutput:_self pixelBuffer:pixelBuffer]; } + CFRelease(pixelBuffer); } } @@ -299,7 +301,7 @@ - (void)reloadFilter{ ///< 调节镜像 [self reloadMirror]; - //< 480*640 比例为4:3 强制转换为16:9 + ///< 480*640 比例为4:3 强制转换为16:9 if([self.configuration.avSessionPreset isEqualToString:AVCaptureSessionPreset640x480]){ CGRect cropRect = self.configuration.landscape ? CGRectMake(0, 0.125, 1, 0.75) : CGRectMake(0.125, 0, 0.75, 1); self.cropfilter = [[GPUImageCropFilter alloc] initWithCropRegion:cropRect]; @@ -309,7 +311,7 @@ - (void)reloadFilter{ [self.videoCamera addTarget:self.filter]; } - //< 添加水印 + ///< 添加水印 if(self.warterMarkView){ [self.filter addTarget:self.blendFilter]; [self.uiElementInput addTarget:self.blendFilter]; @@ -329,7 +331,7 @@ - (void)reloadFilter{ [self.uiElementInput forceProcessingAtSize:self.configuration.videoSize]; - //< 输出数据 + ///< 输出数据 __weak typeof(self) _self = self; [self.output setFrameProcessingCompletionBlock:^(GPUImageOutput *output, CMTime time) { [_self processVideo:output]; diff --git a/LFLiveKit/filter/LFGPUImageBeautyFilter.h b/LFLiveKit/filter/LFGPUImageBeautyFilter.h index 1db560b4..03211585 100755 --- a/LFLiveKit/filter/LFGPUImageBeautyFilter.h +++ b/LFLiveKit/filter/LFGPUImageBeautyFilter.h @@ -1,4 +1,9 @@ +#if __has_include() +#import +#else #import "GPUImage.h" +#endif + @interface LFGPUImageBeautyFilter : GPUImageFilter { } diff --git a/LFLiveKit/filter/LFGPUImageEmptyFilter.h b/LFLiveKit/filter/LFGPUImageEmptyFilter.h index b5637c40..5aad12d6 100755 --- a/LFLiveKit/filter/LFGPUImageEmptyFilter.h +++ b/LFLiveKit/filter/LFGPUImageEmptyFilter.h @@ -1,4 +1,8 @@ +#if __has_include() +#import +#else #import "GPUImage.h" +#endif @interface LFGPUImageEmptyFilter : GPUImageFilter {