diff --git a/MacOS_X_InstallGuide.txt b/MacOS_X_InstallGuide.txt index da67ba0f8..d56963611 100644 --- a/MacOS_X_InstallGuide.txt +++ b/MacOS_X_InstallGuide.txt @@ -23,6 +23,9 @@ http://guide.macports.org/#installing.xcode $sudo port -v selfupdate $sudo port install openssl $sudo port install miniupnpc +###For VOIP Plugin: +$sudo port install speex-devel +$sudo port install opencv ###Get Your OSX SDK if missing: https://github.com/phracker/MacOSX-SDKs diff --git a/plugins/Common/retroshare_plugin.pri b/plugins/Common/retroshare_plugin.pri index 8a5e332b2..2291b93f0 100644 --- a/plugins/Common/retroshare_plugin.pri +++ b/plugins/Common/retroshare_plugin.pri @@ -66,3 +66,18 @@ win32 { for(bin, BIN_DIR):LIBS += -L"$$bin" LIBS += -lpthread } + +macx { + + + OBJECTS_DIR = temp/obj + MOC_DIR = temp/moc + RCC_DIR = temp/qrc + UI_DIR = temp/ui + + DEPENDPATH += . $$INC_DIR + INCLUDEPATH += . $$INC_DIR + + for(lib, LIB_DIR):LIBS += -L"$$lib" + for(bin, BIN_DIR):LIBS += -L"$$bin" +} diff --git a/plugins/FeedReader/FeedReader.pro b/plugins/FeedReader/FeedReader.pro index 8a0862672..a989ecd64 100644 --- a/plugins/FeedReader/FeedReader.pro +++ b/plugins/FeedReader/FeedReader.pro @@ -103,6 +103,28 @@ win32 { INCLUDEPATH += . $$INC_DIR } +macx { + DEFINES += CURL_STATICLIB LIBXML_STATIC LIBXSLT_STATIC LIBEXSLT_STATIC + + XML2_FOUND = + for(inc, INC_DIR){ +#message(Scanning $$inc)s + exists($$inc/libxml2){ + isEmpty( XML2_FOUND) { + message(xml2 is first found here: $$inc .) + INC_DIR += "$$inc/libxml2" + XML2_FOUND = 1 + } + } + } + DEPENDPATH += . $$INC_DIRs + INCLUDEPATH += . $$INC_DIR + + LIBS = -lcurl -lxml2 -lxslt -lcrypto + +error(Missing RetroShare-gui library. Remove Plugins from RetroShare.pro)) +} + openbsd-* { LIBXML2_DIR = /usr/local/include/libxml2 } diff --git a/plugins/VOIP/VOIP.pro b/plugins/VOIP/VOIP.pro index 746530290..29bd3783c 100644 --- a/plugins/VOIP/VOIP.pro +++ b/plugins/VOIP/VOIP.pro @@ -16,7 +16,7 @@ MOBILITY = multimedia DEPENDPATH += ../../retroshare-gui/src/temp/ui ../../libretroshare/src INCLUDEPATH += ../../retroshare-gui/src/temp/ui ../../libretroshare/src -#################################### Windows ##################################### +#################################### Linux ##################################### linux-* { CONFIG += link_pkgconfig @@ -28,6 +28,8 @@ linux-* { LIBS += -lspeex -lspeexdsp -lavcodec -lavutil } +#################################### Windows ##################################### + win32 { DEPENDPATH += . $$INC_DIR @@ -78,6 +80,41 @@ win32 { LIBS += -lavifil32 -lavicap32 -lavcodec -lavutil -lswresample } +#################################### MacOSX ##################################### + +macx { + + DEPENDPATH += . $$INC_DIR + INCLUDEPATH += . $$INC_DIR + + #OPENCV_VERSION = "249" + USE_PRECOMPILED_LIBS = + for(lib, LIB_DIR) { +#message(Scanning $$lib) + exists( $$lib/opencv/libopencv_core*.dylib) { + isEmpty(USE_PRECOMPILED_LIBS) { + message(Get pre-compiled opencv libraries here:) + message($$lib) + LIBS += -L"$$lib/opencv" + LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc + USE_PRECOMPILED_LIBS = 1 + } + } + exists( $$lib/libopencv_videoio*.dylib) { + message(videoio found in opencv libraries.) + message($$lib) + LIBS += -lopencv_videoio + } + } + isEmpty(USE_PRECOMPILED_LIBS) { + message(Use system opencv libraries.) + LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc + } + +error(Missing RetroShare-gui library. Remove Plugins from RetroShare.pro)) +} + + # ffmpeg (and libavutil: https://github.com/ffms/ffms2/issues/11) QMAKE_CXXFLAGS += -D__STDC_CONSTANT_MACROS diff --git a/plugins/VOIP/gui/VideoProcessor.cpp b/plugins/VOIP/gui/VideoProcessor.cpp index 68d0adbd6..ad0a217ec 100644 --- a/plugins/VOIP/gui/VideoProcessor.cpp +++ b/plugins/VOIP/gui/VideoProcessor.cpp @@ -1,6 +1,10 @@ #include #include +#ifdef __MACH__ +#include +#else #include +#endif #include #include @@ -720,7 +724,12 @@ bool FFmpegVideo::decodeData(const RsVOIPDataChunk& chunk,QImage& image) #if defined(__MINGW32__) unsigned char *tmp = (unsigned char*)_aligned_malloc(s + AV_INPUT_BUFFER_PADDING_SIZE, 16) ; #else +#ifdef __MACH__ + //Mac OS X appears to be 16-byte mem aligned. + unsigned char *tmp = (unsigned char*)malloc(s + AV_INPUT_BUFFER_PADDING_SIZE) ; +#else //MAC unsigned char *tmp = (unsigned char*)memalign(16, s + AV_INPUT_BUFFER_PADDING_SIZE) ; +#endif //MAC #endif //MINGW if (tmp == NULL) { std::cerr << "FFmpegVideo::decodeData() Unable to allocate new buffer of size " << s << std::endl; diff --git a/retroshare.pri b/retroshare.pri index 0d1589888..e36eaa152 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -45,6 +45,7 @@ macx { LIB_DIR += "/opt/local/lib" QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 QMAKE_MAC_SDK = macosx10.10 + CONFIG += c+11 } unfinished {