Skip to content

Commit cc3c992

Browse files
committed
control: drop receiver-port
Used by CoUniverse, no signs that used otherwise (but a notice kept for the case someone is using that).
1 parent 1e312b6 commit cc3c992

4 files changed

Lines changed: 5 additions & 73 deletions

File tree

src/audio/audio.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -581,27 +581,6 @@ struct audio_decoder {
581581
static struct response * audio_receiver_process_message(struct state_audio *s, struct msg_receiver *msg)
582582
{
583583
switch (msg->type) {
584-
case RECEIVER_MSG_CHANGE_RX_PORT: {
585-
assert(s->audio_tx_mode == MODE_RECEIVER); // receiver only
586-
struct rtp *old_audio_network_device = s->audio_network_device;
587-
int old_rx_port = s->audio_network_parameters.recv_port;
588-
s->audio_network_parameters.recv_port = msg->new_rx_port;
589-
s->audio_network_device =
590-
initialize_audio_network(&s->audio_network_parameters);
591-
if (s->audio_network_device == nullptr) {
592-
s->audio_network_parameters.recv_port = old_rx_port;
593-
s->audio_network_device = old_audio_network_device;
594-
string err = string("Changing audio RX port to ") +
595-
to_string(msg->new_rx_port) + " failed!";
596-
LOG(LOG_LEVEL_ERROR) << err << "\n";
597-
return new_response(RESPONSE_INT_SERV_ERR, err.c_str());
598-
}
599-
rtp_done(old_audio_network_device);
600-
LOG(LOG_LEVEL_INFO) << "Successfully changed audio "
601-
"RX port to "
602-
<< msg->new_rx_port << ".\n";
603-
break;
604-
}
605584
case RECEIVER_MSG_GET_AUDIO_STATUS: {
606585
double ret = s->muted_receiver ? 0.0 : s->volume;
607586
char volume_str[128] = "";

src/control_socket.cpp

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -562,33 +562,10 @@ static int process_msg(struct control_state *s, fd_t client_fd, char *message, s
562562
send_message(s->root_module, path_audio, (struct message *) msg_audio);
563563
free_response(resp_audio);
564564
} else if (prefix_matches(message, "receiver-port ")) {
565-
struct msg_receiver *msg =
566-
(struct msg_receiver *)
567-
new_message(sizeof(struct msg_receiver));
568-
struct msg_receiver *msg_audio =
569-
(struct msg_receiver *)
570-
new_message(sizeof(struct msg_receiver));
571-
msg->type = RECEIVER_MSG_CHANGE_RX_PORT;
572-
msg_audio->type = RECEIVER_MSG_CHANGE_RX_PORT;
573-
574-
char *port_str = suffix(message, "receiver-port ");
575-
576-
msg->new_rx_port = atoi(port_str);
577-
if (strchr(port_str, ':')) {
578-
msg_audio->new_rx_port = atoi(strchr(port_str, ':') + 1);
579-
} else {
580-
msg_audio->new_rx_port = msg->new_rx_port + 2;
581-
}
582-
583-
enum module_class path_receiver[] = { MODULE_CLASS_RECEIVER, MODULE_CLASS_NONE };
584-
enum module_class path_audio_receiver[] = { MODULE_CLASS_AUDIO, MODULE_CLASS_RECEIVER, MODULE_CLASS_NONE };
585-
append_message_path(path, sizeof(path), path_receiver);
586-
append_message_path(path_audio, sizeof(path_audio), path_audio_receiver);
587-
resp =
588-
send_message(s->root_module, path, (struct message *) msg);
589-
struct response *resp_audio =
590-
send_message(s->root_module, path_audio, (struct message *) msg_audio);
591-
free_response(resp_audio);
565+
const char msg[] = "receiver-port has been removed. Let us "
566+
"know if you use this feature. ";
567+
bug_msg(LOG_LEVEL_ERROR, msg);
568+
resp = new_response(RESPONSE_BAD_REQUEST, msg);
592569
} else if(prefix_matches(message, "fec ")) {
593570
auto *msg = reinterpret_cast<struct msg_universal *>(new_message(sizeof(struct msg_universal)));
594571
char *fec = suffix(message, "fec ");

src/messaging.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <martin.pulec@cesnet.cz>
44
*/
55
/*
6-
* Copyright (c) 2013-2025 CESNET
6+
* Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -108,7 +108,6 @@ struct msg_sender {
108108
};
109109

110110
enum msg_receiver_type {
111-
RECEIVER_MSG_CHANGE_RX_PORT,
112111
RECEIVER_MSG_VIDEO_PROP_CHANGED,
113112
RECEIVER_MSG_GET_AUDIO_STATUS,
114113
RECEIVER_MSG_INCREASE_VOLUME,

src/video_rxtx/ultragrid_rtp.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,29 +182,6 @@ void ultragrid_rtp_video_rxtx::receiver_process_messages()
182182
struct response *r = NULL;
183183

184184
switch (msg->type) {
185-
case RECEIVER_MSG_CHANGE_RX_PORT:
186-
{
187-
assert(m_rxtx_mode == MODE_RECEIVER); // receiver only
188-
auto *old_device = m_network_device;
189-
auto old_port = m_recv_port_number;
190-
m_recv_port_number = msg->new_rx_port;
191-
m_network_device = initialize_network(m_requested_receiver.c_str(),
192-
m_recv_port_number,
193-
m_send_port_number, m_participants,
194-
m_force_ip_version,
195-
m_mcast_if.c_str(),
196-
m_ttl);
197-
if (m_network_device == nullptr) {
198-
log_msg(LOG_LEVEL_ERROR, "[control] Failed to change RX port to %d\n", msg->new_rx_port);
199-
r = new_response(RESPONSE_INT_SERV_ERR, "Changing RX port failed!");
200-
m_network_device = old_device;
201-
m_recv_port_number = old_port;
202-
} else {
203-
log_msg(LOG_LEVEL_NOTICE, "[control] Changed RX port to %d\n", msg->new_rx_port);
204-
destroy_rtp_device(old_device);
205-
}
206-
break;
207-
}
208185
case RECEIVER_MSG_VIDEO_PROP_CHANGED:
209186
{
210187
pdb_iter_t it;

0 commit comments

Comments
 (0)