cwlib(3)

NAME
cwlib - Clockwise library

SYNOPSIS
#include <$CW/h/cwif.h>
#include <$CW/h/cwnet.h>
$CW/videofs/pull/cwlib.a

CONFIG
The Clockwise library contains a set of routines to start servlets on the Clockwise machine and to receive a continuous streams of frames, or to send a continuous stream of frames to the server.

DESCRIPTION

cw_establish
    int
    cw_establish(char *server, char *lrvpivci,
                 char *rrvpivci, char *lsvpivci,
                 char *rsvpivci, char *dpname,
                 uint32_t bsize, uint32_t bw,
                 uint32_t nbufs, loff_t offs,
                 cwmode_t mode, void **vc)
    Establish a connection with a remote pullatm or pushatm utility. Four ATM endpoints are required. lrvpivci and lsvpivci are the local receive and send VPI/VCI pair from and to which data is received or transmitted. The other two are used by the servlet to send and receive data. The parameters bsize, bw, and nbufs are used by the servlet to establish a QoS contract with Clockwise. The parameter offs determines the start offset in the dynamic partition, and the parameter mode determines whether data is read or written. Lastly, the function return a handle vc to identify the connection. The function uses the vfsd to start remote utilities.

cw_close
    int
    cw_close(void *vc)
    Close down a connection identified by vc.

cw_playlist
    typedef enum { CWForward, CWBackward } cwdirection_t;
    typedef struct {
      Time_t   fr_ts;
      loff_t   fr_offs;
      uint32_t fr_size;
      uint64_t fr_fnum;
    } perframe_t;
    int
    cw_playlist(void *vc, uint32_t nframes,
                perframe_t *pfs, cwdirection_t dir)
    Send a playlist to the server (in particular to the pullatm servlet). For each frame that needs to be played, fr_ts represents the time since the start of pullatm at which the frame needs to be played. The offset and size are identified by fr_offs and fr_size and the frame number is identified by fr_fnum. When the frame is actually transmitted, the frame number is also transmitted. When dir is backwards, the dynamic partition is preloaded in the backward direction.

cw_getdata
    int
    cw_getdata(void *vc, uint64_t *fnum,
               uint8_t *buf, uint32_t size)
    Receive data from pullatm in the buffer buf, which has a size of size bytes. The received frame number is stored in the area pointed at by fnum.

cw_senddata
    int
    cw_senddata(void *vc, uint8_t *buf, uint32_t size)
    Send data to the utility pushatm. The buffer to be transmitted is represented by buf and has a size of size bytes.

cw_parseindex, cw_freeindex
    typedef struct {
      char *m_av;
      char *m_dpname;
      char *m_idxname;
      char *m_bsize;
      char *m_bw;
      char *m_preload;
    } cwmedia_t;
    int
    cw_parseindex(char *fname, cwmedia_t **cwmedia)
    void
    cw_freeindex(int nstreams, cwmedia_t *cwmedia)
    Parse an index file and return a data structure holding all information from the index file in the buffer pointed at by cwmedia, or clean up this buffer. The number of stream descriptions is returned by cw_parseindex.

cw_vpivci
    int
    cw_vpivci(char *source, char *dest, char *av,
              char **lvpivci, char **rvpivci)
    Query a broker for the pre-established permanent virtual circuits between source and dest for the data type av. The parameter av is either the string `audio' or `video'. Note that the broker that is used by this function is not part of the Clockwise distribution.

BUGS
Many, probably.

SEE ALSO
pullatm(5)