diff options
author | Jirka Novak <j.novak@netsystem.cz> | 2020-12-26 15:36:41 +0100 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2020-12-28 22:18:59 +0000 |
commit | 9443c14247d13e6d93f93ad35583350cab2d9917 (patch) | |
tree | b0517f0689add7be81838cebebb108e7d346aa4c /ui/qt/rtp_stream_dialog.cpp | |
parent | c657a6f5e7a8ba32a7788787b25146e0d9fa4b5f (diff) |
RTP: Added 'Play Streams' button to 'RTP Streams' dialog
When capture contains just RTP streams without signalizations, there
is no way how to play many streams in one player (Analyze button plays
just two streams). This patch adds Play Streams button to dialog and
allows a user to select as many streams they wish.
Diffstat (limited to 'ui/qt/rtp_stream_dialog.cpp')
-rw-r--r-- | ui/qt/rtp_stream_dialog.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ui/qt/rtp_stream_dialog.cpp b/ui/qt/rtp_stream_dialog.cpp index 58a0af843c..5ef4ceedb0 100644 --- a/ui/qt/rtp_stream_dialog.cpp +++ b/ui/qt/rtp_stream_dialog.cpp @@ -216,6 +216,8 @@ RtpStreamDialog::RtpStreamDialog(QWidget &parent, CaptureFile &cf) : setWindowSubtitle(tr("RTP Streams")); ui->streamTreeWidget->installEventFilter(this); + player_button_ = RtpPlayerDialog::addPlayerButton(ui->buttonBox); + ctx_menu_.addAction(ui->actionSelectNone); ctx_menu_.addAction(ui->actionFindReverse); ctx_menu_.addAction(ui->actionGoToSetup); @@ -411,6 +413,13 @@ void RtpStreamDialog::updateWidgets() ui->actionCopyAsYaml->setEnabled(has_data); ui->actionAnalyze->setEnabled(selected); +#if defined(QT_MULTIMEDIA_LIB) + player_button_->setEnabled(selected); +#else + player_button_->setEnabled(false); + player_button_->setText(tr("No Audio")); +#endif + WiresharkDialog::updateWidgets(); } @@ -653,6 +662,8 @@ void RtpStreamDialog::on_buttonBox_clicked(QAbstractButton *button) on_actionExportAsRtpDump_triggered(); } else if (button == analyze_button_) { on_actionAnalyze_triggered(); + } else if (button == player_button_) { + showPlayer(); } } @@ -661,6 +672,40 @@ void RtpStreamDialog::on_buttonBox_helpRequested() wsApp->helpTopicAction(HELP_RTP_ANALYSIS_DIALOG); } +void RtpStreamDialog::showPlayer() +{ + rtpstream_info_t stream_info; + RtpPlayerDialog *rtp_player_dialog; + + if (ui->streamTreeWidget->selectedItems().count() < 1) return; +#ifdef QT_MULTIMEDIA_LIB + rtp_player_dialog = new RtpPlayerDialog(*this, cap_file_); + + // Gather up our selected streams... + foreach(QTreeWidgetItem *ti, ui->streamTreeWidget->selectedItems()) { + RtpStreamTreeWidgetItem *rsti = static_cast<RtpStreamTreeWidgetItem*>(ti); + rtpstream_info_t *selected_stream = rsti->streamInfo(); + if (selected_stream) { + rtpstream_info_init(&stream_info); + rtpstream_id_copy(&selected_stream->id, &stream_info.id); + stream_info.packet_count = selected_stream->packet_count; + stream_info.setup_frame_number = selected_stream->setup_frame_number; + nstime_copy(&stream_info.start_rel_time, &selected_stream->start_rel_time); + nstime_copy(&stream_info.stop_rel_time, &selected_stream->stop_rel_time); + nstime_copy(&stream_info.start_abs_time, &selected_stream->start_abs_time); + rtp_player_dialog->addRtpStream(&stream_info); + } + } + + connect(rtp_player_dialog, SIGNAL(goToPacket(int)), this, SIGNAL(goToPacket(int))); + + 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 +} + /* * Editor modelines * |