Skip to content

Commit 4caf732

Browse files
committed
rtp.h: do not include config_*.h
1 parent 6bcac12 commit 4caf732

File tree

10 files changed

+38
-14
lines changed

10 files changed

+38
-14
lines changed

src/audio/audio.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
*/
4949

5050
#include <array>
51+
#include <cassert>
5152
#include <cinttypes>
5253
#include <cstdio>
5354
#include <cstdlib>

src/audio/jack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
*/
4242

4343
#include <jack/jack.h>
44+
#include <math.h> // for nexttowardf
4445
#include <limits.h>
4546
#include <stdio.h>
4647
#include <stdlib.h>

src/audio/playback/mixer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
#include <thread>
5353
#include <utility> // for move, pair
5454
#include <vector>
55+
#ifdef _WIN32
56+
#include <ws2tcpip.h>
57+
#else
58+
#include <netinet/in.h> // for sockaddr_in, sockaddr_in6
59+
#include <sys/socket.h> // for sockaddr_storage, AF_UNSPEC, AF_INET
60+
#endif
5561

5662
#include "audio/audio_playback.h"
5763
#include "audio/codec.h"

src/rtp/ldgm.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636
*/
3737

38+
#include <cassert>
3839
#include <cerrno>
3940
#include <climits>
4041
#include <cstdio>
@@ -46,6 +47,9 @@
4647
#include <sys/stat.h>
4748
#include <sys/types.h>
4849
#include <unistd.h>
50+
#ifdef _WIN32
51+
#include <windows.h>
52+
#endif
4953

5054
#define WANT_MKDIR
5155
#include "compat/misc.h" // for mkdir

src/rtp/rtp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,9 @@ struct rtp *rtp_init_if(const char *addr, const char *iface,
11721172
return session;
11731173
}
11741174

1175-
rtp_t rtp_init_with_udp_socket(struct socket_udp_local *l, struct sockaddr *sa, socklen_t len, rtp_callback callback)
1175+
rtp_t
1176+
rtp_init_with_udp_socket(struct socket_udp_local *l, struct sockaddr *sa,
1177+
unsigned len, rtp_callback callback)
11761178
{
11771179
struct rtp *session;
11781180
int i, j;

src/rtp/rtp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
#ifndef __RTP_H__
3838
#define __RTP_H__
3939

40-
#include "config_win32.h"
41-
#include "config_unix.h"
42-
4340
#ifdef __cplusplus
4441
#include <cstddef> // offsetof
4542
#include <cstdint>
@@ -237,7 +234,10 @@ typedef enum {
237234
// RTP_POT_RECORD_SOURCE
238235
} rtp_option;
239236

237+
struct msghdr;
238+
struct sockaddr;
240239
struct socket_udp_local;
240+
struct timeval;
241241

242242
/* API */
243243
rtp_t rtp_init(const char *addr,
@@ -254,7 +254,7 @@ rtp_t rtp_init_if(const char *addr, const char *iface,
254254
rtp_callback callback,
255255
uint8_t *userdata,
256256
int force_ip_version, bool multithreaded);
257-
rtp_t rtp_init_with_udp_socket(struct socket_udp_local *l, struct sockaddr *sa, socklen_t len, rtp_callback callback);
257+
rtp_t rtp_init_with_udp_socket(struct socket_udp_local *l, struct sockaddr *sa, unsigned len, rtp_callback callback);
258258

259259
void rtp_send_bye(struct rtp *session);
260260
void rtp_done(struct rtp *session);

src/transmit.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,19 @@
5858

5959
#include <algorithm>
6060
#include <array>
61+
#include <cassert>
62+
#include <cmath>
6163
#include <iostream>
6264
#include <sstream>
6365
#include <vector>
66+
#ifdef _WIN32
67+
#include <windef.h> // for LARGE_INTEGER
68+
#endif
6469

6570
#include "audio/codec.h"
6671
#include "audio/types.h"
6772
#include "audio/utils.h"
73+
#include "compat/net.h" // for htonl etc.
6874
#include "control_socket.h"
6975
#include "crypto/openssl_encrypt.h"
7076
#include "debug.h"
@@ -432,12 +438,12 @@ tx_send(struct tx *tx, struct video_frame *frame, struct rtp *rtp_session)
432438

433439
for(i = 0; i < frame->tile_count; ++i)
434440
{
435-
int last = FALSE;
441+
bool last = false;
436442
int fragment_offset = 0;
437443

438444
if (i == frame->tile_count - 1) {
439445
if(!frame->fragment || frame->last_fragment)
440-
last = TRUE;
446+
last = true;
441447
}
442448
if(frame->fragment)
443449
fragment_offset = vf_get_tile(frame, i)->offset;

src/utils/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
// maximal platform path length including terminating null byte
4343
#ifdef _WIN32
44-
#include <windows.h>
44+
#include <windef.h> /// for MAX_PATH
4545
#define MAX_PATH_SIZE (MAX_PATH + 1)
4646
#define PATH_SEPARATOR "\\"
4747
#else

src/video_capture/rtsp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
#include <stdlib.h>
5858
#include <string.h>
5959
#include <time.h> // for timespec
60+
#ifndef _WIN32
61+
#include <unistd.h> // for unlink
62+
#endif // defined _WIN32
6063

6164
#include "audio/types.h"
6265
#include "config.h" // for PACKAGE_BUGREPORT
@@ -356,7 +359,7 @@ keep_alive_thread(void *arg){
356359
// actual keepalive
357360
MSG(DEBUG, "GET PARAMETERS %s:\n", s->uri);
358361
if (!rtsp_get_parameters(s->curl, s->uri)) {
359-
s->should_exit = TRUE;
362+
s->should_exit = true;
360363
exit_uv(1);
361364
}
362365
}
@@ -722,7 +725,7 @@ vidcap_rtsp_init(struct vidcap_params *params, void **state) {
722725
s->vrtsp_state.desc.fps = 30;
723726
s->vrtsp_state.desc.interlacing = PROGRESSIVE;
724727

725-
s->should_exit = FALSE;
728+
s->should_exit = false;
726729

727730
s->vrtsp_state.boss_waiting = false;
728731
s->vrtsp_state.worker_waiting = false;

src/video_rxtx/rtp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636
*/
3737

38+
#include <cassert>
3839
#include <cinttypes>
3940
#include <map>
4041
#include <mutex>
@@ -295,17 +296,17 @@ struct rtp *rtp_video_rxtx::initialize_network(const char *addr, int recv_port,
295296
}
296297
struct rtp *device =
297298
rtp_init_if(addr, mcast_if, recv_port, send_port, ttl, rtcp_bw,
298-
FALSE, rtp_recv_callback, (uint8_t *) participants,
299+
false, rtp_recv_callback, (uint8_t *) participants,
299300
force_ip_version, multithreaded);
300301
if (device == nullptr) {
301302
return nullptr;
302303
}
303-
rtp_set_option(device, RTP_OPT_WEAK_VALIDATION, TRUE);
304-
rtp_set_option(device, RTP_OPT_PROMISC, TRUE);
304+
rtp_set_option(device, RTP_OPT_WEAK_VALIDATION, true);
305+
rtp_set_option(device, RTP_OPT_PROMISC, true);
305306
rtp_set_sdes(device, rtp_my_ssrc(device),
306307
RTCP_SDES_TOOL, PACKAGE_STRING, strlen(PACKAGE_STRING));
307308
if (strcmp(addr, IN6_BLACKHOLE_SERVER_MODE_STR) == 0) {
308-
rtp_set_option(device, RTP_OPT_SEND_BACK, TRUE);
309+
rtp_set_option(device, RTP_OPT_SEND_BACK, true);
309310
}
310311

311312
rtp_set_recv_buf(device, INITIAL_VIDEO_RECV_BUFFER_SIZE);

0 commit comments

Comments
 (0)