Main Page   Compound List   File List   Compound Members   File Members  

vat.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1991 Regents of the University of California.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms are permitted
00006  * provided that the above copyright notice and this paragraph are
00007  * duplicated in all such forms and that any documentation,
00008  * advertising materials, and other materials related to such
00009  * distribution and use acknowledge that the software was developed
00010  * by the University of California, Lawrence Berkeley Laboratory,
00011  * Berkeley, CA.  The name of the University may not be used to
00012  * endorse or promote products derived from this software without
00013  * specific prior written permission.
00014  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
00015  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
00016  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017  *
00018  * @(#) $Header: /cvsroot/speak-freely/speak_freely_w/speak_freely/vat.h,v 1.1.1.1 2003/02/04 22:30:36 johnwalker Exp $ (LBL)
00019  * modified for NEVOT by H. Schulzrinne
00020  */
00021 
00022 #ifndef vat_packet_h
00023 #define vat_packet_h
00024 
00025 /*
00026  * vat packet header (0 is MSB):
00027  *
00028  *  0                   1                   2                   3   
00029  *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
00030  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00031  * | V |           |T|   |         |                               |
00032  * | e |    NSID   |S| 0 |  Audio  |        Conference ID          |
00033  * | r |           | |   | Format  |                               |
00034  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00035  * |                                                               |
00036  * |                 Time Stamp (in audio samples)                 |
00037  * |                                                               |
00038  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00039  *
00040  *  protocol version (2 bits)
00041  *  no. of speaker id's (6 bits) [= 0 if src address should be used as id]
00042  *  flags (3 bits)
00043  *  audio format (5 bits)
00044  *  conference identifier (16 bits)
00045  *  timestamp [in audio samples] (32 bits)
00046  *  <0 to 63 4-byte speaker id's>
00047  *  <audio data>
00048  */
00049 typedef struct {
00050         u_char nsid;
00051 #define         NSID_MASK       0x3f
00052         u_char flags;
00053 #define         VATHF_NEWTS     0x80    /* set if start of new talkspurt */
00054 #define         VATHF_FMTMASK   0x1f    /* audio format bits */
00055         u_short confid;
00056         u_int ts;
00057 } vat_hdr_t;
00058 
00059 /*
00060  * Audio formats.
00061  *   Numbers for 'standard' encodings are assigned 0 upwards.
00062  *   Numbers for 'experimental' or non-standard encodings are
00063  *   assigned from 30 downwards.  31 is reserved.  The intent
00064  *   is that the lower numbers will be globally known and widely
00065  *   implemented & others will be used only between mutually
00066  *   consenting programs.
00067  */
00068 typedef enum {
00069   VAT_AUDF_MULAW8 =  0, /* 64 kb/s 8KHz mu-law encoded PCM */
00070   VAT_AUDF_CELP   =  1, /* 4.8 kb/s FED-STD-1016 CELP */
00071   VAT_AUDF_G721   =  2, /* 32 kb/s CCITT ADPCM */
00072   VAT_AUDF_GSM    =  3, /* 13 kb/s GSM */
00073   VAT_AUDF_G723   =  4, /* 24 kb/s CCITT ADPCM */
00074   VAT_AUDF_L16_16 = 26, /* L16, 16000 samples/sec */
00075   VAT_AUDF_L16_44 = 27, /* L16, 44100 samples/sec, 2 channels */
00076   VAT_AUDF_LPC4   = 28, /* 4.8 kb/s LPC, 4 frames */
00077   VAT_AUDF_LPC1   = 29, /* 4.8 kb/s LPC, 1 frame */
00078   VAT_AUDF_IDVI   = 30, /* 32 kb/s Intel DVI ADPCM */
00079   VAT_AUDF_UNDEF  = 31  /* undefined */
00080 } vat_audio_t;
00081 
00082 /*
00083  * Structure of a vat control message (sent to the 'session' port).
00084  * All msgs have the same header:
00085  *  protocol version (2 bits)
00086  *  flags / misc (6 bits)
00087  *  msg type (8 bits)
00088  *  conference id
00089  *
00090  * An 'ID' message has a null-terminated ascii string giving the
00091  * site id string immediately following the header.
00092   *
00093  * A 'DONE' message has no other information.
00094  *
00095  * The structure of an IDLIST is described below.
00096  */
00097 struct CtrlMsgHdr {
00098         u_char flags;
00099         u_char type;
00100         u_short confid;
00101 };
00102 
00103 /*
00104  * An IDLIST message contains:
00105  *  control msg hdr
00106  *  number of site id's in this msg (8 bits)
00107  *  audio flags (3 bits)
00108  *  audio format (5 bits)
00109  *  audio block size (16 bits)
00110  *  <site id entries>
00111  * Each site id entry consists of a 4 byte site id followed by a
00112  * null terminated ascii id string.  The string is padded with
00113  * nulls to the next 4 byte boundary.
00114  */
00115 struct IDMsgHdr {
00116         struct CtrlMsgHdr h;
00117         u_char nsids;
00118         u_char ainfo;
00119         u_short blksize;
00120 };
00121 #endif

Generated on Tue Feb 10 08:26:35 2004 for Speak-FreelyforWindows by doxygen1.2.18