Menu Home

ios

Build WebRTC

First of All, You have evaded the “WALL”. God bless you. Host OS: Ubuntu 16.04 LTE Build Tools git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git Then add depot_tools to your PATH Checkout Source Set the target OS Here, I will build webrtc for Andorid platform. export GYP_DEFINES=”OS=android” Sync Source mkdir webrtc_android cd webrtc_android fetch […]

iOS:How to get your framework version using code

Add these lines in your Framework header file. eg. PrefixFramework.h //! Project version number for LocalSearch. FOUNDATION_EXPORT double PrefixFrameworkVersionNumber; //! Project version string for LocalSearch. FOUNDATION_EXPORT const unsigned char PrefixFrameworkVersionString[]; There arguments will be filled by iOS framework logic.And you can get the version like this: +(NSString*) playerVersion { NSRange […]

iOS:使用GLES绘制文字

EAGLContext *contextGL; contextGL = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; if (contextGL == nil) { NSLog(@”wangsijie, failed to create EAGLContext”); } else { NSLog(@”wangsijie, create EAGLContext OK”); } CGRect rectGL = CGRectMake(100, 100, 150, 100); GLKView *viewGL = [[GLKView alloc] initWithFrame:rectGL]; viewGL.context = contextGL; viewGL.enableSetNeedsDisplay = NO; [self.view addSubview:viewGL]; [viewGL setDelegate:self]; CADisplayLink *displayLink […]

NALU Type Array

NSString * const naluTypesStrings[] = { @”0: Unspecified (non-VCL)”, @”1: Coded slice of a non-IDR picture (VCL)”, // P frame @”2: Coded slice data partition A (VCL)”, @”3: Coded slice data partition B (VCL)”, @”4: Coded slice data partition C (VCL)”, @”5: Coded slice of an IDR picture (VCL)”, // […]

iOS:Get Memory Information

– (void)refreshMemoryInfo { uint64_t physicalMemorySize; uint64_t userMemorySize; int mib[2]; size_t length; mib[0] = CTL_HW; mib[1] = HW_MEMSIZE; length = sizeof(int64_t); sysctl(mib, 2, &physicalMemorySize, &length, NULL, 0); mib[1] = HW_USERMEM; length = sizeof(int64_t); sysctl(mib, 2, &userMemorySize, &length, NULL, 0); }

iOS:Max Memory Budget

iPad1: 127MB/256MB/49% (crash amount/total amount/percentage of total) iPad2: 275MB/512MB/53% iPad3: 645MB/1024MB/62% iPad4: 585MB/1024MB/57% (iOS 8.1) iPad Mini 1st Generation: 297MB/512MB/58% iPad Mini retina: 696MB/1024MB/68% (iOS 7.1) iPad Air: 697MB/1024MB/68% iPad Air 2: 1195MB/2048MB/58% iPod touch 4th gen: 130MB/256MB/51% (iOS 6.1.1) iPod touch 5th gen: 286MB/512MB/56% (iOS 7.0) iPhone4: 325MB/512MB/63% iPhone5: […]

iOS:截图

– (UIImage*)snapshot { UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0.0); [self drawViewHierarchyInRect:self.bounds afterScreenUpdates:NO]; UIImage *snap = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return snap; } – (BOOL)drawViewHierarchyInRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates是在iOS7.0才引入的,所有此方法只适合在iOS7.0及以上系统使用。