r798 - in vdr/vdr-plugin-radio/trunk/debian: . patches

Tobias Grimm tiber-guest at costa.debian.org
Wed Jul 20 16:41:38 UTC 2005


Author: tiber-guest
Date: 2005-07-20 16:41:37 +0000 (Wed, 20 Jul 2005)
New Revision: 798

Added:
   vdr/vdr-plugin-radio/trunk/debian/patches/02_vdr1.3.19.dpatch
Modified:
   vdr/vdr-plugin-radio/trunk/debian/changelog
   vdr/vdr-plugin-radio/trunk/debian/control
   vdr/vdr-plugin-radio/trunk/debian/copyright
   vdr/vdr-plugin-radio/trunk/debian/patches/00list
Log:
radio:added patch to make plugin compile with vdr 1.3.27

Modified: vdr/vdr-plugin-radio/trunk/debian/changelog
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/changelog	2005-07-19 19:03:49 UTC (rev 797)
+++ vdr/vdr-plugin-radio/trunk/debian/changelog	2005-07-20 16:41:37 UTC (rev 798)
@@ -1,3 +1,12 @@
+vdr-plugin-radio (0.0.5-2) unstable; urgency=low
+
+  * Tobias Grimm <tg at e-tobi.net>
+    - Bumped Standards-Version to 3.6.2
+    - Depend/Build-Depend on vdr (>=1.3.27-1)
+    - Conflict with vdr (>=1.3.28)
+
+ -- Debian VDR Team <pkg-vdr-dvb-devel at lists.alioth.debian.org>  Wed, 20 Jul 2005 18:19:53 +0200
+
 vdr-plugin-radio (0.0.5-1) unstable; urgency=low
 
   * First upload to the archive (closes: #288864)

Modified: vdr/vdr-plugin-radio/trunk/debian/control
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/control	2005-07-19 19:03:49 UTC (rev 797)
+++ vdr/vdr-plugin-radio/trunk/debian/control	2005-07-20 16:41:37 UTC (rev 798)
@@ -3,13 +3,13 @@
 Priority: extra
 Maintainer: Debian VDR Team <pkg-vdr-dvb-devel at lists.alioth.debian.org>
 Uploaders: Tobias Grimm <tg at e-tobi.net>, Thomas Schmidt <thomas.schmidt at in.stud.tu-ilmenau.de>
-Build-Depends: debhelper (>= 4.1.16), vdr-dev (>=1.2.6-6), dpatch (>=2.0.9), sharutils
-Standards-Version: 3.6.1
+Build-Depends: debhelper (>= 4.1.16), vdr-dev (>=1.3.27-1), dpatch (>=2.0.9), sharutils
+Standards-Version: 3.6.2
 
 Package: vdr-plugin-radio
 Architecture: any
-Depends: ${shlibs:Depends}, vdr (>= 1.2.6-6)
-Conflicts: vdr (>=1.2.7)
+Depends: ${shlibs:Depends}, vdr (>= 1.3.27-1)
+Conflicts: vdr (>=1.3.28)
 Description: VDR Plugin that displays images for radio channels
  Displays mpg-images instead of a black background while watching radio
  channels.

Modified: vdr/vdr-plugin-radio/trunk/debian/copyright
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/copyright	2005-07-19 19:03:49 UTC (rev 797)
+++ vdr/vdr-plugin-radio/trunk/debian/copyright	2005-07-20 16:41:37 UTC (rev 798)
@@ -5,6 +5,10 @@
 
 Upstream Author: Lars Tegeler
 
+A patch has been provided by F.Precourt <stlabs-SPAMBLOCKER at free.fr>.
+It was downloaded from: http://stlabs.free.fr/vdr/
+
+
 Copyright:
 
 It may be redistributed under the terms of the GNU GPL, Version 2

Modified: vdr/vdr-plugin-radio/trunk/debian/patches/00list
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/patches/00list	2005-07-19 19:03:49 UTC (rev 797)
+++ vdr/vdr-plugin-radio/trunk/debian/patches/00list	2005-07-20 16:41:37 UTC (rev 798)
@@ -1 +1,2 @@
 01_Makefile-fPIC-fix
+02_vdr1.3.19

Added: vdr/vdr-plugin-radio/trunk/debian/patches/02_vdr1.3.19.dpatch
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/patches/02_vdr1.3.19.dpatch	2005-07-19 19:03:49 UTC (rev 797)
+++ vdr/vdr-plugin-radio/trunk/debian/patches/02_vdr1.3.19.dpatch	2005-07-20 16:41:37 UTC (rev 798)
@@ -0,0 +1,422 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+
+## VDR 1.3.19 patch by F.Pecourt <stlabs-SPAMBLOCKER at free.fr>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Makes the plugin compile with newer vdr versions
+
+ at DPATCH@
+diff -Nur vdr-plugin-radio-0.0.5.orig/HISTORY radio-0.0.6/HISTORY
+--- vdr-plugin-radio-0.0.5.orig/HISTORY	2004-11-13 15:01:38.000000000 +0100
++++ radio-0.0.6/HISTORY	2005-03-19 17:47:54.000000000 +0100
+@@ -1,6 +1,14 @@
+ VDR Plugin 'radio' Revision History
+ -----------------------------------
+ 
++
++2005-03-19: Version 0.0.6
++- F.PECOURT:
++	modified functions calls for new Audio IDs and
++	radiotransfer for vdr 1.3.22. First dirty hacks
++	still one problem: blank image when switching
++	from one radio to an other. Clear missing!
++	
+ 2004-11-10: Version 0.0.1
+ 
+ - Initial revision.
+diff -Nur vdr-plugin-radio-0.0.5.orig/radio.c radio-0.0.6/radio.c
+--- vdr-plugin-radio-0.0.5.orig/radio.c	2004-11-13 15:09:01.000000000 +0100
++++ radio-0.0.6/radio.c	2005-03-19 17:42:36.000000000 +0100
+@@ -4,26 +4,35 @@
+  * See the README file for copyright information and how to reach the author.
+  *
+  * $Id$
++ * When		Who		What
++ * 20050319	F.PECOURT	modified functions calls for new Audio IDs and
++ *				radiotransfer for vdr 1.3.22. First dirty hacks
++ *				still one problem: blank image when switching
++ *				from one radio to an other. Clear missing!
+  */
+ 
+ #include <vdr/plugin.h>
+ #include <vdr/status.h>
+ #include <vdr/config.h>
++#include <vdr/interface.h>
+ #include "getopt.h"
+ #include "radiotransfer.h"
+ //file exists 
+ #include <sys/stat.h>
+ 
+-static const char *VERSION        = "0.0.5";
++static const char *VERSION        = "0.0.5+0.0.6";
+ static const char *DESCRIPTION    = "Radio Background Image plugin";
+ static const char *MAINMENUENTRY  = NULL;
+ 
++int Activate=false;
++
+ class cPluginRadio : public cPlugin, cStatus {
+ private:
+   // Add any member variables or functions you may need here.
+   cRadioTransfer *_radioTransfer;
+   const char *ConfigDir;
+   bool ConfigDirParam;
++  int newActivate;
+ public:
+   cPluginRadio(void);
+   virtual ~cPluginRadio();
+@@ -33,6 +42,7 @@
+   virtual bool ProcessArgs(int argc, char *argv[]);
+   virtual bool Initialize(void);
+   virtual bool Start(void);
++  virtual void Stop(void);
+   virtual void Housekeeping(void);
+   virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; }
+   virtual cOsdObject *MainMenuAction(void);
+@@ -64,6 +74,33 @@
+   return   "  -f dir,   --files=dir      use dir as image directory (default: <vdrconfig>/plugins/radio)\n";
+ }
+ 
++// --- cMenuSetupRadio -------------------------------------------------------
++
++class cMenuSetupRadio : public cMenuSetupPage {
++private:
++  int newActivate;
++protected:
++  virtual void Store(void);
++public:
++  cMenuSetupRadio(void);
++  };
++
++cMenuSetupRadio::cMenuSetupRadio(void)
++{
++//  newGreetingTime = GreetingTime;
++//  newUseAlternateGreeting = UseAlternateGreeting;
++//  Add(new cMenuEditIntItem( tr("Greeting time (s)"),      &newGreetingTime));
++//  Add(new cMenuEditBoolItem(tr("Use alternate greeting"), &newUseAlternateGreeting));
++  newActivate = Activate;
++  Add(new cMenuEditBoolItem( tr("Activate "),      &newActivate));
++  }
++
++void cMenuSetupRadio::Store(void)
++{
++  SetupStore("Activate", Activate = newActivate);
++}
++
++
+ bool cPluginRadio::ProcessArgs(int argc, char *argv[])
+ {
+ 	// Implement command line argument processing here if applicable.
+@@ -97,14 +134,19 @@
+ bool cPluginRadio::Start(void)
+ {
+   // Start any background activities the plugin shall perform.
++   fprintf(stderr,"vdr: RADIO PLUGIN START\n");
+     if (!ConfigDirParam) ConfigDir = strdup(ConfigDirectory( Name() ));
+   return true;
+ }
+ 
++void cPluginRadio::Stop(void)
++{
++}
++
+ void cPluginRadio::Housekeeping(void)
+ {
+   // Perform any cleanup or other regular tasks.
+-}
++}   
+ 
+ cOsdObject *cPluginRadio::MainMenuAction(void)
+ {
+@@ -115,26 +157,35 @@
+ cMenuSetupPage *cPluginRadio::SetupMenu(void)
+ {
+   // Return a setup menu in case the plugin supports one.
+-  return NULL;
++  return new cMenuSetupRadio;
++
++//  return NULL;
+ }
+ 
+ bool cPluginRadio::SetupParse(const char *Name, const char *Value)
+ {
+   // Parse your own setup parameters and store their values.
+-  return false;
++  if      (!strcasecmp(Name, "Activate"))         Activate = atoi(Value);
++  else
++     return false;
++  return true;
+ }
+ 
+ void cPluginRadio::ChannelSwitch(const cDevice *Device, int ChannelNumber)
+ {
+         const cChannel *chan;
+ 	char *image;
+-
++  	int apid[2] = {0, 0};
++	if (Activate==false) return ;
+         if ( cDevice::CurrentChannel() == ChannelNumber ){
+ 	
+ 		chan = ChannelNumber ? Channels.GetByNumber(ChannelNumber) : NULL;
++
+ 		if (chan != NULL && chan->Vpid() == 0){
+ 			asprintf(&image, "%s/%s.mpg", ConfigDir, chan->Name());
+ 			if ( !file_exists( image ) ){
++				fprintf(stderr, "vdr: radio background image not found: %s (Channelname: %s)\n", image, chan->Name());
++				dsyslog("vdr: radio background image not found: %s (Channelname: %s)\n", image, chan->Name());
+ 				free(image);
+ 				asprintf(&image, "%s/radio.mpg", ConfigDir);
+ 				if ( !file_exists( image ) ){
+@@ -142,7 +193,9 @@
+ 					fprintf(stderr, "vdr: radio background image not found: %s (Channelname: %s)\n", image, chan->Name());
+ 				}
+ 			}
+-			cControl::Launch(new cRadioTransferControl(cDevice::ActualDevice(), 0, chan->Apid1(), 0, 0, 0, chan->Ca(), image));
++			apid[0]=chan->Apid(0);
++			fprintf(stderr, "*PLUGIN RADIO-IMAGE apid = %d   Channelname: %s Use image : %s\n", chan->Apid(0), chan->Name(),image);
++			cControl::Launch(new cRadioTransferControl(cDevice::ActualDevice(), 0, apid , NULL, chan->Ca(), image));
+ 			free(image);
+ 		}
+ 	}
+@@ -152,5 +205,7 @@
+         struct stat file_stat;
+         return ((stat(filename, &file_stat) == 0) ? true:false);
+ }
++//cRadioTransferControl::cRadioTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2, int CA, const char *Image)
++//cRadioTransferControl::cRadioTransferControl(cDevice *ReceiverDevice, int VPid, int Apid[], int Dpid[], int CA, const char *Image)
+ 
+ VDRPLUGINCREATOR(cPluginRadio); // Don't touch this!
+diff -Nur vdr-plugin-radio-0.0.5.orig/radiotransfer.c radio-0.0.6/radiotransfer.c
+--- vdr-plugin-radio-0.0.5.orig/radiotransfer.c	2004-11-13 15:07:24.000000000 +0100
++++ radio-0.0.6/radiotransfer.c	2005-03-19 17:37:59.000000000 +0100
+@@ -13,8 +13,12 @@
+ 
+ // --- cRadioTransfer -------------------------------------------------------------
+ 
+-cRadioTransfer::cRadioTransfer(int VPid, int APid1, int APid2, int DPid1, int DPid2, int CA, const char *Image)
+-:cReceiver(CA, -1, 5, VPid, APid1, APid2, DPid1, DPid2)
++//cRadioTransfer::cRadioTransfer(int VPid, int APid1, int APid2, int DPid1, int DPid2, int CA, const char *Image)
++//:cReceiver(CA, -1, 5, VPid, APid1, APid2, DPid1, DPid2)
++
++cRadioTransfer::cRadioTransfer(int VPid, int APid[], int DPid[], int CA, const char *Image)
++:cReceiver(CA, -1, VPid, APid, DPid, NULL)
++
+ #if VDRVERSNUM > 10300	
+ ,cThread("radiotransfer")
+ #else
+@@ -27,7 +31,7 @@
+ #else
+    ringBuffer = new cRingBufferLinear(TRANSFERBUFSIZE, TS_SIZE * 2, true);
+ #endif
+-  remux = new cRemux(VPid, APid1, APid2, DPid1, DPid2);
++  remux = new cRemux(VPid, APid, DPid, NULL); //VPid, APid1, APid2, DPid1, DPid2
+   canToggleAudioTrack = false;
+   audioTrack = 0xC0;
+   active = false;
+@@ -74,7 +78,67 @@
+   int PollTimeouts = 0;
+   active = true;
+   ShowImage(imagepath);
+-#if VDRVERSNUM > 10310
++#if VDRVERSNUM > 10318
++  uchar *p = NULL;
++  int Result = 0;
++  while (active) {
++  	int Count;
++        uchar *b = ringBuffer->Get(Count);
++        if (b) {
++           if (ringBuffer->Available() > TRANSFERBUFSIZE * 9 / 10) {
++              // If the buffer runs full, we have no chance of ever catching up
++              // since the data comes in at the same rate as it goes out (it's "live").
++              // So let's clear the buffer instead of suffering from permanent
++              // overflows.
++              dsyslog("clearing transfer buffer to avoid overflows");
++              DeviceClear();
++              ringBuffer->Clear();
++              remux->Clear();
++              PlayPes(NULL, 0);
++              p = NULL;
++#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3
++              GotBufferReserve = false;
++#endif
++              continue;
++              }
++           Count = remux->Put(b, Count);
++           if (Count)
++              ringBuffer->Del(Count);
++           }
++        if (!p)
++           p = remux->Get(Result);
++        if (p) {
++           cPoller Poller;
++           if (DevicePoll(Poller, 100)) {
++              PollTimeouts = 0;
++              int w = PlayPes(p, Result);
++              if (w > 0) {
++                 p += w;
++                 Result -= w;
++                 remux->Del(w);
++                 if (Result <= 0)
++                    p = NULL;
++                 }
++              else if (w < 0 && FATALERRNO)
++                 LOG_ERROR;
++              }
++           else {
++              PollTimeouts++;
++              if (PollTimeouts == POLLTIMEOUTS_BEFORE_DEVICECLEAR) {
++                 dsyslog("clearing device because of consecutive poll timeouts");
++                 DeviceClear();
++                 ringBuffer->Clear();
++                 remux->Clear();
++                 PlayPes(NULL, 0);
++                 p = NULL;
++#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3
++                 GotBufferReserve = false;
++#endif
++                 }
++              }
++           }
++        }
++#elif VDRVERSNUM > 10310
+   uchar *p = NULL;
+   int Result = 0;
+   while (active) {
+@@ -87,6 +151,7 @@
+               // So let's clear the buffer instead of suffering from permanent
+               // overflows.
+               dsyslog("clearing transfer buffer to avoid overflows");
++		fprintf(stderr,"clearing transfer buffer to avoid overflows");
+               ringBuffer->Clear();
+               remux->Clear();
+               p = NULL;
+@@ -103,7 +168,7 @@
+            cPoller Poller;
+            if (DevicePoll(Poller, 100)) {
+               PollTimeouts = 0;
+-              int w = PlayVideo(p, Result);
++              int w = PlayPes(p, Result);
+               if (w > 0) {
+                  p += w;
+                  Result -= w;
+@@ -118,6 +183,8 @@
+               PollTimeouts++;
+               if (PollTimeouts == POLLTIMEOUTS_BEFORE_DEVICECLEAR) {
+                  dsyslog("clearing device because of consecutive poll timeouts");
++		 fprintf(stderr,"clearing device because of consecutive poll timeouts");
++		 
+                  DeviceClear();
+                  ringBuffer->Clear();
+                  remux->Clear();
+@@ -142,7 +209,7 @@
+ 					cPoller Poller;
+ 					if (DevicePoll(Poller, 100)) {
+ 						PollTimeouts = 0;
+-						int w = PlayVideo(p, Result);
++						int w = PlayPes(p, Result);
+ 						if (w > 0) {
+ 							p += w;
+ 							Result -= w;
+@@ -179,9 +246,8 @@
+          switch (c) {
+            case 0xBD: // dolby
+                 if (Except)
+-                   PlayAudio(&b[i], l);
++                   PlayPes(&b[i], l);
+                 // continue with deleting the data - otherwise it disturbs DVB replay
+-	   
+            case 0xC0 ... 0xC1: // audio
+                 if (c == 0xC1)
+                    canToggleAudioTrack = true;
+@@ -195,7 +261,7 @@
+                 //esyslog("ERROR: unexpected packet id %02X", c);
+                 l = 0;
+            }
+-	 PlayAudio(&b[i], l);
++	 PlayPes(&b[i], l);
+          if (l)
+             i += l - 1; // the loop increments, too!
+          }
+@@ -223,10 +289,10 @@
+   return NULL;
+ }
+ 
+-void cRadioTransfer::SetAudioTrack(int Index)
++void cRadioTransfer::SetAudioTrack(eTrackType Type, const tTrackId *TrackId)
+ {
+-  if ((audioTrack == 0xC0) != (Index == 0)) {
+-     audioTrack = (Index == 1) ? 0xC1 : 0xC0;
++  if ((audioTrack == 0xC0) != (Type == 0)) {
++     audioTrack = (Type == 1) ? 0xC1 : 0xC0;
+      DeviceClear();
+      }
+ }
+@@ -299,19 +365,24 @@
+ 			pes_header[6] = 0x0f;
+ 		}
+ 		memcpy(&pes_header[6 + ptslen], data, payload_size);
+-		PlayVideo(pes_header, 6 + ptslen + payload_size);
++		PlayPes(pes_header, 6 + ptslen + payload_size);
+ 		len -= payload_size;
+ 		data += payload_size;
+ 		ptslen = 1;
+ 	}
+ }
+ 
++
+ // --- cRadioTransferControl ------------------------------------------------------
+ 
+ cDevice *cRadioTransferControl::receiverDevice = NULL;
+ 
+-cRadioTransferControl::cRadioTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2, int CA, const char *Image)
+-:cControl(transfer = new cRadioTransfer(VPid, APid1, APid2, DPid1, DPid2, CA, Image), true)
++//cRadioTransferControl::cRadioTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2, int CA, const char *Image)
++//:cControl(transfer = new cRadioTransfer(VPid, APid1, APid2, DPid1, DPid2, CA, Image), true)
++
++
++cRadioTransferControl::cRadioTransferControl(cDevice *ReceiverDevice, int VPid, int APid[], int DPid[], int CA, const char *Image)
++:cControl(transfer = new cRadioTransfer(VPid, APid, DPid, CA, Image), true)
+ {
+   cDevice::PrimaryDevice()->AttachPlayer(transfer );
+   ReceiverDevice->AttachReceiver(transfer);
+diff -Nur vdr-plugin-radio-0.0.5.orig/radiotransfer.h radio-0.0.6/radiotransfer.h
+--- vdr-plugin-radio-0.0.5.orig/radiotransfer.h	2004-11-13 15:01:38.000000000 +0100
++++ radio-0.0.6/radiotransfer.h	2005-03-08 01:05:26.000000000 +0100
+@@ -7,6 +7,7 @@
+ #include <vdr/remux.h>
+ #include <vdr/ringbuffer.h>
+ #include <vdr/thread.h>
++#include <vdr/device.h>
+ 
+ class cRadioTransfer : public cReceiver, public cPlayer, public cThread {
+ private:
+@@ -16,6 +17,7 @@
+   uchar audioTrack;
+   bool active;
+   const char *imagepath;
++  int ppids[5];
+   void StripAudioPackets(uchar *b, int Length, uchar Except = 0x00);
+   void send_pes_packet(unsigned char *data, int len, int timestamp);
+   void ShowImage (const char *file);
+@@ -24,11 +26,11 @@
+   virtual void Receive(uchar *Data, int Length);
+   virtual void Action(void);
+ public:
+-  cRadioTransfer(int VPid, int APid1, int APid2, int DPid1, int DPid2, int CA, const char *Image);
++  cRadioTransfer(int VPid, int APid[], int DPid[], int CA, const char *Image);
+   virtual ~cRadioTransfer();
+   virtual int NumAudioTracks(void) const;
+   virtual const char **GetAudioTracks(int *CurrentTrack = NULL) const;
+-  virtual void SetAudioTrack(int Index);
++  virtual void SetAudioTrack(eTrackType Type, const tTrackId *TrackId);
+   };
+ 
+ class cRadioTransferControl : public cControl {
+@@ -36,7 +38,7 @@
+   cRadioTransfer *transfer;
+   static cDevice *receiverDevice;
+ public:
+-  cRadioTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2, int CA, const char *Image);
++  cRadioTransferControl(cDevice *ReceiverDevice, int VPid, int APid[], int DPid[], int CA, const char *Image);
+   ~cRadioTransferControl();
+   virtual void Hide(void) {}
+   static cDevice *ReceiverDevice(void) { return receiverDevice; }




More information about the pkg-vdr-dvb-changes mailing list