mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 20:40:27 +00:00
Stats/events: identify by stream ID (host:port)
This commit is contained in:
@@ -173,7 +173,7 @@ void state_transcoder_decompress::worker()
|
||||
case message::FRAME:
|
||||
for (unsigned int i = 0; i < output_ports.size(); ++i) {
|
||||
if (output_ports[i].active)
|
||||
recompress_process_async(output_ports[i].state, msg.frame, i);
|
||||
recompress_process_async(output_ports[i].state, msg.frame);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,11 @@ void *recompress_init(struct module *parent,
|
||||
|
||||
try {
|
||||
auto rxtx = video_rxtx::create("ultragrid_rtp", params);
|
||||
if (strchr(host, ':') != NULL) {
|
||||
rxtx->m_port_id = string("[") + host + "]:" + to_string(tx_port);
|
||||
} else {
|
||||
rxtx->m_port_id = string(host) + ":" + to_string(tx_port);
|
||||
}
|
||||
|
||||
return new state_recompress(
|
||||
decltype(state_recompress::video_rxtx)(dynamic_cast<ultragrid_rtp_video_rxtx *>(rxtx)),
|
||||
@@ -78,7 +83,7 @@ void *recompress_init(struct module *parent,
|
||||
}
|
||||
}
|
||||
|
||||
void recompress_process_async(void *state, shared_ptr<video_frame> frame, int port_id)
|
||||
void recompress_process_async(void *state, shared_ptr<video_frame> frame)
|
||||
{
|
||||
auto s = static_cast<state_recompress *>(state);
|
||||
|
||||
@@ -97,7 +102,6 @@ void recompress_process_async(void *state, shared_ptr<video_frame> frame, int po
|
||||
s->frames = 0;
|
||||
}
|
||||
|
||||
s->video_rxtx->m_port_id = port_id;
|
||||
s->video_rxtx->send(frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,5 +24,6 @@ uint32_t recompress_get_ssrc(void *state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <memory>
|
||||
void recompress_process_async(void *state, std::shared_ptr<video_frame> frame, int port_id);
|
||||
#include <string>
|
||||
void recompress_process_async(void *state, std::shared_ptr<video_frame> frame);
|
||||
#endif
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
video_rxtx::video_rxtx(map<string, param_u> const ¶ms): m_port_id(-1), m_paused(params.at("paused").b),
|
||||
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),
|
||||
m_parent(static_cast<struct module *>(params.at("parent").ptr)),
|
||||
m_compression(nullptr),
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
}
|
||||
virtual void join();
|
||||
static video_rxtx *create(std::string const & name, std::map<std::string, param_u> const &);
|
||||
int m_port_id;
|
||||
std::string m_port_id;
|
||||
protected:
|
||||
video_rxtx(std::map<std::string, param_u> const &);
|
||||
int check_sender_messages();
|
||||
|
||||
@@ -211,20 +211,17 @@ after_send:
|
||||
// report events and stats
|
||||
auto new_desc = video_desc_from_frame(tx_frame.get());
|
||||
if (new_desc != m_video_desc) {
|
||||
control_report_event(m_control, (m_port_id != -1 ? (string("-") + to_string(m_port_id) + " ") : string("")) +
|
||||
control_report_event(m_control, m_port_id + " " +
|
||||
string("captured video changed - ") +
|
||||
(string) new_desc);
|
||||
m_video_desc = new_desc;
|
||||
}
|
||||
if (tx_frame->paused_play) {
|
||||
control_report_event(m_control, (m_port_id != -1 ? (string("-") + to_string(m_port_id) + " ") : string("")) +
|
||||
control_report_event(m_control, m_port_id + " " +
|
||||
string("play"));
|
||||
}
|
||||
ostringstream oss;
|
||||
if (m_port_id != -1) {
|
||||
oss << "-" << m_port_id << " ";
|
||||
}
|
||||
oss << "bufferId " << buffer_id <<
|
||||
oss << m_port_id << " bufferId " << buffer_id <<
|
||||
" droppedFrames " << dropped_frames <<
|
||||
" nanoPerFrameActual " << (m_nano_per_frame_actual_cumul += nano_actual) <<
|
||||
" nanoPerFrameExpected " << (m_nano_per_frame_expected_cumul += nano_expected) <<
|
||||
|
||||
Reference in New Issue
Block a user