Commit e07bc4ba authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI

Generate an iOS version of media streamer tester

parent b83020fb
......@@ -18,6 +18,7 @@ mediastreamer2_tester_SOURCES= \
mediastreamer2_framework_tester.c \
mediastreamer2_player_tester.c
AM_CPPFLAGS=\
-I$(top_srcdir)/ \
-I$(top_srcdir)/include/ \
......@@ -61,6 +62,18 @@ AM_CFLAGS+=-DHAVE_MATROSKA
endif
if BUILD_IOS
noinst_LTLIBRARIES=libmediastreamer2_tester_ios.la
libmediastreamer2_tester_ios_la_SOURCES = mediastreamer2_tester_ios.m
libmediastreamer2_tester_ios_la_LIBTOOLFLAGS = --tag=CC
LDADD+=libmediastreamer2_tester_ios.la
mediastreamer2_tester_SOURCES += mediastreamer2_neon_tester.c
AM_CFLAGS += $(SPEEX_CFLAGS)
AM_OBJCFLAGS = $(AM_CFLAGS)
endif
test: mediastreamer2_tester
./mediastreamer2_tester $(TEST_OPTIONS)
......
......@@ -32,11 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#include <AudioToolbox/AudioToolbox.h>
#include <CoreFoundation/CFRunLoop.h>
#endif
static test_suite_t **test_suite = NULL;
static int nb_test_suites = 0;
......@@ -227,33 +223,8 @@ void helper(const char *name) {
}
#ifndef WINAPI_FAMILY_PHONE_APP
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
int _main (int argc, char *argv[]) {
#elif TARGET_OS_IPHONE
int g_argc;
char** g_argv;
static int _main(int argc, char * argv[]);
void stop_handler(int sig) {
return;
}
static void* apple_main(void* data) {
_main(g_argc,g_argv);
return NULL;
}
int main(int argc, char * argv[]) {
pthread_t main_thread;
g_argc=argc;
g_argv=argv;
pthread_create(&main_thread,NULL,apple_main,NULL);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int value = UIApplicationMain(0, nil, nil, nil);
[pool release];
return value;
pthread_join(main_thread,NULL);
return 0;
}
static int _main(int argc, char * argv[]) {
#if TARGET_OS_MAC || TARGET_OS_IPHONE
int apple_main (int argc, char *argv[]) {
#else
int main (int argc, char *argv[]) {
#endif
......
......@@ -70,6 +70,10 @@ extern void mediastreamer2_tester_init(void);
extern void mediastreamer2_tester_uninit(void);
extern int mediastreamer2_tester_run_tests(const char *suite_name, const char *test_name);
#if TARGET_OS_MAC || TARGET_OS_IPHONE
int apple_main(int argc, char *argv[]);
#endif
#ifdef __cplusplus
};
......
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006-2014 Belledonne Communications, Grenoble
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.
*/
#if TARGET_OS_IPHONE
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#include <AudioToolbox/AudioToolbox.h>
#include <CoreFoundation/CFRunLoop.h>
#include "mediastreamer2_tester.h"
int g_argc;
char** g_argv;
void stop_handler(int sig) {
return;
}
static void* _apple_main(void* data) {
apple_main(g_argc,g_argv);
return NULL;
}
int main(int argc, char * argv[]) {
pthread_t main_thread;
g_argc=argc;
g_argv=argv;
pthread_create(&main_thread,NULL,_apple_main,NULL);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int value = UIApplicationMain(0, nil, nil, nil);
[pool release];
return value;
pthread_join(main_thread,NULL);
return 0;
}
#endif // target IPHONE
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment