Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mumble module nocmake. #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
261df11
Initial commit
slomkowski Oct 25, 2015
6b846af
Add source files from old repository.
slomkowski Oct 25, 2015
a54a352
Update Mumble.proto to 1.2.10.
slomkowski Oct 25, 2015
58fee46
Complete callbacks.
slomkowski Oct 27, 2015
6df4aff
Refactor Mumlib_Private class.
slomkowski Oct 27, 2015
d289bf3
Change example to be simple echo.
slomkowski Oct 27, 2015
5e060ea
Add text message sending.
slomkowski Oct 30, 2015
8d55100
Clean up CMakeLists.txt.
slomkowski Nov 4, 2015
1c2b09e
Clean up includes.
slomkowski Nov 4, 2015
a1bb860
Add README.
slomkowski Nov 7, 2015
a67dced
Add sequence reset after silence time. #2
slomkowski Nov 9, 2015
ae1e71f
Add sequence and session numbers to audio callbacks. #3
slomkowski Nov 17, 2015
0aee284
Add 'override' to virtual function overloads.
slomkowski Nov 17, 2015
f01b693
Change CMake version to 2.8.0.
slomkowski Nov 23, 2015
783ba52
Implement joinChannel command
NerdyProjects Nov 30, 2015
193c498
Merge pull request #5 from NerdyProjects/join_channel
slomkowski Dec 1, 2015
fbe08c1
Add support for reconnecting after communication error. #4
slomkowski Dec 4, 2015
57484ec
Merge branch 'master' of github.com:slomkowski/mumlib
slomkowski Dec 4, 2015
9b3af96
Add additional receive error message.
slomkowski Dec 13, 2015
7e37c6e
Disable exception throwing if receive 0 bytes. #6
slomkowski Dec 13, 2015
4b8fad8
Add exception when input SSL buffer is overflown. #6
slomkowski Dec 14, 2015
7a45a4c
Fix wrong channel texting after channel join.
slomkowski Dec 14, 2015
2617016
Fix crash after channel linking.
slomkowski Dec 14, 2015
a4f511d
Fix crash after channel linking.
slomkowski Dec 14, 2015
44f2bbd
Increase SSL input buffer to handle images. #7
slomkowski Jan 20, 2016
fa3956f
Merge branch '6-bytes-transferred'
slomkowski Jan 20, 2016
b7720cc
Add support for changing Opus encoder bitrate. #11
slomkowski Apr 15, 2016
449a2a0
Fix SWAP64 implementation to work on more platforms
Hunter522 May 23, 2016
c5fc079
Merge pull request #13 from Hunter522/swap64-fix
slomkowski Jun 17, 2016
c49e870
for some reason the shared library version does not seem to build
hungrymonkey Oct 1, 2017
9ce0c2c
added callback skeleton
hungrymonkey Oct 1, 2017
6ed35d5
I have to commit before adding git subtree mumlib
hungrymonkey Oct 1, 2017
41d3bc3
Add 'thirdparty/mumlib/' from commit 'c5fc079b4cf40651ef25b6915c03074…
hungrymonkey Oct 1, 2017
9a4cb2c
.pb.h filename is blocking me from building, I have to check google p…
hungrymonkey Oct 1, 2017
02dc248
the protoc command is really crude but the whole things builds
hungrymonkey Oct 1, 2017
0924832
fix some issues so it can build, I did a really ugly hack and added s…
hungrymonkey Oct 1, 2017
ef11687
commit my old callback.h
hungrymonkey Oct 1, 2017
4bb2655
cleaning up some code before I start adding other stuff to mumble
hungrymonkey Oct 1, 2017
85c7594
linked boost_system using system lib
hungrymonkey Oct 1, 2017
250b32a
seems to compile, now. I have to work on callback setter
hungrymonkey Oct 1, 2017
b7a8a22
i can might test, texting soon. woooooooooo
hungrymonkey Oct 1, 2017
54dc285
code compiles, I now have to test it in godot
hungrymonkey Oct 1, 2017
6a58332
it connect but it crash when trying to recieve a message
hungrymonkey Oct 2, 2017
1b4dc6b
added audio data callback. i dont know if it work but I have to fix t…
hungrymonkey Oct 2, 2017
473002b
fix a small logical error with converting short to byte
hungrymonkey Oct 2, 2017
e6f1948
Distros such as fedora have bash as default popd is a shell builtin.
hungrymonkey Oct 2, 2017
4f80b96
added packages to build this repo
hungrymonkey Oct 2, 2017
546cf33
forgot to add boost_system
hungrymonkey Oct 2, 2017
9d1a30f
i am cleaning up code and added a nullptr check to make sure it does …
hungrymonkey Oct 3, 2017
ab457fa
i have to debug the callback part where i create my own function
hungrymonkey Oct 3, 2017
1a8a8d3
i have to figure out how to use funcref properly
hungrymonkey Oct 3, 2017
880001f
added some stuff that does nto work. WOrking on ref
hungrymonkey Oct 3, 2017
3f42aa7
still crashes
hungrymonkey Oct 3, 2017
477fdfa
commit current nonworking code
hungrymonkey Oct 4, 2017
0c41ac3
Merge branch 'master' into mumble_module_nocmake
hungrymonkey Oct 4, 2017
815bbc7
texting works
hungrymonkey Oct 4, 2017
b0ca503
texting work on a few servers
hungrymonkey Oct 4, 2017
15a4b7f
change a few things
hungrymonkey Oct 4, 2017
24dffe4
Merge branch 'master' into mumble_module_nocmake
hungrymonkey Oct 4, 2017
23e90e9
i have to test audio send and listen
hungrymonkey Oct 5, 2017
21677c5
clean up code and it still crashes on voice
hungrymonkey Oct 5, 2017
4560c99
messup the common for loop
hungrymonkey Oct 6, 2017
604da65
fix some small issues and added print statements, I will remove it wh…
hungrymonkey Oct 6, 2017
cfa13bc
fix the data corruption but it did not fix the crashing
hungrymonkey Oct 6, 2017
e467d0a
change Mumble to be tracked by godot
hungrymonkey Oct 8, 2017
27f1ab2
Merge branch 'master' into mumble_module_nocmake
hungrymonkey Oct 8, 2017
2d2b0a0
delete print_line and unused functions
hungrymonkey Oct 8, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ for x in env.module_list:

lib = env_modules.Library("modules", env.modules_sources)

env.Prepend(LIBS=[lib])
env.Prepend(LIBS=[lib,'boost_system', 'protobuf', 'log4cpp'])
4 changes: 4 additions & 0 deletions modules/mumble/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.backup
*.back
*.pyc
*.o
263 changes: 263 additions & 0 deletions modules/mumble/SCsub
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
# SCsub

Import('env')


mumble_env = env.Clone()
if (env['builtin_opus'] != 'no'):
thirdparty_dir = "#thirdparty/opus/"

thirdparty_sources = [
"silk/tables_other.c",
"silk/sum_sqr_shift.c",
"silk/PLC.c",
"silk/dec_API.c",
"silk/decode_pulses.c",
"silk/inner_prod_aligned.c",
"silk/init_encoder.c",
"silk/interpolate.c",
"silk/stereo_encode_pred.c",
"silk/decode_frame.c",
"silk/NLSF_del_dec_quant.c",
"silk/VAD.c",
"silk/resampler_private_AR2.c",
"silk/NLSF_unpack.c",
"silk/resampler_down2.c",
"silk/sort.c",
"silk/resampler_private_IIR_FIR.c",
"silk/resampler_down2_3.c",
"silk/resampler_private_up2_HQ.c",
"silk/tables_gain.c",
"silk/stereo_find_predictor.c",
"silk/stereo_quant_pred.c",
"silk/NLSF_stabilize.c",
"silk/ana_filt_bank_1.c",
"silk/check_control_input.c",
"silk/bwexpander.c",
"silk/A2NLSF.c",
"silk/LPC_inv_pred_gain.c",
"silk/log2lin.c",
"silk/process_NLSFs.c",
"silk/sigm_Q15.c",
"silk/VQ_WMat_EC.c",
"silk/quant_LTP_gains.c",
"silk/resampler_private_down_FIR.c",
"silk/NLSF_decode.c",
"silk/control_codec.c",
"silk/NLSF_VQ_weights_laroia.c",
"silk/decode_pitch.c",
"silk/stereo_decode_pred.c",
"silk/tables_pulses_per_block.c",
"silk/init_decoder.c",
"silk/table_LSF_cos.c",
"silk/decode_core.c",
"silk/code_signs.c",
"silk/enc_API.c",
"silk/tables_LTP.c",
"silk/pitch_est_tables.c",
"silk/biquad_alt.c",
"silk/encode_indices.c",
"silk/tables_NLSF_CB_WB.c",
"silk/debug.c",
"silk/decode_parameters.c",
"silk/tables_pitch_lag.c",
"silk/NLSF2A.c",
"silk/resampler.c",
"silk/decode_indices.c",
"silk/NLSF_VQ.c",
"silk/bwexpander_32.c",
"silk/tables_NLSF_CB_NB_MB.c",
"silk/encode_pulses.c",
"silk/NSQ_del_dec.c",
"silk/control_SNR.c",
"silk/shell_coder.c",
"silk/NLSF_encode.c",
"silk/stereo_MS_to_LR.c",
"silk/stereo_LR_to_MS.c",
"silk/HP_variable_cutoff.c",
"silk/LPC_analysis_filter.c",
"silk/CNG.c",
"silk/decoder_set_fs.c",
"silk/resampler_rom.c",
"silk/control_audio_bandwidth.c",
"silk/lin2log.c",
"silk/LP_variable_cutoff.c",
"silk/NSQ.c",
"silk/gain_quant.c",
"celt/laplace.c",
"celt/vq.c",
"celt/quant_bands.c",
"celt/kiss_fft.c",
"celt/entcode.c",
"celt/entenc.c",
"celt/celt_lpc.c",
"celt/pitch.c",
"celt/rate.c",
"celt/mathops.c",
#"celt/arm/armcpu.c",
#"celt/arm/celt_neon_intr.c",
#"celt/arm/celt_ne10_mdct.c",
#"celt/arm/celt_ne10_fft.c",
#"celt/arm/arm_celt_map.c",
"celt/celt_encoder.c",
"celt/celt.c",
"celt/bands.c",
"celt/cwrs.c",
"celt/entdec.c",
"celt/celt_decoder.c",
"celt/mdct.c",
"celt/modes.c",
"repacketizer.c",
"mlp_data.c",
"opus_multistream.c",
"opusfile.c",
"opus_encoder.c",
"analysis.c",
"mlp.c",
"info.c",
"stream.c",
"opus_decoder.c",
"internal.c",
"wincerts.c",
"opus.c",
"opus_multistream_encoder.c",
"http.c",
"opus_multistream_decoder.c"
]

opus_sources_silk = []

if("opus_fixed_point" in env and env.opus_fixed_point == "yes"):
mumble_env.Append(CFLAGS=["-DFIXED_POINT"])
opus_sources_silk = [
"silk/fixed/schur64_FIX.c",
"silk/fixed/residual_energy16_FIX.c",
"silk/fixed/encode_frame_FIX.c",
"silk/fixed/regularize_correlations_FIX.c",
"silk/fixed/apply_sine_window_FIX.c",
"silk/fixed/solve_LS_FIX.c",
"silk/fixed/schur_FIX.c",
"silk/fixed/pitch_analysis_core_FIX.c",
"silk/fixed/noise_shape_analysis_FIX.c",
"silk/fixed/find_LTP_FIX.c",
"silk/fixed/vector_ops_FIX.c",
"silk/fixed/autocorr_FIX.c",
"silk/fixed/warped_autocorrelation_FIX.c",
"silk/fixed/find_pitch_lags_FIX.c",
"silk/fixed/k2a_Q16_FIX.c",
"silk/fixed/LTP_scale_ctrl_FIX.c",
"silk/fixed/corrMatrix_FIX.c",
"silk/fixed/prefilter_FIX.c",
"silk/fixed/find_LPC_FIX.c",
"silk/fixed/residual_energy_FIX.c",
"silk/fixed/process_gains_FIX.c",
"silk/fixed/LTP_analysis_filter_FIX.c",
"silk/fixed/k2a_FIX.c",
"silk/fixed/burg_modified_FIX.c",
"silk/fixed/find_pred_coefs_FIX.c"
]
else:
opus_sources_silk = [
"silk/float/LTP_scale_ctrl_FLP.c",
"silk/float/regularize_correlations_FLP.c",
"silk/float/corrMatrix_FLP.c",
"silk/float/LPC_analysis_filter_FLP.c",
"silk/float/levinsondurbin_FLP.c",
"silk/float/schur_FLP.c",
"silk/float/scale_vector_FLP.c",
"silk/float/apply_sine_window_FLP.c",
"silk/float/pitch_analysis_core_FLP.c",
"silk/float/wrappers_FLP.c",
"silk/float/bwexpander_FLP.c",
"silk/float/warped_autocorrelation_FLP.c",
"silk/float/solve_LS_FLP.c",
"silk/float/find_LPC_FLP.c",
"silk/float/autocorrelation_FLP.c",
"silk/float/find_pred_coefs_FLP.c",
"silk/float/find_pitch_lags_FLP.c",
"silk/float/burg_modified_FLP.c",
"silk/float/find_LTP_FLP.c",
"silk/float/energy_FLP.c",
"silk/float/sort_FLP.c",
"silk/float/LPC_inv_pred_gain_FLP.c",
"silk/float/k2a_FLP.c",
"silk/float/noise_shape_analysis_FLP.c",
"silk/float/inner_product_FLP.c",
"silk/float/process_gains_FLP.c",
"silk/float/encode_frame_FLP.c",
"silk/float/scale_copy_vector_FLP.c",
"silk/float/residual_energy_FLP.c",
"silk/float/LTP_analysis_filter_FLP.c",
"silk/float/prefilter_FLP.c"
]

thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources + opus_sources_silk]

mumble_env.add_source_files(env.modules_sources, thirdparty_sources)
mumble_env.Append(CFLAGS=["-DHAVE_CONFIG_H"])

thirdparty_include_paths = [
"",
"celt",
"opus",
"silk",
"silk/fixed",
"silk/float",
]
mumble_env.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths])

# also requires libogg
if (env['builtin_libogg'] != 'no'):
mumble_env.Append(CPPPATH=["#thirdparty/libogg"])


sources = [
"register_types.cpp",
"mumble.cpp"
"callback.cpp"
"utils.cpp"
]


thirdparty_dir = "#thirdparty"

third_party_includes = [
"mumlib/include",
"mumlib/build"
]
third_party_sources = [
"mumlib/src/Audio.cpp",
"mumlib/src/Callback.cpp",
"mumlib/src/CryptState.cpp",
"mumlib/src/Transport.cpp",
"mumlib/src/VarInt.cpp",
"mumlib/src/mumlib.cpp",
"mumlib/build/Mumble.pb.cc"
]
third_party_system_lib = [
"/usr/lib64",
"/usr/lib"
]
third_party_system_include = [
"/usr/include",
"/usr/include/boost"
]
build_mumlib_proto = "pushd ../../thirdparty/mumlib; mkdir build;" + \
"protoc --proto_path=. --cpp_out=build/ Mumble.proto; popd;"

import subprocess
def subprocess_cmd(command):
process = subprocess.Popen(command,stdout=subprocess.PIPE, shell=True, executable='/bin/bash')
proc_stdout = process.communicate()[0].strip()

## build .pb.h files
subprocess_cmd(build_mumlib_proto)

#mumble_env.Append(LIBPATH=third_party_system_lib)
#mumble_env.Append(CPPPATH=third_party_system_include)
#mumble_env.Append(LIBS=['protobuf', 'log4cpp'])

mumble_env.Append(CPPPATH=[ thirdparty_dir + "/" + dir for dir in third_party_includes])
mumble_env.add_source_files(env.modules_sources, [ thirdparty_dir + '/' + dir for dir in third_party_sources ])
mumble_env.add_source_files(env.modules_sources,"*.cpp")
mumble_env.Append(CXXFLAGS=['-O2', '-std=c++11'])
67 changes: 67 additions & 0 deletions modules/mumble/callback.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#include "callback.h"
#include "utils.h"
#include "variant.h"
#include "print_string.h"
#include "scene/resources/audio_stream_sample.h"

SimpleCallback::SimpleCallback() : _callback(*this) { }
SimpleCallback::~SimpleCallback() { }
mumlib::Callback *SimpleCallback::get_callback(){
return &_callback;
}
void SimpleCallback::MyCallBack::audio( int target,
int sessionId,
int sequenceNumber,
int16_t *pcm_data,
uint32_t pcm_data_size){
if(!_cb._audio_handler.is_null()){
Variant sid(sessionId);
Variant snum(sequenceNumber);
Ref<AudioStreamSample> sam = Ref<AudioStreamSample>(utils::pcm2Sample(pcm_data, pcm_data_size));
Variant pcm(sam);

Variant::CallError err;
const Variant *args[3] = { &sid, &snum, &pcm};
Variant result = _cb._audio_handler->call_func( args, 3, err);
}
}


void SimpleCallback::MyCallBack::textMessage(
uint32_t actor,
std::vector<uint32_t> session,
std::vector<uint32_t> channel_id,
std::vector<uint32_t> tree_id,
std::string message) {
if(!_cb._text_handler.is_null()){
Variant s = utils::cpp_uint32vec2Variant(session);
Variant c = utils::cpp_uint32vec2Variant(channel_id);
Variant t = utils::cpp_uint32vec2Variant(tree_id);
Variant a(actor);
Variant m(String(message.c_str()));
Variant::CallError err;
const Variant *args[5] = {&a, &s, &c, &t, &m};
Variant result = _cb._text_handler->call_func( args, 5, err );
}

}
void SimpleCallback::MyCallBack::version(
uint16_t major,
uint8_t minor,
uint8_t patch,
std::string release,
std::string os,
std::string os_version){ }

void SimpleCallback::_bind_methods(){
ClassDB::bind_method(D_METHOD("setAudioHandler", "handler"), &SimpleCallback::setAudioHandler);
ClassDB::bind_method(D_METHOD("setTextHandler", "handler"), &SimpleCallback::setTextHandler);

}

void SimpleCallback::setAudioHandler( Ref<FuncRef> handler){
this->_audio_handler = handler;
}
void SimpleCallback::setTextHandler( Ref<FuncRef> handler){
this->_text_handler = handler;
}
Loading