aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_analysis_dialog.cpp
diff options
context:
space:
mode:
authorJirka Novak <j.novak@netsystem.cz>2021-03-27 21:01:43 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-03-30 07:57:22 +0000
commit47862d8fceffe75acb6db122dc355db084a315c6 (patch)
tree1584541fd8b5ada174055f07dfc311b56de55d3e /ui/qt/rtp_analysis_dialog.cpp
parente43058ca592a4bff238126356d38546da2e677b5 (diff)
RTP Player: Dialog is nonmodal now and can be called multiple ways
Changes: - refactored main_dialog handling of telephony dialogs - RTP Player dialog is nonmodal now and can be left open - it is possible to issue three actions on RTP Player dialog from other dialogs (other dialog have selected set of RTP streams before action) - replace - removes existing streams from RTP dialog and shows new set - add - adds new set to existing list in RTP dialog - remove - remove streams in set from list in RTP dialog - Sequence Dialog: - was modified to hold rtpstream_info_t for RTP streams - added Play button - VoIP features (RTP Play button, select/deselect RTP stream) are disabled after creation and must be enabled. It handles that RTP Play button is not shown e.g. in TCP sequence show
Diffstat (limited to 'ui/qt/rtp_analysis_dialog.cpp')
-rw-r--r--ui/qt/rtp_analysis_dialog.cpp75
1 files changed, 30 insertions, 45 deletions
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index d640f90a36..7951f4a74c 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -328,7 +328,7 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf, rtpstream
ui->actionSaveReverseAudioSyncFile->setEnabled(false);
}
- player_button_ = RtpPlayerDialog::addPlayerButton(ui->buttonBox);
+ player_button_ = RtpPlayerDialog::addPlayerButton(ui->buttonBox, this);
QPushButton *export_btn = ui->buttonBox->addButton(ui->actionExportButton->text(), QDialogButtonBox::ActionRole);
export_btn->setToolTip(ui->actionExportButton->toolTip());
@@ -442,9 +442,6 @@ void RtpAnalysisDialog::updateWidgets()
#if defined(QT_MULTIMEDIA_LIB)
player_button_->setEnabled(num_streams_ > 0 && !file_closed_);
-#else
- player_button_->setEnabled(false);
- player_button_->setText(tr("No Audio"));
#endif
ui->tabWidget->setEnabled(enable_tab);
@@ -636,13 +633,6 @@ void RtpAnalysisDialog::on_actionSaveGraph_triggered()
}
}
-void RtpAnalysisDialog::on_buttonBox_clicked(QAbstractButton *button)
-{
- if (button == player_button_) {
- showPlayer();
- }
-}
-
void RtpAnalysisDialog::on_buttonBox_helpRequested()
{
wsApp->helpTopicAction(HELP_RTP_ANALYSIS_DIALOG);
@@ -959,45 +949,40 @@ void RtpAnalysisDialog::updateGraph()
ui->streamGraph->replot();
}
-void RtpAnalysisDialog::showPlayer()
+QVector<rtpstream_info_t *>RtpAnalysisDialog::getSelectedRtpStreams()
{
-#ifdef QT_MULTIMEDIA_LIB
- if (num_streams_ < 1) return;
+ QVector<rtpstream_info_t *> stream_infos;
+
+ if (num_streams_ > 0) {
+ stream_infos << &fwd_statinfo_;
- RtpPlayerDialog *rtp_player_dialog = new RtpPlayerDialog(*this, cap_file_);
- rtpstream_info_t stream_info;
-
- // XXX We might want to create an "rtp_stream_id_t" struct with only
- // addresses, ports & SSRC.
- rtpstream_info_init(&stream_info);
- rtpstream_id_copy(&fwd_statinfo_.id, &stream_info.id);
- stream_info.packet_count = fwd_statinfo_.packet_count;
- stream_info.setup_frame_number = fwd_statinfo_.setup_frame_number;
- stream_info.rtp_stats = fwd_statinfo_.rtp_stats;
- nstime_copy(&stream_info.start_rel_time, &fwd_statinfo_.start_rel_time);
- nstime_copy(&stream_info.stop_rel_time, &fwd_statinfo_.stop_rel_time);
- nstime_copy(&stream_info.start_abs_time, &fwd_statinfo_.start_abs_time);
- rtp_player_dialog->addRtpStream(&stream_info);
-
- if (num_streams_ > 1) {
- rtpstream_info_init(&stream_info);
- rtpstream_id_copy(&rev_statinfo_.id, &stream_info.id);
- stream_info.packet_count = rev_statinfo_.packet_count;
- stream_info.setup_frame_number = rev_statinfo_.setup_frame_number;
- stream_info.rtp_stats = rev_statinfo_.rtp_stats;
- nstime_copy(&stream_info.start_rel_time, &rev_statinfo_.start_rel_time);
- nstime_copy(&stream_info.stop_rel_time, &rev_statinfo_.stop_rel_time);
- nstime_copy(&stream_info.start_abs_time, &rev_statinfo_.start_abs_time);
- rtp_player_dialog->addRtpStream(&stream_info);
+ if (num_streams_ > 1) {
+ stream_infos << &rev_statinfo_;
+ }
}
- connect(rtp_player_dialog, SIGNAL(goToPacket(int)), this, SIGNAL(goToPacket(int)));
+ return stream_infos;
+}
+
+void RtpAnalysisDialog::rtpPlayerReplace()
+{
+ if (num_streams_ < 1) return;
+
+ emit rtpPlayerDialogReplaceRtpStreams(getSelectedRtpStreams());
+}
+
+void RtpAnalysisDialog::rtpPlayerAdd()
+{
+ if (num_streams_ < 1) return;
+
+ emit rtpPlayerDialogAddRtpStreams(getSelectedRtpStreams());
+}
+
+void RtpAnalysisDialog::rtpPlayerRemove()
+{
+ if (num_streams_ < 1) return;
- rtp_player_dialog->setWindowModality(Qt::ApplicationModal);
- rtp_player_dialog->setAttribute(Qt::WA_DeleteOnClose);
- rtp_player_dialog->setMarkers();
- rtp_player_dialog->show();
-#endif // QT_MULTIMEDIA_LIB
+ emit rtpPlayerDialogRemoveRtpStreams(getSelectedRtpStreams());
}
/* Convert one packet payload to samples in row */