Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Commit 97ca138

Browse files
committed
fixed issue with rr dns that resulted in connections going to one ingets while media went to another
1 parent 02b0f4c commit 97ca138

File tree

3 files changed

+76
-24
lines changed

3 files changed

+76
-24
lines changed

build_scripts/build_tachyon_windows_vs.bat

+30-18
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
REM check for cef binary
22
REM check for dependencies (ffmpeg, etc)
33
SET build_config=Release
4-
SET obs_version=1.2.11
4+
SET obs_version=1.2.14
55
SET cef_binary_dir=C:\beam\cef_binary
66
SET cef_release_dir=C:\beam\obs-browser-1.22
77
SET coredeps=C:\beam\tachyon_deps
88
SET QTDIR64=C:\Qt\5.6\msvc2015_64
9+
SET QTDIR32=C:\Qt\5.6\msvc2015
910
SET PATH=%PATH%;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Program Files (x86)\CMake\bin
11+
SET DepsPath32=%coredeps%\win32
1012
SET DepsPath64=%coredeps%\win64
11-
SET FFmpegPath64=%coredeps%\win64
12-
SET x264Path64=%coredeps%\win64
13-
SET curlPath64=%coredeps%\win64
13+
SET build32=
14+
SET build64=
15+
SET package=
16+
if "%1" == "all" (
17+
SET build32=true
18+
SET build64=true
19+
SET package=true
20+
)
21+
if "%1" == "win64" (
22+
SET build64=true
23+
)
1424
echo "building CEF browser plugin"
15-
REM call python automate-git.py --download-dir=../.. --branch=2623 --x64-build
16-
REM SET cef_root_dir=%cd%\cef
1725
pushd .
1826
cd ..
1927
call git submodule update --init
2028
cd ..
21-
REM windows 64 bit binary: https://cefbuilds.com/#branch_2623
22-
REM pushd .
23-
REM cd %cef_binary_dir%
24-
REM mkdir build
25-
REM cd build
26-
REM cmake -G "Visual Studio 14 2015 Win64" ..
27-
REM msbuild /p:Configuration=%build_config%,Platform=x64 ALL_BUILD.vcxproj || exit /b
28-
REM current CEF plugin expects this one folder down
29-
REM copy libcef_dll\%build_config%\libcef_dll_wrapper.lib libcef_dll\
30-
REM popd
3129
echo "building libftl"
3230
call git clone https://github.com/WatchBeam/ftl-sdk.git
3331
cd ftl-sdk
@@ -39,8 +37,22 @@ SET ftl_lib_dir=%cd%\%build_config%\ftl.lib
3937
SET ftl_inc_dir=%cd%\..\libftl
4038
popd
4139
REM cmake -G "Visual Studio 14 2015 Win64" -DOBS_VERSION_OVERRIDE=%obs_version% -DFTLSDK_LIB=%ftl_lib_dir% -DFTLSDK_INCLUDE_DIR=%ftl_inc_dir% -DCEF_ROOT_DIR=%cef_binary_dir% -DCOPY_DEPENDENCIES=true ..
42-
cmake -G "Visual Studio 14 2015 Win64" -DOBS_VERSION_OVERRIDE=%obs_version% -DFTLSDK_LIB=%ftl_lib_dir% -DFTLSDK_INCLUDE_DIR=%ftl_inc_dir% -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
43-
call msbuild /t:Rebuild /p:Configuration=%build_config%,Platform=x64 ALL_BUILD.vcxproj || exit /b
40+
REM cmake -G "Visual Studio 14 2015 Win64" -DOBS_VERSION_OVERRIDE=%obs_version% -DFTLSDK_LIB=%ftl_lib_dir% -DFTLSDK_INCLUDE_DIR=%ftl_inc_dir% -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
41+
REM call msbuild /p:Configuration=%build_config%,Platform=x64 ALL_BUILD.vcxproj || exit /b
42+
REM cmake -G "Visual Studio 14 2015" -DOBS_VERSION_OVERRIDE=%obs_version% -DFTLSDK_LIB=%ftl_lib_dir% -DFTLSDK_INCLUDE_DIR=%ftl_inc_dir% -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
43+
REM call msbuild /p:Configuration=%build_config% ALL_BUILD.vcxproj || exit /b
44+
if defined build64 (
45+
rmdir CMakeFiles /s /q
46+
del CMakeCache.txt
47+
cmake -G "Visual Studio 14 2015 Win64" -DOBS_VERSION_OVERRIDE=%obs_version% -DFTLSDK_LIB=%ftl_lib_dir% -DFTLSDK_INCLUDE_DIR=%ftl_inc_dir% -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
48+
call msbuild /p:Configuration=%build_config%,Platform=x64 ALL_BUILD.vcxproj || exit /b
49+
)
50+
if defined build32 (
51+
rmdir CMakeFiles /s /q
52+
del CMakeCache.txt
53+
cmake -G "Visual Studio 14 2015" -DOBS_VERSION_OVERRIDE=%obs_version% -DFTLSDK_LIB=%ftl_lib_dir% -DFTLSDK_INCLUDE_DIR=%ftl_inc_dir% -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
54+
call msbuild /p:Configuration=%build_config% ALL_BUILD.vcxproj
55+
)
4456
echo "Building FTL-Express"
4557
pushd .
4658
cd ..\..

build_scripts/tachyon_windows_installer.nsi

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; HM NIS Edit Wizard helper defines
44
!define PRODUCT_NAME "Tachyon"
55
!define DEFAULT_INST_DIR "$PROGRAMFILES\${PRODUCT_NAME}"
6-
!define PRODUCT_VERSION "1.2.11"
6+
!define PRODUCT_VERSION "1.2.14"
77
!define PRODUCT_PUBLISHER "Beam Interactive"
88
!define PRODUCT_WEB_SITE "http://beam.pro"
99
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\tachyon64.exe"
@@ -614,6 +614,9 @@ Section "data" SEC04
614614
File "rundir\Release\data\obs-plugins\win-capture\get-graphics-offsets64.exe"
615615
File "rundir\Release\data\obs-plugins\win-capture\graphics-hook64.dll"
616616
File "rundir\Release\data\obs-plugins\win-capture\inject-helper64.exe"
617+
File "rundir\Release\data\obs-plugins\win-capture\get-graphics-offsets32.exe"
618+
File "rundir\Release\data\obs-plugins\win-capture\graphics-hook32.dll"
619+
File "rundir\Release\data\obs-plugins\win-capture\inject-helper32.exe"
617620
SetOutPath "$INSTDIR\data\obs-plugins\win-capture\locale"
618621
File "rundir\Release\data\obs-plugins\win-capture\locale\ar-SA.ini"
619622
File "rundir\Release\data\obs-plugins\win-capture\locale\ca-ES.ini"
@@ -1112,6 +1115,9 @@ Section Uninstall
11121115
Delete "$INSTDIR\data\obs-plugins\win-capture\inject-helper64.exe"
11131116
Delete "$INSTDIR\data\obs-plugins\win-capture\graphics-hook64.dll"
11141117
Delete "$INSTDIR\data\obs-plugins\win-capture\get-graphics-offsets64.exe"
1118+
Delete "$INSTDIR\data\obs-plugins\win-capture\inject-helper32.exe"
1119+
Delete "$INSTDIR\data\obs-plugins\win-capture\graphics-hook32.dll"
1120+
Delete "$INSTDIR\data\obs-plugins\win-capture\get-graphics-offsets32.exe"
11151121
Delete "$INSTDIR\data\obs-plugins\text-freetype2\text_default.effect"
11161122
Delete "$INSTDIR\data\obs-plugins\text-freetype2\locale\zh-TW.ini"
11171123
Delete "$INSTDIR\data\obs-plugins\text-freetype2\locale\zh-CN.ini"

plugins/obs-ffmpeg/obs-ffmpeg-output.c

+39-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#include <ftl/ftl.h>
2929

3030
#ifdef _WIN32
31+
#include <winsock2.h>
32+
#include <ws2tcpip.h>
33+
#pragma comment(lib, "ws2_32.lib")
3134
#include <windows.h>
3235
#include <process.h>
3336
#include <Shellapi.h>
@@ -66,6 +69,7 @@ struct ffmpeg_cfg {
6669

6770
/* FTL specific fields */
6871
const char *ingest_location;
72+
char ingest_ip[20];
6973
uint32_t channel_id;
7074
char stream_key[2048];
7175
uint32_t audio_ssrc;
@@ -180,10 +184,39 @@ int map_ftl_error_to_obs_error(int status) {
180184
return ftl_to_obs_error_code;
181185
}
182186

187+
static int lookup_ingest_ip(const char *ingest_location, char *ingest_ip){
188+
struct hostent *remoteHost;
189+
struct in_addr addr;
190+
int retval = -1;
191+
ingest_ip[0] = '\0';
192+
193+
remoteHost = gethostbyname(ingest_location);
194+
195+
if(remoteHost) {
196+
int i = 0;
197+
if (remoteHost->h_addrtype == AF_INET)
198+
{
199+
while (remoteHost->h_addr_list[i] != 0) {
200+
addr.s_addr = *(u_long *) remoteHost->h_addr_list[i++];
201+
blog(LOG_INFO, "IP Address #%d of ingest is: %s\n", i, inet_ntoa(addr));
202+
203+
/*only use the first ip found*/
204+
if(strlen(ingest_ip) == 0){
205+
strcpy(ingest_ip, inet_ntoa(addr));
206+
retval = 0;
207+
}
208+
}
209+
}
210+
}
211+
212+
return retval;
213+
}
214+
183215
ftl_status_t attempt_ftl_connection(struct ffmpeg_output *output, struct ffmpeg_cfg config)
184216
{
185217
ftl_status_t status_code;
186218

219+
187220
/* Use Charon to autheticate and configure muxer settings */
188221
ftl_init();
189222
ftl_register_log_handler(log_libftl_messages);
@@ -192,9 +225,9 @@ ftl_status_t attempt_ftl_connection(struct ffmpeg_output *output, struct ffmpeg_
192225
if (status_code != FTL_SUCCESS) {
193226
blog(LOG_WARNING, "Failed to initialize stream configuration: errno %d\n", status_code);
194227
return OBS_OUTPUT_ERROR;
195-
}
228+
}
196229

197-
ftl_set_ingest_location(output->stream_config, config.ingest_location);
230+
ftl_set_ingest_location(output->stream_config, config.ingest_ip);
198231
ftl_set_authetication_key(output->stream_config, config.channel_id, config.stream_key);
199232

200233
#ifdef _FTL_USE_H264
@@ -1176,6 +1209,7 @@ static int try_connect(struct ffmpeg_output *output)
11761209
settings = obs_output_get_settings(output->output);
11771210
memset(&config, 0, sizeof(config));
11781211
config.ingest_location = get_string_or_null(settings, "url");
1212+
lookup_ingest_ip(config.ingest_location, config.ingest_ip);
11791213
config.format_name = get_string_or_null(settings, "format_name");
11801214
config.format_mime_type = get_string_or_null(settings,
11811215
"format_mime_type");
@@ -1189,7 +1223,7 @@ static int try_connect(struct ffmpeg_output *output)
11891223
full_streamkey = get_string_or_null(settings, "ftl_stream_key");
11901224

11911225
/* Build the RTP command line */
1192-
if (config.ingest_location == NULL) {
1226+
if (config.ingest_location == NULL || strlen(config.ingest_ip) == 0) {
11931227
blog(LOG_WARNING, "ingest location blank");
11941228
return OBS_OUTPUT_ERROR;
11951229
}
@@ -1305,7 +1339,7 @@ static int try_connect(struct ffmpeg_output *output)
13051339
/* Glue together the ingest URL */
13061340

13071341
#ifdef _WIN32
1308-
swprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg)/sizeof(wchar_t), L"-rtpingestaddr=%hs:8082", config.ingest_location);
1342+
swprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg)/sizeof(wchar_t), L"-rtpingestaddr=%hs:8082", config.ingest_ip);
13091343
blog(LOG_WARNING, "FTL ingest args are: %S\n", ftl_ingest_arg);
13101344
ZeroMemory( &output->ShExecInfo, sizeof(output->ShExecInfo) );
13111345
output->ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
@@ -1320,7 +1354,7 @@ static int try_connect(struct ffmpeg_output *output)
13201354
ShellExecuteEx(&output->ShExecInfo);
13211355
SetPriorityClass(output->ShExecInfo.hProcess, HIGH_PRIORITY_CLASS);
13221356
#else
1323-
snprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg), "-rtpingestaddr=%s:8082", config.ingest_location);
1357+
snprintf(ftl_ingest_arg, sizeof(ftl_ingest_arg), "-rtpingestaddr=%s:8082", config.ingest_ip);
13241358
blog(LOG_WARNING, "FTL ingest args are: %s\n", ftl_ingest_arg);
13251359
/* print error message if fork() fails */
13261360
blog(LOG_WARNING, "Forking Process\n");

0 commit comments

Comments
 (0)