This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIImage *)alteredImageFromSampleBuffer:(CMSampleBufferRef)sampleBuffer | |
{ | |
// Get a reference to the buffer, lock the address, and get a pointer to its data. Easy peasy. | |
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); | |
CVPixelBufferLockBaseAddress(imageBuffer, 0); | |
void *sourceData = CVPixelBufferGetBaseAddress(imageBuffer); | |
// Set a bunch of variables we need. The "radius" for the blur kernel needs to be positive and odd. The permute map maps the BGRA channels of the buffer to the ARGB that vImage needs. | |
size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer); | |
size_t width = CVPixelBufferGetWidth(imageBuffer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
此处主要参考 http://harryhsu.logdown.com/posts/198416-build-ffmpeg-on-mac-os-109 | |
根据我的编译过程做了适当修改 | |
1. Download NDK | |
https://developer.android.com/tools/sdk/ndk/index.html | |
我下载的版本是android-ndk-r10,不同的版本在下面的build脚中本需要修改的地方大致相同. | |
2. Download ffmpeg source code | |
下载 ffmpeg(http://www.ffmpeg.org/download.html) | |
推荐 git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.m | |
// RuntimeDemo | |
// | |
// Created by hangchen on 11/7/14. | |
// Copyright (c) 2014 hangchen. All rights reserved. | |
// | |
#import "AppDelegate.h" | |
#import <objc/runtime.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SmartPointer.h | |
// MemoryDemo | |
// | |
// Created by HangChen on 5/5/15. | |
// Copyright (c) 2015 HangChen. All rights reserved. | |
// | |
#ifndef __MemoryDemo__SmartPointer__ | |
#define __MemoryDemo__SmartPointer__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation XCDUUID | |
+ (void) load | |
{ | |
// query runtime if NSUUID class already exists, if so => done | |
if (objc_getClass("NSUUID")) | |
{ | |
return; | |
} | |
OlderNewer