int fd; int ttl; int pkt_buf_size; int reuse_socket; int is_udp_multicast;
struct sockaddr_storage udp_addr; int udp_addr_len;
struct sockaddr_storage my_addr; int my_addr_len;
UDPFifoBuf *p_fifo; int cir_buf_size; int cir_buf_err;
/* Have pthreads*/ pthread_t thread_cir_buf; //线程ID
} UDPContext;
int init_udp(UDPContext **pp_udpctx, char *host, char *addr, int port); int read_udp(UDPContext *p_ctx, char *p_buf, int size); int close_udp(UDPContext **pp_ctx, char *host); #endif
#define AVERROR(e) (-(e)) // Returns a negative error code from a POSIX error code, // to return from library functions. #define udp_neterrno() AVERROR(errno)