aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-12-20 17:23:54 +0800
committerMistivia <i@mistivia.com>2025-12-20 17:25:36 +0800
commit05233a9bc6520190eb9550cb4a3cdf63d241ab71 (patch)
tree416db5aa1e37e598dd9f79a4281af33bf0f015d1
parent5e3d349b3fcf4a219ea7540059076ab7beed8ed2 (diff)
add windows support
-rw-r--r--Makefile5
-rw-r--r--s3_client.cpp2
-rw-r--r--srtserver.c19
-rw-r--r--transcode_talker.h1
4 files changed, 18 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index c47dc4c..f812e50 100644
--- a/Makefile
+++ b/Makefile
@@ -2,10 +2,15 @@ CC := gcc
CXX := g++
CFLAGS := -g -Wall
CXXFLAGS := -g -Wall -std=c++14
+UNAME := $(shell uname -s)
LDFLAGS := -g -lsrt \
-lavformat -lavutil -lavcodec \
-laws-cpp-sdk-core -laws-cpp-sdk-s3
+ifeq ($(findstring MINGW,$(UNAME)),MINGW)
+ LDFLAGS += -lws2_32
+endif
+
C_SOURCES := $(shell find . -maxdepth 1 -name '*.c')
CPP_SOURCES := $(shell find . -maxdepth 1 -name '*.cpp')
diff --git a/s3_client.cpp b/s3_client.cpp
index 8ef235b..28ab669 100644
--- a/s3_client.cpp
+++ b/s3_client.cpp
@@ -29,8 +29,10 @@ void S3Client_init() {
Aws::Auth::AWSCredentials credentials;
config.endpointOverride = ezlive_config->endpoint;
config.region = ezlive_config->region;
+#if !defined(_WIN32)
config.checksumConfig.requestChecksumCalculation = Aws::Client::RequestChecksumCalculation::WHEN_REQUIRED;
config.checksumConfig.responseChecksumValidation = Aws::Client::ResponseChecksumValidation::WHEN_REQUIRED;
+#endif
credentials = Aws::Auth::AWSCredentials(ezlive_config->access_key, ezlive_config->secret_key);
s3client = new Aws::S3::S3Client(credentials, nullptr, config);
}
diff --git a/srtserver.c b/srtserver.c
index 97ce272..65bc46d 100644
--- a/srtserver.c
+++ b/srtserver.c
@@ -6,14 +6,17 @@
#include <assert.h>
#include <stdarg.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/poll.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <arpa/inet.h>
-#include <time.h>
+#if defined(_WIN32)
+ #include <winsock2.h>
+#else
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <sys/poll.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <arpa/inet.h>
+#endif
#include <srt/srt.h>
diff --git a/transcode_talker.h b/transcode_talker.h
index 4b0f301..9ec3817 100644
--- a/transcode_talker.h
+++ b/transcode_talker.h
@@ -3,7 +3,6 @@
#include "ringbuf.h"
#include "pthread.h"
-#include <bits/pthreadtypes.h>
typedef struct {
char *files[15];