aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_stream_dialog.cpp
diff options
context:
space:
mode:
authorJirka Novak <j.novak@netsystem.cz>2021-01-01 22:10:34 +0100
committerJirka Novak <j.novak@netsystem.cz>2021-01-01 22:10:34 +0100
commite9e36e20bc35092ad6584306884cfcdd3af66956 (patch)
tree9479b1afc6597a6807965c147d90c682b6e62138 /ui/qt/rtp_stream_dialog.cpp
parent793ece52e543ac2fe378b4582785303a8245cb60 (diff)
RTP Stream Dialog: Start of call can be shown as Time of Day
Start of call column is shown as seconds from start of capture nowadays. This patch add option to show it as Time of Day. It adds symetry to other voice processing dialogs
Diffstat (limited to 'ui/qt/rtp_stream_dialog.cpp')
-rw-r--r--ui/qt/rtp_stream_dialog.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp
index 8952cb4f61..a7b4f5d986 100644
--- a/ui/qt/rtp_stream_dialog.cpp
+++ b/ui/qt/rtp_stream_dialog.cpp
@@ -29,6 +29,7 @@
#include <QTextStream>
#include <QTreeWidgetItem>
#include <QTreeWidgetItemIterator>
+#include <QDateTime>
#include <ui/qt/utils/color_utils.h>
@@ -79,7 +80,8 @@ class RtpStreamTreeWidgetItem : public QTreeWidgetItem
public:
RtpStreamTreeWidgetItem(QTreeWidget *tree, rtpstream_info_t *stream_info) :
QTreeWidgetItem(tree, rtp_stream_type_),
- stream_info_(stream_info)
+ stream_info_(stream_info),
+ tod_(0)
{
drawData();
}
@@ -99,7 +101,13 @@ public:
setText(dst_addr_col_, calc.dst_addr_str);
setText(dst_port_col_, QString::number(calc.dst_port));
setText(ssrc_col_, QString("0x%1").arg(calc.ssrc, 0, 16));
- setText(start_time_col_, QString::number(calc.start_time_ms, 'f', 6));
+ if (tod_) {
+ QDateTime abs_dt = QDateTime::fromMSecsSinceEpoch(nstime_to_msec(&stream_info_->start_fd->abs_ts));
+ setText(start_time_col_, QString("%1")
+ .arg(abs_dt.toString("yyyy-MM-dd hh:mm:ss.zzz")));
+ } else {
+ setText(start_time_col_, QString::number(calc.start_time_ms, 'f', 6));
+ }
setText(duration_col_, QString::number(calc.duration_ms, 'f', prefs.gui_decimal_places1));
setText(payload_col_, calc.all_payload_type_names);
setText(packets_col_, QString::number(calc.packet_count));
@@ -220,9 +228,15 @@ public:
return QTreeWidgetItem::operator <(other);
}
+ void setTOD(gboolean tod)
+ {
+ tod_ = tod;
+ }
+
private:
rtpstream_info_t *stream_info_;
guint32 lost_;
+ gboolean tod_;
};
RtpStreamDialog::RtpStreamDialog(QWidget &parent, CaptureFile &cf) :
@@ -754,6 +768,18 @@ void RtpStreamDialog::on_displayFilterCheckBox_toggled(bool checked _U_)
cap_file_.retapPackets();
}
+void RtpStreamDialog::on_todCheckBox_toggled(bool checked)
+{
+ QTreeWidgetItemIterator iter(ui->streamTreeWidget);
+ while (*iter) {
+ RtpStreamTreeWidgetItem *rsti = static_cast<RtpStreamTreeWidgetItem*>(*iter);
+ rsti->setTOD(checked);
+ rsti->drawData();
+ ++iter;
+ }
+ ui->streamTreeWidget->resizeColumnToContents(start_time_col_);
+}
+
void RtpStreamDialog::showPlayer()
{
rtpstream_info_t stream_info;