Commit 81dd23b3 authored by Benjamin REIS's avatar Benjamin REIS

Use correct macro __ios --> TARGET_OS_IPHONE

parent b937df18
......@@ -103,7 +103,7 @@ const char* aq_format_error(OSStatus status) {
return "unkown error code";
}
}
#ifdef __ios
#if TARGET_OS_IPHONE
#define CFStringRef void *
#define CFRelease(A) {}
#define CFStringGetCString(A, B, LEN, encoding) {}
......@@ -282,7 +282,7 @@ static void show_format(char *name,
static void aqcard_detect(MSSndCardManager * m)
{
#ifdef __ios
#if TARGET_OS_IPHONE
AudioStreamBasicDescription deviceFormat;
memset(&deviceFormat, 0, sizeof(AudioStreamBasicDescription));
......
......@@ -20,6 +20,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mediastreamer2/dtmfgen.h"
#include "mediastreamer2/msticker.h"
#if __APPLE__
#include "TargetConditionals.h"
#endif
#include <math.h>
......@@ -30,7 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define NO_SAMPLES_THRESHOLD 100 /*ms*/
#if defined(__ANDROID__) || defined(__ios) /* because android and iOS don't deal well with audio stop and restarts at each dtmf.*/
#if defined(__ANDROID__) || TARGET_OS_IPHONE /* because android and iOS don't deal well with audio stop and restarts at each dtmf.*/
#define TRAILLING_SILENCE 10000 /*ms*/
#else
#define TRAILLING_SILENCE 500 /*ms*/
......
......@@ -49,7 +49,9 @@
#include <arpa/inet.h>
#endif
#if __APPLE__
#include "TargetConditionals.h"
#endif
#include <sys/time.h>
......@@ -332,7 +334,7 @@ ORTP_PUBLIC void ortp_shm_close(void *memory);
/*define __ios when we are compiling for ios.
The TARGET_OS_IPHONE macro is stupid, it is defined to 0 when compiling on mac os x.
*/
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1
#if TARGET_OS_IPHONE
#define __ios 1
#endif
......
......@@ -26,6 +26,7 @@
#include "mediastreamer2/mscodecutils.h"
#define VTH264_ENC_NAME "VideoToolboxH264Encoder"
#define vth264enc_log(level, fmt, ...) ms_##level(VTH264_ENC_NAME ": " fmt, ##__VA_ARGS__)
#define vth264enc_message(fmt, ...) vth264enc_log(message, fmt, ##__VA_ARGS__)
......@@ -218,7 +219,7 @@ static VTCompressionSessionRef vth264enc_session_create(VTH264EncCtx *ctx) {
CFRelease(value);
CFMutableDictionaryRef session_props = CFDictionaryCreateMutable (kCFAllocatorDefault, 1, NULL, NULL);
#if !TARGET_OS_IOS
#if !TARGET_OS_IPHONE
CFDictionarySetValue(session_props, kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kCFBooleanTrue);
#endif
......@@ -272,7 +273,7 @@ static VTCompressionSessionRef vth264enc_session_create(VTH264EncCtx *ctx) {
goto fail;
} else {
vth264enc_message("encoder succesfully initialized.");
#if !TARGET_OS_IOS
#if !TARGET_OS_IPHONE
CFBooleanRef hardware_acceleration_enabled;
err = VTSessionCopyProperty(session, kVTCompressionPropertyKey_UsingHardwareAcceleratedVideoEncoder, kCFAllocatorDefault, &hardware_acceleration_enabled);
if (err != noErr) {
......@@ -1011,7 +1012,7 @@ void _register_videotoolbox_if_supported(MSFactory *factory) {
ms_message("VideoToolbox H264 codec is not supported on simulators");
#else
#ifdef __ios
#if TARGET_OS_IPHONE
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0) {
#else
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber10_8) {
......
......@@ -43,6 +43,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mediastreamer2/devices.h"
#endif
#if __APPLE__
#include "TargetConditionals.h"
#endif
#include <sys/types.h>
#ifndef _WIN32
......@@ -245,7 +249,7 @@ void audio_stream_prepare_sound(AudioStream *stream, MSSndCard *playcard, MSSndC
ms_filter_call_method(stream->dummy,MS_RTP_RECV_SET_SESSION,stream->ms.sessions.rtp_session);
if (captcard && playcard){
#ifdef __ios
#if TARGET_OS_IPHONE
int muted = 1;
stream->soundread=ms_snd_card_create_reader(captcard);
stream->soundwrite=ms_snd_card_create_writer(playcard);
......@@ -268,7 +272,7 @@ void audio_stream_prepare_sound(AudioStream *stream, MSSndCard *playcard, MSSndC
static void _audio_stream_unprepare_sound(AudioStream *stream, bool_t keep_sound_resources){
if (stream->ms.state==MSStreamPreparing){
stop_preload_graph(stream);
#ifdef __ios
#if TARGET_OS_IPHONE
if (!keep_sound_resources){
if (stream->soundread) ms_filter_destroy(stream->soundread);
stream->soundread=NULL;
......
......@@ -28,7 +28,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "private.h"
#include <ctype.h>
#if __APPLE__
#include "TargetConditionals.h"
#endif
#ifndef MS_MINIMAL_MTU
/*this is used for determining the minimum size of recv buffers for RTP packets
......@@ -87,7 +89,7 @@ MSTickerPrio __ms_get_default_prio(bool_t is_video) {
#endif
if(penv && _ms_ticker_prio_from_env(penv, &prio) == 0) return prio;
#ifdef __ios
#if TARGET_OS_IPHONE
return MS_TICKER_PRIO_HIGH;
#else
return MS_TICKER_PRIO_NORMAL;
......
......@@ -32,6 +32,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mediastreamer2/mseventqueue.h"
#include "private.h"
#if __APPLE__
#include "TargetConditionals.h"
#endif
static void configure_recorder_output(VideoStream *stream);
static int video_stream_start_with_source_and_output(VideoStream *stream, RtpProfile *profile, const char *rem_rtp_ip, int rem_rtp_port,
......@@ -238,13 +241,13 @@ const char *video_stream_get_default_video_renderer(void){
return "MSDrawDibDisplay";
#elif defined(__ANDROID__)
return "MSAndroidDisplay";
#elif __APPLE__ && !defined(__ios)
#elif __APPLE__ && !TARGET_OS_IPHONE
return "MSOSXGLDisplay";
#elif defined (HAVE_XV)
return "MSX11Video";
#elif defined(HAVE_GLX)
return "MSGLXVideo";
#elif defined(__ios)
#elif TARGET_OS_IPHONE
return "IOSDisplay";
#elif defined(__QNX__)
return "MSBB10Display";
......@@ -1475,7 +1478,7 @@ void video_stream_set_native_window_id(VideoStream *stream, void *id){
void video_stream_set_native_preview_window_id(VideoStream *stream, void *id){
stream->preview_window_id=id;
#ifndef __ios
#if TARGET_OS_IPHONE
if (stream->output2){
ms_filter_call_method(stream->output2,MS_VIDEO_DISPLAY_SET_NATIVE_WINDOW_ID,&id);
}
......
......@@ -47,6 +47,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <ortp/b64.h>
#if __APPLE__
#include "TargetConditionals.h"
#endif
static int cond = 1;
......@@ -289,7 +292,7 @@ static void setup_media_streams(MediastreamDatas *args) {
display_name = "MSGLXVideo";
#elif defined(HAVE_XV)
display_name = "MSX11Video";
#elif __APPLE__ && !defined(__ios)
#elif __APPLE__ && !TARGET_OS_IPHONE
display_name ="MSOSXGLDisplay";
#else
display_name = "MSVideoOut";
......
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