This file contains 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
jobject StlStringStringMapToJavaHashMap(JNIEnv *env, const std::map<std::string, std::string>& map) { | |
jclass mapClass = env->FindClass("java/util/HashMap"); | |
if(mapClass == NULL) | |
return NULL; | |
jmethodID init = env->GetMethodID(mapClass, "<init>", "()V"); | |
jobject hashMap = env->NewObject(mapClass, init); | |
jmethodID put = env->GetMethodID(mapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); | |
std::map<std::string, std::string>::const_iterator citr = map.begin(); |
This file contains 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
#!/bin/bash | |
set -x | |
# common shortcuts | |
git config --global alias.co checkout | |
git config --global alias.ci commit | |
git config --global alias.st status | |
git config --global alias.br branch | |
git config --global alias.rb rebase |
This file contains 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
#ifndef ATOMIC_H | |
#define ATOMIC_H | |
// Adapted from http://golubenco.org/2007/06/14/atomic-operations | |
/** | |
* @brief Atomic type | |
*/ | |
typedef int atomic_t; |
This file contains 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
/* | |
* The MIT License | |
* | |
* Copyright (c) 2011 Paul Solt, PaulSolt@gmail.com | |
* | |
* https://github.com/PaulSolt/UIImage-Conversion/blob/master/MITLicense.txt | |
* | |
*/ | |
#import <Foundation/Foundation.h> |
This file contains 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
(NSString *) CreateTypeStringWithOSType(OSType inType); // ;-) |
This file contains 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
echo "install gas-preproccesor.pr" | |
git clone git://github.com/mansr/gas-preprocessor.git | |
echo "copy gas-preprocessor.pl to /usr/sbin" | |
sudo cp -f gas-preprocessor/gas-preprocessor.pl /usr/sbin/ | |
echo "set execute right" | |
chmod +x /usr/sbin/gas-preprocessor.pl | |
echo "install finished." |
This file contains 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
#!/bin/sh | |
# directories | |
SOURCE="ffmpeg" | |
FAT="build-iOS" | |
SCRATCH="scratch" | |
# must be an absolute path | |
THIN=`pwd`/"thin" |
This file contains 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
// | |
// NSWeakTimer.m | |
#import "NSWeakTimer.h" | |
@interface NSWeakTimerTarget : NSObject | |
@property (weak) id target; | |
@property (assign) SEL selector; | |
@property (assign) NSTimer* timer; |
This file contains 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
-(void)getPixelBuffer:(CVPixelBufferRef *)pbuf { | |
@synchronized (self) { | |
if(!_pFrame || !_pFrame->data[0]) | |
return; | |
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: | |
// [NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey, | |
// [NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey, | |
@(_pFrame->linesize[0]), kCVPixelBufferBytesPerRowAlignmentKey, |
NewerOlder