Latest 0.1.3
Homepage https://github.com/wzyinglong/NLCustomCamera
License MIT
Platforms ios 9.0, requires ARC
Dependencies GPUImage, TZImagePickerController, Masonry, ZFPlayer, MJExtension, ReactiveObjC
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

NLRecordParam *param = [NLRecordParam recordConfigWithVideoRatio:NLShootRatioFullScreen shootMode:photoVideoMode position:AVCaptureDevicePositionBack maxRecordTime:15.0f minRecordTime:1.0f isCompression:NO waterMark:nil isFilter:YES isShowBeautyBtn:NO isShowAlbumBtn:YES currentVC:self];
[NLRecordManager shareManager].recordParam = param;
NLPhotoViewController *page = [NLPhotoViewController new];
[self presentViewController:page animated:YES completion:nil];

Fix GPUImage

Fix Xcode main thread warning https://github.com/BradLarson/GPUImage/pull/2533/files

- (void)recalculateViewGeometry;
{

    __block CGRect currentBounds;

    runOnMainQueueWithoutDeadlocking(^{
        currentBounds = self.bounds;
    });

    runSynchronouslyOnVideoProcessingQueue(^{
        CGFloat heightScaling, widthScaling;

//        CGSize currentViewSize = self.bounds.size;

        //    CGFloat imageAspectRatio = inputImageSize.width / inputImageSize.height;
        //    CGFloat viewAspectRatio = currentViewSize.width / currentViewSize.height;

        CGRect insetRect = AVMakeRectWithAspectRatioInsideRect(inputImageSize, currentBounds);

        switch(_fillMode)
        {
            case kGPUImageFillModeStretch:
            {
                widthScaling = 1.0;
                heightScaling = 1.0;
            }; break;
            case kGPUImageFillModePreserveAspectRatio:
            {
                widthScaling = insetRect.size.width / currentBounds.size.width;
                heightScaling = insetRect.size.height / currentBounds.size.height;
            }; break;
            case kGPUImageFillModePreserveAspectRatioAndFill:
            {
                //            CGFloat widthHolder = insetRect.size.width / currentViewSize.width;
                widthScaling = currentBounds.size.height / insetRect.size.height;
                heightScaling = currentBounds.size.width / insetRect.size.width;
            }; break;
        }

        imageVertices[0] = -widthScaling;
        imageVertices[1] = -heightScaling;
        imageVertices[2] = widthScaling;
        imageVertices[3] = -heightScaling;
        imageVertices[4] = -widthScaling;
        imageVertices[5] = heightScaling;
        imageVertices[6] = widthScaling;
        imageVertices[7] = heightScaling;
    });

//    static const GLfloat imageVertices[] = {
//        -1.0f, -1.0f,
//        1.0f, -1.0f,
//        -1.0f,  1.0f,
//        1.0f,  1.0f,
//    };
}

Installation

NLCustomCamera is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'NLCustomCamera'

Author

wzyinglong, [email protected]

License

NLCustomCamera is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NLCustomCamera",
    "version": "0.1.3",
    "summary": "u81eau5b9au4e49u76f8u673a,u529fu80fdu652fu6301u62cdu6444u89c6u9891(u652fu6301u6ee4u955c),u7167u76f8(u652fu6301u6ee4u955c),u4e09u79cdu6a21u5f0fu9009u62e9(u89c6u9891,u62cdu7167,u4e8cu8005u7ed3u5b58)",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/wzyinglong/NLCustomCamera",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "wzyinglong": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wzyinglong/NLCustomCamera.git",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "NLCustomCamera/Classes/**/*",
    "resource_bundles": {
        "NLCustomCamera": [
            "NLCustomCamera/Assets/**/*"
        ]
    },
    "dependencies": {
        "GPUImage": [
            "~> 0.1.7"
        ],
        "TZImagePickerController": [],
        "Masonry": [],
        "ZFPlayer": [
            "~> 2.1.6"
        ],
        "MJExtension": [
            "~> 3.0.13"
        ],
        "ReactiveObjC": []
    }
}

Pin It on Pinterest

Share This