diff options
Diffstat (limited to 'testing/av_test.c')
-rw-r--r-- | testing/av_test.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/testing/av_test.c b/testing/av_test.c index 637fb9ac..04605468 100644 --- a/testing/av_test.c +++ b/testing/av_test.c | |||
@@ -22,6 +22,10 @@ | |||
22 | * -lopencv_highgui -lopencv_imgproc -lsndfile -pthread -lvpx -lopus -lsodium -lportaudio | 22 | * -lopencv_highgui -lopencv_imgproc -lsndfile -pthread -lvpx -lopus -lsodium -lportaudio |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #ifdef __cplusplus | ||
26 | extern "C" { | ||
27 | #endif | ||
28 | |||
25 | // XXX: Hack because toxav doesn't really expose ring_buffer, but this av test | 29 | // XXX: Hack because toxav doesn't really expose ring_buffer, but this av test |
26 | // uses it. Not all of these functions are used, but when linking statically, | 30 | // uses it. Not all of these functions are used, but when linking statically, |
27 | // not renaming them will cause multiple definition errors, so we need to rename | 31 | // not renaming them will cause multiple definition errors, so we need to rename |
@@ -37,12 +41,15 @@ | |||
37 | #define rb_data test_rb_data | 41 | #define rb_data test_rb_data |
38 | #include "../toxav/ring_buffer.c" | 42 | #include "../toxav/ring_buffer.c" |
39 | 43 | ||
40 | #include "../toxav/ring_buffer.h" | ||
41 | #include "../toxav/toxav.h" | 44 | #include "../toxav/toxav.h" |
42 | #include "../toxcore/network.h" /* current_time_monotonic() */ | 45 | #include "../toxcore/network.h" /* current_time_monotonic() */ |
43 | #include "../toxcore/tox.h" | 46 | #include "../toxcore/tox.h" |
44 | #include "../toxcore/util.h" | 47 | #include "../toxcore/util.h" |
45 | 48 | ||
49 | #ifdef __cplusplus | ||
50 | } | ||
51 | #endif | ||
52 | |||
46 | /* Playing audio data */ | 53 | /* Playing audio data */ |
47 | #include <portaudio.h> | 54 | #include <portaudio.h> |
48 | /* Reading audio */ | 55 | /* Reading audio */ |
@@ -175,7 +182,9 @@ static void t_toxav_receive_video_frame_cb(ToxAV *av, uint32_t friend_number, | |||
175 | 182 | ||
176 | CvMat mat = cvMat(height, width, CV_8UC3, img_data); | 183 | CvMat mat = cvMat(height, width, CV_8UC3, img_data); |
177 | 184 | ||
178 | CvSize sz = {.height = height, .width = width}; | 185 | CvSize sz; |
186 | sz.height = height; | ||
187 | sz.width = width; | ||
179 | 188 | ||
180 | IplImage *header = cvCreateImageHeader(sz, 1, 3); | 189 | IplImage *header = cvCreateImageHeader(sz, 1, 3); |
181 | IplImage *img = cvGetImage(&mat, header); | 190 | IplImage *img = cvGetImage(&mat, header); |
@@ -598,9 +607,9 @@ CHECK_ARG: | |||
598 | 607 | ||
599 | /* Start decode thread */ | 608 | /* Start decode thread */ |
600 | struct toxav_thread_data data = { | 609 | struct toxav_thread_data data = { |
601 | .AliceAV = AliceAV, | 610 | AliceAV, |
602 | .BobAV = BobAV, | 611 | BobAV, |
603 | .sig = 0 | 612 | 0, |
604 | }; | 613 | }; |
605 | 614 | ||
606 | pthread_t dect; | 615 | pthread_t dect; |
@@ -723,9 +732,9 @@ CHECK_ARG: | |||
723 | 732 | ||
724 | /* Start decode thread */ | 733 | /* Start decode thread */ |
725 | struct toxav_thread_data data = { | 734 | struct toxav_thread_data data = { |
726 | .AliceAV = AliceAV, | 735 | AliceAV, |
727 | .BobAV = BobAV, | 736 | BobAV, |
728 | .sig = 0 | 737 | 0, |
729 | }; | 738 | }; |
730 | 739 | ||
731 | pthread_t dect; | 740 | pthread_t dect; |
@@ -739,7 +748,9 @@ CHECK_ARG: | |||
739 | exit(1); | 748 | exit(1); |
740 | } | 749 | } |
741 | 750 | ||
742 | // toxav_video_bit_rate_set(AliceAV, 0, 5000, false, NULL); | 751 | #if 0 |
752 | toxav_video_bit_rate_set(AliceAV, 0, 5000, false, NULL); | ||
753 | #endif | ||
743 | 754 | ||
744 | time_t start_time = time(NULL); | 755 | time_t start_time = time(NULL); |
745 | 756 | ||