Wireshark  4.3.0
The Wireshark network protocol analyzer
rtp_stream_dialog.h
Go to the documentation of this file.
1 
10 #ifndef RTP_STREAM_DIALOG_H
11 #define RTP_STREAM_DIALOG_H
12 
13 #include "wireshark_dialog.h"
14 
15 #include <mutex>
16 
17 #include "ui/rtp_stream.h"
18 #include "rtp_player_dialog.h"
19 
20 #include <QToolButton>
21 #include <QMenu>
22 
23 namespace Ui {
24 class RtpStreamDialog;
25 }
26 
27 // Singleton by https://refactoring.guru/design-patterns/singleton/cpp/example#example-1
29 {
30  Q_OBJECT
31 
32 public:
36  static RtpStreamDialog *openRtpStreamDialog(QWidget &parent, CaptureFile &cf, QObject *packet_list);
37 
41  RtpStreamDialog(RtpStreamDialog &other) = delete;
42  void operator=(const RtpStreamDialog &) = delete;
43 
44  // Caller must provide ids which are immutable to recap
45  void selectRtpStream(QVector<rtpstream_id_t *> stream_ids);
46  // Caller must provide ids which are immutable to recap
47  void deselectRtpStream(QVector<rtpstream_id_t *> stream_ids);
48 
49 signals:
50  // Tells the packet list to redraw. An alternative might be to add a
51  // cf_packet_marked callback to file.[ch] but that's synchronous and
52  // might incur too much overhead.
53  void packetsMarked();
54  void updateFilter(QString filter, bool force = false);
55  void goToPacket(int packet_num);
56  void rtpPlayerDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
57  void rtpPlayerDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_ids);
58  void rtpPlayerDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_ids);
59  void rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_infos);
60  void rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_infos);
61  void rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_infos);
62 
63 public slots:
64  void displayFilterSuccess(bool success);
65  void rtpPlayerReplace();
66  void rtpPlayerAdd();
67  void rtpPlayerRemove();
68  void rtpAnalysisReplace();
69  void rtpAnalysisAdd();
70  void rtpAnalysisRemove();
71 
72 protected:
73  explicit RtpStreamDialog(QWidget &parent, CaptureFile &cf);
74  ~RtpStreamDialog();
75 
76  bool eventFilter(QObject *obj, QEvent *event);
77  void captureFileClosing();
78  void captureFileClosed();
79 
80 private:
81  static RtpStreamDialog *pinstance_;
82  static std::mutex mutex_;
83 
84  Ui::RtpStreamDialog *ui;
85  rtpstream_tapinfo_t tapinfo_;
86  QToolButton *find_reverse_button_;
87  QPushButton *prepare_button_;
88  QPushButton *export_button_;
89  QPushButton *copy_button_;
90  QToolButton *analyze_button_;
91  QToolButton *player_button_;
92  QMenu ctx_menu_;
93  bool need_redraw_;
94  QList<rtpstream_id_t> last_selected_;
95 
96  static void tapReset(rtpstream_tapinfo_t *tapinfo);
97  static void tapDraw(rtpstream_tapinfo_t *tapinfo);
98  static void tapMarkPacket(rtpstream_tapinfo_t *tapinfo, frame_data *fd);
99 
100  void updateStreams();
101  void updateWidgets();
102  void showPlayer();
103 
104  void setRtpStreamSelection(rtpstream_id_t *id, bool state);
105 
106  QList<QVariant> streamRowData(int row) const;
107  void freeLastSelected();
108  void invertSelection();
109  QVector<rtpstream_id_t *>getSelectedRtpIds();
110 
111 private slots:
112  void showStreamMenu(QPoint pos);
113  void on_actionCopyAsCsv_triggered();
114  void on_actionCopyAsYaml_triggered();
115  void on_actionFindReverseNormal_triggered();
116  void on_actionFindReversePair_triggered();
117  void on_actionFindReverseSingle_triggered();
118  void on_actionGoToSetup_triggered();
119  void on_actionMarkPackets_triggered();
120  void on_actionPrepareFilter_triggered();
121  void on_streamTreeWidget_itemSelectionChanged();
122  void on_buttonBox_helpRequested();
123  void on_actionExportAsRtpDump_triggered();
124  void captureEvent(CaptureEvent e);
125  void displayFilterCheckBoxToggled(bool checked);
126  void on_todCheckBox_toggled(bool checked);
127  void on_actionSelectAll_triggered();
128  void on_actionSelectInvert_triggered();
129  void on_actionSelectNone_triggered();
130  void on_actionAnalyze_triggered();
131 };
132 
133 #endif // RTP_STREAM_DIALOG_H
Definition: capture_event.h:21
Definition: capture_file.h:21
Definition: rtp_stream_dialog.h:29
void captureFileClosed()
Called when the capture file was closed. This can be used to enable or disable widgets according to t...
Definition: rtp_stream_dialog.cpp:731
static RtpStreamDialog * openRtpStreamDialog(QWidget &parent, CaptureFile &cf, QObject *packet_list)
Definition: rtp_stream_dialog.cpp:307
void captureFileClosing()
Called when the capture file is about to close. This can be used to disconnect taps and similar actio...
Definition: rtp_stream_dialog.cpp:724
RtpStreamDialog(RtpStreamDialog &other)=delete
Definition: wireshark_dialog.h:35
Definition: rtp_stream_id.h:33
Definition: rtp_stream.h:87