📄 sender.h
字号:
//// Copyright 2004 Alan Post//// This file is part of voudp.//// voudp is free software; you can redistribute it and/or modify it under the// terms of the GNU General Public License as published by the Free Software// Foundation; either version 2 of the License, or (at your option) any later// version.//// voudp is distributed in the hope that it will be useful, but WITHOUT ANY// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR// A PARTICULAR PURPOSE. See the GNU General Public License for more details.//// You should have received a copy of the GNU General Public License along with// voudp; if not, write to the Free Software Foundation, Inc., 59 Temple Place,// Suite 330, Boston, MA 02111-1307 USA//#ifndef __SENDER_H__#define __SENDER_H__#include "constants.h"#include <sys/types.h>#include <string>#include <map>struct recipient_info_t{ std::string host; size_t port; size_t max_packet_len; size_t max_buf_ms;};class packet_t;class Sender{public: typedef map<std::string, recipient_info_t> infos_t; typedef map<std::string, packet_t*> actives_t; Sender(); ~Sender(); void push_frame( const float *frame ); void set_recipient_info( const std::string &name, const recipient_info_t &info ); bool get_recipient_info( const std::string &name, recipient_info_t &info ); bool start_recipient( const std::string &name ); bool stop_recipient( const std::string &name ); bool is_recipient_active( const std::string &name ); void delete_recipient( const std::string &name ); infos_t::const_iterator infos_begin() const; infos_t::const_iterator infos_end() const;private: void send_packet(); bool can_fit( const frame_len_t &frame_len ); client_id_t cid; frame_id_t next_fid; infos_t infos; actives_t actives; void *speex_bits; void *enc_state;};#endif // __SENDER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -