Skip to content

Commit

Permalink
Updating toxcore to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dvor committed Mar 9, 2018
1 parent 29d3736 commit 6a0ae9c
Show file tree
Hide file tree
Showing 71 changed files with 4,397 additions and 7,107 deletions.
20 changes: 2 additions & 18 deletions install-tox.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ diff --git a/toxcore/toxav/audio.h b/toxcore/toxav/audio.h
index 5f9d7f7..e4b8f61 100644
--- a/toxcore/toxav/audio.h
+++ b/toxcore/toxav/audio.h
@@ -27,7 +27,7 @@
@@ -25,7 +25,7 @@
#include "../toxcore/logger.h"
#include "../toxcore/util.h"

-#include <opus.h>
+#include "opus.h"
#include <pthread.h>

struct RTPMessage;
#define AUDIO_JITTERBUFFER_COUNT 3
diff --git a/toxcore/toxav/groupav.h b/toxcore/toxav/groupav.h
index 1929b17..b791111 100644
--- a/toxcore/toxav/groupav.h
Expand Down Expand Up @@ -76,19 +76,3 @@ index 8d46998..156eea9 100644
#else
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
#include <windows.h>
diff --git a/toxcore/toxav/video.m b/toxcore/toxav/video.m
index c84e89f..b817089 100644
--- a/toxcore/toxav/video.m
+++ b/toxcore/toxav/video.m
@@ -84,8 +84,9 @@ VCSession *vc_new(Logger *log, ToxAV *av, uint32_t friend_number, toxav_video_re
#endif
cfg.g_lag_in_frames = 0;
cfg.kf_min_dist = 0;
- cfg.kf_max_dist = 48;
- cfg.kf_mode = VPX_KF_AUTO;
+ cfg.kf_max_dist = 10; /* a full frame every 10 frames minimum (can be more often, codec decides automatically) */
+ cfg.kf_mode = VPX_KF_AUTO; /* Encoder determines optimal placement automatically */
+ cfg.rc_end_usage = VPX_CQ; /* Constrained Quality (CQ) mode -> give codec a hint that we may be on low bandwidth connection */

rc = vpx_codec_enc_init(vc->encoder, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0);

11 changes: 11 additions & 0 deletions install-tox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ for file in toxcore/**/*.c; do
mv -v "$file" "${file%.c}.m"
done

remove_files_matching() {
for file in $1; do
echo "Removing $file"
rm $file
done
}

remove_files_matching "toxcore/**/*.bazel"
remove_files_matching "toxcore/**/*_test.cpp"
remove_files_matching "toxcore/**/*.api.h"

echo "Applying install-tox.patch"
git apply install-tox.patch

2 changes: 1 addition & 1 deletion toxcore-git
Submodule toxcore-git updated 225 files
4 changes: 2 additions & 2 deletions toxcore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "toxcore"
s.version = "0.1.10-improving-video"
s.version = "0.2.0"
s.summary = "Cocoapods wrapper for toxcore"
s.homepage = "https://github.com/Antidote-for-Tox/toxcore"
s.license = 'GPLv3'
Expand All @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
# Preserve the layout of headers in the toxcore directory
s.header_mappings_dir = 'toxcore'

s.source_files = 'toxcore/toxcore/*.{m,h}', 'toxcore/toxencryptsave/*.{m,h}', 'toxcore/toxdns/*.{m,h}', 'toxcore/toxav/*.{m,h}'
s.source_files = 'toxcore/toxcore/*.{m,h}', 'toxcore/toxencryptsave/*.{m,h}', 'toxcore/toxav/*.{m,h}'

s.dependency 'libopus-patched-config', '1.1'
s.dependency 'libsodium', '~> 1.0.1'
Expand Down
20 changes: 20 additions & 0 deletions toxcore/toxav/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@
#include "opus.h"
#include <pthread.h>

#define AUDIO_JITTERBUFFER_COUNT 3
#define AUDIO_MAX_SAMPLE_RATE 48000
#define AUDIO_MAX_CHANNEL_COUNT 2

#define AUDIO_START_SAMPLE_RATE 48000
#define AUDIO_START_BITRATE 48000
#define AUDIO_START_CHANNEL_COUNT 2
#define AUDIO_OPUS_PACKET_LOSS_PERC 10
#define AUDIO_OPUS_COMPLEXITY 10

#define AUDIO_DECODER_START_SAMPLE_RATE 48000
#define AUDIO_DECODER_START_CHANNEL_COUNT 1

#define AUDIO_MAX_FRAME_DURATION_MS 120

// ((sampling_rate_in_hz * frame_duration_in_ms) / 1000) * 2 // because PCM16 needs 2 bytes for 1 sample
// These are per frame and per channel.
#define AUDIO_MAX_BUFFER_SIZE_PCM16 ((AUDIO_MAX_SAMPLE_RATE * AUDIO_MAX_FRAME_DURATION_MS) / 1000)
#define AUDIO_MAX_BUFFER_SIZE_BYTES (AUDIO_MAX_BUFFER_SIZE_PCM16 * 2)

struct RTPMessage;

typedef struct ACSession_s {
Expand Down
Loading

0 comments on commit 6a0ae9c

Please sign in to comment.