aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_analysis_dialog.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-10-08 11:31:42 -0700
committerGerald Combs <gerald@wireshark.org>2015-10-08 20:14:35 +0000
commitf274902be581b52db68c66f4864d85b7ea8fefe4 (patch)
treeec178b5a5e9ece6c00d7ea78f8005b085b4cf992 /ui/qt/rtp_analysis_dialog.cpp
parent03d853400c61f6784e6ccf37fe5a5ba7f7da312a (diff)
Qt: Add a play button to the RTP Stream Analysis dialog.
Rename the "Play Call" button to "Play Streams". Move the button creation code to a common routine. Use it to add a "Play Streams" button to the RTP Stream Analysis, similar to the GTK+ UI. Don't restrict RTP to IPv[46] as suggested by Michal. I don't have any RTP-over-Bluetooth captures so I can't test this directly. Change-Id: I4703cac1d5bf5b3ff0255d36da2c5164feb0547d Reviewed-on: https://code.wireshark.org/review/10888 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/rtp_analysis_dialog.cpp')
-rw-r--r--ui/qt/rtp_analysis_dialog.cpp47
1 files changed, 41 insertions, 6 deletions
diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp
index 10d374628f..caf54d0839 100644
--- a/ui/qt/rtp_analysis_dialog.cpp
+++ b/ui/qt/rtp_analysis_dialog.cpp
@@ -45,6 +45,7 @@
#include "color_utils.h"
#include "qt_ui_utils.h"
+#include "rtp_player_dialog.h"
#include "stock_icon.h"
#include "wireshark_application.h"
@@ -247,9 +248,11 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf) :
port_src_fwd_(0),
port_dst_fwd_(0),
ssrc_fwd_(0),
+ stream_fwd_(0),
port_src_rev_(0),
port_dst_rev_(0),
- ssrc_rev_(0)
+ ssrc_rev_(0),
+ stream_rev_(0)
{
ui->setupUi(this);
setWindowSubtitle(tr("RTP Stream Analysis"));
@@ -258,6 +261,8 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf) :
resize(parent.width() * 4 / 5, parent.height() * 4 / 5);
ui->progressFrame->hide();
+ player_button_ = RtpPlayerDialog::addPlayerButton(ui->buttonBox);
+
stream_ctx_menu_.addAction(ui->actionGoToPacket);
stream_ctx_menu_.addAction(ui->actionNextProblem);
stream_ctx_menu_.addSeparator();
@@ -337,7 +342,7 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf) :
save_menu->addAction(ui->actionSaveGraph);
ui->buttonBox->button(QDialogButtonBox::Save)->setMenu(save_menu);
- const gchar *filter_text = "rtp && rtp.version && rtp.ssrc && (ip || ipv6)";
+ const gchar *filter_text = "rtp && rtp.version && rtp.ssrc";
dfilter_t *sfcode;
gchar *err_msg;
@@ -411,7 +416,6 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf) :
rtpstream_scan(&tapinfo_, cap_file_.capFile(), NULL);
num_streams_ = 0;
- GList *filtered_list = NULL;
for (GList *strinfo_list = g_list_first(tapinfo_.strinfo_list); strinfo_list; strinfo_list = g_list_next(strinfo_list)) {
rtp_stream_info_t * strinfo = (rtp_stream_info_t*)(strinfo_list->data);
if (ADDRESSES_EQUAL(&(strinfo->src_addr), &(src_fwd_))
@@ -420,7 +424,7 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf) :
&& (strinfo->dest_port == port_dst_fwd_))
{
++num_streams_;
- filtered_list = g_list_prepend(filtered_list, strinfo);
+ stream_fwd_ = strinfo;
}
if (ADDRESSES_EQUAL(&(strinfo->src_addr), &(src_rev_))
@@ -429,9 +433,10 @@ RtpAnalysisDialog::RtpAnalysisDialog(QWidget &parent, CaptureFile &cf) :
&& (strinfo->dest_port == port_dst_rev_))
{
++num_streams_;
- filtered_list = g_list_append(filtered_list, strinfo);
- if (ssrc_rev_ == 0)
+ if (ssrc_rev_ == 0) {
ssrc_rev_ = strinfo->ssrc;
+ stream_rev_ = strinfo;
+ }
}
}
@@ -501,6 +506,13 @@ void RtpAnalysisDialog::updateWidgets()
ui->actionSaveForwardCsv->setEnabled(enable_save_fwd_csv);
ui->actionSaveReverseCsv->setEnabled(enable_save_rev_csv);
+#if defined(QT_MULTIMEDIA_LIB)
+ player_button_->setEnabled(stream_fwd_ != 0);
+#else
+ player_button_->setEnabled(false);
+ player_button_->setText(tr("No Audio"));
+#endif
+
ui->tabWidget->setEnabled(enable_tab);
hint.prepend("<small><i>");
hint.append("</i></small>");
@@ -657,6 +669,13 @@ 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);
@@ -1026,6 +1045,22 @@ void RtpAnalysisDialog::updateGraph()
ui->streamGraph->replot();
}
+void RtpAnalysisDialog::showPlayer()
+{
+#ifdef QT_MULTIMEDIA_LIB
+ if (!stream_fwd_) return;
+
+ RtpPlayerDialog rtp_player_dialog(*this, cap_file_);
+
+ rtp_player_dialog.addRtpStream(stream_fwd_);
+ if (stream_rev_) rtp_player_dialog.addRtpStream(stream_rev_);
+
+ connect(&rtp_player_dialog, SIGNAL(goToPacket(int)), this, SIGNAL(goToPacket(int)));
+
+ rtp_player_dialog.exec();
+#endif // QT_MULTIMEDIA_LIB
+}
+
// rtp_analysis.c:copy_file
enum { save_audio_none_, save_audio_au_, save_audio_raw_ };
void RtpAnalysisDialog::saveAudio(RtpAnalysisDialog::StreamDirection direction)