diff options
Diffstat (limited to 'pjsip-apps/src/pjsua/ios/ipjsua')
4 files changed, 93 insertions, 27 deletions
diff --git a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.h b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.h index 56e6d3ea..7f01d275 100644 --- a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.h +++ b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.h @@ -1,11 +1,23 @@ // // ipjsuaAppDelegate.h // ipjsua -// -// Created by Liong Sauw Ming on 13/3/13. -// Copyright (c) 2013 Teluu. All rights reserved. -// - +/* + * Copyright (C) 2013-2014 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #import <UIKit/UIKit.h> @class ipjsuaViewController; diff --git a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m index 5bcf2409..d415d94c 100644 --- a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m +++ b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaAppDelegate.m @@ -1,11 +1,23 @@ // // ipjsuaAppDelegate.m // ipjsua -// -// Created by Liong Sauw Ming on 13/3/13. -// Copyright (c) 2013 Teluu. All rights reserved. -// - +/* + * Copyright (C) 2013-2014 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #import "ipjsuaAppDelegate.h" #import <pjlib.h> #import <pjsua.h> @@ -33,8 +45,8 @@ static pj_thread_t *a_thread; static void displayMsg(const char *msg) { NSString *str = [NSString stringWithFormat:@"%s", msg]; - [app performSelectorOnMainThread:@selector(displayMsg:) withObject:str - waitUntilDone:NO]; + dispatch_async(dispatch_get_main_queue(), + ^{app.viewController.textLabel.text = str;}); } static void pjsuaOnStartedCb(pj_status_t status, const char* msg) @@ -73,11 +85,6 @@ static void pjsuaOnAppConfigCb(pjsua_app_config *cfg) PJ_UNUSED_ARG(cfg); } -- (void)displayMsg:(NSString *)str -{ - app.viewController.textLabel.text = str; -} - - (void)pjsuaStart { // TODO: read from config? @@ -215,4 +222,27 @@ pj_bool_t showNotification(pjsua_call_id call_id) return PJ_FALSE; } +void displayWindow(pjsua_vid_win_id wid) +{ +#if PJSUA_HAS_VIDEO + pjsua_vid_win_info wi; + + if (wid != PJSUA_INVALID_ID && + pjsua_vid_win_get_info(wid, &wi) == PJ_SUCCESS) + { + UIView *view = (__bridge UIView *)wi.hwnd.info.ios.window; + if (view) { + dispatch_async(dispatch_get_main_queue(), ^{ + UIView *parent = app.viewController.view; + /* Add the video window as subview */ + [parent addSubview:view]; + /* Center it */ + view.center = CGPointMake(parent.bounds.size.width/2.0, + parent.bounds.size.height/2.0); + }); + } + } +#endif +} + @end diff --git a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.h b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.h index 1b892756..460a7349 100644 --- a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.h +++ b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.h @@ -1,11 +1,23 @@ // // ipjsuaViewController.h // ipjsua -// -// Created by Liong Sauw Ming on 13/3/13. -// Copyright (c) 2013 Teluu. All rights reserved. -// - +/* + * Copyright (C) 2013-2014 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #import <UIKit/UIKit.h> @interface ipjsuaViewController : UIViewController diff --git a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.m b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.m index 44b335ee..d03acd5a 100644 --- a/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.m +++ b/pjsip-apps/src/pjsua/ios/ipjsua/ipjsuaViewController.m @@ -1,11 +1,23 @@ // // ipjsuaViewController.m // ipjsua -// -// Created by Liong Sauw Ming on 13/3/13. -// Copyright (c) 2013 Teluu. All rights reserved. -// - +/* + * Copyright (C) 2013-2014 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #import "ipjsuaViewController.h" @interface ipjsuaViewController () |