aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/main_window_slots.cpp
diff options
context:
space:
mode:
authorJirka Novak <j.novak@netsystem.cz>2021-04-14 15:47:07 +0200
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-04-15 21:19:51 +0000
commitc8479e41aef12427be96b7db7f4c6a9bf87d2216 (patch)
tree951ea3f46762d46aac3c4025d7e00422dcc9fe7b /ui/qt/main_window_slots.cpp
parent212ff30603e343929c4c22173c38b7149bc4998c (diff)
VoIP dialogs: Improvements and new functions
Changes: - RTP Player added to Telephony/RTP menu. - When openning RTP Analysis or RTP Player from RTP menu, just selected stream is added. When Ctrl is hold during opening, reverse stream is searched and added too. - RTP Player: Added tool to select/deselect all inaudible streams - RTP Player: Added Prepare Filter button - RTP Player: Added Analyze button - RTP Analysis: Added Prepare Filter button - documentation updated Code changes: - RTP Player::rescanPacket() is not fired multiple times during rate change and during dialog creation - Error shown in RTP player is cleared after every new decode of streams - RTP Player handles case when Qt do not emit stop stream event - "Select" menu code unified between dialogs> - RTP Player: Audio routing menu unified - buttons are connected to actions by signals() - Analyze dialog is called by list of rtpstream_id, not rtpstream_info
Diffstat (limited to 'ui/qt/main_window_slots.cpp')
-rw-r--r--ui/qt/main_window_slots.cpp83
1 files changed, 70 insertions, 13 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 22de93ace2..1818034bff 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -1275,6 +1275,7 @@ void MainWindow::setMenusForSelectedPacket()
main_ui_->actionSCTPShowAllAssociations->setEnabled(is_sctp);
main_ui_->actionSCTPFilterThisAssociation->setEnabled(is_sctp);
main_ui_->actionTelephonyRtpStreamAnalysis->setEnabled(is_rtp);
+ main_ui_->actionTelephonyRtpPlayer->setEnabled(is_rtp);
main_ui_->actionTelephonyLteRlcGraph->setEnabled(is_lte_rlc);
}
@@ -3314,6 +3315,14 @@ void MainWindow::openTelephonyRtpPlayerDialog()
connect(rtp_player_dialog_, SIGNAL(goToPacket(int)),
packet_list_, SLOT(goToPacket(int)));
+ connect(rtp_player_dialog_, SIGNAL(updateFilter(QString, bool)),
+ this, SLOT(filterPackets(QString, bool)));
+ connect(rtp_player_dialog_, SIGNAL(rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *>)),
+ this, SLOT(rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *>)));
+ connect(rtp_player_dialog_, SIGNAL(rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *>)),
+ this, SLOT(rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *>)));
+ connect(rtp_player_dialog_, SIGNAL(rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *>)),
+ this, SLOT(rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *>)));
}
rtp_player_dialog_->show();
}
@@ -3361,6 +3370,8 @@ void MainWindow::openTelephonyRtpAnalysisDialog()
connect(rtp_analysis_dialog_, SIGNAL(goToPacket(int)),
packet_list_, SLOT(goToPacket(int)));
+ connect(rtp_analysis_dialog_, SIGNAL(updateFilter(QString, bool)),
+ this, SLOT(filterPackets(QString, bool)));
connect(rtp_analysis_dialog_, SIGNAL(rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_info_t *>)),
this, SLOT(rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_info_t *>)));
connect(rtp_analysis_dialog_, SIGNAL(rtpPlayerDialogAddRtpStreams(QVector<rtpstream_info_t *>)),
@@ -3478,12 +3489,12 @@ void MainWindow::openTelephonyRtpStreamsDialog()
this, SLOT(rtpPlayerDialogAddRtpStreams(QVector<rtpstream_info_t *>)));
connect(rtp_stream_dialog_, SIGNAL(rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_info_t *>)),
this, SLOT(rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_info_t *>)));
- connect(rtp_stream_dialog_, SIGNAL(rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_info_t *>)),
- this, SLOT(rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_info_t *>)));
- connect(rtp_stream_dialog_, SIGNAL(rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_info_t *>)),
- this, SLOT(rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_info_t *>)));
- connect(rtp_stream_dialog_, SIGNAL(rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_info_t *>)),
- this, SLOT(rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_info_t *>)));
+ connect(rtp_stream_dialog_, SIGNAL(rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *>)),
+ this, SLOT(rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *>)));
+ connect(rtp_stream_dialog_, SIGNAL(rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *>)),
+ this, SLOT(rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *>)));
+ connect(rtp_stream_dialog_, SIGNAL(rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *>)),
+ this, SLOT(rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *>)));
}
rtp_stream_dialog_->show();
}
@@ -3497,9 +3508,55 @@ void MainWindow::on_actionTelephonyRtpStreams_triggered()
void MainWindow::on_actionTelephonyRtpStreamAnalysis_triggered()
{
+ QVector<rtpstream_info_t *> stream_infos;
+ QString err;
+
telephony_dialog_mutex.lock();
openTelephonyRtpAnalysisDialog();
- rtp_analysis_dialog_->findRtpStreams();
+ if (QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier)) {
+ err = findRtpStreams(&stream_infos, true);
+ } else {
+ err = findRtpStreams(&stream_infos, false);
+ }
+ if (err != NULL) {
+ QMessageBox::warning(this, tr("RTP packet search failed"),
+ err,
+ QMessageBox::Ok);
+ } else {
+ QVector<rtpstream_id_t *> ids;
+ foreach(rtpstream_info_t *stream, stream_infos) {
+ ids << &stream->id;
+ }
+ rtp_analysis_dialog_->addRtpStreams(ids);
+ }
+ foreach(rtpstream_info_t *rtpstream, stream_infos) {
+ rtpstream_info_free_data(rtpstream);
+ }
+ telephony_dialog_mutex.unlock();
+}
+
+void MainWindow::on_actionTelephonyRtpPlayer_triggered()
+{
+ QVector<rtpstream_info_t *> stream_infos;
+ QString err;
+
+ telephony_dialog_mutex.lock();
+ openTelephonyRtpPlayerDialog();
+ if (QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier)) {
+ err = findRtpStreams(&stream_infos, true);
+ } else {
+ err = findRtpStreams(&stream_infos, false);
+ }
+ if (err != NULL) {
+ QMessageBox::warning(this, tr("RTP packet search failed"),
+ err,
+ QMessageBox::Ok);
+ } else {
+ rtp_player_dialog_->addRtpStreams(stream_infos);
+ }
+ foreach(rtpstream_info_t *rtpstream, stream_infos) {
+ rtpstream_info_free_data(rtpstream);
+ }
telephony_dialog_mutex.unlock();
}
@@ -4100,27 +4157,27 @@ void MainWindow::rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_info_t *> str
telephony_dialog_mutex.unlock();
}
-void MainWindow::rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_info_t *> stream_infos)
+void MainWindow::rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids)
{
telephony_dialog_mutex.lock();
openTelephonyRtpAnalysisDialog();
- rtp_analysis_dialog_->replaceRtpStreams(stream_infos);
+ rtp_analysis_dialog_->replaceRtpStreams(stream_ids);
telephony_dialog_mutex.unlock();
}
-void MainWindow::rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_info_t *> stream_infos)
+void MainWindow::rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids)
{
telephony_dialog_mutex.lock();
openTelephonyRtpAnalysisDialog();
- rtp_analysis_dialog_->addRtpStreams(stream_infos);
+ rtp_analysis_dialog_->addRtpStreams(stream_ids);
telephony_dialog_mutex.unlock();
}
-void MainWindow::rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_info_t *> stream_infos)
+void MainWindow::rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids)
{
telephony_dialog_mutex.lock();
openTelephonyRtpAnalysisDialog();
- rtp_analysis_dialog_->removeRtpStreams(stream_infos);
+ rtp_analysis_dialog_->removeRtpStreams(stream_ids);
telephony_dialog_mutex.unlock();
}