10 #ifndef RTP_PLAYER_DIALOG_H
11 #define RTP_PLAYER_DIALOG_H
26 #include <QTreeWidgetItem>
28 #include <ui/qt/widgets/qcustomplot.h>
30 #ifdef QT_MULTIMEDIA_LIB
31 # if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
32 # include <QAudioDevice>
34 # include <QAudioDeviceInfo>
42 class QCPItemStraightLine;
43 class QDialogButtonBox;
47 class QCPAxisTickerDateTime;
61 save_mode_from_cursor,
62 save_mode_sync_stream,
70 #ifdef QT_MULTIMEDIA_LIB
71 Q_PROPERTY(QString currentOutputDeviceName READ currentOutputDeviceName)
91 static QToolButton *
addPlayerButton(QDialogButtonBox *button_box, QDialog *dialog);
93 #ifdef QT_MULTIMEDIA_LIB
106 void replaceRtpStreams(QVector<rtpstream_id_t *> stream_ids);
107 void addRtpStreams(QVector<rtpstream_id_t *> stream_ids);
108 void removeRtpStreams(QVector<rtpstream_id_t *> stream_ids);
114 void packetsMarked();
115 void updateFilter(QString filter,
bool force =
false);
116 void goToPacket(
int packet_num);
117 void rtpAnalysisDialogReplaceRtpStreams(QVector<rtpstream_id_t *> stream_infos);
118 void rtpAnalysisDialogAddRtpStreams(QVector<rtpstream_id_t *> stream_infos);
119 void rtpAnalysisDialogRemoveRtpStreams(QVector<rtpstream_id_t *> stream_infos);
122 void rtpAnalysisReplace();
123 void rtpAnalysisAdd();
124 void rtpAnalysisRemove();
129 #ifdef QT_MULTIMEDIA_LIB
132 virtual void showEvent(QShowEvent *);
133 void contextMenuEvent(QContextMenuEvent *event);
134 bool eventFilter(QObject *obj, QEvent *event);
144 void rescanPackets(
bool rescale_axes =
false);
145 void createPlot(
bool rescale_axes =
false);
146 void updateWidgets();
147 void itemEntered(QTreeWidgetItem *item,
int column);
148 void mouseMovePlot(QMouseEvent *event);
149 void graphClicked(QMouseEvent *event);
150 void graphDoubleClicked(QMouseEvent *event);
151 void plotClicked(QCPAbstractPlottable *plottable,
int dataIndex, QMouseEvent *event);
152 void updateHintLabel();
155 void playFinished(RtpAudioStream *
stream, QAudio::Error error);
157 void setPlayPosition(
double secs);
158 void setPlaybackError(
const QString playback_error);
159 void changeAudioRoutingOnItem(QTreeWidgetItem *ti,
AudioRouting new_audio_routing);
160 void changeAudioRouting(
AudioRouting new_audio_routing);
161 void invertAudioMutingOnItem(QTreeWidgetItem *ti);
162 void on_playButton_clicked();
163 void on_pauseButton_clicked();
164 void on_stopButton_clicked();
165 void on_actionReset_triggered();
166 void on_actionZoomIn_triggered();
167 void on_actionZoomOut_triggered();
168 void on_actionMoveLeft10_triggered();
169 void on_actionMoveRight10_triggered();
170 void on_actionMoveLeft1_triggered();
171 void on_actionMoveRight1_triggered();
172 void on_actionGoToPacket_triggered();
173 void on_actionGoToSetupPacketPlot_triggered();
174 void on_actionGoToSetupPacketTree_triggered();
175 void on_actionRemoveStream_triggered();
176 void on_actionAudioRoutingP_triggered();
177 void on_actionAudioRoutingL_triggered();
178 void on_actionAudioRoutingLR_triggered();
179 void on_actionAudioRoutingR_triggered();
180 void on_actionAudioRoutingMute_triggered();
181 void on_actionAudioRoutingUnmute_triggered();
182 void on_actionAudioRoutingMuteInvert_triggered();
183 void on_streamTreeWidget_itemSelectionChanged();
184 void on_streamTreeWidget_itemDoubleClicked(QTreeWidgetItem *item,
const int column);
185 void on_outputDeviceComboBox_currentTextChanged(
const QString &);
186 void on_outputAudioRate_currentTextChanged(
const QString &);
187 void on_jitterSpinBox_valueChanged(
double);
188 void on_timingComboBox_currentIndexChanged(
int);
189 void on_todCheckBox_toggled(
bool checked);
190 void on_buttonBox_helpRequested();
191 void on_actionSelectAll_triggered();
192 void on_actionSelectInvert_triggered();
193 void on_actionSelectNone_triggered();
195 void on_actionPlay_triggered();
196 void on_actionStop_triggered();
197 void on_actionSaveAudioFromCursor_triggered();
198 void on_actionSaveAudioSyncStream_triggered();
199 void on_actionSaveAudioSyncFile_triggered();
200 void on_actionSavePayload_triggered();
201 void on_actionSelectInaudible_triggered();
202 void on_actionDeselectInaudible_triggered();
203 void on_actionPrepareFilter_triggered();
204 void on_actionReadCapture_triggered();
206 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
207 void sinkStateChanged();
213 static std::mutex init_mutex_;
214 static std::mutex run_mutex_;
216 #ifdef QT_MULTIMEDIA_LIB
217 Ui::RtpPlayerDialog *ui;
218 QMenu *graph_ctx_menu_;
219 QMenu *list_ctx_menu_;
220 double first_stream_rel_start_time_;
221 double first_stream_abs_start_time_;
222 double first_stream_rel_stop_time_;
223 double streams_length_;
224 double start_marker_time_;
225 double start_marker_time_play_;
226 QCPItemStraightLine *cur_play_pos_;
227 QCPItemStraightLine *start_marker_pos_;
228 QString playback_error_;
229 QSharedPointer<QCPAxisTicker> number_ticker_;
230 QSharedPointer<QCPAxisTickerDateTime> datetime_ticker_;
231 bool stereo_available_;
232 QList<RtpAudioStream *> playing_streams_;
233 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
234 QAudioSink *marker_stream_;
235 QTimer notify_timer_;
236 qint64 notify_timer_start_diff_;
238 QAudioOutput *marker_stream_;
240 quint32 marker_stream_requested_out_rate_;
241 QTreeWidgetItem *last_ti_;
242 bool listener_removed_;
243 QPushButton *read_btn_;
244 QToolButton *inaudible_btn_;
245 QToolButton *analyze_btn_;
246 QPushButton *prepare_btn_;
247 QPushButton *export_btn_;
248 QMultiHash<guint, RtpAudioStream *> stream_hash_;
251 bool read_capture_enabled_;
252 double silence_skipped_time_;
260 static void tapDraw(
void *tapinfo_ptr);
263 void zoomXAxis(
bool in);
264 void panXAxis(
int x_pixels);
265 const QString getFormatedTime(
double f_time);
266 const QString getFormatedHoveredTime();
267 int getHoveredPacket();
268 QString currentOutputDeviceName();
269 double getStartPlayMarker();
270 void drawStartPlayMarker();
271 void setStartPlayMarker(
double new_time);
273 void formatAudioRouting(QTreeWidgetItem *ti,
AudioRouting audio_routing);
274 bool isStereoAvailable();
275 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
276 QAudioSink *getSilenceAudioOutput();
277 QAudioDevice getCurrentDeviceInfo();
279 QAudioOutput *getSilenceAudioOutput();
280 QAudioDeviceInfo getCurrentDeviceInfo();
282 QTreeWidgetItem *findItemByCoords(QPoint point);
283 QTreeWidgetItem *findItem(QCPAbstractPlottable *plottable);
284 void handleItemHighlight(QTreeWidgetItem *ti,
bool scroll);
285 void highlightItem(QTreeWidgetItem *ti,
bool highlight);
286 void invertSelection();
287 void handleGoToSetupPacket(QTreeWidgetItem *ti);
289 void removeRow(QTreeWidgetItem *ti);
290 void fillAudioRateMenu();
291 void cleanupMarkerStream();
293 qint64 saveAudioHeaderAU(QFile *save_file, quint32 channels,
unsigned audio_rate);
294 qint64 saveAudioHeaderWAV(QFile *save_file, quint32 channels,
unsigned audio_rate, qint64 samples);
295 bool writeAudioSilenceSamples(QFile *out_file, qint64 samples,
int stream_count);
296 bool writeAudioStreamsSamples(QFile *out_file, QVector<RtpAudioStream *> streams,
bool swap_bytes);
297 save_audio_t selectFileAudioFormatAndName(QString *file_path);
298 save_payload_t selectFilePayloadFormatAndName(QString *file_path);
299 QVector<RtpAudioStream *>getSelectedAudibleNonmutedAudioStreams();
300 void saveAudio(save_mode_t save_mode);
304 void selectInaudible(
bool select);
305 QVector<rtpstream_id_t *>getSelectedRtpStreamIDs();
306 void fillTappedColumns();
310 Ui::RtpPlayerDialog *ui;
Definition: rtp_audio_routing.h:28
Definition: capture_event.h:20
Definition: capture_file.h:23
Definition: rtp_player_dialog.h:68
static RtpPlayerDialog * openRtpPlayerDialog(QWidget &parent, CaptureFile &cf, QObject *packet_list, bool capture_running)
Definition: rtp_player_dialog.cpp:147
RtpPlayerDialog(RtpPlayerDialog &other)=delete
static QToolButton * addPlayerButton(QDialogButtonBox *button_box, QDialog *dialog)
Common routine to add a "Play call" button to a QDialogButtonBox.
Definition: rtp_player_dialog.cpp:352
Definition: wireshark_dialog.h:35
Definition: packet_info.h:44
Definition: packet-rtp.h:29
Definition: rtp_stream_id.h:33
Definition: rtp_stream.h:40
Definition: epan_dissect.h:28
tap_packet_status
Definition: tap.h:25