From 61ebd168e2e6345f5aa51e7c1eb8850189934956 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Mon, 8 Feb 2010 15:12:32 +0000 Subject: [PATCH] HDTV for Windows --- responsepacket.c | 11 +++++++++++ responsepacket.h | 1 + vompclient.c | 3 ++- vompclientrrproc.c | 24 +++++++++++++++++++++--- vompserver.c | 16 ++++++++-------- 5 files changed, 43 insertions(+), 12 deletions(-) diff --git a/responsepacket.c b/responsepacket.c index 60bfa1a..2c4864f 100644 --- a/responsepacket.c +++ b/responsepacket.c @@ -116,6 +116,17 @@ bool ResponsePacket::addULLONG(ULLONG ull) return true; } +bool ResponsePacket::adddouble(double d) +{ + if (!checkExtend(sizeof(double))) return false; + ULLONG ull; + memcpy(&ull,&d,sizeof(double)); + *(ULLONG*)&buffer[bufUsed] = htonll(ull); + bufUsed += sizeof(ULLONG); + return true; +} + + bool ResponsePacket::checkExtend(ULONG by) { if ((bufUsed + by) < bufSize) return true; diff --git a/responsepacket.h b/responsepacket.h index 7b8f25d..945d28b 100644 --- a/responsepacket.h +++ b/responsepacket.h @@ -37,6 +37,7 @@ class ResponsePacket bool addLONG(LONG l); bool addUCHAR(UCHAR c); bool addULLONG(ULLONG ull); + bool adddouble(double d); UCHAR* getPtr() { return buffer; } ULONG getLen() { return bufUsed; } diff --git a/vompclient.c b/vompclient.c index fd8baf5..6562fe7 100644 --- a/vompclient.c +++ b/vompclient.c @@ -317,6 +317,7 @@ void VompClient::run2() fclose(netLogFile); netLogFile = NULL; } + fflush(NULL); } } else @@ -392,7 +393,7 @@ void VompClient::writeResumeData() (char*)recplayer->getCurrentRecording()->FileName(), recplayer->frameNumberFromPosition(recplayer->getLastPosition()) );*/ - /* write to vdr resume file */ + /* write to vdrdeveldevel resume file */ int resume = recplayer->frameNumberFromPosition(recplayer->getLastPosition()); char* ResumeIdC = config.getValueString("General", "ResumeId"); int ResumeId; diff --git a/vompclientrrproc.c b/vompclientrrproc.c index ce9cc11..1476880 100644 --- a/vompclientrrproc.c +++ b/vompclientrrproc.c @@ -634,7 +634,7 @@ int VompClientRRProc::processDeleteRecording() { if (recording->Delete()) { - // Copy svdrp's way of doing this, see if it works + // Copy svdrdeveldevelp's way of doing this, see if it works #if VDRVERSNUM > 10300 ::Recordings.DelByName(recording->FileName()); #endif @@ -857,6 +857,11 @@ int VompClientRRProc::processGetChannelsList() resp->addULONG(channel->Number()); resp->addULONG(type); resp->addString(channel->Name()); +#if VDRVERSNUM < 10703 + resp->addULONG(2); +#else + resp->addULONG(channel->Vtype()); +#endif } } @@ -935,6 +940,11 @@ int VompClientRRProc::processGetChannelPids() // tpid resp->addULONG(channel->Vpid()); +#if VDRVERSNUM < 10703 + resp->addULONG(2); +#else + resp->addULONG(channel->Vtype()); +#endif resp->addULONG(numApids); #if VDRVERSNUM < 10300 @@ -1127,8 +1137,9 @@ int VompClientRRProc::processStartStreamingRecording() resp->addULLONG(x.recplayer->getLengthBytes()); resp->addULONG(x.recplayer->getLengthFrames()); + #if VDRVERSNUM < 10703 - resp->addUCHAR(true);//added for TS + resp->addUCHAR(true);//added for TS #else resp->addUCHAR(recording->IsPesRecording());//added for TS #endif @@ -1572,7 +1583,7 @@ int VompClientRRProc::processGetRecInfo() string: language string: description } - + 8 bytes: frames per second */ // Get current timer @@ -1697,6 +1708,13 @@ int VompClientRRProc::processGetRecInfo() } #endif + double framespersec; +#if VDRVERSNUM < 10703 + framespersec = FRAMESPERSEC; +#else + framespersec = Info->FramesPerSecond(); +#endif + resp->adddouble(framespersec); // Done. send it diff --git a/vompserver.c b/vompserver.c index aa449b7..31e2b6c 100644 --- a/vompserver.c +++ b/vompserver.c @@ -68,14 +68,14 @@ bool cPluginVompserver::Start(void) if (!configDir) { - const char* vdrret = cPlugin::ConfigDirectory("vompserver"); - if (!vdrret) + const char* vdrdeveldevelret = cPlugin::ConfigDirectory("vompserver"); + if (!vdrdeveldevelret) { dsyslog("VOMP: Could not get config dir from VDR"); return false; } - configDir = new char[strlen(vdrret)+1]; - strcpy(configDir, vdrret); + configDir = new char[strlen(vdrdeveldevelret)+1]; + strcpy(configDir, vdrdeveldevelret); } int success = mvpserver.run(configDir); @@ -106,15 +106,15 @@ bool cPluginVompserver::ProcessArgs(int argc, char *argv[]) { if (c == 'c') { - const char* vdrret = cPlugin::ConfigDirectory(optarg); - if (!vdrret) + const char* vdrdeveldevelret = cPlugin::ConfigDirectory(optarg); + if (!vdrdeveldevelret) { dsyslog("VOMP: Could not get config dir from VDR"); return false; } - configDir = new char[strlen(vdrret)+1]; - strcpy(configDir, vdrret); + configDir = new char[strlen(vdrdeveldevelret)+1]; + strcpy(configDir, vdrdeveldevelret); } else { -- 2.39.5