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

Added support for CURL debug callback.

This commit is contained in:
Rolf Ahrenberg 2014-11-09 02:25:47 +02:00
parent cf930286c2
commit 123fc5f96b
2 changed files with 32 additions and 0 deletions

31
tuner.c
View File

@ -111,6 +111,35 @@ size_t cSatipTuner::DataCallback(void *ptrP, size_t sizeP, size_t nmembP, void *
return len; return len;
} }
int cSatipTuner::DebugCallback(CURL *handleP, curl_infotype typeP, char *dataP, size_t sizeP, void *userPtrP)
{
cSatipTuner *obj = reinterpret_cast<cSatipTuner *>(userPtrP);
if (obj) {
switch (typeP) {
case CURLINFO_TEXT:
debug("cSatipTuner::%s(%d): RTSP INFO %.*s", __FUNCTION__, obj->deviceM->GetId(), (int)sizeP, dataP);
break;
case CURLINFO_HEADER_IN:
debug("cSatipTuner::%s(%d): RTSP HEAD <<< %.*s", __FUNCTION__, obj->deviceM->GetId(), (int)sizeP, dataP);
break;
case CURLINFO_HEADER_OUT:
debug("cSatipTuner::%s(%d): RTSP HEAD >>> %.*s", __FUNCTION__, obj->deviceM->GetId(), (int)sizeP, dataP);
break;
case CURLINFO_DATA_IN:
debug("cSatipTuner::%s(%d): RTSP DATA <<< %.*s", __FUNCTION__, obj->deviceM->GetId(), (int)sizeP, dataP);
break;
case CURLINFO_DATA_OUT:
debug("cSatipTuner::%s(%d): RTSP DATA >>> %.*s", __FUNCTION__, obj->deviceM->GetId(), (int)sizeP, dataP);
break;
default:
break;
}
}
return 0;
}
void cSatipTuner::Action(void) void cSatipTuner::Action(void)
{ {
debug("cSatipTuner::%s(): entering [device %d]", __FUNCTION__, deviceM->GetId()); debug("cSatipTuner::%s(): entering [device %d]", __FUNCTION__, deviceM->GetId());
@ -212,6 +241,8 @@ bool cSatipTuner::Connect(void)
#ifdef DEBUG #ifdef DEBUG
// Verbose output // Verbose output
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_VERBOSE, 1L); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_VERBOSE, 1L);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_DEBUGFUNCTION, cSatipTuner::DebugCallback);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_DEBUGDATA, this);
#endif #endif
// No progress meter and no signaling // No progress meter and no signaling

View File

@ -38,6 +38,7 @@ private:
static size_t HeaderCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP); static size_t HeaderCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);
static size_t DataCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP); static size_t DataCallback(void *ptrP, size_t sizeP, size_t nmembP, void *dataP);
static int DebugCallback(CURL *handleP, curl_infotype typeP, char *dataP, size_t sizeP, void *userPtrP);
cCondWait sleepM; cCondWait sleepM;
cSatipDeviceIf* deviceM; cSatipDeviceIf* deviceM;