SASC-NG
DVBSoftCAM

cCiFrame Class Reference

#include <cam.h>

List of all members.

Public Member Functions

 cCiFrame (void)
 ~cCiFrame ()
void SetRb (cRingBufferLinear *Rb)
unsigned char * GetBuff (int l)
void Put (void)
unsigned char * Get (int &l)
void Del (void)
int Avail (void)

Detailed Description

Definition at line 63 of file cam.h.


Constructor & Destructor Documentation

cCiFrame::cCiFrame ( void  )

Definition at line 1670 of file cam.c.

{
  rb=0; mem=0; len=alen=glen=0;
}
cCiFrame::~cCiFrame ( )

Definition at line 1675 of file cam.c.

References free.

{
  free(mem);
}

Member Function Documentation

int cCiFrame::Avail ( void  )

Definition at line 1723 of file cam.c.

Referenced by cCam::Write().

{
  return rb ? rb->Available() : 0;
}
void cCiFrame::Del ( void  )

Definition at line 1728 of file cam.c.

References LEN_OFF.

Referenced by cCam::Read(), and cCam::Write().

{
  if(rb && glen) {
    rb->Del(glen+LEN_OFF);
    glen=0;
    }
}
unsigned char * cCiFrame::Get ( int &  l)

Definition at line 1703 of file cam.c.

References L_GEN_DEBUG, LDUMP, and LEN_OFF.

Referenced by cCam::Read(), and cCam::Write().

{
  if(rb) {
    int c;
    unsigned char *data=rb->Get(c);
    if(data) {
      if(c>LEN_OFF) {
        int s=*((short *)data);
        if(c>=s+LEN_OFF) {
          l=glen=s;
          return data+LEN_OFF;
          }
        }
      LDUMP(L_GEN_DEBUG,data,c,"internal: ci rb frame sync got=%d avail=%d -",c,rb->Available());
      rb->Clear();
      }
    }
  return 0;
}
unsigned char * cCiFrame::GetBuff ( int  l)

Definition at line 1680 of file cam.c.

References free, L_GEN_DEBUG, LEN_OFF, MALLOC, and PRINTF.

Referenced by cScCamSlot::Process(), and cCam::Write().

{
  if(!mem || l>alen) {
    free(mem); mem=0; alen=0;
    mem=MALLOC(unsigned char,l+LEN_OFF);
    if(mem) alen=l;
    }
  len=l;
  if(!mem) {
    PRINTF(L_GEN_DEBUG,"internal: ci-frame alloc failed");
    return 0;
    }
  return mem+LEN_OFF;
}
void cCiFrame::Put ( void  )

Definition at line 1695 of file cam.c.

References LEN_OFF.

Referenced by cScCamSlot::Process(), and cCam::Write().

{
  if(rb && mem) {
    *((short *)mem)=len;
    rb->Put(mem,len+LEN_OFF);
    }
}
void cCiFrame::SetRb ( cRingBufferLinear *  Rb) [inline]

Definition at line 71 of file cam.h.

Referenced by cCam::cCam(), and cScCamSlot::cScCamSlot().

{ rb=Rb; }

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