SASC
DVBSoftCAM

SCDEVICE Class Reference

List of all members.

Public Member Functions

 SCDEVICE (cScDevicePlugin *DevPlugin, int Adapter, int Frontend, int cafd)
 SASC.
 ~SCDEVICE ()
bool SetCaDescr (ca_descr_t *ca_descr, bool initial)
bool SetCaPid (ca_pid_t *ca_pid)
void DumpAV (void)
 OWN_SETCA.
virtual bool HasCi (void)
void LateInit (void)
 OWN_FULLTS.
void EarlyShutdown (void)
bool CheckFullTs (void)
 SCDEVICE (cScDevicePlugin *DevPlugin, int Adapter, int Frontend, int cafd)
 SASC.
 ~SCDEVICE ()
bool SetCaDescr (ca_descr_t *ca_descr, bool initial)
bool SetCaPid (ca_pid_t *ca_pid)
void DumpAV (void)
virtual bool HasCi (void)
void LateInit (void)
void EarlyShutdown (void)
bool CheckFullTs (void)

Protected Member Functions

virtual bool Ready (void)
 SASC.
virtual bool SetPid (cPidHandle *Handle, int Type, bool On)
virtual bool SetChannelDevice (const cChannel *Channel, bool LiveView)
virtual bool OpenDvr (void)
virtual void CloseDvr (void)
virtual bool GetTSPacket (uchar *&Data)
virtual bool Ready (void)
 SASC.
virtual bool SetPid (cPidHandle *Handle, int Type, bool On)
virtual bool SetChannelDevice (const cChannel *Channel, bool LiveView)
virtual bool OpenDvr (void)
virtual void CloseDvr (void)
virtual bool GetTSPacket (uchar *&Data)

Detailed Description

Definition at line 22 of file device-tmpl.c.


Constructor & Destructor Documentation

SCDEVICE::SCDEVICE ( cScDevicePlugin *  DevPlugin,
int  Adapter,
int  Frontend,
int  cafd 
)

SASC.

Definition at line 67 of file device-tmpl.c.

:DVBDEVICE(Adapter,Frontend,OWN_DEVPARAMS)
#else
:DVBDEVICE(Adapter,Frontend)
#endif //OWN_DEVPARAMS
#else
:DVBDEVICE(Adapter)
#endif //APIVERSNUM >= 10711
{
#ifndef SASC
  tsBuffer=0; hwciadapter=0;
#endif
  cam=0; devplugin=DevPlugin; softcsa=fullts=false;
  fd_ca=cafd; fd_ca2=dup(fd_ca); fd_dvr=-1;
#if APIVERSNUM >= 10711
  snprintf(devId,sizeof(devId),"%d/%d",Adapter,Frontend);
#else
  snprintf(devId,sizeof(devId),"%d",Adapter);
#endif
#ifdef SASC
  cam=new cCam(this,Adapter,0,devId,devplugin,softcsa,fullts);
#endif // !SASC
}
SCDEVICE::~SCDEVICE ( )

Definition at line 93 of file device-tmpl.c.

References EarlyShutdown().

{
#ifndef SASC
  DetachAllReceivers();
  Cancel(3);
  EarlyShutdown();
#endif
  if(fd_ca>=0) close(fd_ca);
  if(fd_ca2>=0) close(fd_ca2);
#ifdef SASC
  delete cam;
#endif
}
SCDEVICE::SCDEVICE ( cScDevicePlugin *  DevPlugin,
int  Adapter,
int  Frontend,
int  cafd 
)

SASC.

SCDEVICE::~SCDEVICE ( )

Member Function Documentation

bool SCDEVICE::CheckFullTs ( void  )

Definition at line 134 of file device-tmpl.c.

Referenced by LateInit().

{
  return false;
}
bool SCDEVICE::CheckFullTs ( void  )
virtual void SCDEVICE::CloseDvr ( void  ) [protected, virtual]
void SCDEVICE::CloseDvr ( void  ) [protected, virtual]

Definition at line 214 of file device-tmpl.c.

References cMutex::Lock(), and cMutex::Unlock().

Referenced by OpenDvr().

{
  tsMutex.Lock();
  delete tsBuffer; tsBuffer=0;
  tsMutex.Unlock();
  if(fd_dvr>=0) { close(fd_dvr); fd_dvr=-1; }
}
void SCDEVICE::DumpAV ( void  )

OWN_SETCA.

Definition at line 120 of file device-tmpl.c.

{}
void SCDEVICE::DumpAV ( void  )
void SCDEVICE::EarlyShutdown ( void  )
void SCDEVICE::EarlyShutdown ( void  )

Definition at line 126 of file device-tmpl.c.

Referenced by ~SCDEVICE().

{
  SetCamSlot(0);
  delete cam; cam=0;
  delete hwciadapter; hwciadapter=0;
}
virtual bool SCDEVICE::GetTSPacket ( uchar *&  Data) [protected, virtual]
bool SCDEVICE::GetTSPacket ( uchar *&  Data) [protected, virtual]

Definition at line 222 of file device-tmpl.c.

References cDeCsaTSBuffer::Get().

{
  if(tsBuffer) { Data=tsBuffer->Get(); return true; }
  return false;
}
virtual bool SCDEVICE::HasCi ( void  ) [virtual]
bool SCDEVICE::HasCi ( void  ) [virtual]

Definition at line 162 of file device-tmpl.c.

{
  return cam || hwciadapter;
}
void SCDEVICE::LateInit ( void  )

OWN_FULLTS.

Definition at line 140 of file device-tmpl.c.

References CheckFullTs(), DVB_DEV_SPEC, cScDevices::ForceBudget(), L_GEN_ERROR, L_GEN_INFO, and PRINTF.

{
  int n=CardIndex();
  if(DeviceNumber()!=n)
    PRINTF(L_GEN_ERROR,"CardIndex - DeviceNumber mismatch! Put SC plugin first on VDR commandline!");
  softcsa=(fd_ca<0);
  if(softcsa) {
    if(HasDecoder()) PRINTF(L_GEN_ERROR,"Card %s is a full-featured card but no ca device found!",devId);
    }
  else if(cScDevices::ForceBudget(n)) {
    PRINTF(L_GEN_INFO,"Budget mode forced on card %s",devId);
    softcsa=true;
    }
  if(softcsa) {
    fullts=CheckFullTs();
    if(fullts) PRINTF(L_GEN_INFO,"Enabling hybrid full-ts mode on card %s",devId);
    else PRINTF(L_GEN_INFO,"Using software decryption on card %s",devId);
    }
  if(fd_ca2>=0) hwciadapter=cDvbCiAdapter::CreateCiAdapter(this,fd_ca2);
  cam=new cCam(this,DVB_DEV_SPEC,devId,devplugin,softcsa,fullts);
}
void SCDEVICE::LateInit ( void  )
virtual bool SCDEVICE::OpenDvr ( void  ) [protected, virtual]
bool SCDEVICE::OpenDvr ( void  ) [protected, virtual]

Definition at line 201 of file device-tmpl.c.

References CloseDvr(), cCam::DeCSA(), cScSetup::DeCsaTsBuffSize, DEV_DVB_DVR, DVB_DEV_SPEC, DvbOpen(), cMutex::Lock(), MEGABYTE, ScSetup, and cMutex::Unlock().

{
  CloseDvr();
  fd_dvr=cScDevices::DvbOpen(DEV_DVB_DVR,DVB_DEV_SPEC,O_RDONLY|O_NONBLOCK,true);
  if(fd_dvr>=0) {
    cDeCSA *decsa=cam ? cam->DeCSA() : 0;
    tsMutex.Lock();
    tsBuffer=new cDeCsaTSBuffer(fd_dvr,MEGABYTE(ScSetup.DeCsaTsBuffSize),CardIndex()+1,decsa,ScActive());
    tsMutex.Unlock();
    }
  return fd_dvr>=0;
}
bool SCDEVICE::Ready ( void  ) [protected, virtual]

SASC.

Definition at line 167 of file device-tmpl.c.

References cCiAdapter::Ready().

{
  return (cam         ? cam->Ready():true) &&
         (hwciadapter ? hwciadapter->Ready():true);
}
virtual bool SCDEVICE::Ready ( void  ) [protected, virtual]

SASC.

bool SCDEVICE::SetCaDescr ( ca_descr_t *  ca_descr,
bool  initial 
)
bool SCDEVICE::SetCaDescr ( ca_descr_t *  ca_descr,
bool  initial 
)

Definition at line 108 of file device-tmpl.c.

{
  return false;
}
bool SCDEVICE::SetCaPid ( ca_pid_t *  ca_pid)

Definition at line 113 of file device-tmpl.c.

{
  return false;
}
bool SCDEVICE::SetCaPid ( ca_pid_t *  ca_pid)
virtual bool SCDEVICE::SetChannelDevice ( const cChannel *  Channel,
bool  LiveView 
) [protected, virtual]
bool SCDEVICE::SetChannelDevice ( const cChannel *  Channel,
bool  LiveView 
) [protected, virtual]

Definition at line 182 of file device-tmpl.c.

References cChannel::Ca(), CA_ENCRYPTED_MIN, L_GEN_INFO, cCam::PostTune(), PRINTF, and cCam::Tune().

{
  if(cam) cam->Tune(Channel);
  bool ret=DVBDEVICE::SetChannelDevice(Channel,LiveView);
  if(LiveView && IsPrimaryDevice() && Channel->Ca()>=CA_ENCRYPTED_MIN &&
     !Transferring() &&
     softcsa && !fullts) {
    PRINTF(L_GEN_INFO,"Forcing transfermode on card %s",devId);
    DVBDEVICE::SetChannelDevice(Channel,false); // force transfermode
    }
  if(ret && cam) cam->PostTune();
  return ret;
}
virtual bool SCDEVICE::SetPid ( cPidHandle *  Handle,
int  Type,
bool  On 
) [protected, virtual]
bool SCDEVICE::SetPid ( cPidHandle *  Handle,
int  Type,
bool  On 
) [protected, virtual]

Definition at line 173 of file device-tmpl.c.

References cMutex::Lock(), cDeCsaTSBuffer::SetActive(), cCam::SetPid(), and cMutex::Unlock().

{
  if(cam) cam->SetPid(Type,Handle->pid,On);
  tsMutex.Lock();
  if(tsBuffer) tsBuffer->SetActive(ScActive());
  tsMutex.Unlock();
  return DVBDEVICE::SetPid(Handle,Type,On);
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines