mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 00:40:13 +00:00
removed play/pause stuff
this stuff is no longer used (has been used by CoUniverse)
This commit is contained in:
@@ -174,8 +174,6 @@ struct state_audio {
|
||||
|
||||
char *requested_encryption = nullptr;
|
||||
|
||||
volatile bool paused = false; // for CoUniverse...
|
||||
|
||||
int audio_tx_mode = 0;
|
||||
|
||||
double volume = 1.0; // receiver volume scale
|
||||
@@ -913,16 +911,10 @@ static struct response *audio_sender_process_message(struct state_audio *s, stru
|
||||
return new_response(RESPONSE_OK, status);
|
||||
break;
|
||||
}
|
||||
case SENDER_MSG_PAUSE:
|
||||
s->paused = true;
|
||||
break;
|
||||
case SENDER_MSG_MUTE:
|
||||
s->muted_sender = !s->muted_sender;
|
||||
log_msg(LOG_LEVEL_NOTICE, "Audio sender %smuted.\n", s->muted_sender ? "" : "un");
|
||||
break;
|
||||
case SENDER_MSG_PLAY:
|
||||
s->paused = false;
|
||||
break;
|
||||
case SENDER_MSG_QUERY_VIDEO_MODE:
|
||||
return new_response(RESPONSE_BAD_REQUEST, NULL);
|
||||
case SENDER_MSG_RESET_SSRC:
|
||||
@@ -1073,9 +1065,6 @@ static void *audio_sender_thread(void *arg)
|
||||
memset(buffer->data, 0, buffer->data_len);
|
||||
}
|
||||
export_audio(s->exporter, buffer);
|
||||
if (s->paused) {
|
||||
continue;
|
||||
}
|
||||
|
||||
s->filter_chain.filter(&buffer);
|
||||
|
||||
|
||||
@@ -458,10 +458,6 @@ static int process_msg(struct control_state *s, fd_t client_fd, char *message, s
|
||||
if(prefix_matches(message, "receiver ")) {
|
||||
strncpy(msg->receiver, suffix(message, "receiver "), sizeof(msg->receiver) - 1);
|
||||
msg->type = SENDER_MSG_CHANGE_RECEIVER;
|
||||
} else if(prefix_matches(message, "play")) {
|
||||
msg->type = SENDER_MSG_PLAY;
|
||||
} else if(prefix_matches(message, "pause")) {
|
||||
msg->type = SENDER_MSG_PAUSE;
|
||||
} else if(prefix_matches(message, "reset-ssrc")) {
|
||||
msg->type = SENDER_MSG_RESET_SSRC;
|
||||
} else {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @brief decompressing part of transcoding reflector
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2013-2022 CESNET, z. s. p. o.
|
||||
* Copyright (c) 2013-2023 CESNET, z. s. p. o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -201,7 +201,6 @@ void *hd_rum_decompress_init(struct module *parent, struct hd_rum_output_conf co
|
||||
params["exporter"].ptr = NULL;
|
||||
params["compression"].str = "none";
|
||||
params["rxtx_mode"].i = MODE_RECEIVER;
|
||||
params["paused"].b = true;
|
||||
|
||||
//RTP
|
||||
params["mtu"].i = 9000; // doesn't matter anyway...
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* (therefore it wraps the whole sending part of UltraGrid).
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2013-2022 CESNET, z. s. p. o.
|
||||
* Copyright (c) 2013-2023 CESNET, z. s. p. o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -121,7 +121,6 @@ recompress_output_port::recompress_output_port(struct module *parent,
|
||||
params["exporter"].ptr = NULL;
|
||||
params["compression"].str = "none";
|
||||
params["rxtx_mode"].i = MODE_SENDER;
|
||||
params["paused"].b = false;
|
||||
|
||||
//RTP
|
||||
params["mtu"].i = mtu;
|
||||
|
||||
@@ -138,7 +138,6 @@ static constexpr const char *DEFAULT_AUDIO_CODEC = "PCM";
|
||||
#define OPT_PIX_FMTS (('P' << 8) | 'F')
|
||||
#define OPT_PIXFMT_CONV_POLICY (('P' << 8) | 'C')
|
||||
#define OPT_RTSP_SERVER (('R' << 8) | 'S')
|
||||
#define OPT_START_PAUSED (('S' << 8) | 'P')
|
||||
#define OPT_VIDEO_CODECS (('V' << 8) | 'C')
|
||||
#define OPT_VIDEO_PROTOCOL (('V' << 8) | 'P')
|
||||
#define OPT_WINDOW_TITLE (('W' << 8) | 'T')
|
||||
@@ -577,7 +576,6 @@ struct ug_options {
|
||||
bool is_server = false;
|
||||
|
||||
const char *requested_capabilities = nullptr;
|
||||
bool start_paused = false;
|
||||
|
||||
const char *video_protocol = "ultragrid_rtp";
|
||||
const char *video_protocol_opts = "";
|
||||
@@ -763,7 +761,6 @@ static int parse_options(int argc, char *argv[], struct ug_options *opt) {
|
||||
{"conv-policy", required_argument, 0, OPT_PIXFMT_CONV_POLICY},
|
||||
{"pix-fmts", no_argument, 0, OPT_PIX_FMTS},
|
||||
{"rtsp-server", optional_argument, 0, OPT_RTSP_SERVER},
|
||||
{"start-paused", no_argument, 0, OPT_START_PAUSED},
|
||||
{"video-codecs", no_argument, 0, OPT_VIDEO_CODECS},
|
||||
{"video-protocol", required_argument, 0, OPT_VIDEO_PROTOCOL},
|
||||
{"window-title", required_argument, 0, OPT_WINDOW_TITLE},
|
||||
@@ -980,9 +977,6 @@ static int parse_options(int argc, char *argv[], struct ug_options *opt) {
|
||||
break;
|
||||
case OPT_LIST_MODULES:
|
||||
return list_all_modules() ? 1 : -EXIT_FAILURE;
|
||||
case OPT_START_PAUSED:
|
||||
opt->start_paused = true;
|
||||
break;
|
||||
case OPT_PARAM:
|
||||
if (!parse_params(optarg, false)) {
|
||||
return 1;
|
||||
@@ -1419,7 +1413,6 @@ int main(int argc, char *argv[])
|
||||
params["exporter"].ptr = exporter;
|
||||
params["compression"].str = opt.requested_compression;
|
||||
params["rxtx_mode"].i = opt.video_rxtx_mode;
|
||||
params["paused"].b = opt.start_paused;
|
||||
|
||||
// iHDTV
|
||||
params["argc"].i = argc;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @author Martin Pulec <martin.pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2013-2021 CESNET, z. s. p. o.
|
||||
* Copyright (c) 2013-2023 CESNET, z. s. p. o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -100,8 +100,6 @@ enum msg_sender_type {
|
||||
SENDER_MSG_CHANGE_PORT,
|
||||
SENDER_MSG_GET_STATUS,
|
||||
SENDER_MSG_MUTE,
|
||||
SENDER_MSG_PLAY,
|
||||
SENDER_MSG_PAUSE,
|
||||
SENDER_MSG_CHANGE_FEC,
|
||||
SENDER_MSG_QUERY_VIDEO_MODE,
|
||||
SENDER_MSG_RESET_SSRC,
|
||||
|
||||
@@ -296,7 +296,6 @@ struct video_frame {
|
||||
};
|
||||
int64_t compress_start; ///< in ns from epoch
|
||||
int64_t compress_end; ///< in ns from epoch
|
||||
unsigned int paused_play:1;
|
||||
#define VF_METADATA_END tile_count
|
||||
|
||||
/// tiles contain actual video frame data. A frame usually contains exactly one
|
||||
|
||||
@@ -120,7 +120,6 @@ static int vidcap_ug_input_init(struct vidcap_params *cap_params, void **state)
|
||||
params["exporter"].ptr = NULL;
|
||||
params["compression"].str = "none";
|
||||
params["rxtx_mode"].i = MODE_RECEIVER;
|
||||
params["paused"].i = false;
|
||||
|
||||
//RTP
|
||||
params["mtu"].i = 9000; // doesn't matter anyway...
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @author Martin Pulec <pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2013-2019 CESNET z.s.p.o.
|
||||
* Copyright (c) 2013-2023 CESNET z.s.p.o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -70,8 +70,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
video_rxtx::video_rxtx(map<string, param_u> const ¶ms): m_port_id("default"), m_paused(params.at("paused").b),
|
||||
m_report_paused_play(false), m_rxtx_mode(params.at("rxtx_mode").i),
|
||||
video_rxtx::video_rxtx(map<string, param_u> const ¶ms): m_port_id("default"),
|
||||
m_rxtx_mode(params.at("rxtx_mode").i),
|
||||
m_parent(static_cast<struct module *>(params.at("parent").ptr)),
|
||||
m_frames_sent(0ull), m_compression(nullptr),
|
||||
m_exporter(static_cast<struct exporter *>(params.at("exporter").ptr)),
|
||||
@@ -169,20 +169,13 @@ void *video_rxtx::sender_thread(void *args) {
|
||||
return static_cast<video_rxtx *>(args)->sender_loop();
|
||||
}
|
||||
|
||||
int video_rxtx::check_sender_messages() {
|
||||
int ret = 0;
|
||||
void video_rxtx::check_sender_messages() {
|
||||
// process external messages
|
||||
struct message *msg_external;
|
||||
while((msg_external = check_message(&m_sender_mod))) {
|
||||
int status;
|
||||
struct response *r = process_sender_message((struct msg_sender *) msg_external, &status);
|
||||
if (status == STREAM_PAUSED_PLAY) {
|
||||
ret = STREAM_PAUSED_PLAY;
|
||||
}
|
||||
struct response *r = process_sender_message((struct msg_sender *) msg_external);
|
||||
free_message(msg_external, r);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *video_rxtx::sender_loop() {
|
||||
@@ -192,7 +185,7 @@ void *video_rxtx::sender_loop() {
|
||||
memset(&saved_vid_desc, 0, sizeof(saved_vid_desc));
|
||||
|
||||
while(1) {
|
||||
int ret = check_sender_messages();
|
||||
check_sender_messages();
|
||||
|
||||
shared_ptr<video_frame> tx_frame;
|
||||
|
||||
@@ -202,8 +195,6 @@ void *video_rxtx::sender_loop() {
|
||||
|
||||
export_video(m_exporter, tx_frame.get());
|
||||
|
||||
tx_frame->paused_play = ret == STREAM_PAUSED_PLAY;
|
||||
|
||||
send_frame(tx_frame);
|
||||
m_frames_sent += 1;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @author Martin Pulec <pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2013-2017 CESNET z.s.p.o.
|
||||
* Copyright (c) 2013-2023 CESNET z.s.p.o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -71,8 +71,6 @@ struct video_rxtx_info {
|
||||
class video_rxtx *(*create)(std::map<std::string, param_u> const ¶ms);
|
||||
};
|
||||
|
||||
#define STREAM_PAUSED_PLAY 1
|
||||
|
||||
class video_rxtx {
|
||||
public:
|
||||
virtual ~video_rxtx();
|
||||
@@ -95,9 +93,7 @@ public:
|
||||
bool m_should_exit = false;
|
||||
protected:
|
||||
video_rxtx(std::map<std::string, param_u> const &);
|
||||
int check_sender_messages();
|
||||
bool m_paused;
|
||||
bool m_report_paused_play;
|
||||
void check_sender_messages();
|
||||
struct module m_sender_mod;
|
||||
struct module m_receiver_mod;
|
||||
int m_rxtx_mode;
|
||||
@@ -109,8 +105,7 @@ private:
|
||||
virtual void *(*get_receiver_thread())(void *arg) = 0;
|
||||
static void *sender_thread(void *args);
|
||||
void *sender_loop();
|
||||
virtual struct response *process_sender_message(struct msg_sender *, int *status) {
|
||||
*status = 0;
|
||||
virtual struct response *process_sender_message(struct msg_sender *) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,9 +76,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct response *rtp_video_rxtx::process_sender_message(struct msg_sender *msg, int *status)
|
||||
struct response *rtp_video_rxtx::process_sender_message(struct msg_sender *msg)
|
||||
{
|
||||
*status = 0;
|
||||
switch(msg->type) {
|
||||
case SENDER_MSG_CHANGE_RECEIVER:
|
||||
{
|
||||
@@ -132,21 +131,6 @@ struct response *rtp_video_rxtx::process_sender_message(struct msg_sender *msg,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SENDER_MSG_PAUSE:
|
||||
{
|
||||
lock_guard<mutex> lock(m_network_devices_lock);
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Paused.\n");
|
||||
m_paused = true;
|
||||
break;
|
||||
}
|
||||
case SENDER_MSG_PLAY:
|
||||
{
|
||||
lock_guard<mutex> lock(m_network_devices_lock);
|
||||
log_msg(LOG_LEVEL_ERROR, "[control] Playing again.\n");
|
||||
m_paused = false;
|
||||
*status = STREAM_PAUSED_PLAY;
|
||||
break;
|
||||
}
|
||||
case SENDER_MSG_CHANGE_FEC:
|
||||
{
|
||||
lock_guard<mutex> lock(m_network_devices_lock);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @author Martin Pulec <pulec@cesnet.cz>
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2013-2021 CESNET z.s.p.o.
|
||||
* Copyright (c) 2013-2023 CESNET z.s.p.o.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -83,7 +83,7 @@ protected:
|
||||
time_ns_t m_start_time;
|
||||
video_desc m_video_desc;
|
||||
private:
|
||||
struct response *process_sender_message(struct msg_sender *i, int *status);
|
||||
struct response *process_sender_message(struct msg_sender *i) override;
|
||||
};
|
||||
|
||||
#endif // VIDEO_RXTX_RTP_H_
|
||||
|
||||
@@ -150,10 +150,6 @@ void ultragrid_rtp_video_rxtx::send_frame_async(shared_ptr<video_frame> tx_frame
|
||||
{
|
||||
lock_guard<mutex> lock(m_network_devices_lock);
|
||||
|
||||
if (m_paused) {
|
||||
goto after_send;
|
||||
}
|
||||
|
||||
if (m_connections_count == 1) { /* normal case - only one connection */
|
||||
tx_send(m_tx, tx_frame.get(),
|
||||
m_network_devices[0]);
|
||||
@@ -185,7 +181,6 @@ void ultragrid_rtp_video_rxtx::send_frame_async(shared_ptr<video_frame> tx_frame
|
||||
} while (!m_should_exit && rc == TRUE);
|
||||
}
|
||||
|
||||
after_send:
|
||||
m_async_sending_lock.lock();
|
||||
m_async_sending = false;
|
||||
m_async_sending_lock.unlock();
|
||||
|
||||
Reference in New Issue
Block a user