1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Got rid of IPTV_DEBUG.

This commit is contained in:
Rolf Ahrenberg 2015-03-08 15:47:12 +02:00
parent bc6da9dd63
commit 130e2d09d0
4 changed files with 34 additions and 17 deletions

View File

@ -2,18 +2,10 @@
# Makefile for IPTV plugin
#
# Debugging on/off
#IPTV_DEBUG = 1
# Default shell for EXT protocol
#IPTV_EXTSHELL = /bin/bash
# Strip debug symbols? Set eg. to /bin/true if not
STRIP = strip
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
# By default the main source file also carries this name.
@ -41,6 +33,7 @@ TMPDIR ?= /tmp
export CFLAGS = $(call PKGCFG,cflags)
export CXXFLAGS = $(call PKGCFG,cxxflags)
STRIP ?= /bin/true
### The version number of VDR's plugin API:
@ -69,10 +62,6 @@ INCLUDES +=
DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
ifdef IPTV_DEBUG
DEFINES += -DDEBUG
endif
ifdef IPTV_EXTSHELL
DEFINES += -DEXTSHELL='"$(IPTV_EXTSHELL)"'
endif
@ -139,9 +128,7 @@ install-i18n: $(I18Nmsgs)
$(SOFILE): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
ifndef IPTV_DEBUG
@$(STRIP) $@
endif
install-lib: $(SOFILE)
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)

2
log.h
View File

@ -26,7 +26,7 @@
#define debug6(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug6) ? dsyslog("IPTV6: " x) : void() )
// 0x0040: TBD
#define debug7(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug7) ? dsyslog("IPTV7: " x) : void() )
// 0x0080: TBD
// 0x0080: CURL
#define debug8(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug8) ? dsyslog("IPTV8: " x) : void() )
// 0x0100: TBD
#define debug9(x...) void( IptvConfig.IsTraceMode(cIptvConfig::eTraceModeDebug9) ? dsyslog("IPTV9: " x) : void() )

View File

@ -55,6 +55,35 @@ cIptvProtocolCurl::~cIptvProtocolCurl()
DELETE_POINTER(ringBufferM);
}
int cIptvProtocolCurl::DebugCallback(CURL *handleP, curl_infotype typeP, char *dataP, size_t sizeP, void *userPtrP)
{
cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP);
if (obj) {
switch (typeP) {
case CURLINFO_TEXT:
debug8("%s INFO %.*s", __PRETTY_FUNCTION__, (int)sizeP, dataP);
break;
case CURLINFO_HEADER_IN:
debug8("%s HEAD <<< %.*s", __PRETTY_FUNCTION__, (int)sizeP, dataP);
break;
case CURLINFO_HEADER_OUT:
debug8("%s HEAD >>>\n%.*s", __PRETTY_FUNCTION__, (int)sizeP, dataP);
break;
case CURLINFO_DATA_IN:
debug8("%s DATA <<< %zu", __PRETTY_FUNCTION__, sizeP);
break;
case CURLINFO_DATA_OUT:
debug8("%s DATA >>> %zu", __PRETTY_FUNCTION__, sizeP);
break;
default:
break;
}
}
return 0;
}
size_t cIptvProtocolCurl::WriteCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP)
{
cIptvProtocolCurl *obj = reinterpret_cast<cIptvProtocolCurl *>(dataP);
@ -258,10 +287,10 @@ bool cIptvProtocolCurl::Connect()
CURLcode res = CURLE_OK;
cString netrc = cString::sprintf("%s/netrc", IptvConfig.GetConfigDirectory());
#ifdef DEBUG
// Verbose output
iptv_curl_easy_setopt(handleM, CURLOPT_VERBOSE, 1L);
#endif
iptv_curl_easy_setopt(handleM, CURLOPT_DEBUGFUNCTION, cIptvProtocolCurl::DebugCallback);
iptv_curl_easy_setopt(handleM, CURLOPT_DEBUGDATA, this);
// Set callbacks
iptv_curl_easy_setopt(handleM, CURLOPT_WRITEFUNCTION, cIptvProtocolCurl::WriteCallback);

View File

@ -36,6 +36,7 @@ private:
eKeepAliveIntervalMs = 300000 // in milliseconds
};
static int DebugCallback(CURL *handleP, curl_infotype typeP, char *dataP, size_t sizeP, void *userPtrP);
static size_t WriteCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);
static size_t WriteRtspCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);
static size_t DescribeCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);