update: 2012/03/10
reference:
1. I touchs: My Second iApp Developement
2. I touchs: Git 單一開發者與遠端備份機制
3. I touchs: Filter4Cam 學習之 Getting Raw Video Data
A. 新增專案
Xcode > File > New > New Project... > iOS > Application > OpenGL Game > Next
Product Name: Filter4Cam
Device Family: iPhone
Use StroyBoard: checked
Use Automatic Reference Counting: checked
> Next > Create
B. 調整相關設定
1. Filter4Cam-Info.plist 檔案
a. 將 Key 為 Bundle identifier 的 Value 設為: com.blogspot.Filter4Cam
(告訴 iTunes 使用者的 iOS 設備需要符合哪些需求, 才可安裝此 app.)
> 點選 Key 為 Required device capabilities 的左邊箭頭以展開 Item, 再點選
Item 右方的 "加號", 在新產生的 Item 項目中, 將其 Value 設為 still-camera,
其代表: 此 app 需要一個內建的相機, 並且可以從此相機中使用影像擷取器
界面來拍攝相片.
a. Base SDK: iOS 5.0
Debug / Release : Any iOS SDK: iPhone Developer
iOS Deployment target: iOS 5.0
C. 新增 Framework
1. 預設的 Framework 為:
GLKit
- Provides libraries of commonly needed functions and classes to reduce the effort
needed to create a new OpenGL ES 2.0 application or the effort required to port
an existing OpenGL ES 1.1 application to OpenGL ES 2.0.
OpenGLES
- Is used for visualizing 2D and 3D data.
2. 加入以下的 Framework:
AssetsLibrary
- Access the pictures and videos managed by the Photos application.
AVFoundation
- Manage and Play Audio-Visual media in your iOS app.
CoreImage
- Use pixel-accurate near-real-time image processing.
CoreLocation
- Determine the current location or heading associated with a device.
CoreMedia
- Handle time-based AV assets.
CoreVideo
- Play and process movies with frame-by-frame control.
ImageIO
- Provides interfaces for reading and writing most image formats.
MobileCoreServices
- Give you access to constants and additional APIs for dealing with time-based
media.
QuartzCore
- Add 2D graphics rendering support.
-------------------------------------------------------------------------------------
D. 從樣板移除不會使用到的 code
開啓 ViewController.m 檔案, 只留下以下的程式碼, 其餘皆刪除:
#import "ViewController.h"
@implementation ViewController
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc. that aren't in use.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
/*
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}*/
//@update
return YES;
}
@end
-------------------------------------------------------------------------------------
E. 專案備份與回復
1. 備份
a. 打開終端機, 進入到專案目錄內(含 .git 檔的位置):
$ cd /Lanli/RD/Projects/Filter4Cam/
b. 執行備份:
$ git bundle create Filter4Cam_2012_02_24_01.BUNDLE --all
c. 上傳到 Google 文件中:
2. 回復
a. 從 Google 文件下載 xxx.BUNDLE 檔案
b. 執行以下的步驟:
$ cd /Lanli/RD
$ git clone xxx.BUNDLE myProject
$ cd myProject
$ git fetch
$ git pull
說明: myProject 為自定的新專案目錄名稱.
-------------------------------------------------------------------------------------
F. 備註
利用 Filter4Cam 參考: 新增專案 的方式產生的專案, 當實際利用 OpenGL ES
來產生影像輸出時, 會出現錯誤訊息:
2012-02-24 09:07:28.216 Filter4Cam[2331:707] *** Terminating app due
to uncaught exception 'NSInternalInconsistencyException', reason:
'-[GLKViewController loadView] loaded the "qIN-Z6-fbv-view-rsN-32-Zl3"
nib but didn't get a GLKView.'
解決方式: (use GLKit Framework)
在新增 View Controller 後, 將 Subclass 從 UIViewController 改成
GLKViewController, 並將 .storyboard 裡的 View 由 UIView 改成
GLKView.
雖然之後可以正常呈現相機影像了, 但是方向轉變時, 不穩定度更高.
因此, 最後還是用目前的方式來建立專案.
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。