common: Reverse the order of the header includes

I tried to make the headers be included in local to global order. This
way any potential missing includes are detected making it easier to
make changes to header location and includes.
This commit is contained in:
Joni Räsänen 2021-06-01 10:54:23 +03:00
parent ae57fb6ce9
commit ba8b0cba80
73 changed files with 305 additions and 265 deletions

View File

@ -1,5 +1,13 @@
#pragma once #pragma once
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else
#include <sys/time.h>
#endif
#include <chrono> #include <chrono>
namespace uvgrtp { namespace uvgrtp {

View File

@ -25,7 +25,7 @@
#include <cryptopp/crc.h> #include <cryptopp/crc.h>
#endif #endif
#else // __cplusplus #else // __cplusplus < 201703L
#ifndef __RTP_NO_CRYPTO__ #ifndef __RTP_NO_CRYPTO__
#define __RTP_CRYPTO__ #define __RTP_CRYPTO__
@ -42,6 +42,8 @@
#endif #endif
#endif // __cplusplus #endif // __cplusplus
#include <iostream>
namespace uvgrtp { namespace uvgrtp {
namespace crypto { namespace crypto {

View File

@ -1,14 +1,14 @@
#pragma once #pragma once
#include <condition_variable>
#include <queue>
#include <thread>
#include "queue.hh" #include "queue.hh"
#include "socket.hh" #include "socket.hh"
#include "runner.hh" #include "runner.hh"
#include "util.hh" #include "util.hh"
#include <condition_variable>
#include <queue>
#include <thread>
namespace uvgrtp { namespace uvgrtp {
/* System call dispatcher is an optimization technique which aims to minimize /* System call dispatcher is an optimization technique which aims to minimize

View File

@ -1,10 +1,10 @@
#pragma once #pragma once
#include <deque> #include "formats/h26x.hh"
#include "frame.hh" #include "frame.hh"
#include "queue.hh" #include "queue.hh"
#include "formats/h26x.hh"
#include <deque>
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,14 +1,14 @@
#pragma once #pragma once
#include "formats/h26x.hh"
#include "frame.hh"
#include "queue.hh"
#include <deque> #include <deque>
#include <map> #include <map>
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
#include "frame.hh"
#include "queue.hh"
#include "formats/h26x.hh"
namespace uvgrtp { namespace uvgrtp {
namespace formats { namespace formats {

View File

@ -1,8 +1,9 @@
#pragma once #pragma once
#include "formats/h26x.hh"
#include "frame.hh" #include "frame.hh"
#include "queue.hh" #include "queue.hh"
#include "formats/h26x.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,15 +1,15 @@
#pragma once #pragma once
#include <map>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include "../rtp.hh" #include "../rtp.hh"
#include "../socket.hh" #include "../socket.hh"
#include "../queue.hh" #include "../queue.hh"
#include "../util.hh" #include "../util.hh"
#include <map>
#include <memory>
#include <unordered_map>
#include <unordered_set>
namespace uvgrtp { namespace uvgrtp {
namespace formats { namespace formats {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include "util.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <windows.h> #include <windows.h>
@ -11,7 +13,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "util.hh"
#define RTP_HEADER_LENGTH 12 #define RTP_HEADER_LENGTH 12
#define RTCP_HEADER_LENGTH 12 #define RTCP_HEADER_LENGTH 12

View File

@ -1,11 +1,11 @@
#pragma once #pragma once
#include <atomic>
#include "runner.hh" #include "runner.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include <atomic>
namespace uvgrtp { namespace uvgrtp {
class holepuncher : public runner { class holepuncher : public runner {

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <map>
#include "session.hh" #include "session.hh"
#include <map>
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,8 +1,5 @@
#pragma once #pragma once
#include <unordered_map>
#include <memory>
#include "holepuncher.hh" #include "holepuncher.hh"
#include "pkt_dispatch.hh" #include "pkt_dispatch.hh"
#include "rtcp.hh" #include "rtcp.hh"
@ -13,6 +10,11 @@
#include "formats/media.hh" #include "formats/media.hh"
#include <unordered_map>
#include <memory>
namespace uvgrtp { namespace uvgrtp {
class media_stream { class media_stream {

View File

@ -1,5 +1,9 @@
#pragma once #pragma once
#ifdef _WIN32
#include <winsock2.h>
#endif
namespace uvgrtp { namespace uvgrtp {
namespace mingw { namespace mingw {
int inet_pton(int af, const char *src, struct in_addr *dst); int inet_pton(int af, const char *src, struct in_addr *dst);

View File

@ -1,13 +1,13 @@
#pragma once #pragma once
#include <mutex>
#include <unordered_map>
#include "frame.hh" #include "frame.hh"
#include "runner.hh" #include "runner.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include <mutex>
#include <unordered_map>
namespace uvgrtp { namespace uvgrtp {
typedef rtp_error_t (*packet_handler)(ssize_t, void *, int, uvgrtp::frame::rtp_frame **); typedef rtp_error_t (*packet_handler)(ssize_t, void *, int, uvgrtp::frame::rtp_frame **);

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include <vector>
#include "socket.hh" #include "socket.hh"
#include <vector>
namespace uvgrtp { namespace uvgrtp {
namespace poll { namespace poll {
/* Cross-platform poll implementation for listening to a socket for a period of time /* Cross-platform poll implementation for listening to a socket for a period of time

View File

@ -1,10 +1,5 @@
#pragma once #pragma once
#include <atomic>
#include <memory>
#include <unordered_map>
#include <vector>
#include "dispatch.hh" #include "dispatch.hh"
#include "frame.hh" #include "frame.hh"
#include "rtp.hh" #include "rtp.hh"
@ -12,6 +7,11 @@
#include "srtp/base.hh" #include "srtp/base.hh"
#include "util.hh" #include "util.hh"
#include <atomic>
#include <memory>
#include <unordered_map>
#include <vector>
#if defined(_MSC_VER) #if defined(_MSC_VER)
typedef SSIZE_T ssize_t; typedef SSIZE_T ssize_t;
#endif #endif

View File

@ -1,10 +1,5 @@
#pragma once #pragma once
#include <bitset>
#include <map>
#include <thread>
#include <vector>
#include "clock.hh" #include "clock.hh"
#include "frame.hh" #include "frame.hh"
#include "runner.hh" #include "runner.hh"
@ -12,6 +7,11 @@
#include "srtp/srtcp.hh" #include "srtp/srtcp.hh"
#include "util.hh" #include "util.hh"
#include <bitset>
#include <map>
#include <thread>
#include <vector>
namespace uvgrtp { namespace uvgrtp {
/// \cond DO_NOT_DOCUMENT /// \cond DO_NOT_DOCUMENT

View File

@ -1,5 +1,4 @@
#ifndef __RTP_HH_ #pragma once
#define __RTP_HH_
#include "clock.hh" #include "clock.hh"
#include "frame.hh" #include "frame.hh"
@ -68,5 +67,3 @@ namespace uvgrtp {
}; };
namespace uvg_rtp = uvgrtp; namespace uvg_rtp = uvgrtp;
#endif /* __RTP_HH_ */

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include <thread>
#include "util.hh" #include "util.hh"
#include <thread>
namespace uvgrtp { namespace uvgrtp {
class runner { class runner {
public: public:

View File

@ -1,12 +1,12 @@
#pragma once #pragma once
#include "media_stream.hh"
#include "zrtp.hh"
#include <mutex> #include <mutex>
#include <string> #include <string>
#include <vector> #include <vector>
#include "media_stream.hh"
#include "zrtp.hh"
namespace uvgrtp { namespace uvgrtp {
class session { class session {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include "util.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <mswsock.h> #include <mswsock.h>
@ -13,7 +15,6 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "util.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,5 +1,11 @@
#pragma once #pragma once
#include "../debug.hh"
#include "../frame.hh"
#include "../rtp.hh"
#include "../util.hh"
#include "../zrtp.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <mswsock.h> #include <mswsock.h>
@ -13,11 +19,7 @@
#include <unordered_set> #include <unordered_set>
#include <vector> #include <vector>
#include "../debug.hh"
#include "../frame.hh"
#include "../rtp.hh"
#include "../util.hh"
#include "../zrtp.hh"
enum { enum {
AES128_KEY_SIZE = 16, AES128_KEY_SIZE = 16,

View File

@ -1,5 +1,11 @@
#pragma once #pragma once
#include "crypto.hh"
#include "frame.hh"
#include "socket.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <mswsock.h> #include <mswsock.h>
@ -12,11 +18,7 @@
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include "crypto.hh"
#include "frame.hh"
#include "socket.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,11 +1,12 @@
#pragma once #pragma once
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
#include "frame.hh" #include "frame.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,11 +1,13 @@
#pragma once #pragma once
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
#include "zrtp.hh"
#include "frame.hh" #include "frame.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,11 +1,14 @@
#pragma once #pragma once
#include "zrtp/zrtp_receiver.hh"
#include "zrtp.hh"
#include "zrtp/defines.hh"
#include "frame.hh" #include "frame.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,11 +1,13 @@
#pragma once #pragma once
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
#include "frame.hh" #include "frame.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,10 +1,12 @@
#pragma once #pragma once
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
#include "frame.hh" #include "frame.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,12 +1,12 @@
#pragma once #pragma once
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
#include "frame.hh" #include "frame.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {
typedef struct capabilities zrtp_capab_t; typedef struct capabilities zrtp_capab_t;

View File

@ -1,10 +1,11 @@
#pragma once #pragma once
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
#include "frame.hh" #include "frame.hh"
#include "socket.hh" #include "socket.hh"
#include "util.hh" #include "util.hh"
#include "zrtp/defines.hh"
#include "zrtp/zrtp_receiver.hh"
namespace uvgrtp { namespace uvgrtp {

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include "socket.hh"
namespace uvgrtp { namespace uvgrtp {
namespace zrtp_msg { namespace zrtp_msg {

View File

@ -1,11 +1,5 @@
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#else
#include <sys/time.h>
#endif
#include "clock.hh" #include "clock.hh"
#include <stdio.h> #include <stdio.h>
static const uint64_t EPOCH = 2208988800ULL; static const uint64_t EPOCH = 2208988800ULL;

View File

@ -1,7 +1,10 @@
#include <iostream>
#include "crypto.hh" #include "crypto.hh"
#include "debug.hh" #include "debug.hh"
/* ***************** hmac-sha1 ***************** */ /* ***************** hmac-sha1 ***************** */
uvgrtp::crypto::hmac::sha1::sha1(uint8_t *key, size_t key_size) uvgrtp::crypto::hmac::sha1::sha1(uint8_t *key, size_t key_size)

View File

@ -1,6 +1,8 @@
#include "debug.hh"
#include "dispatch.hh" #include "dispatch.hh"
#include "socket.hh" #include "socket.hh"
#include "debug.hh"
#ifndef _WIN32 #ifndef _WIN32
uvgrtp::dispatcher::dispatcher(uvgrtp::socket *socket): uvgrtp::dispatcher::dispatcher(uvgrtp::socket *socket):

View File

@ -1,7 +1,7 @@
#ifdef _WIN32 #include "formats/h264.hh"
#else
#include <sys/socket.h> #include "queue.hh"
#endif #include "debug.hh"
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
@ -9,10 +9,10 @@
#include <unordered_map> #include <unordered_map>
#include <queue> #include <queue>
#include "debug.hh" #ifndef _WIN32
#include "queue.hh" #include <sys/socket.h>
#endif
#include "formats/h264.hh"
void uvgrtp::formats::h264::clear_aggregation_info() void uvgrtp::formats::h264::clear_aggregation_info()
{ {

View File

@ -1,14 +1,14 @@
#include "formats/h264.hh"
#include "queue.hh"
#include "debug.hh"
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <unordered_set> #include <unordered_set>
#include "debug.hh"
#include "queue.hh"
#include "formats/h264.hh"
#define RTP_FRAME_MAX_DELAY 100 #define RTP_FRAME_MAX_DELAY 100
#define INVALID_SEQ 0x13371338 #define INVALID_SEQ 0x13371338
#define INVALID_TS 0xffffffff #define INVALID_TS 0xffffffff

View File

@ -1,7 +1,7 @@
#ifdef _WIN32 #include "formats/h265.hh"
#else
#include <sys/socket.h> #include "debug.hh"
#endif #include "queue.hh"
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
@ -9,10 +9,9 @@
#include <unordered_map> #include <unordered_map>
#include <queue> #include <queue>
#include "debug.hh" #ifndef _WIN32
#include "queue.hh" #include <sys/socket.h>
#endif
#include "formats/h265.hh"
void uvgrtp::formats::h265::clear_aggregation_info() void uvgrtp::formats::h265::clear_aggregation_info()
{ {

View File

@ -1,14 +1,14 @@
#include "formats/h265.hh"
#include "debug.hh"
#include "queue.hh"
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <unordered_set> #include <unordered_set>
#include "debug.hh"
#include "queue.hh"
#include "formats/h265.hh"
#define INVALID_SEQ 0x13371338 #define INVALID_SEQ 0x13371338
#define INVALID_TS 0xffffffff #define INVALID_TS 0xffffffff

View File

@ -1,7 +1,7 @@
#ifdef _WIN32 #include "formats/h266.hh"
#else
#include <sys/socket.h> #include "queue.hh"
#endif #include "debug.hh"
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
@ -9,10 +9,10 @@
#include <unordered_map> #include <unordered_map>
#include <queue> #include <queue>
#include "debug.hh"
#include "queue.hh"
#include "formats/h266.hh" #ifndef _WIN32
#include <sys/socket.h>
#endif
rtp_error_t uvgrtp::formats::h266::push_nal_unit(uint8_t *data, size_t data_len, bool more) rtp_error_t uvgrtp::formats::h266::push_nal_unit(uint8_t *data, size_t data_len, bool more)
{ {

View File

@ -1,14 +1,14 @@
#include "formats/h266.hh"
#include "debug.hh"
#include "queue.hh"
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <unordered_set> #include <unordered_set>
#include "debug.hh"
#include "queue.hh"
#include "formats/h266.hh"
#define INVALID_SEQ 0x13371338 #define INVALID_SEQ 0x13371338
#define INVALID_TS 0xffffffff #define INVALID_TS 0xffffffff

View File

@ -1,7 +1,7 @@
#ifdef _WIN32 #include "formats/h26x.hh"
#else
#include <sys/socket.h> #include "queue.hh"
#endif #include "debug.hh"
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
@ -9,10 +9,11 @@
#include <unordered_map> #include <unordered_map>
#include <queue> #include <queue>
#include "debug.hh"
#include "queue.hh"
#include "formats/h26x.hh" #ifndef _WIN32
#include <sys/socket.h>
#endif
#define PTR_DIFF(a, b) ((ptrdiff_t)((char *)(a) - (char *)(b))) #define PTR_DIFF(a, b) ((ptrdiff_t)((char *)(a) - (char *)(b)))

View File

@ -1,12 +1,9 @@
#ifdef __linux__ #include "formats/media.hh"
#else
#endif
#include <map> #include <map>
#include <unordered_map> #include <unordered_map>
#include "debug.hh" #include "debug.hh"
#include "formats/media.hh"
#define INVALID_SEQ 0xffffffff #define INVALID_SEQ 0xffffffff

View File

@ -1,8 +1,10 @@
#include "frame.hh"
#include "util.hh"
#include "debug.hh"
#include <cstring> #include <cstring>
#include "debug.hh"
#include "frame.hh"
#include "util.hh"
uvgrtp::frame::rtp_frame *uvgrtp::frame::alloc_rtp_frame() uvgrtp::frame::rtp_frame *uvgrtp::frame::alloc_rtp_frame()
{ {

View File

@ -1,6 +1,8 @@
#include "holepuncher.hh"
#include "clock.hh" #include "clock.hh"
#include "debug.hh" #include "debug.hh"
#include "holepuncher.hh"
#define THRESHOLD 2000 #define THRESHOLD 2000

View File

@ -1,3 +1,7 @@
#include "hostname.hh"
#include "debug.hh"
#ifdef _WIN32 #ifdef _WIN32
//#include <windows.h> //#include <windows.h>
//#include <winbase.h> //#include <winbase.h>
@ -8,9 +12,6 @@
#include <errno.h> #include <errno.h>
#endif #endif
#include "debug.hh"
#include "hostname.hh"
#define NAME_MAXLEN 512 #define NAME_MAXLEN 512
std::string uvgrtp::hostname::get_hostname() std::string uvgrtp::hostname::get_hostname()

View File

@ -1,12 +1,13 @@
#include <cstdlib> #include "lib.hh"
#include <cstring>
#include <iostream>
#include "debug.hh" #include "debug.hh"
#include "hostname.hh" #include "hostname.hh"
#include "lib.hh"
#include "random.hh" #include "random.hh"
#include <cstdlib>
#include <cstring>
#include <iostream>
thread_local rtp_error_t rtp_errno; thread_local rtp_error_t rtp_errno;
uvgrtp::context::context() uvgrtp::context::context()

View File

@ -1,13 +1,13 @@
#include <cstring>
#include <errno.h>
#include "debug.hh"
#include "media_stream.hh" #include "media_stream.hh"
#include "random.hh"
#include "formats/h264.hh" #include "formats/h264.hh"
#include "formats/h265.hh" #include "formats/h265.hh"
#include "formats/h266.hh" #include "formats/h266.hh"
#include "debug.hh"
#include "random.hh"
#include <cstring>
#include <errno.h>
#define INVALID_TS UINT64_MAX #define INVALID_TS UINT64_MAX

View File

@ -1,8 +1,8 @@
#if defined(__MINGW32__) || defined(__MINGW64__) #if defined(__MINGW32__) || defined(__MINGW64__)
#include <winsock2.h>
#include <cstdint>
#include "mingw_inet.hh" #include "mingw_inet.hh"
#include <cstdint>
#define NS_INADDRSZ 4 #define NS_INADDRSZ 4
#define NS_IN6ADDRSZ 16 #define NS_IN6ADDRSZ 16
#define NS_INT16SZ 2 #define NS_INT16SZ 2

View File

@ -1,3 +1,9 @@
#include "pkt_dispatch.hh"
#include "debug.hh"
#include "random.hh"
#include "util.hh"
#ifdef __linux__ #ifdef __linux__
#include <errno.h> #include <errno.h>
#else #else
@ -6,11 +12,6 @@
#include <cstring> #include <cstring>
#include "debug.hh"
#include "pkt_dispatch.hh"
#include "random.hh"
#include "util.hh"
uvgrtp::pkt_dispatcher::pkt_dispatcher(): uvgrtp::pkt_dispatcher::pkt_dispatcher():
recv_hook_arg_(nullptr), recv_hook_arg_(nullptr),
recv_hook_(nullptr) recv_hook_(nullptr)

View File

@ -1,3 +1,8 @@
#include "poll.hh"
#include "multicast.hh"
#include "debug.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#else #else
@ -7,9 +12,8 @@
#include <cstring> #include <cstring>
#include "debug.hh"
#include "multicast.hh"
#include "poll.hh"
rtp_error_t uvgrtp::poll::blocked_recv(uvgrtp::socket *socket, uint8_t *buf, size_t buf_len, int timeout, int *bytes_read) rtp_error_t uvgrtp::poll::blocked_recv(uvgrtp::socket *socket, uint8_t *buf, size_t buf_len, int timeout, int *bytes_read)
{ {

View File

@ -1,3 +1,12 @@
#include "queue.hh"
#include "formats/h264.hh"
#include "formats/h265.hh"
#include "formats/h266.hh"
#include "debug.hh"
#include "random.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <windows.h> #include <windows.h>
@ -8,13 +17,6 @@
#include <cstring> #include <cstring>
#endif #endif
#include "debug.hh"
#include "queue.hh"
#include "random.hh"
#include "formats/h264.hh"
#include "formats/h265.hh"
#include "formats/h266.hh"
uvgrtp::frame_queue::frame_queue(uvgrtp::socket *socket, uvgrtp::rtp *rtp, int flags): uvgrtp::frame_queue::frame_queue(uvgrtp::socket *socket, uvgrtp::rtp *rtp, int flags):
rtp_(rtp), socket_(socket), flags_(flags) rtp_(rtp), socket_(socket), flags_(flags)

View File

@ -1,8 +1,12 @@
#include "random.hh"
#include "debug.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <windows.h> #include <windows.h>
#include <wincrypt.h> #include <wincrypt.h>
#else // _WIN32 #else // non _WIN32
#ifdef HAVE_GETRANDOM #ifdef HAVE_GETRANDOM
#include <sys/random.h> #include <sys/random.h>
#else // HAVE_GETRANDOM #else // HAVE_GETRANDOM
@ -11,12 +15,10 @@
#endif // HAVE_GETRANDOM #endif // HAVE_GETRANDOM
#endif // _WIN32 #endif // _WIN32
#include <cstdlib> #include <cstdlib>
#include <ctime> #include <ctime>
#include "debug.hh"
#include "random.hh"
rtp_error_t uvgrtp::random::init() rtp_error_t uvgrtp::random::init()
{ {
#ifdef _WIN32 #ifdef _WIN32

View File

@ -1,5 +1,11 @@
#ifdef _WIN32 #include "rtcp.hh"
#else
#include "hostname.hh"
#include "poll.hh"
#include "debug.hh"
#include "util.hh"
#ifndef _WIN32
#include <sys/time.h> #include <sys/time.h>
#endif #endif
@ -8,11 +14,6 @@
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include "debug.hh"
#include "hostname.hh"
#include "poll.hh"
#include "rtcp.hh"
#include "util.hh"
uvgrtp::rtcp::rtcp(uvgrtp::rtp *rtp, int flags): uvgrtp::rtcp::rtcp(uvgrtp::rtp *rtp, int flags):
rtp_(rtp), flags_(flags), our_role_(RECEIVER), rtp_(rtp), flags_(flags), our_role_(RECEIVER),

View File

@ -1,7 +1,3 @@
#ifdef _WIN32
#else
#endif
#include "rtcp.hh" #include "rtcp.hh"
uvgrtp::frame::rtcp_app_packet *uvgrtp::rtcp::get_app_packet(uint32_t ssrc) uvgrtp::frame::rtcp_app_packet *uvgrtp::rtcp::get_app_packet(uint32_t ssrc)

View File

@ -1,7 +1,3 @@
#ifdef _WIN32
#else
#endif
#include "rtcp.hh" #include "rtcp.hh"
rtp_error_t uvgrtp::rtcp::handle_bye_packet(uint8_t *packet, size_t size) rtp_error_t uvgrtp::rtcp::handle_bye_packet(uint8_t *packet, size_t size)

View File

@ -1,7 +1,3 @@
#ifdef _WIN32
#else
#endif
#include "rtcp.hh" #include "rtcp.hh"
uvgrtp::frame::rtcp_receiver_report *uvgrtp::rtcp::get_receiver_packet(uint32_t ssrc) uvgrtp::frame::rtcp_receiver_report *uvgrtp::rtcp::get_receiver_packet(uint32_t ssrc)

View File

@ -1,7 +1,3 @@
#ifdef _WIN32
#else
#endif
#include "rtcp.hh" #include "rtcp.hh"
#include "poll.hh" #include "poll.hh"

View File

@ -1,7 +1,3 @@
#ifdef _WIN32
#else
#endif
#include "rtcp.hh" #include "rtcp.hh"
uvgrtp::frame::rtcp_sdes_packet *uvgrtp::rtcp::get_sdes_packet(uint32_t ssrc) uvgrtp::frame::rtcp_sdes_packet *uvgrtp::rtcp::get_sdes_packet(uint32_t ssrc)

View File

@ -1,7 +1,3 @@
#ifdef _WIN32
#else
#endif
#include "rtcp.hh" #include "rtcp.hh"
uvgrtp::frame::rtcp_sender_report *uvgrtp::rtcp::get_sender_packet(uint32_t ssrc) uvgrtp::frame::rtcp_sender_report *uvgrtp::rtcp::get_sender_packet(uint32_t ssrc)

View File

@ -1,3 +1,9 @@
#include "rtp.hh"
#include "clock.hh"
#include "debug.hh"
#include "random.hh"
#ifdef __linux__ #ifdef __linux__
#include <arpa/inet.h> #include <arpa/inet.h>
#include <unistd.h> #include <unistd.h>
@ -5,10 +11,7 @@
#include <chrono> #include <chrono>
#include "clock.hh"
#include "debug.hh"
#include "random.hh"
#include "rtp.hh"
#define INVALID_TS UINT64_MAX #define INVALID_TS UINT64_MAX

View File

@ -1,5 +1,6 @@
#include "debug.hh"
#include "session.hh" #include "session.hh"
#include "debug.hh"
uvgrtp::session::session(std::string addr): uvgrtp::session::session(std::string addr):
#ifdef __RTP_CRYPTO__ #ifdef __RTP_CRYPTO__

View File

@ -1,3 +1,8 @@
#include "socket.hh"
#include "debug.hh"
#include "util.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <Ws2tcpip.h> #include <Ws2tcpip.h>
@ -17,9 +22,6 @@ using namespace mingw;
#include <cstring> #include <cstring>
#include <cassert> #include <cassert>
#include "debug.hh"
#include "socket.hh"
#include "util.hh"
#define WSABUF_SIZE 32 #define WSABUF_SIZE 32

View File

@ -1,8 +1,9 @@
#include <cstring> #include "srtp/base.hh"
#include <iostream>
#include "crypto.hh" #include "crypto.hh"
#include "srtp/base.hh"
#include <cstring>
#include <iostream>
uvgrtp::base_srtp::base_srtp(): uvgrtp::base_srtp::base_srtp():
srtp_ctx_(new uvgrtp::srtp_ctx_t), srtp_ctx_(new uvgrtp::srtp_ctx_t),

View File

@ -1,8 +1,10 @@
#include "srtp/srtcp.hh"
#include "crypto.hh"
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include "crypto.hh"
#include "srtp/srtcp.hh"
uvgrtp::srtcp::srtcp() uvgrtp::srtcp::srtcp()
{ {

View File

@ -1,9 +1,10 @@
#include "srtp/srtp.hh"
#include "srtp/base.hh"
#include "crypto.hh"
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include "crypto.hh"
#include "srtp/base.hh"
#include "srtp/srtp.hh"
#define MAX_OFF 10000 #define MAX_OFF 10000

View File

@ -1,14 +1,3 @@
#ifdef _WIN32
#define MSG_DONTWAIT 0
#else
#endif
#include <cstring>
#include <thread>
#include "debug.hh"
#include "crypto.hh"
#include "random.hh"
#include "zrtp.hh" #include "zrtp.hh"
#include "zrtp/commit.hh" #include "zrtp/commit.hh"
@ -19,8 +8,20 @@
#include "zrtp/hello_ack.hh" #include "zrtp/hello_ack.hh"
#include "zrtp/zrtp_receiver.hh" #include "zrtp/zrtp_receiver.hh"
#include "debug.hh"
#include "crypto.hh"
#include "random.hh"
#include <cstring>
#include <thread>
using namespace uvgrtp::zrtp_msg; using namespace uvgrtp::zrtp_msg;
#ifdef _WIN32
#define MSG_DONTWAIT 0
#endif
#define ZRTP_VERSION 110 #define ZRTP_VERSION 110
uvgrtp::zrtp::zrtp(): uvgrtp::zrtp::zrtp():

View File

@ -1,11 +1,11 @@
#include "zrtp/commit.hh"
#include "zrtp.hh"
#include "debug.hh"
#include <cassert> #include <cassert>
#include <cstring> #include <cstring>
#include "debug.hh"
#include "zrtp.hh"
#include "zrtp/commit.hh"
#define ZRTP_COMMIT "Commit " #define ZRTP_COMMIT "Commit "
uvgrtp::zrtp_msg::commit::commit(zrtp_session_t& session) uvgrtp::zrtp_msg::commit::commit(zrtp_session_t& session)

View File

@ -1,9 +1,9 @@
#include <cstring> #include "zrtp/confack.hh"
#include "debug.hh" #include "debug.hh"
#include "zrtp.hh"
#include "zrtp/confack.hh" #include <cstring>
#define ZRTP_CONFACK "Conf2ACK" #define ZRTP_CONFACK "Conf2ACK"

View File

@ -1,9 +1,8 @@
#include <cstring> #include "zrtp/confirm.hh"
#include "debug.hh" #include "debug.hh"
#include "zrtp.hh"
#include "zrtp/confirm.hh" #include <cstring>
#define ZRTP_CONFRIM1 "Confirm1" #define ZRTP_CONFRIM1 "Confirm1"
#define ZRTP_CONFRIM2 "Confirm2" #define ZRTP_CONFRIM2 "Confirm2"

View File

@ -1,9 +1,10 @@
#include <cstring>
#include "debug.hh"
#include "zrtp.hh"
#include "zrtp/dh_kxchng.hh" #include "zrtp/dh_kxchng.hh"
#include "zrtp.hh"
#include "zrtp/defines.hh" #include "zrtp/defines.hh"
#include "debug.hh"
#include <cstring>
#define ZRTP_DH_PART1 "DHPart1 " #define ZRTP_DH_PART1 "DHPart1 "
#define ZRTP_DH_PART2 "DHPart2 " #define ZRTP_DH_PART2 "DHPart2 "

View File

@ -1,9 +1,12 @@
#include <cstring> #include "zrtp/error.hh"
#include "zrtp/defines.hh"
#include "zrtp.hh"
#include "debug.hh" #include "debug.hh"
#include "zrtp.hh"
#include "zrtp/defines.hh"
#include "zrtp/error.hh" #include <cstring>
#define ZRTP_ERROR "Error " #define ZRTP_ERROR "Error "

View File

@ -1,9 +1,10 @@
#include <cstring>
#include "debug.hh"
#include "zrtp.hh"
#include "zrtp/hello.hh" #include "zrtp/hello.hh"
#include "zrtp/defines.hh" #include "zrtp/defines.hh"
#include "zrtp.hh"
#include "debug.hh"
#include <cstring>
#define ZRTP_VERSION "1.10" #define ZRTP_VERSION "1.10"
#define ZRTP_HELLO "Hello " #define ZRTP_HELLO "Hello "

View File

@ -1,9 +1,10 @@
#include <cstring> #include "zrtp/hello_ack.hh"
#include "debug.hh"
#include "zrtp.hh" #include "zrtp.hh"
#include "zrtp/defines.hh" #include "zrtp/defines.hh"
#include "zrtp/hello_ack.hh" #include "debug.hh"
#include <cstring>
#define ZRTP_HELLO_ACK "HelloACK" #define ZRTP_HELLO_ACK "HelloACK"

View File

@ -1,3 +1,18 @@
#include "zrtp/zrtp_receiver.hh"
#include "zrtp/defines.hh"
#include "zrtp/dh_kxchng.hh"
#include "zrtp/commit.hh"
#include "zrtp/confack.hh"
#include "zrtp/confirm.hh"
#include "zrtp/hello.hh"
#include "zrtp/hello_ack.hh"
#include "crypto.hh"
#include "poll.hh"
#include "debug.hh"
#include "util.hh"
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <mswsock.h> #include <mswsock.h>
@ -10,18 +25,6 @@
#include <cstring> #include <cstring>
#include "debug.hh"
#include "util.hh"
#include "crypto.hh"
#include "poll.hh"
#include "zrtp/defines.hh"
#include "zrtp/dh_kxchng.hh"
#include "zrtp/commit.hh"
#include "zrtp/confack.hh"
#include "zrtp/confirm.hh"
#include "zrtp/hello.hh"
#include "zrtp/hello_ack.hh"
#include "zrtp/zrtp_receiver.hh"
using namespace uvgrtp::zrtp_msg; using namespace uvgrtp::zrtp_msg;