글

mediacodec

Hello, I'm using android's MediaCodec to render a movie to a texture created in Unity. I do this by attaching the texture from Unity to a framebuffer object and then rendering to it using the texture drawn to by android SurfaceTexture. The movie was rendering fine until I switched to Development build and then switched back to Production. Now, the image from SurfaceTexture only shows up when I use Development build. What changes in terms of OpenGL when I switch to development build? Or am I messing up the gl context somehow? Below is the native code I call every frame where I think has the highest probability of having errors. public void DrawFrame () {   synchronized ( this ) { if ( updateSurface ) { //GLES20.glActiveTexture(GLES20.GL_TEXTURE0); mSurfaceTexture . updateTexImage ();   mSurfaceTexture . getTransformMatrix ( mSTMatrix ); updateSurface = false ; ...

HowTo compile native C codes to a library for iOS development in Xcode

이미지
HowTo compile native C codes to a library for iOS development in Xcode Posted on 2011/10/30 by allen For iOS development, sometimes you want to use a existed native C codes for help. Objective-C is a superset of C so it’s easy to combine C codes in your Objective-C project. But for a library usage, it only support compiling C code to a static library by now. In this tutorial, I take an open source project MQTT message broker Mosquitto as an example to demo how to compile it into a static library in Xcode. Environments * Xcode 4.1 * MacOSX Lion * mosquitto 0.13 Tutorial 1. Download mosquito form < http://mosquitto.org/files/source/mosquitto-0.13.tar.gz >. Here is the whole directory structure: 2. Create a new project by template C/C++ Library * Choose static type 3. Import(or just drap and drop) C codes(include .h and .c) to the project 4. Check the “Build settings” in project * “Base SDK” => Latest iOS * “Architecture...

Creating iOS plugins for Unity

from  ← Introducing Rain’s Hack Upstate    Creating iOS plugins for Unity This is just a quick starter tutorial on making a simple iOS plugin for Unity. In your Unity project, create a folder Assets/Plugin/iOS. Files directly in that folder (can’t be in a subfolder) automatically get added to your iOS project when you have Unity create an iOS build. We’ll create a testplugin.mm file in that folder. In that file, we put the code for the iOS side of the plugin. Unity needs the plugins to be c named. So, we wrap it in an extern “C”. Here is an example plugin:        extern "C" { int _pow2 ( int x ) { // Just a simple example of returning an int value return x * x ; } // Returns a char* (a string to Unity) char * _helloWorldString () { // We can use NSString and go to the c string that Unity wants NSString * helloString = @ "Hello World" ; ...

ffmpeg ios build

이미지
After a couple of days I have made step by step instructions for this install: FFmpeg Build Instructions MAC 10.8 or better Copy ffmpeg-2.0.tar.bz2 ( https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2 , https://ffmpeg.org/download.html ) and Unzip to Documents folder Make sure you have the latest Command Line Tools under Xcode >; Preferences >; Downloads >; Components Install gas-preprocessor Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor . Copy gas-preprocessor.pl to /usr/bin directory. Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all. Bug in xcrun starting in version 10.8 open terminal and paste in following command and press enter: export DEVELOPER_DIR = "/Applications/Xcode.app/Contents/Developer/" cd to ffmpeg-2 folder and paste in following command and press enter: mkdir armv7 mkdir armv7s mkdir i386 mkdir - p universal / lib To config armv...

When MacBook Pro Retina too hot, on body and keyborad

I have experienced my mac book pro retina is too hot to touch it. The reason is, surely Apple should fix this!, the heat of GPU (GeForce) for retina mode is hot. So, 1. Turn on Energy Saver instead of running screen saver. (Don't run especially high quality screen saver) 2. Use smcFanControl, download http://www.eidac.de/?p=243 When I ran the application first, I saw the temperature of my mac book was 89~90 degree, then the application cools down it to 59~75.

MonoDevelop-Unity, High CPU problem

Disable the git integration in MonoDevelop via Add-in manager/Version Control/Git Support. This fixed the problem for me.

tips on account manager

Many an Android app requires a server backend of some sort, and what better choice than App Engine ? It's free, reliable, and does everything you're likely to need in a backend. It has one other major advantage, too: It supports Google Account authentication, and nearly all Android users will already have a Google Account. So given that we want a backend for our app, and given that we want to have user authentication, how do we go about this? We could prompt the user for their credentials, but that seems less than ideal: the Android device already has their credentials, and users may not trust us with them. Is there a way we can leverage an Android API to take care of authentication? It turns out there is. Authentication with App Engine, regardless of where you're doing it, is a three-stage process: Obtain an authentication token. This can be done with ClientLogin for installed apps, for example, or with AuthSub for a webapp. When logging in directly ...