diff options
Diffstat (limited to 'toxav')
-rw-r--r-- | toxav/BUILD.bazel | 7 | ||||
-rw-r--r-- | toxav/Makefile.inc | 1 | ||||
-rw-r--r-- | toxav/audio.h | 1 | ||||
-rw-r--r-- | toxav/pair.h | 6 | ||||
-rw-r--r-- | toxav/toxav.c | 4 | ||||
-rw-r--r-- | toxav/video.h | 1 |
6 files changed, 20 insertions, 0 deletions
diff --git a/toxav/BUILD.bazel b/toxav/BUILD.bazel index dbe57b6c..f6c92b52 100644 --- a/toxav/BUILD.bazel +++ b/toxav/BUILD.bazel | |||
@@ -55,10 +55,16 @@ cc_test( | |||
55 | ) | 55 | ) |
56 | 56 | ||
57 | cc_library( | 57 | cc_library( |
58 | name = "pair", | ||
59 | hdrs = ["pair.h"], | ||
60 | ) | ||
61 | |||
62 | cc_library( | ||
58 | name = "audio", | 63 | name = "audio", |
59 | srcs = ["audio.c"], | 64 | srcs = ["audio.c"], |
60 | hdrs = ["audio.h"], | 65 | hdrs = ["audio.h"], |
61 | deps = [ | 66 | deps = [ |
67 | ":pair", | ||
62 | ":public", | 68 | ":public", |
63 | ":rtp", | 69 | ":rtp", |
64 | "//c-toxcore/toxcore:network", | 70 | "//c-toxcore/toxcore:network", |
@@ -78,6 +84,7 @@ cc_library( | |||
78 | ], | 84 | ], |
79 | deps = [ | 85 | deps = [ |
80 | ":audio", | 86 | ":audio", |
87 | ":pair", | ||
81 | ":public", | 88 | ":public", |
82 | "//c-toxcore/toxcore:network", | 89 | "//c-toxcore/toxcore:network", |
83 | "@libvpx", | 90 | "@libvpx", |
diff --git a/toxav/Makefile.inc b/toxav/Makefile.inc index 7b788198..5f6342c0 100644 --- a/toxav/Makefile.inc +++ b/toxav/Makefile.inc | |||
@@ -16,6 +16,7 @@ libtoxav_la_SOURCES = ../toxav/rtp.h \ | |||
16 | ../toxav/video.c \ | 16 | ../toxav/video.c \ |
17 | ../toxav/bwcontroller.h \ | 17 | ../toxav/bwcontroller.h \ |
18 | ../toxav/bwcontroller.c \ | 18 | ../toxav/bwcontroller.c \ |
19 | ../toxav/pair.h \ | ||
19 | ../toxav/ring_buffer.h \ | 20 | ../toxav/ring_buffer.h \ |
20 | ../toxav/ring_buffer.c \ | 21 | ../toxav/ring_buffer.c \ |
21 | ../toxav/toxav.h \ | 22 | ../toxav/toxav.h \ |
diff --git a/toxav/audio.h b/toxav/audio.h index 64aa2f12..39d534e0 100644 --- a/toxav/audio.h +++ b/toxav/audio.h | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include "../toxcore/logger.h" | 25 | #include "../toxcore/logger.h" |
26 | #include "../toxcore/util.h" | 26 | #include "../toxcore/util.h" |
27 | #include "pair.h" | ||
27 | 28 | ||
28 | #include <opus.h> | 29 | #include <opus.h> |
29 | #include <pthread.h> | 30 | #include <pthread.h> |
diff --git a/toxav/pair.h b/toxav/pair.h new file mode 100644 index 00000000..59ef2b62 --- /dev/null +++ b/toxav/pair.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef C_TOXCORE_TOXAV_PAIR_H | ||
2 | #define C_TOXCORE_TOXAV_PAIR_H | ||
3 | |||
4 | #define PAIR(TYPE1__, TYPE2__) struct { TYPE1__ first; TYPE2__ second; } | ||
5 | |||
6 | #endif // C_TOXCORE_TOXAV_PAIR_H | ||
diff --git a/toxav/toxav.c b/toxav/toxav.c index 5abe1130..dcffca4d 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -242,6 +242,10 @@ void toxav_iterate(ToxAV *av) | |||
242 | ac_iterate(i->audio.second); | 242 | ac_iterate(i->audio.second); |
243 | vc_iterate(i->video.second); | 243 | vc_iterate(i->video.second); |
244 | 244 | ||
245 | // TODO(iphydf): Find out what MIN-semantics are desired here and | ||
246 | // use a min_* function from util.h. | ||
247 | #define MIN(a,b) (((a)<(b))?(a):(b)) | ||
248 | |||
245 | if (i->msi_call->self_capabilities & msi_CapRAudio && | 249 | if (i->msi_call->self_capabilities & msi_CapRAudio && |
246 | i->msi_call->peer_capabilities & msi_CapSAudio) { | 250 | i->msi_call->peer_capabilities & msi_CapSAudio) { |
247 | rc = MIN(i->audio.second->lp_frame_duration, rc); | 251 | rc = MIN(i->audio.second->lp_frame_duration, rc); |
diff --git a/toxav/video.h b/toxav/video.h index 616a866a..7a0913a0 100644 --- a/toxav/video.h +++ b/toxav/video.h | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include "../toxcore/logger.h" | 25 | #include "../toxcore/logger.h" |
26 | #include "../toxcore/util.h" | 26 | #include "../toxcore/util.h" |
27 | #include "pair.h" | ||
27 | 28 | ||
28 | #include <vpx/vpx_decoder.h> | 29 | #include <vpx/vpx_decoder.h> |
29 | #include <vpx/vpx_encoder.h> | 30 | #include <vpx/vpx_encoder.h> |