if (channel->Number() == (int)channelNumber)
{
int vpid = channel->Vpid();
+#if VDRVERSNUM < 10300
int apid1 = channel->Apid1();
-
+#else
+ int apid1 = channel->Apid(0);
+#endif
printf("Found channel number %lu, vpid = %i, apid1 = %i\n", channelNumber, vpid, apid1);
return channel;
}
cRecordings Recordings;
Recordings.Load(); // probably have to do this
- cRecording* recording = Recordings.GetByName((char*)data);
+ cRecording *recording = Recordings.GetByName((char*)data);
printf("recording pointer %p\n", recording);
int count = 4; // leave space for the packet length
char* point;
-
+#if VDRVERSNUM < 10300
point = (char*)recording->Summary();
+#else
+ point = (char*)recording->Info()->ShortText();
+#endif
strcpy((char*)&sendBuffer[count], point);
count += strlen(point) + 1;
*(unsigned long*)&sendBuffer[0] = htonl(count - 4); // -4 : take off the size field
return;
}
+#if VDRVERSNUM < 10300
cMutexLock MutexLock;
- const cSchedules* Schedules = cSIProcessor::Schedules(MutexLock);
-// const cSchedules* Schedules = cSchedules::Schedules(MutexLock);
+ const cSchedules *Schedules = cSIProcessor::Schedules(MutexLock);
+#else
+ cSchedulesLock MutexLock;
+ const cSchedules *Schedules = cSchedules::Schedules(MutexLock);
+#endif
if (!Schedules)
{
unsigned char sendBuffer[8];
{
FILE* f = fopen("/tmp/s.txt", "w");
+#if VDRVERSNUM < 10300
cMutexLock MutexLock;
- const cSchedules* Schedules = cSIProcessor::Schedules(MutexLock);
-// const cSchedules* Schedules = cSchedules::Schedules(MutexLock);
+ const cSchedules *Schedules = cSIProcessor::Schedules(MutexLock);
+#else
+ cSchedulesLock MutexLock;
+ const cSchedules *Schedules = cSchedules::Schedules(MutexLock);
+#endif
if (!Schedules)
{
fprintf(f, "Schedules = NULL\n");
tChannelID tchid;
cChannel *thisChannel;
- const cEventInfo* event;
+#if VDRVERSNUM < 10300
+ const cEventInfo *event;
int eventNumber = 0;
+#else
+ const cEvent *event;
+#endif
// Schedule = Schedules->GetSchedule(channel->GetChannelID());
// Schedule = Schedules->GetSchedule();
fprintf(f, "Schedule #%i\n", scheduleNumber);
fprintf(f, "-------------\n\n");
+#if VDRVERSNUM < 10300
tchid = Schedule->GetChannelID();
+#else
+ tchid = Schedule->ChannelID();
+#endif
+#if VDRVERSNUM < 10300
fprintf(f, "ChannelID.ToString() = %s\n", tchid.ToString());
fprintf(f, "NumEvents() = %i\n", Schedule->NumEvents());
+#else
+// put the count at the end.
+#endif
thisChannel = Channels.GetByChannelID(tchid, true);
if (thisChannel)
{
fprintf(f, "thisChannel = NULL for tchid\n");
}
+#if VDRVERSNUM < 10300
for (eventNumber = 0; eventNumber < Schedule->NumEvents(); eventNumber++)
{
event = Schedule->GetEventNumber(eventNumber);
event->Dump(f);
fprintf(f, "\n\n");
}
-
+#else
+// This whole section needs rewriting to walk the list.
+ event = Schedule->Events()->First();
+ while (event) {
+ event = Schedule->Events()->Next(event);
+ }
+#endif
fprintf(f, "\nDump from object:\n");
#define BUFOVERTIME 5000
#define BUFOVERCOUNT 100
+#if VDRVERSNUM < 10300
cMediamvpTransceiver::cMediamvpTransceiver(const cChannel *Channel, int Priority, int Socket, cDevice *Device) :
cReceiver(Channel->Ca(), Priority, 7, Channel->Vpid(), Channel->Ppid(),
Channel->Apid1(), Channel->Apid2(), Channel->Dpid1(), Channel->Dpid2(),
Channel->Tpid()) {
- m_Active = false;
+#else
+cMediamvpTransceiver::cMediamvpTransceiver(const cChannel *Channel, int Priority, int Socket, cDevice *Device) :
+ cReceiver(Channel->Ca(), Priority, Channel->Vpid(),
+ Channel->Apids(), Channel->Dpids(), Channel->Spids()) {
+#endif
+ m_Active = false;
m_Socket = Socket;
m_Remux = NULL;
m_Device = Device;
// m_RingBuffer = new cRingBufferLinear(VIDEOBUFSIZE, TS_SIZE * 20, true);
/* Select the correct Muxing depending on whether it's video or not */
+#if VDRVERSNUM < 10300
if ( Channel->Vpid() == 0 || Channel->Vpid() == 1 || Channel->Vpid() == 0x1FFF ) {
m_Remux = new cTS2ESRemux(Channel->Apid1());
} else {
m_Remux = new cTS2PSRemux(Channel->Vpid(), Channel->Apid1(), 0, 0, 0, 0);
}
+#else
+ if ( Channel->Vpid() == 0 || Channel->Vpid() == 1 || Channel->Vpid() == 0x1FFF ) {
+ m_Remux = new cTS2ESRemux(Channel->Apid(0));
+ } else {
+ m_Remux = new cTS2PSRemux(Channel->Vpid(), Channel->Apid(0), 0, 0, 0, 0);
+ }
+#endif
printf("Created transceiver at %p, remux @%p ringbuffer %p\n",this,m_Remux,m_RingBuffer);
/* Suggested by Peter Wagner to assist single DVB card systems */
int p = m_RingBuffer->Put(Data, Length);
if (p != Length) {
++errcnt;
- if (showerr) {
+#if VDRVERSNUM < 10300
+ if (showerr) {
if (firsterr == 0)
firsterr = time_ms();
else if (firsterr + BUFOVERTIME > time_ms() && errcnt > BUFOVERCOUNT) {
esyslog("ERROR: ring buffer overflow (%d bytes dropped)", Length - p);
else
firsterr = time_ms();
+#else
+ if (showerr) {
+ if (firsterr == 0) {
+ firsterr = 1;
+ lastTime.Set();
+ }
+ else if (lastTime.Elapsed() > BUFOVERTIME && errcnt > BUFOVERCOUNT) {
+ esyslog("ERROR: too many buffer overflows, logging stopped");
+ showerr = false;
+ }
+ } else if (lastTime.Elapsed() < BUFOVERTIME) {
+ showerr = true;
+ firsterr = 0;
+ errcnt = 0;
+ }
+
+ if (showerr)
+ esyslog("ERROR: ring buffer overflow (%d bytes dropped)", Length - p);
+ else
+ firsterr = 1;
+#endif
}
}
}