#ifndef _H261_CTRL_H #define _H261_CTRL_H #ifdef OLD #include #include "picinfo.h" #include "encoder.h" #include "decoder.h" #endif const int QCIF_TYPE = 1; const int CIF_TYPE = 2; #define H261CTRLPORT 3000 #define H261RXPORT 3001 #define H261TXPORT 3002 #define H261MAGIC 0x44169312 #define PING_REQ 0x01 #define ACK 0x02 #define NACK 0x03 #define CONN_REQ 0x04 #define CONN_BUSY 0x05 #define DISCONNECT 0x06 struct h261ctrl_t { u_int magic; u_int seq; u_int type; u_int rep_type; u_int h261_imgtype; h261ctrl_t(); }; void setconnstatus(int); class H261CtrlConn { private: struct sockaddr_in neighbor; public: int is_connected; int format; int encpid; int decpid; int ctrlfd, encsockfd, encfilefd, decfd; char *encfilename; H261CtrlConn(); int MakeConnect(char *hostname); int AcceptConnect(h261ctrl_t *h, struct sockaddr_in *peer); void AcceptDisconnect(h261ctrl_t *h, struct sockaddr_in *peer); void Disconnect(); int sendh261ctrlpkt(h261ctrl_t *pkt, struct sockaddr_in *peer, h261ctrl_t *rep=NULL); void RcvPkt(void); }; #endif