Skip to content

Commit

Permalink
disable log in QtAV module in release mode wang-bin#658
Browse files Browse the repository at this point in the history
only print QtAV information
  • Loading branch information
wang-bin committed Jul 22, 2016
1 parent 51fb475 commit b377fbe
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/QtAV/private/singleton.h
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
/******************************************************************************
singleton.h: singleton template
Copyright (C) 2012-2015 Wang Bin <[email protected]>
Copyright (C) 2012-2016 Wang Bin <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -28,8 28,8 @@
#if USE_EXCEPTION
#include <stdexcept> // std::string breaks abi
#endif
#define DEBUG 1
#if DEBUG

#ifdef DEBUG
#define DBG(fmt, ...) \
fprintf(stderr, fmt, ##__VA_ARGS__); \
fflush(0);
Expand Down
2 changes: 0 additions & 2 deletions src/capi/ass_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 21,6 @@
//�FS%

#define ASS_CAPI_BUILD
#define DEBUG_RESOLVE
#define DEBUG_LOAD
//#define CAPI_IS_LAZY_RESOLVE 0
#ifndef CAPI_LINK_ASS
#include "capi.h"
Expand Down
1 change: 1 addition & 0 deletions src/capi/ass_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 40,7 @@ namespace ass {
#ifndef CAPI_LINK_ASS
using namespace capi; // original header is in namespace capi, types are changed
#endif // CAPI_LINK_ASS
namespace capi { bool loaded();} // For link or NS style. Or load test for class style. api.loaded for class style.
class api_dll;
class api
{
Expand Down
2 changes: 0 additions & 2 deletions src/capi/egl_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 20,6 @@
******************************************************************************/
#define CAPI_LINKAGE EGLAPIENTRY // for functions defined in namespace egl::capi
#define EGL_CAPI_BUILD
#define DEBUG_RESOLVE
#define DEBUG_LOAD
//#define CAPI_IS_LAZY_RESOLVE 0
#ifndef CAPI_LINK_EGL
#include "capi.h"
Expand Down
1 change: 1 addition & 0 deletions src/capi/egl_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 43,7 @@ namespace egl {
#ifndef CAPI_LINK_EGL
using namespace capi; // original header is in namespace capi, types are changed
#endif // CAPI_LINK_EGL
namespace capi { bool loaded();} // For link or NS style. Or load test for class style. api.loaded for class style.
class api_dll;
class api
{
Expand Down
2 changes: 1 addition & 1 deletion src/capi/openal_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 22,7 @@

#define OPENAL_CAPI_BUILD
//#define DEBUG_RESOLVE
#define DEBUG_LOAD
//#define DEBUG_LOAD // why affects other xxx_api.cpp?
//#define CAPI_IS_LAZY_RESOLVE 0
#ifndef CAPI_LINK_OPENAL
#include "capi.h"
Expand Down
10 changes: 7 additions & 3 deletions src/libQtAV.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 26,16 @@ config_libcedarv: CONFIG *= neon config_simd #need by qt4 addSimdCompiler(). neo
## sse2 sse4_1 may be defined in Qt5 qmodule.pri but is not included. Qt4 defines sse and sse2
sse4_1|config_sse4_1|contains(TARGET_ARCH_SUB, sse4.1): CONFIG *= sse4_1 config_simd
sse2|config_sse2|contains(TARGET_ARCH_SUB, sse2): CONFIG *= sse2 config_simd

CONFIG(debug, debug|release): DEFINES = DEBUG
#release: DEFINES = QT_NO_DEBUG_OUTPUT
#var with '_' can not pass to pri?
PROJECTROOT = $$PWD/..
!include(libQtAV.pri): error("could not find libQtAV.pri")
preparePaths($$OUT_PWD/../out)
exists($$PROJECTROOT/extra/qtLongName(include)): INCLUDEPATH = $$PROJECTROOT/extra/qtLongName(include)
exists($$PROJECTROOT/extra/qtLongName(lib)): LIBS = -L$$PROJECTROOT/extra/qtLongName(lib)


config_uchardet {
DEFINES = LINK_UCHARDET
LIBS *= -luchardet
Expand Down Expand Up @@ -412,8 416,8 @@ winrt {
# use old libva.so to link against
glibc_compat: *linux*: LIBS = -lrt # do not use clock_gettime in libc, GLIBC_2.17 is not available on old system
static_ffmpeg {
# libs needed by mac static ffmpeg. corefoundation: vda, avdevice
mac|ios: LIBS = -liconv -lbz2 -llzma -lz -framework CoreFoundation -Wl,-framework,Security
# libs needed by mac static ffmpeg. corefoundation: vda, avdevice. coca: vf_coreimage
mac|ios: LIBS = -liconv -lbz2 -llzma -lz -framework CoreFoundation -framework Security -framework Cocoa
win32: LIBS *= -lws2_32 -lstrmiids -lvfw32 -luuid
!mac:*g * {
LIBS *= -lz
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 229,7 @@ QtAVDebug::QtAVDebug(QtMsgType t, QDebug *d)
if (!sFirstRun)
return;
sFirstRun = false;
//printf("Qt Logging first run........\n");
printf("%s\n", aboutQtAV_PlainText().toUtf8().constData());
// check environment var and call other functions at first Qt logging call
// always override setLogLevel()
QByteArray env = qgetenv("QTAV_LOG_LEVEL");
Expand Down
6 changes: 4 additions & 2 deletions widgets/global.cpp
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
/******************************************************************************
VideoRendererTypes: type id and manually id register function
Copyright (C) 2015 Wang Bin <[email protected]>
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
* This file is part of QtAV (from 2015)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -81,7 81,9 @@ namespace Widgets {

void registerRenderers()
{
#if !defined(QT_NO_DEBUG)
qDebug("registerRenderers...........");
#endif
// check whether it is called
static bool initialized = false;
if (initialized)
Expand Down

0 comments on commit b377fbe

Please sign in to comment.