Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
e07bc4ba
Commit
e07bc4ba
authored
Nov 18, 2014
by
Guillaume BIENKOWSKI
Browse files
Generate an iOS version of media streamer tester
parent
b83020fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
32 deletions
+73
-32
tester/Makefile.am
tester/Makefile.am
+13
-0
tester/mediastreamer2_tester.c
tester/mediastreamer2_tester.c
+3
-32
tester/mediastreamer2_tester.h
tester/mediastreamer2_tester.h
+4
-0
tester/mediastreamer2_tester_ios.m
tester/mediastreamer2_tester_ios.m
+53
-0
No files found.
tester/Makefile.am
View file @
e07bc4ba
...
...
@@ -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)
...
...
tester/mediastreamer2_tester.c
View file @
e07bc4ba
...
...
@@ -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
...
...
tester/mediastreamer2_tester.h
View file @
e07bc4ba
...
...
@@ -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
};
...
...
tester/mediastreamer2_tester_ios.m
0 → 100644
View file @
e07bc4ba
/*
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment