레이블이 iphone인 게시물을 표시합니다. 모든 게시물 표시
레이블이 iphone인 게시물을 표시합니다. 모든 게시물 표시

2010년 12월 8일 수요일

방송국 스트리밍(모바일) 주소들~

아이폰,아이패드에서 DMB가 안된는걸 어느정도 보완 할듯 하네요 
(도토리플레이어에 추가 해서 보시면 더 편합니다.)

iMBC http://stest.imbc.com/live/onair.m3u8
SBS http://h264media.sbs.co.kr/sbsch6/_definst_/smil:ch6wifi.smil/playlist.m3u8
GTB http://211.224.129.158:1935/live/myStream.sdp/playlist.m3u8
KBS24 http://news24kbs-2.gscdn.com/news24_300/_definst_/news24_300.stream/playlist.m3u8
ONGAMENET http://m3u8list.appspot.com/m3u8?bn=ONGAMENET
MBCGAME http://m3u8list.appspot.com/m3u8?bn=MBCGAME
YTN http://m3u8list.appspot.com/m3u8?bn=YTN
TVN http://m3u8list.appspot.com/m3u8?bn=TVN
ETN http://m3u8list.appspot.com/m3u8?bn=ETN
EPL http://m.keysco.com:1935/live/keysco01.sdp/playlist.m3u8
YSTAR http://121.78.116.91:1935/live/BizCastLive/playlist.m3u8
CHK http://live35.futurewiz.co.kr:1935/live_channelk/vid/playlist.m3u8
OBS http://obslive-obsl.ktics.co.kr:1935/obslive/_definst_/obsobs/playlist.m3u8
MNET http://ssmnet.bridgeplatform.co.kr:1935/liveIPhoneMNET/liveIPhoneMNET/playlist.m3u8
KMTV http://ssmnet.bridgeplatform.co.kr:1935/liveIPhoneKM/liveIPhoneKM/playlist.m3u8
LOTTE http://116.193.92.26:1935/live/11002.stream/playlist.m3u8
CJ http://ko.live.vercoop.com/streamingvideo/cjmall/stream/stream_192k.m3u8
WOWTV http://wowmlive.shinbnstar.com:1935/live2/wowtv/playlist.m3u8
KCTV http://122.202.129.136:1935/live/ch5/playlist.m3u8
EDAILY http://121.189.8.101:1935/live/smil:auto.smil/playlist.m3u8
CBS http://cbsl-cbslive.ktics.co.kr:1935/cbsl/_definst_/cbslive/playlist.m3u8
NHK http://plslive-w.nhk.or.jp/nhkworld/app/live.m3u8
YHNEWS http://116.125.124.156:1935/live/smil:yonhap.smil/playlist.m3u8
MBN http://mbn.shinbnstar.com/videos/ch1/hi/prog_index.m3u8
MTN http://mtn.mt.co.kr/mtnMobile.htm?device=iphone3
CHK http://live35.futurewiz.co.kr:1935/live_channelk/vid/playlist.m3u8
MPITV http://mapoitv.gscdn.com:1935/mapo/mapo.stream/playlist.m3u8
BZNTV http://ko.live.vercoop.com/streamingvideo/chosun/stream.m3u8

2010년 12월 5일 일요일

unity3d로 iOS(아이폰,아이패드)디바이스에 3d게임개발

Unity3d는 최근 각광받고 있는 3d게임 엔진 입니다.
아이폰 및 다양한 디바이스(안드로이드,ps3,xbox,wii)를 지원하고
업데이트도 빠르게 진행되어 두터운 개발자 층을 형성해 가고 잇습니다.

iOS 기반 디바이스(아이폰,아이패드)에 테스트를 해보려고 했는데
2.5버젼에서의 튜토리얼이 많아 설치프로그램을 찾아서 링크를 저장해둡니다.
생각보다 구하기 힘드네요 ~

http://download.unity3d.com/download_unity/unity-2.6.1.dmg
http://mac.softpedia.com/dyn-postdownload.php?p=61879&t=0&i=1

추가로 아이폰에 적용하는 과정을 설명한 블로거글 ~
http://onstory.egloos.com/1807205

2010년 10월 22일 금요일

IOS view 메모리관리 팁

delloc 메소드에
자신이 생성한 UI객체는 release해준다!

-(void) delloc {
      [myui release];
}

viewDidUnload 메소드에
자신이 생성한 UI객체를 nil로 할당 해준다!

 -(void) viewDidUnload {
       self.myui = nil;
}

IOS 키 입력창 제거 하는 방식 정리

IOS 개발시 키보드 입력창을 사라지게 하는 방법이 두가지 있다
중요하지 않다고 생각하는지 자꾸 잊어버린다.

1. 컨트롤러에 testFieldDondEditing 메소드를 추가 하는 방법
    ex) -(IBAction)textFieldDoneEditing:(id)sender{
                [sender resignFirstResponder];
          }

1번의 방법은 키 입력시 Done이라는 버튼이 있을 경우이다
허나 숫자 전용 입력키에는 Done버튼이 없다!

이럴경우엔 뷰영역(백그라운드)를 클릭하면 사라지게 하는 방법으로 처리

2.백그라운드에 탭, 또는 클릭 이벤트 콜백을 생성
   - (IBAction)backgroundClick:(id)sender{
             [textfield resingFirstResponder]; //텍스트 필드 갯수만큼 추가
      }

    이때! 뷰의 클래스를 UIView에서 UIControl로 변경 해주어야 한다
     UIControl은 UIView를 상속함

   

2010년 9월 19일 일요일

아이폰으로 pc(키보드)를 제어하는 어플 개발

피씨를 아이폰으로 제어할 수 있는 어플리케이션을 등록 했습니다.
자세한 설명은 아래 주소에서 확인 할 수 있습니다.
https://sites.google.com/site/remotepcapp/userguideko

- 기능
사운드 조절
방향키, 시스템키, 영문키, 숫자키, 일부 특수문자 입력을 지원

* 맥, 윈도우 모두 지원

프리젠테이션을 진행할때 ,PC로 영화를 볼때
웹서핑을 할 때 등등 유용하게 사용될 듯 합니다.

가격 : 0.99$
앱스토어 검색어 "devityaz"

2010년 5월 11일 화요일

APNS Provider php로 구현

일반 호스팅에서는 php의 stream_socket_client를 막아놔서
pc에 Xampp 설치해서 테스트, 성공
google Apps Engine 에서는 java의 SSLSocket를 제한 한건지 잘 안됨

http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/

2010년 4월 26일 월요일

[링크] iphone App 외부실행과, 통신 방법

http://iphonedevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.html
한글 번역은 여기
http://alones.kr/1324

2010년 3월 20일 토요일

[링크] OpenCV를 iphone에서 사용하는 방법법

관련링크

http://www.computer-vision-software.com/blog/2009/04/opencv-vs-apple-iphone/comment-page-1/

http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en

http://zaaghad.blogspot.com/2009/02/universal-i386arm-opencv-framework-for.html

2010년 3월 17일 수요일

opencv iphone에서의 사용 코드

opencv 를 아이폰 적용 코드 학습을 위해 기록 한다.
시작!

#import "OpenCVTestViewController.h"

#import

@implementation OpenCVTestViewController
@synthesize imageView;

- (void)dealloc {
AudioServicesDisposeSystemSoundID(alertSoundID);
[imageView dealloc];
[super dealloc];
}

#pragma mark -
#pragma mark OpenCV Support Methods

// NOTE you SHOULD cvReleaseImage() for the return value when end of the code.
- (IplImage *)CreateIplImageFromUIImage:(UIImage *)image {
CGImageRef imageRef = image.CGImage;

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
IplImage *iplimage = cvCreateImage(cvSize(image.size.width, image.size.height), IPL_DEPTH_8U, 4);
CGContextRef contextRef = CGBitmapContextCreate(iplimage->imageData, iplimage->width, iplimage->height,
iplimage->depth, iplimage->widthStep,
colorSpace, kCGImageAlphaPremultipliedLast|kCGBitmapByteOrderDefault);
CGContextDrawImage(contextRef, CGRectMake(0, 0, image.size.width, image.size.height), imageRef);
CGContextRelease(contextRef);
CGColorSpaceRelease(colorSpace);

IplImage *ret = cvCreateImage(cvGetSize(iplimage), IPL_DEPTH_8U, 3);
cvCvtColor(iplimage, ret, CV_RGBA2BGR);
cvReleaseImage(&iplimage);

return ret;
}

// NOTE You should convert color mode as RGB before passing to this function
- (UIImage *)UIImageFromIplImage:(IplImage *)image {
NSLog(@"IplImage (%d, %d) %d bits by %d channels, %d bytes/row %s", image->width, image->height, image->depth, image->nChannels, image->widthStep, image->channelSeq);

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
NSData *data = [NSData dataWithBytes:image->imageData length:image->imageSize];
CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)data);
CGImageRef imageRef = CGImageCreate(image->width, image->height,
image->depth, image->depth * image->nChannels, image->widthStep,
colorSpace, kCGImageAlphaNone|kCGBitmapByteOrderDefault,
provider, NULL, false, kCGRenderingIntentDefault);
UIImage *ret = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
CGDataProviderRelease(provider);
CGColorSpaceRelease(colorSpace);
return ret;
}

#pragma mark -
#pragma mark Utilities for intarnal use

- (void)showProgressIndicator:(NSString *)text {
//[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
self.view.userInteractionEnabled = FALSE;
if(!progressHUD) {
CGFloat w = 160.0f, h = 120.0f;
progressHUD = [[UIProgressHUD alloc] initWithFrame:CGRectMake((self.view.frame.size.width-w)/2, (self.view.frame.size.height-h)/2, w, h)];
[progressHUD setText:text];
[progressHUD showInView:self.view];
}
}

- (void)hideProgressIndicator {
//[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
self.view.userInteractionEnabled = TRUE;
if(progressHUD) {
[progressHUD hide];
[progressHUD release];
progressHUD = nil;

AudioServicesPlaySystemSound(alertSoundID);
}
}

- (void)opencvEdgeDetect {
if(imageView.image) {
cvSetErrMode(CV_ErrModeParent);

// Create grayscale IplImage from UIImage
IplImage *img_color = [self CreateIplImageFromUIImage:imageView.image];
IplImage *img = cvCreateImage(cvGetSize(img_color), IPL_DEPTH_8U, 1);
cvCvtColor(img_color, img, CV_BGR2GRAY);
cvReleaseImage(&img_color);

// Detect edge
IplImage *img2 = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1);
cvCanny(img, img2, 64, 128, 3);
cvReleaseImage(&img);

// Convert black and whilte to 24bit image then convert to UIImage to show
IplImage *image = cvCreateImage(cvGetSize(img2), IPL_DEPTH_8U, 3);
for(int y=0; yheight; y++) {
for(int x=0; xwidth; x++) {
char *p = image->imageData + y * image->widthStep + x * 3;
*p = *(p+1) = *(p+2) = img2->imageData[y * img2->widthStep + x];
}
}
cvReleaseImage(&img2);
imageView.image = [self UIImageFromIplImage:image];
cvReleaseImage(&image);

[self hideProgressIndicator];
}
}

- (void) opencvFaceDetect:(UIImage *)overlayImage {
if(imageView.image) {
cvSetErrMode(CV_ErrModeParent);

IplImage *image = [self CreateIplImageFromUIImage:imageView.image];

// Scaling down
IplImage *small_image = cvCreateImage(cvSize(image->width/2,image->height/2), IPL_DEPTH_8U, 3);
cvPyrDown(image, small_image, CV_GAUSSIAN_5x5);
int scale = 2;

// Load XML
NSString *path = [[NSBundle mainBundle] pathForResource:@"haarcascade_frontalface_default" ofType:@"xml"];
CvHaarClassifierCascade* cascade = (CvHaarClassifierCascade*)cvLoad([path cStringUsingEncoding:NSASCIIStringEncoding], NULL, NULL, NULL);
CvMemStorage* storage = cvCreateMemStorage(0);

// Detect faces and draw rectangle on them
CvSeq* faces = cvHaarDetectObjects(small_image, cascade, storage, 1.2f, 2, CV_HAAR_DO_CANNY_PRUNING, cvSize(20, 20));
cvReleaseImage(&small_image);

// Create canvas to show the results
CGImageRef imageRef = imageView.image.CGImage;
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef contextRef = CGBitmapContextCreate(NULL, imageView.image.size.width, imageView.image.size.height,
8, imageView.image.size.width * 4,
colorSpace, kCGImageAlphaPremultipliedLast|kCGBitmapByteOrderDefault);
CGContextDrawImage(contextRef, CGRectMake(0, 0, imageView.image.size.width, imageView.image.size.height), imageRef);

CGContextSetLineWidth(contextRef, 4);
CGContextSetRGBStrokeColor(contextRef, 0.0, 0.0, 1.0, 0.5);

// Draw results on the iamge
for(int i = 0; i < faces->total; i++) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

// Calc the rect of faces
CvRect cvrect = *(CvRect*)cvGetSeqElem(faces, i);
CGRect face_rect = CGContextConvertRectToDeviceSpace(contextRef, CGRectMake(cvrect.x * scale, cvrect.y * scale, cvrect.width * scale, cvrect.height * scale));

if(overlayImage) {
CGContextDrawImage(contextRef, face_rect, overlayImage.CGImage);
} else {
CGContextStrokeRect(contextRef, face_rect);
}

[pool release];
}

imageView.image = [UIImage imageWithCGImage:CGBitmapContextCreateImage(contextRef)];
CGContextRelease(contextRef);
CGColorSpaceRelease(colorSpace);

cvReleaseMemStorage(&storage);
cvReleaseHaarClassifierCascade(&cascade);

[self hideProgressIndicator];
}
}


#pragma mark -
#pragma mark IBAction

- (IBAction)loadImage:(id)sender {
if(!actionSheetAction) {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""
delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
otherButtonTitles:@"Use Photo from Library", @"Take Photo with Camera", @"Use Default Lena", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
actionSheetAction = ActionSheetToSelectTypeOfSource;
[actionSheet showInView:self.view];
[actionSheet release];
}
}

- (IBAction)saveImage:(id)sender {
if(imageView.image) {
[self showProgressIndicator:@"Saving"];
UIImageWriteToSavedPhotosAlbum(imageView.image, self, @selector(finishUIImageWriteToSavedPhotosAlbum:didFinishSavingWithError:contextInfo:), nil);
}
}

- (void)finishUIImageWriteToSavedPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
[self hideProgressIndicator];
}

- (IBAction)edgeDetect:(id)sender {
[self showProgressIndicator:@"Detecting"];
[self performSelectorInBackground:@selector(opencvEdgeDetect) withObject:nil];
}

- (IBAction)faceDetect:(id)sender {
cvSetErrMode(CV_ErrModeParent);
if(imageView.image && !actionSheetAction) {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""
delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
otherButtonTitles:@"Bounding Box", @"Laughing Man", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
actionSheetAction = ActionSheetToSelectTypeOfMarks;
[actionSheet showInView:self.view];
[actionSheet release];
}
}

#pragma mark -
#pragma mark UIViewControllerDelegate

- (void)viewDidLoad {
[super viewDidLoad];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:YES];
[self loadImage:nil];

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Tink" ofType:@"aiff"] isDirectory:NO];
AudioServicesCreateSystemSoundID((CFURLRef)url, &alertSoundID);
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return NO;
}

#pragma mark -
#pragma mark UIActionSheetDelegate

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
switch(actionSheetAction) {
case ActionSheetToSelectTypeOfSource: {
UIImagePickerControllerSourceType sourceType;
if (buttonIndex == 0) {
sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
} else if(buttonIndex == 1) {
sourceType = UIImagePickerControllerSourceTypeCamera;
} else if(buttonIndex == 2) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"lena" ofType:@"jpg"];
imageView.image = [UIImage imageWithContentsOfFile:path];
break;
} else {
// Cancel
break;
}
if([UIImagePickerController isSourceTypeAvailable:sourceType]) {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = sourceType;
picker.delegate = self;
picker.allowsImageEditing = NO;
[self presentModalViewController:picker animated:YES];
[picker release];
}
break;
}
case ActionSheetToSelectTypeOfMarks: {
if(buttonIndex != 0 && buttonIndex != 1) {
break;
}

UIImage *image = nil;
if(buttonIndex == 1) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"laughing_man" ofType:@"png"];
image = [UIImage imageWithContentsOfFile:path];
}

[self showProgressIndicator:@"Detecting"];
[self performSelectorInBackground:@selector(opencvFaceDetect:) withObject:image];
break;
}
}
actionSheetAction = 0;
}

#pragma mark -
#pragma mark UIImagePickerControllerDelegate

- (UIImage *)scaleAndRotateImage:(UIImage *)image {
static int kMaxResolution = 640;

CGImageRef imgRef = image.CGImage;
CGFloat width = CGImageGetWidth(imgRef);
CGFloat height = CGImageGetHeight(imgRef);

CGAffineTransform transform = CGAffineTransformIdentity;
CGRect bounds = CGRectMake(0, 0, width, height);
if (width > kMaxResolution || height > kMaxResolution) {
CGFloat ratio = width/height;
if (ratio > 1) {
bounds.size.width = kMaxResolution;
bounds.size.height = bounds.size.width / ratio;
} else {
bounds.size.height = kMaxResolution;
bounds.size.width = bounds.size.height * ratio;
}
}

CGFloat scaleRatio = bounds.size.width / width;
CGSize imageSize = CGSizeMake(CGImageGetWidth(imgRef), CGImageGetHeight(imgRef));
CGFloat boundHeight;

UIImageOrientation orient = image.imageOrientation;
switch(orient) {
case UIImageOrientationUp:
transform = CGAffineTransformIdentity;
break;
case UIImageOrientationUpMirrored:
transform = CGAffineTransformMakeTranslation(imageSize.width, 0.0);
transform = CGAffineTransformScale(transform, -1.0, 1.0);
break;
case UIImageOrientationDown:
transform = CGAffineTransformMakeTranslation(imageSize.width, imageSize.height);
transform = CGAffineTransformRotate(transform, M_PI);
break;
case UIImageOrientationDownMirrored:
transform = CGAffineTransformMakeTranslation(0.0, imageSize.height);
transform = CGAffineTransformScale(transform, 1.0, -1.0);
break;
case UIImageOrientationLeftMirrored:
boundHeight = bounds.size.height;
bounds.size.height = bounds.size.width;
bounds.size.width = boundHeight;
transform = CGAffineTransformMakeTranslation(imageSize.height, imageSize.width);
transform = CGAffineTransformScale(transform, -1.0, 1.0);
transform = CGAffineTransformRotate(transform, 3.0 * M_PI / 2.0);
break;
case UIImageOrientationLeft:
boundHeight = bounds.size.height;
bounds.size.height = bounds.size.width;
bounds.size.width = boundHeight;
transform = CGAffineTransformMakeTranslation(0.0, imageSize.width);
transform = CGAffineTransformRotate(transform, 3.0 * M_PI / 2.0);
break;
case UIImageOrientationRightMirrored:
boundHeight = bounds.size.height;
bounds.size.height = bounds.size.width;
bounds.size.width = boundHeight;
transform = CGAffineTransformMakeScale(-1.0, 1.0);
transform = CGAffineTransformRotate(transform, M_PI / 2.0);
break;
case UIImageOrientationRight:
boundHeight = bounds.size.height;
bounds.size.height = bounds.size.width;
bounds.size.width = boundHeight;
transform = CGAffineTransformMakeTranslation(imageSize.height, 0.0);
transform = CGAffineTransformRotate(transform, M_PI / 2.0);
break;
default:
[NSException raise:NSInternalInconsistencyException format:@"Invalid image orientation"];
}

UIGraphicsBeginImageContext(bounds.size);
CGContextRef context = UIGraphicsGetCurrentContext();
if (orient == UIImageOrientationRight || orient == UIImageOrientationLeft) {
CGContextScaleCTM(context, -scaleRatio, scaleRatio);
CGContextTranslateCTM(context, -height, 0);
} else {
CGContextScaleCTM(context, scaleRatio, -scaleRatio);
CGContextTranslateCTM(context, 0, -height);
}
CGContextConcatCTM(context, transform);
CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, width, height), imgRef);
UIImage *imageCopy = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

return imageCopy;
}

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image
editingInfo:(NSDictionary *)editingInfo
{
imageView.image = [self scaleAndRotateImage:image];
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
@end