Fix Windows not accepting connections on RTSP
This commit is contained in:
@@ -95,10 +95,10 @@ std::string_view to_enum_string(net_e net) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
host_t host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port) {
|
host_t host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port) {
|
||||||
enet_address_set_host(&addr, "::");
|
enet_address_set_host(&addr, "0.0.0.0");
|
||||||
enet_address_set_port(&addr, port);
|
enet_address_set_port(&addr, port);
|
||||||
|
|
||||||
return host_t { enet_host_create(AF_INET6, &addr, peers, 1, 0, 0) };
|
return host_t { enet_host_create(AF_INET, &addr, peers, 1, 0, 0) };
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_host(ENetHost *host) {
|
void free_host(ENetHost *host) {
|
||||||
|
|||||||
@@ -3,13 +3,12 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "../main.h"
|
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <bitset>
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#include <net/if.h>
|
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
@@ -23,9 +22,9 @@
|
|||||||
#include <pulse/simple.h>
|
#include <pulse/simple.h>
|
||||||
#include <pulse/error.h>
|
#include <pulse/error.h>
|
||||||
|
|
||||||
#include <bitset>
|
#include "sunshine/task_pool.h"
|
||||||
#include <sunshine/task_pool.h>
|
#include "sunshine/config.h"
|
||||||
#include <sunshine/config.h>
|
#include "sunshine/main.h"
|
||||||
|
|
||||||
namespace platf {
|
namespace platf {
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
@@ -300,7 +299,7 @@ struct mic_attr_t : public mic_t {
|
|||||||
pa_sample_spec ss;
|
pa_sample_spec ss;
|
||||||
util::safe_ptr<pa_simple, pa_simple_free> mic;
|
util::safe_ptr<pa_simple, pa_simple_free> mic;
|
||||||
|
|
||||||
explicit mic_attr_t(const pa_sample_spec& ss) : ss(ss), mic {} {}
|
explicit mic_attr_t(pa_sample_format format, std::uint32_t sample_rate, std::uint8_t channels) : ss { format, sample_rate, channels }, mic {} {}
|
||||||
capture_e sample(std::vector<std::int16_t> &sample_buf) override {
|
capture_e sample(std::vector<std::int16_t> &sample_buf) override {
|
||||||
auto sample_size = sample_buf.size();
|
auto sample_size = sample_buf.size();
|
||||||
|
|
||||||
@@ -337,11 +336,7 @@ std::unique_ptr<display_t> display() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<mic_t> microphone(std::uint32_t sample_rate) {
|
std::unique_ptr<mic_t> microphone(std::uint32_t sample_rate) {
|
||||||
std::unique_ptr<mic_attr_t> mic {
|
auto mic = std::make_unique<mic_attr_t>(PA_SAMPLE_S16LE, sample_rate, 2);
|
||||||
new mic_attr_t {
|
|
||||||
{ PA_SAMPLE_S16LE, sample_rate, 2 }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
@@ -354,7 +349,7 @@ std::unique_ptr<mic_t> microphone(std::uint32_t sample_rate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mic->mic.reset(
|
mic->mic.reset(
|
||||||
pa_simple_new(nullptr, "sunshine", pa_stream_direction_t::PA_STREAM_RECORD, audio_sink, "sunshine_record", &mic->ss, nullptr, nullptr, &status)
|
pa_simple_new(nullptr, "sunshine", pa_stream_direction_t::PA_STREAM_RECORD, audio_sink, "sunshine-record", &mic->ss, nullptr, nullptr, &status)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!mic->mic) {
|
if(!mic->mic) {
|
||||||
|
|||||||
+2
-2
@@ -201,8 +201,8 @@ struct broadcast_ctx_t {
|
|||||||
|
|
||||||
asio::io_service io;
|
asio::io_service io;
|
||||||
|
|
||||||
udp::socket video_sock { io, udp::endpoint(udp::v6(), VIDEO_STREAM_PORT) };
|
udp::socket video_sock { io, udp::endpoint(udp::v4(), VIDEO_STREAM_PORT) };
|
||||||
udp::socket audio_sock { io, udp::endpoint(udp::v6(), AUDIO_STREAM_PORT) };
|
udp::socket audio_sock { io, udp::endpoint(udp::v4(), AUDIO_STREAM_PORT) };
|
||||||
control_server_t control_server { CONTROL_PORT };
|
control_server_t control_server { CONTROL_PORT };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user