56 media_stream(std::string cname, std::string remote_addr, std::string local_addr, uint16_t src_port, uint16_t dst_port,
57 rtp_format_t fmt, std::shared_ptr<uvgrtp::socketfactory> sfp,
int rce_flags);
67 rtp_error_t init(std::shared_ptr<uvgrtp::zrtp> zrtp);
78 rtp_error_t init_auto_zrtp(std::shared_ptr<uvgrtp::zrtp> zrtp);
138 rtp_error_t
push_frame(uint8_t *data,
size_t data_len,
int rtp_flags);
162 rtp_error_t
push_frame(std::unique_ptr<uint8_t[]> data,
size_t data_len,
int rtp_flags);
193 rtp_error_t
push_frame(uint8_t *data,
size_t data_len, uint32_t ts,
int rtp_flags);
227 rtp_error_t
push_frame(uint8_t* data,
size_t data_len, uint32_t ts, uint64_t ntp_ts,
int rtp_flags);
258 rtp_error_t
push_frame(std::unique_ptr<uint8_t[]> data,
size_t data_len, uint32_t ts,
int rtp_flags);
292 rtp_error_t
push_frame(std::unique_ptr<uint8_t[]> data,
size_t data_len, uint32_t ts, uint64_t ntp_ts,
int rtp_flags);
365 uint32_t get_key()
const;
394 rtp_error_t init_connection();
397 rtp_error_t create_media(rtp_format_t fmt);
400 rtp_error_t free_resources(rtp_error_t ret);
402 rtp_error_t init_srtp_with_zrtp(
int rce_flags,
int type, std::shared_ptr<uvgrtp::base_srtp> srtp,
403 std::shared_ptr<uvgrtp::zrtp> zrtp);
405 rtp_error_t start_components();
407 rtp_error_t install_packet_handlers();
409 uint32_t get_default_bandwidth_kbps(rtp_format_t fmt);
411 bool check_pull_preconditions();
412 rtp_error_t check_push_preconditions(
int rtp_flags,
bool smart_pointer);
416 inline uint8_t* copy_frame(uint8_t* original,
size_t data_len);
420 std::shared_ptr<uvgrtp::srtp> srtp_;
421 std::shared_ptr<uvgrtp::srtcp> srtcp_;
422 std::shared_ptr<uvgrtp::socket> socket_;
423 std::shared_ptr<uvgrtp::rtp> rtp_;
424 std::shared_ptr<uvgrtp::rtcp> rtcp_;
425 std::shared_ptr<uvgrtp::zrtp> zrtp_;
427 std::shared_ptr<uvgrtp::socketfactory> sfp_;
429 sockaddr_in remote_sockaddr_;
430 sockaddr_in6 remote_sockaddr_ip6_;
431 std::string remote_address_;
432 std::string local_address_;
446 std::shared_ptr<uvgrtp::reception_flow> reception_flow_;
449 std::unique_ptr<uvgrtp::formats::media> media_;
452 std::unique_ptr<uvgrtp::holepuncher> holepuncher_;
456 ssize_t fps_numerator_ = 30;
457 ssize_t fps_denominator_ = 1;
458 uint32_t bandwidth_ = 0;
459 std::shared_ptr<std::atomic<std::uint32_t>> ssrc_;
460 std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc_;