Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Volkert committed Jul 6, 2015
2 parents 15c9256 + a1b1380 commit 23844e3
Show file tree
Hide file tree
Showing 18 changed files with 154 additions and 109 deletions.
62 changes: 40 additions & 22 deletions Homer/bin/CMakeLists.txt
Expand Up @@ -8,7 +8,7 @@ INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../../HomerBuild/CMakeConfig.txt)
# Configuration
##############################################################

IF(WINDOWS)
IF(WINDOWS OR APPLE)
SET(HOMER_QT5 "true")
ENDIF()

Expand Down Expand Up @@ -106,7 +106,12 @@ SET (FLAGS
${FLAGS}
-D_GLIBCXX_USE_WSTRING
)

if(HOMER_QT5)
SET (FLAGS
${FLAGS}
-DHOMER_QT5
)
ENDIF()
##############################################################
# set rapth entries for non-default builds
IF (NOT (${BUILD} MATCHES "Default"))
Expand Down Expand Up @@ -514,41 +519,54 @@ SET (LIBS_APPLE
)
IF (NOT(${BUILD} MATCHES "Default"))
SET (LIBS_APPLE_INSTALL
libQtCore.dylib
libQtGui.dylib
libQtNetwork.dylib
libQtXml.dylib
libQtXmlPatterns.dylib
libQtWebKit.dylib
libQtCore.4.dylib
libQtGui.4.dylib
libQtNetwork.4.dylib
libQtXml.4.dylib
libQtXmlPatterns.4.dylib
libQtWebKit.4.dylib
libQtCore.4.8.4.dylib
libQtGui.4.8.4.dylib
libQtNetwork.4.8.4.dylib
libQtXml.4.8.4.dylib
libQtXmlPatterns.4.8.4.dylib
libQtWebKit.4.9.3.dylib
libQt5Core.dylib
libQt5Gui.dylib
libQt5Network.dylib
libQt5Xml.dylib
libQt5XmlPatterns.dylib
libQt5WebKit.dylib
libQt5Core.5.dylib
libQt5Gui.5.dylib
libQt5Network.5.dylib
libQt5Xml.5.dylib
libQt5XmlPatterns.5.dylib
libQt5WebKit.5.dylib
libQt5Core.5.4.1.dylib
libQt5Gui.5.4.1.dylib
libQt5Network.5.4.1.dylib
libQt5Xml.5.4.1.dylib
libQt5XmlPatterns.5.4.1.dylib
libQt5WebKit.5.4.1.dylib
plugins/imageformats/libqgif.dylib
plugins/imageformats/libqico.dylib
plugins/imageformats/libqjpeg.dylib
plugins/imageformats/libqmng.dylib
plugins/imageformats/libqsvg.dylib
plugins/imageformats/libqtga.dylib
plugins/imageformats/libqtiff.dylib
platforms/libqcocoa.dylib
)
SET (LIBS_APPLE
IF(HOMER_QT5)
SET (LIBS_APPLE
${LIBS_APPLE}
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5WebKitWidgets_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Xml_LIBRARIES}
)
ELSE()
SET (LIBS_APPLE
${LIBS_APPLE}
QtCore
QtGui
QtNetwork
QtXml
QtXmlPatterns
QtWebKit
)
)
ENDIF()
else()
SET (LIBS_APPLE
${LIBS_APPLE}
Expand Down
5 changes: 5 additions & 0 deletions Homer/src/Dialogs/HelpDialog.cpp
Expand Up @@ -126,6 +126,11 @@ QString HelpDialog::GetSystemInfo()
tOs = "OS X Mavericks";
break;
#endif
#if (QT_VERSION >= 0x050401)
case QSysInfo::MV_YOSEMITE:
tOs = "OS X Yosemite";
break;
#endif
default:
tOs = "OS X unknown version";
break;
Expand Down
2 changes: 1 addition & 1 deletion Homer/src/MainWindow.cpp
Expand Up @@ -58,7 +58,7 @@
#include <ProcessStatisticService.h>
#include <Snippets.h>

#if not HOMER_QT5
#if not defined(HOMER_QT5)
#include <QPlastiqueStyle>
#endif
#include <QApplication>
Expand Down
18 changes: 9 additions & 9 deletions Homer/src/MediaSourceDesktop.cpp
Expand Up @@ -438,12 +438,12 @@ void MediaSourceDesktop::CreateScreenshot()
//####################################################################
QPixmap tSourcePixmap;
// screen capturing
#ifdef APPLE
#if !defined(APPLE) || defined(HOMER_QT5)
tSourcePixmap = QPixmap::grabWindow(mWidget->winId(), mGrabOffsetX, mGrabOffsetY, tCaptureResX, tCaptureResY);
#else
CGImageRef tOSXWindowImage = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOptionOnScreenOnly, mWidget->winId(), kCGWindowImageDefault);
tSourcePixmap = QPixmap::fromMacCGImageRef(tOSXWindowImage).copy(mGrabOffsetX, mGrabOffsetY, tCaptureResX, tCaptureResY);
CGImageRelease(tOSXWindowImage);
#else
tSourcePixmap = QPixmap::grabWindow(mWidget->winId(), mGrabOffsetX, mGrabOffsetY, tCaptureResX, tCaptureResY);
#endif

//####################################################################
Expand Down Expand Up @@ -629,7 +629,7 @@ GrabResolutions MediaSourceDesktop::GetSupportedVideoGrabResolutions()

mSupportedVideoFormats.clear();

tFormat.Name="CIF"; // 352 × 288
tFormat.Name="CIF"; // 352 288
tFormat.ResX = 352;
tFormat.ResY = 288;
mSupportedVideoFormats.push_back(tFormat);
Expand All @@ -639,27 +639,27 @@ GrabResolutions MediaSourceDesktop::GetSupportedVideoGrabResolutions()
tFormat.ResY = 480;
mSupportedVideoFormats.push_back(tFormat);

tFormat.Name="DVD"; // 720 × 576
tFormat.Name="DVD"; // 720 576
tFormat.ResX = 720;
tFormat.ResY = 576;
mSupportedVideoFormats.push_back(tFormat);

tFormat.Name="CIF9"; // 1056 × 864
tFormat.Name="CIF9"; // 1056 864
tFormat.ResX = 1056;
tFormat.ResY = 864;
mSupportedVideoFormats.push_back(tFormat);

tFormat.Name="SXGA"; // 1280 × 1024
tFormat.Name="SXGA"; // 1280 1024
tFormat.ResX = 1280;
tFormat.ResY = 1024;
mSupportedVideoFormats.push_back(tFormat);

tFormat.Name="WXGA+"; // 1440 × 900
tFormat.Name="WXGA+"; // 1440 900
tFormat.ResX = 1440;
tFormat.ResY = 900;
mSupportedVideoFormats.push_back(tFormat);

tFormat.Name="SXGA+"; // 1440 × 1050
tFormat.Name="SXGA+"; // 1440 1050
tFormat.ResX = 1440;
tFormat.ResY = 1050;
mSupportedVideoFormats.push_back(tFormat);
Expand Down
2 changes: 1 addition & 1 deletion Homer/src/Widgets/OverviewPlaylistWidget.cpp
Expand Up @@ -1337,7 +1337,7 @@ Playlist OverviewPlaylistWidget::ParsePLS(QString pFilePlaylist, bool pAcceptVid
tPlaylistEntry.Location = tValue;
}else
{// local file
if ((!tLineString.startsWith("/")) && (!tValue.startsWith("\\")) && (!tValue.indexOf(":\\") == 1))
if ((!tLineString.startsWith("/")) && (!tValue.startsWith("\\")) && (tValue.indexOf(":\\") != 1))
tPlaylistEntry.Location = tDir + tValue;
else
tPlaylistEntry.Location = tValue;
Expand Down
20 changes: 12 additions & 8 deletions Homer/src/Widgets/VideoWidget.cpp
Expand Up @@ -259,9 +259,11 @@ void VideoWidget::Init(QMainWindow* pMainWindow, ParticipantWidget *pParticipant
//### speedup video presentation by setting the following
//####################################################################
setAutoFillBackground(false);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAttribute(Qt::WA_OpaquePaintEvent, true);
#if !defined(APPLE)
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAttribute(Qt::WA_OpaquePaintEvent, true);
#endif

SetVisible(pVisible);
mNeedBackgroundUpdatesUntillNextFrame = true;
Expand Down Expand Up @@ -1389,8 +1391,8 @@ void VideoWidget::ShowFullScreen(int &pPosX, int &pPosY)
int tScreenMiddleX = tScreenRes.x() + tScreenRes.width() / 2;
int tScreenMiddleY = tScreenRes.y() + tScreenRes.height() / 2;

int tCurXDiff = fabs(tWidgetMiddleAsGlobalPos.x() - tScreenMiddleX);
int tCurYDiff = fabs(tWidgetMiddleAsGlobalPos.y() - tScreenMiddleY);
int tCurXDiff = abs(tWidgetMiddleAsGlobalPos.x() - tScreenMiddleX);
int tCurYDiff = abs(tWidgetMiddleAsGlobalPos.y() - tScreenMiddleY);
if (tCurXDiff + tCurYDiff < tXDiff + tYDiff)
{
LOG(LOG_VERBOSE, "Screen %d with diff: x=%d, y=%d", i, tCurXDiff, tCurYDiff);
Expand Down Expand Up @@ -2129,9 +2131,11 @@ void VideoWidget::customEvent(QEvent *pEvent)
//### each future painting task will be managed by our own paintEvent function
//#############################################################################
setAutoFillBackground(false);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAttribute(Qt::WA_OpaquePaintEvent, true);
#if !defined(APPLE)
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAttribute(Qt::WA_OpaquePaintEvent, true);
#endif
mNeedBackgroundUpdatesUntillNextFrame = true;
}

Expand Down
2 changes: 1 addition & 1 deletion Homer/src/main.cpp
Expand Up @@ -522,7 +522,7 @@ int WINAPI WinMain(HINSTANCE pInstance, HINSTANCE pPrevInstance, LPSTR pCmdLine,

///////////////////////////////////////////////////////////////////////////////
// active memory debugger as early as possible
Thread::ActiveMemoryDebugger();
Thread::ActivateMemoryDebugger();

string tFirstArg = (pArgc > 1) ? pArgv[1] : "";

Expand Down
2 changes: 1 addition & 1 deletion HomerBase/include/HBThread.h
Expand Up @@ -54,7 +54,7 @@ class Thread

virtual ~Thread( );

static void ActiveMemoryDebugger();
static void ActivateMemoryDebugger();
static void DeactivateMemoryDebugger();
static unsigned long GetMemoryAllocationSize(int pThreadID);

Expand Down
27 changes: 13 additions & 14 deletions HomerBase/src/HBSocket.cpp
Expand Up @@ -1212,7 +1212,6 @@ string Socket::GetAddrFromDescriptor(SocketAddressDescriptor *tAddressDescriptor
char tSourceHostStr[INET6_ADDRSTRLEN];
switch (tAddressDescriptor->sa_stor.ss_family)
{
default:
case AF_INET:
if (inet_ntop(AF_INET, &tAddressDescriptor->sa_in.sin_addr, tSourceHostStr, INET_ADDRSTRLEN /* is always smaller than INET6_ADDRSTRLEN */) == NULL)
{
Expand All @@ -1231,22 +1230,22 @@ string Socket::GetAddrFromDescriptor(SocketAddressDescriptor *tAddressDescriptor
if(pPort != NULL)
*pPort = (unsigned int)ntohs(tAddressDescriptor->sa_in6.sin6_port);
break;
default:
LOGEX(Socket, LOG_ERROR, "Unsupported address family detected");
break;
}
if (tSourceHostStr != NULL)
{
tResult = string(tSourceHostStr);

#ifdef SOCKET_AVOID_IPv4_IN_IPv6
// IPv4 in IPv6 address?
if ((tResult.find(':') != string::npos) && (tResult.find('.') != string::npos))
tResult.erase(0, tResult.rfind(':') + 1);
tResult = string(tSourceHostStr);

// transform an address of "::ffff:0.0.0.0" to a "::"
if ((tResult == "0.0.0.0") && (tAddressDescriptor->sa_stor.ss_family == AF_INET6))
tResult = "::";
#endif
}else
tResult = "";
#ifdef SOCKET_AVOID_IPv4_IN_IPv6
// IPv4 in IPv6 address?
if ((tResult.find(':') != string::npos) && (tResult.find('.') != string::npos))
tResult.erase(0, tResult.rfind(':') + 1);

// transform an address of "::ffff:0.0.0.0" to a "::"
if ((tResult == "0.0.0.0") && (tAddressDescriptor->sa_stor.ss_family == AF_INET6))
tResult = "::";
#endif

return tResult;
}
Expand Down
18 changes: 8 additions & 10 deletions HomerBase/src/HBSystem.cpp
Expand Up @@ -37,8 +37,9 @@

#if defined(LINUX)
#include <sys/sysinfo.h>
#endif

//TODO: available in OSX?
#if defined(LINUX) || defined(APPLE)
#include <execinfo.h>
#endif

Expand Down Expand Up @@ -105,10 +106,8 @@ string System::GetKernelVersion()
{
#if defined(LINUX) || defined(APPLE) || defined(BSD)
struct utsname tInfo;
uname(&tInfo);

if (tInfo.release != NULL)
tResult = string(tInfo.release);
if(uname(&tInfo) == 0)
tResult = string(tInfo.release);
#endif
#if defined(WINDOWS)
#if (_MSC_VER < 1800)
Expand Down Expand Up @@ -176,9 +175,7 @@ string System::GetMachineType()
{
#if defined(LINUX) || defined(APPLE) || defined(BSD)
struct utsname tInfo;
uname(&tInfo);

if (tInfo.machine != NULL)
if(uname(&tInfo) == 0)
{
string tType = string(tInfo.machine);
if(tType == "i686")
Expand Down Expand Up @@ -318,7 +315,7 @@ list<string> System::GetStackTrace()
int tStackTraceStep = 0;
char tStringBuf[MAX_STACK_TRACE_STEP_LENGTH];

#ifdef LINUX
#if defined(LINUX) || defined (APPLE)
void *tStackTrace[MAX_STACK_TRACE_DEPTH];
int tStackTraceSize;
char **tStackTraceList;
Expand Down Expand Up @@ -401,7 +398,8 @@ list<string> System::GetStackTrace()
// memory cleanup
free(tStackTraceList);
free(tFuncName);
#else
#endif
#if defined(WINDOWS)
// inspired from: http://www.codeproject.com/Articles/11132/Walking-the-callstack

HANDLE tProcess = GetCurrentProcess();
Expand Down
6 changes: 4 additions & 2 deletions HomerBase/src/HBThread.cpp
Expand Up @@ -31,7 +31,9 @@

#include <Header_Windows.h>

#if defined(LINUX)
#include <malloc.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <cstdio>
Expand Down Expand Up @@ -119,7 +121,7 @@ static void* malloc_hook(size_t pSize, const void* pCaller)
return tResult;
}

void Thread::ActiveMemoryDebugger()
void Thread::ActivateMemoryDebugger()
{
#ifdef DEBUG_VERSION
LOGEX(Thread, LOG_WARN, "Activating malloc() hook");
Expand Down Expand Up @@ -149,7 +151,7 @@ unsigned long Thread::GetMemoryAllocationSize(int pThreadID)

#else

void Thread::ActiveMemoryDebugger()
void Thread::ActivateMemoryDebugger()
{

}
Expand Down
11 changes: 5 additions & 6 deletions HomerConference/src/SIP.cpp
Expand Up @@ -885,14 +885,13 @@ string SIP::CreateAuthInfo(sip_t const *pSip)

LOG(LOG_VERBOSE, "Found realm: \"%s\" in auth. information from SIP server", tRealm);
LOG(LOG_VERBOSE, "Found scheme: \"%s\" in auth. information from SIP server", tScheme);
sprintf(tAuthInfo, "%s:%s:%s:%s", tScheme, tRealm, mSipRegisterServerUsername.c_str(), mSipRegisterServerPassword.c_str());
#ifdef DEBUG_AUTH_DATA
if (LOGGER.GetLogLevel() == LOG_VERBOSE)
if(sprintf(tAuthInfo, "%s:%s:%s:%s", tScheme, tRealm, mSipRegisterServerUsername.c_str(), mSipRegisterServerPassword.c_str()) >= 0)
{
#ifdef DEBUG_AUTH_DATA
LOG(LOG_VERBOSE, "Generated auth. info:", tAuthInfo);
#endif

if (tAuthInfo != NULL)
#endif
tResult = string(tAuthInfo);
}

return tResult;
}
Expand Down

0 comments on commit 23844e3

Please sign in to comment.