mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refine RTCP packets parsing
This commit is contained in:
parent
1591318792
commit
a728e02b93
5 changed files with 131 additions and 464 deletions
|
@ -34,6 +34,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
|
||||
#include <srs_kernel_consts.hpp>
|
||||
|
||||
|
@ -108,7 +109,20 @@ extern std::string srs_generate_rtmp_url(std::string server, int port, std::stri
|
|||
extern srs_error_t srs_write_large_iovs(ISrsProtocolReadWriter* skt, iovec* iovs, int size, ssize_t* pnwrite = NULL);
|
||||
|
||||
// join string in vector with indicated separator
|
||||
extern std::string srs_join_vector_string(std::vector<std::string>& vs, std::string separator);
|
||||
template <typename T>
|
||||
std::string srs_join_vector_string(std::vector<T>& vs, std::string separator)
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
||||
for (int i = 0; i < (int)vs.size(); i++) {
|
||||
ss << vs.at(i);
|
||||
if (i != (int)vs.size() - 1) {
|
||||
ss << separator;
|
||||
}
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
// Whether domain is an IPv4 address.
|
||||
extern bool srs_is_ipv4(std::string domain);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue