mirror of
				https://github.com/rofafor/vdr-plugin-femon.git
				synced 2023-10-10 11:36:53 +00:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					1a98e97e8e | ||
| 
						 | 
					fe364e3568 | ||
| 
						 | 
					66f79dd5bc | 
							
								
								
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							@@ -525,3 +525,7 @@ VDR Plugin 'femon' Revision History
 | 
			
		||||
- Got rid of FEMON_DEBUG.
 | 
			
		||||
- Added support for tracing modes.
 | 
			
		||||
- Removed the 'femonclient' plugin.
 | 
			
		||||
 | 
			
		||||
2015-xx-xx: Version 2.2.2
 | 
			
		||||
 | 
			
		||||
- Fixed frontend handling during a device switch.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								femon.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								femon.c
									
									
									
									
									
								
							@@ -25,7 +25,7 @@
 | 
			
		||||
#define GITVERSION ""
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static const char VERSION[]       = "2.2.1" GITVERSION;
 | 
			
		||||
static const char VERSION[]       = "2.2.2" GITVERSION;
 | 
			
		||||
static const char DESCRIPTION[]   = trNOOP("DVB Signal Information Monitor (OSD)");
 | 
			
		||||
static const char MAINMENUENTRY[] = trNOOP("Signal Information");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										136
									
								
								osd.c
									
									
									
									
									
								
							
							
						
						
									
										136
									
								
								osd.c
									
									
									
									
									
								
							@@ -718,40 +718,7 @@ void cFemonOsd::Show(void)
 | 
			
		||||
  eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
 | 
			
		||||
  const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
 | 
			
		||||
 | 
			
		||||
  deviceSourceM = DEVICESOURCE_DVBAPI;
 | 
			
		||||
  if (channel) {
 | 
			
		||||
     if (channel->IsSourceType('I'))
 | 
			
		||||
        deviceSourceM = DEVICESOURCE_IPTV;
 | 
			
		||||
     else if (channel->IsSourceType('V'))
 | 
			
		||||
        deviceSourceM = DEVICESOURCE_PVRINPUT;
 | 
			
		||||
     }
 | 
			
		||||
 | 
			
		||||
  if (deviceSourceM == DEVICESOURCE_DVBAPI) {
 | 
			
		||||
     if (!strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
 | 
			
		||||
        cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
 | 
			
		||||
        frontendM = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
 | 
			
		||||
        if (frontendM >= 0) {
 | 
			
		||||
           if (ioctl(frontendM, FE_GET_INFO, &frontendInfoM) < 0) {
 | 
			
		||||
              if (!FemonConfig.GetUseSvdrp())
 | 
			
		||||
                 error("%s Cannot read frontend info", __PRETTY_FUNCTION__);
 | 
			
		||||
              close(frontendM);
 | 
			
		||||
              frontendM = -1;
 | 
			
		||||
              memset(&frontendInfoM, 0, sizeof(frontendInfoM));
 | 
			
		||||
              return;
 | 
			
		||||
              }
 | 
			
		||||
           }
 | 
			
		||||
        else if (FemonConfig.GetUseSvdrp()) {
 | 
			
		||||
           if (!SvdrpConnect() || !SvdrpTune())
 | 
			
		||||
              return;
 | 
			
		||||
           }
 | 
			
		||||
        else {
 | 
			
		||||
           error("%s Cannot open frontend device", __PRETTY_FUNCTION__);
 | 
			
		||||
           return;
 | 
			
		||||
           }
 | 
			
		||||
        }
 | 
			
		||||
     }
 | 
			
		||||
  else
 | 
			
		||||
     frontendM = -1;
 | 
			
		||||
  AttachFrontend();
 | 
			
		||||
 | 
			
		||||
  osdM = cOsdProvider::NewOsd(osdLeftM, osdTopM);
 | 
			
		||||
  if (osdM) {
 | 
			
		||||
@@ -780,6 +747,54 @@ void cFemonOsd::Show(void)
 | 
			
		||||
     }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool cFemonOsd::AttachFrontend(void)
 | 
			
		||||
{
 | 
			
		||||
  debug1("%s", __PRETTY_FUNCTION__);
 | 
			
		||||
  const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
 | 
			
		||||
 | 
			
		||||
  if (frontendM >= 0) {
 | 
			
		||||
     close(frontendM);
 | 
			
		||||
     frontendM = -1;
 | 
			
		||||
     }
 | 
			
		||||
 | 
			
		||||
  deviceSourceM = DEVICESOURCE_DVBAPI;
 | 
			
		||||
  if (channel) {
 | 
			
		||||
     if (channel->IsSourceType('I'))
 | 
			
		||||
        deviceSourceM = DEVICESOURCE_IPTV;
 | 
			
		||||
     else if (channel->IsSourceType('V'))
 | 
			
		||||
        deviceSourceM = DEVICESOURCE_PVRINPUT;
 | 
			
		||||
     }
 | 
			
		||||
 | 
			
		||||
  if (deviceSourceM == DEVICESOURCE_DVBAPI) {
 | 
			
		||||
     if (!strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
 | 
			
		||||
        cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
 | 
			
		||||
        frontendM = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
 | 
			
		||||
        if (frontendM >= 0) {
 | 
			
		||||
           if (ioctl(frontendM, FE_GET_INFO, &frontendInfoM) < 0) {
 | 
			
		||||
              if (!FemonConfig.GetUseSvdrp())
 | 
			
		||||
                 error("%s Cannot read frontend info", __PRETTY_FUNCTION__);
 | 
			
		||||
              close(frontendM);
 | 
			
		||||
              frontendM = -1;
 | 
			
		||||
              memset(&frontendInfoM, 0, sizeof(frontendInfoM));
 | 
			
		||||
              return false;
 | 
			
		||||
              }
 | 
			
		||||
           }
 | 
			
		||||
        else if (FemonConfig.GetUseSvdrp()) {
 | 
			
		||||
           if (!SvdrpConnect() || !SvdrpTune())
 | 
			
		||||
              return false;
 | 
			
		||||
           }
 | 
			
		||||
        else {
 | 
			
		||||
           error("%s Cannot open frontend device", __PRETTY_FUNCTION__);
 | 
			
		||||
           return false;
 | 
			
		||||
           }
 | 
			
		||||
        }
 | 
			
		||||
     }
 | 
			
		||||
  else
 | 
			
		||||
     frontendM = -1;
 | 
			
		||||
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cFemonOsd::ChannelSwitch(const cDevice * deviceP, int channelNumberP, bool liveViewP)
 | 
			
		||||
{
 | 
			
		||||
  debug1("%s (%d, %d, %d)", __PRETTY_FUNCTION__, deviceP->DeviceNumber(), channelNumberP, liveViewP);
 | 
			
		||||
@@ -797,49 +812,13 @@ void cFemonOsd::ChannelSwitch(const cDevice * deviceP, int channelNumberP, bool
 | 
			
		||||
     return;
 | 
			
		||||
     }
 | 
			
		||||
 | 
			
		||||
  if (channel && FemonConfig.GetAnalyzeStream()) {
 | 
			
		||||
     deviceSourceM = DEVICESOURCE_DVBAPI;
 | 
			
		||||
     if (channel->IsSourceType('I'))
 | 
			
		||||
        deviceSourceM = DEVICESOURCE_IPTV;
 | 
			
		||||
     else if (channel->IsSourceType('V'))
 | 
			
		||||
        deviceSourceM = DEVICESOURCE_PVRINPUT;
 | 
			
		||||
 | 
			
		||||
     if (frontendM >= 0) {
 | 
			
		||||
        close(frontendM);
 | 
			
		||||
        frontendM = -1;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
     if (deviceSourceM == DEVICESOURCE_DVBAPI) {
 | 
			
		||||
        if (!strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
 | 
			
		||||
           cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
 | 
			
		||||
           frontendM = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
 | 
			
		||||
           if (frontendM >= 0) {
 | 
			
		||||
              if (ioctl(frontendM, FE_GET_INFO, &frontendInfoM) < 0) {
 | 
			
		||||
                 if (!FemonConfig.GetUseSvdrp())
 | 
			
		||||
                    error("%s Cannot read frontend info", __PRETTY_FUNCTION__);
 | 
			
		||||
                 close(frontendM);
 | 
			
		||||
                 frontendM = -1;
 | 
			
		||||
                 memset(&frontendInfoM, 0, sizeof(frontendInfoM));
 | 
			
		||||
                 return;
 | 
			
		||||
                 }
 | 
			
		||||
              }
 | 
			
		||||
           else if (FemonConfig.GetUseSvdrp()) {
 | 
			
		||||
              if (!SvdrpConnect() || !SvdrpTune())
 | 
			
		||||
                 return;
 | 
			
		||||
              }
 | 
			
		||||
           else {
 | 
			
		||||
              error("%s Cannot open frontend device", __PRETTY_FUNCTION__);
 | 
			
		||||
              return;
 | 
			
		||||
              }
 | 
			
		||||
           }
 | 
			
		||||
 | 
			
		||||
        if (receiverM) {
 | 
			
		||||
           receiverM->Deactivate();
 | 
			
		||||
           DELETENULL(receiverM);
 | 
			
		||||
           }
 | 
			
		||||
        receiverM = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
 | 
			
		||||
        cDevice::ActualDevice()->AttachReceiver(receiverM);
 | 
			
		||||
  if (channel && FemonConfig.GetAnalyzeStream() && AttachFrontend()) {
 | 
			
		||||
     if (receiverM) {
 | 
			
		||||
        receiverM->Deactivate();
 | 
			
		||||
        DELETENULL(receiverM);
 | 
			
		||||
        }
 | 
			
		||||
     receiverM = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
 | 
			
		||||
     cDevice::ActualDevice()->AttachReceiver(receiverM);
 | 
			
		||||
     }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -939,12 +918,13 @@ bool cFemonOsd::DeviceSwitch(int directionP)
 | 
			
		||||
                  d->CamSlot()->Assign(NULL);
 | 
			
		||||
               d->SwitchChannel(channel, false);
 | 
			
		||||
               cControl::Launch(new cTransferControl(d, channel));
 | 
			
		||||
               return (true);
 | 
			
		||||
               AttachFrontend();
 | 
			
		||||
               return true;
 | 
			
		||||
               }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
     }
 | 
			
		||||
   return (false);
 | 
			
		||||
   return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool cFemonOsd::SvdrpConnect(void)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								osd.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								osd.h
									
									
									
									
									
								
							@@ -72,6 +72,7 @@ private:
 | 
			
		||||
  cCondWait         sleepM;
 | 
			
		||||
  cMutex            mutexM;
 | 
			
		||||
 | 
			
		||||
  bool AttachFrontend(void);
 | 
			
		||||
  void DrawStatusWindow(void);
 | 
			
		||||
  void DrawInfoWindow(void);
 | 
			
		||||
  bool SvdrpConnect(void);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user