Commit Graph

63 Commits

Author SHA1 Message Date
Jirka Novak ea91c5785a Qt6: Audio code review
Changes:
- audio rates are fixed, I selected common ones
- fixed signal names - they didn't matched expected autogenerated ones
- first play notification delay on Qt6 compensated
2022-07-21 20:09:52 +00:00
Gerald Combs b8d85227f6 Qt: Update the RTP stream UI to support Qt6Multimedia.
Fixes #18115
2022-07-21 20:09:52 +00:00
Gerald Combs 9c19f47394 Qt: Fix a couple of slot names.
QComboBox emits currentTextChanged with a QString argument, not
currentIndexChanged.

Switch to new-style connections where we can.
2022-06-21 12:20:02 -07:00
Roland Knall 2cf938cfa8 tap: Adding flags for tap_packet
This allows flags to be passed by the registering listener
to the collection of information
2022-06-10 05:46:15 +00:00
Jirka Novak 411b3c1d78 Fix: Fixed issue with deadlock when same RTP dialog opened twice
RTP dialogs can stay opened, therefore calls of its functions are
protected by locks. There was issue that same mutex was used during
construction of the dialog and calling functions. It created possible
deadlock.
Change separates lock used for dialog creation and lock for function calls.
When function call lock is locked, new calls are ignored and warning is
printed to STDERR. Showing a dialog with warning looks too intrusive to me.

Fixes #18025
2022-04-06 07:16:59 +00:00
Moshe Kaplan 3953ddcf57 Add UI header files to Doxygen
Add @file markers for UI
header files so that Doxygen will
generate documentation for them.
2021-11-30 08:01:36 -05:00
Tomasz Moń 890555b8bd Qt: Qt6.2 compatibility fixes
Wireshark successfully compiles on Windows with Qt6.2 with following
cmake options:
  -DUSE_qt6=ON -DDISABLE_ERROR=ON

QCustomPlot QT 6.2 patch is taken from QCustomPlot forum post by miccs.
2021-11-29 04:55:12 +00:00
Joerg Mayer fe01f0109d Readd feature to make QtXMultimedia optional again
In order to be able to defer solving all Qt6 API differences at once
I tried to reactivate the QT_MULTIMEDIA_LIB feature. I managed to fix
most problems but one problem remains in both Qt5 and Qt6 builds.
Without Qt[56]Multimedia, the following error exceeds my non-existing
C++ knowledge:

jmayer/work/wireshark/git/ui/qt/rtp_player_dialog.cpp:154:18: error: out-of-line definition of 'RtpPlayerDialog' does not match any declaration in 'RtpPlayerDialog'
RtpPlayerDialog::RtpPlayerDialog(QWidget &parent, CaptureFile &cf, bool capture_running) :
                 ^~~~~~~~~~~~~~~
2021-11-24 10:31:16 +00:00
Jirka Novak c01456b77e VoIP Dialogs: Refactoring of singleton windows to factory methods
Singletons moved from main_window to each class's static open<NameOfClass>
method:
- RtpPlayerDialog
- RtpStreamDialog
- VoipCallsDialog
- RtpAnalysisDialog

Fixed issue with selecting RTP stream in sequence dialog. When user
selected a stream and moved mouse to Rtp Player button and pressed it,
incorrect RTP stream was sent to it.
2021-05-22 03:08:46 +00:00
Jirka Novak 6d6b376b43 VoIP dialogs: Default actions for buttons works as before
When button is pressed or triggered by shortcut, it opens same
window as before.
User can click small arrow next to button and it open menu with all
new actions e.g. Set/Add/Remove for RTP Player.
Documentation updated.
2021-05-04 20:45:35 +00:00
Jirka Novak 4c7c377d42 RTP Player: Player is able to skip silence during playback
Code is NOT able to do VAD (Voice Activity Detection) so audio silence
(sequence of equal samples) nor noise are not recognized as silence. Just
missing RTP (Confort Noise, interupted RTP, ...) and muted streams are
recognized as silence for this feature.
User can control duration of shortest silence to skip.
Updated documentation.
2021-05-03 21:38:48 +00:00
Gerald Combs f80227861f Qt: Fix some documentation warnings. 2021-04-30 22:25:17 +00:00
Jirka Novak 21b334fd82 RTP Player: Export of audio can start at position of play cursor
Added additional option for audio exporting 'From cursor'.
Documentation updated.
2021-04-28 20:29:02 +00:00
Jirka Novak 54b7886a5e RTP Player: Memory consumption improvements
Audio for play is now decoded and stored without silence parts.

Changes:
- ui/qt/utils/rtp_audio_file.cpp created to handle silence skipping
- ui/qt/rtp_audio_stream.cpp refactored to support it
- Fixed issue with exporting streams: File synchronized export was missing
leading silence.
- No line is shown in waveform graph if there is silence
2021-04-25 19:34:52 +02:00
j.novak@netsystem.cz 0048142ea1 RTP Player: Added button 'Refresh streams' for live capture 2021-04-22 19:33:11 +00:00
Jirka Novak c8479e41ae VoIP dialogs: Improvements and new functions
Changes:
- RTP Player added to Telephony/RTP menu.
- When openning RTP Analysis or RTP Player from RTP menu, just selected
  stream is added. When Ctrl is hold during opening, reverse stream is
searched and added too.
- RTP Player: Added tool to select/deselect all inaudible streams
- RTP Player: Added Prepare Filter button
- RTP Player: Added Analyze button
- RTP Analysis: Added Prepare Filter button
- documentation updated

Code changes:
- RTP Player::rescanPacket() is not fired multiple times during rate change and during dialog creation
- Error shown in RTP player is cleared after every new decode of streams
- RTP Player handles case when Qt do not emit stop stream event
- "Select" menu code unified between dialogs>
- RTP Player: Audio routing menu unified
- buttons are connected to actions by signals()
- Analyze dialog is called by list of rtpstream_id, not rtpstream_info
2021-04-15 21:19:51 +00:00
Jirka Novak c7f5646249 VoIP dialogs: Performance improvements
Retap and UI response are much faster when many RTP streams are
processed. RTP Streams/Analyse 1000+, RTP Player 500+.

Changes:
- RTP streams are searched with hash, not by iterating over list.
- UI operations do not redraw screen after every change, just after all
  changes. UI is locked when rereading packets.
- Sample list during RTP decoding is stored in memory so wireshark uses
  just half of opened files for audio decoding than before.
- Analysis window checkbox area is limited in height
- Dialogs shows shows count of streams, count of selected streams and
  count of unmuted streams
- Documentation extended with chapter about RTP decoding parameters
- Documentation extended with performance estimates
2021-04-14 14:02:58 +00:00
Alexis La Goutte 38d279326a Fix -Wdocumentation warning 2021-04-14 14:01:49 +00:00
Jirka Novak bc96d375ab RTP Player: Parallel playlist operations avoided
Changes:
- UI is locked during adding new streams
- When decoding of stream fails, it is reported in UI
2021-04-13 13:42:57 +02:00
Jirka Novak e462b2b1c2 RTP Player: Fixed issue with hanging the player at end of play on Windows
Changes:
- Fixed issue with hanging the player. The issue is in Qt - internal
  Mutex is locked when Qt calls outputStateChanged() and you can't call
  any other action on the audio object
- Fixed issue when play marker stream was running forever
- Removed !1855 because it introduces delay on play on Windows platform
2021-04-08 12:01:38 +00:00
j.novak@netsystem.cz 2b072b8e76 RTP Stream Analysis: Process more streams than two, audio save removed 2021-04-07 05:40:09 +00:00
j.novak@netsystem.cz fe98c68224 RTP Player: UI improvements 2021-04-06 11:23:00 +00:00
j.novak@netsystem.cz 4e5f0456c6 RTP Player: Added ability to save streams as .au and .wav
Features:
- saves multiple streams (all selected and unmuted)
- saves streams same way they are played (jitter buffer, sampling, ...)
- only streams with audio (play rate >0) are exported
  - streams with play rate == 0 are silently ignored even selected for
    export
- all exported streams must use same play rate (user can change it
  before save)
2021-04-01 08:07:22 +00:00
j.novak@netsystem.cz 7e39f4eb86 RTP Player: Added ability to save streams as .au and .wav
Features:
- saves multiple streams (all selected and unmuted)
- saves streams same way they are played (jitter buffer, sampling, ...)
- only streams with audio (play rate >0) are exported
  - streams with play rate == 0 are silently ignored even selected for
    export
- all exported streams must use same play rate (user can change it
  before save)
2021-03-31 14:52:06 +00:00
Jirka Novak 7445635fdc RTP Player: Allow a user to select output rate
Tool allows a user to replay at specific rate when there is any issue
with autodetected rate by payloads.
Offered rates are provided by selected audio device.
2021-03-30 19:17:28 +00:00
Jirka Novak 47862d8fce 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
2021-03-30 07:57:22 +00:00
Jirka Novak 2a4859bd14 RTP Player: UI improvements
Changes:
- all waveforms has common scale therefore louder/quiter signal is visible
- when stream/streams are deleted from view, Y axis is rescaled and
  waveforms are rearranged to reuse empty space
2021-03-24 09:23:52 +00:00
Jirka Novak 24d59017a6 RTP Player: Added additional shortcuts
Added shortcuts:
- Mute/Unmute/Invert Mute
- Play/Pause/Stop

Removed outdated help in tooltip text. It makes no sense to use it, all
actions are available in context menu.
2021-03-11 12:44:48 +00:00
Jirka Novak 649eab2dfe RTP player: It is possible to select SETUP packet related to RTP stream
When SETUP (or related signalling packet) exists, it is selected by
Shift+G. If RTP stream is "alone", first RTP packet of the stream is
selected.
2021-03-10 15:45:12 +00:00
Jirka Novak ce786ed265 Rtp player: It is possible to select multiple rows in stream's list and graph
Changes:
- It is possible to select multiple streams in list and in graph
- Select All/None/Invert implemented in list of streams and in graph
- Indication of "Selected" stream redesigned in graph
- Mouse hovering shows related row/wave
- All operations adapted to multiselection
2021-03-09 16:49:09 +00:00
Gerald Combs d3f17ee08a Remove modelines in ui/qt.
Remove the editor modeline blocks from most of the source files in ui/qt
by running

    perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -g '\.(cpp|h)' )

then cleaning up the remaining files by hand.

This *shouldn't* affect anyone since

- All of the source files in ui/qt use 4 space indentation, which
  matches the default in our top-level .editorconfig

- The one notable editor that's likely to be used on these files and
  *doesn't* support EditorConfig (Qt Creator) defaults to 4 space
  indentation.
2021-03-08 18:11:32 +00:00
Jirka Novak 7e063b6070 RTP Player dialog improved
Functional changes:
  Audio routing information is now stored in audio stream and not in table. It
is handled by separate utils/rtp_audio_routing.cpp class which is able to
convert it between mono/stereo etc.
  There is new utils/rtp_audio_routing_filter.cpp class which is able to
route mono audio stream to any audio channel.
  Sample file separated from audio stream file - sample file is generated only
during recap. So when we need new waveform, we just use existing sample file
and no recap required - it is much faster.
  Audio stream exports just mono audio. Mono audio is then expanded to stereo
and correct channel by AudioRoutingFilter during play as required. So when
audio routing is changed, no recap and no audio export is required.
  When audio stream is muted, no audio is produced nor played.
  Most of signals between RtpPlayerDialog and RtpAudioStream were removed.
Start/Pause/Stop is processed in RtpPlayDialog (just for non muted streams).
Play possition is not received from every playing stream but from independent
silence stream.
  Added Mute/Unmute function.

Optimalization:
  When audio routing is changed, just graphs are updated. No retap nor audio
decoding is required.
  When TOD is changed, just graphs are updated. No retap nor audio decoding is
required.
2021-02-09 18:10:14 +00:00
Jirka Novak 74961582b3 RTP Player: Possibility to remove stream from RTP player
When many streams are analyzed, some streams can be found as useless during
replay. Patch adds option to remove it from list in RTP player.
Once stream is removed, it can't be returned except close/reopen RTP player
with new selection.
2021-02-05 16:10:12 +00:00
j.novak@netsystem.cz 88a86f5f01 RTP dissector: Remove unused functions
Patch removes (just comments out) functions not used by the code
as found by Martin Mathieson.
2021-02-05 09:19:48 +00:00
Gerald Combs f55813e518 Qt: Remove an unneeded semicolon. 2021-02-05 01:09:36 +00:00
Jirka Novak 1897208d34 RTP Player: Selected waveform is emphased. Waveform can be selected by click.
When there is many waveforms, it is not clear which one is selected in list.
It is important for selecting packets from graph.
Patch emphasis selected waveform. In addition, it allows to select waveform
by clicking on it.
2021-02-04 22:30:26 +00:00
Jirka Novak 68ae34fba7 RTP Player: Audio routing information refactored
Audio routing information storage refactored to separate mute information and
channel routing. It is required for next changes.
2021-02-04 22:30:26 +00:00
Jirka Novak 976c560bea RTP Player: Fix for #16452
Reason for #16452 is that RTP Player dialog is destroyed before tap
finishes when Escape key pressed. The only solution I found is to check
whether dialog does exists when tap finishes. If so, data are processed
and shown. If dialog was destroyed in meanwhile, no data processing is done.
2021-01-02 08:02:35 +00:00
Jirka Novak 3b781dbab5 rtp_player_dialog: Route audio for a stream to left/right speaker in RTP player
Column 'Play' added to player. Double click on a stream in the column changes
audio routing for the stream.
When soundcard supports only one channel, there are Mute/Play option. When
soundcard supports two or more channels, there are Mute/L/L+R/R options.
Muted channel is drawn with dotted line.

Change-Id: If120c902195da46f98a1663c589f20c6a1da0ba7
Reviewed-on: https://code.wireshark.org/review/35687
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-08 11:50:16 +00:00
Jirka Novak 71fb8bebfe rtp_player: Player is able to set start of audio play by double click
Patch adds ability to set start of audio play by double clicking on waveform.
Patch fixes unreported issue with placing waveform at incorrect place when switched relative/absolute time mode (check/uncheck Time of Day).

Change-Id: Ib8ce24aea870e2443e033afbb6d6e9fbcf222431
Reviewed-on: https://code.wireshark.org/review/35621
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-07 09:38:14 +00:00
Tomasz Moń a83ee43846 Qt: Do not use exec() in RTP dialogs
Favor asynchronous show() as it does not create new event loop.

Change-Id: I01982806f87705f04138f15ae8eb084f1d4f9b2c
Reviewed-on: https://code.wireshark.org/review/34677
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-02 20:26:43 +00:00
Alexis La Goutte ef500e800a Update to qcustomplot 2.0.1
Upgrade the internal version of QCustomPlot to 2.0.1

Change-Id: I1eb372d8e6a2f6c1bbdde4c74596785bf2d405c2
Reviewed-on: https://code.wireshark.org/review/17980
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-17 08:34:46 +00:00
Guy Harris 2d41b15495 Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed
tap's packet routine won't be called again, so they don't have to keep
track of whether they've failed themselves.

We make the return value from the packet routine an enum.

Don't have a separate type for the per-packet routine for "follow" taps;
they're expected to act like tap packet routines, so just use the type
for tap packet routines.

One tap packet routine returned -1; that's not a valid return value, and
wasn't one before this change (the return value was a boolean), so
presume the intent was "don't redraw".

Another tap routine's early return, without doing any work, returned
TRUE; this is presumably an error (no work done, no need to redraw), so
presumably it should be "don't redraw".

Clean up some white space while we're at it.

Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8
Reviewed-on: https://code.wireshark.org/review/31283
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-01 05:03:42 +00:00
Jiri Novak 87973bf516 RTP: Common functions for allocation/deallocation of rtpstream_info_t
Change-Id: I9a0a11d238473a7c57d85547dca0713ed421a500
Reviewed-on: https://code.wireshark.org/review/28417
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-25 14:16:26 +00:00
Jiri Novak 9f8c332c59 RTP: code cleanup 3
*rtp_stream* -> rtpstream to follow common name

Change-Id: I381bc1cdb8206c5cfe67e94dd7fb1a5cb25f9c16
Reviewed-on: https://code.wireshark.org/review/28394
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-23 10:03:54 +00:00
Jiri Novak 27a1906c58 RTP: Code clean up
Changes:
- rtpstream_packet renamed to rtpstream_packet_cb to follow *_cb pattern
- variables/types used in iax2_analysis_dialog were created as copy of *rtp* ones, but names were left as *rtp* -> *iax2*
- struct _rtp_stream_info replaced with rtp_stream_info_t
- there was tap-rtp-analysis.h, but no tap-rtp-analysis.c - related content was moved from tap-rtp-common.c
- *rtp_stream* functions renamed to *rtpstream*
- renamed rtp_stream_info_t to rtpstream_info_t to follow *rtpstream* pattern.
- renamed ui/rtp_stream.c rtpstream_draw -> rtpstream_draw_cb

Change-Id: Ib11ff5367cc464ea1b0c73432bc50b0eb9cd203e
Reviewed-on: https://code.wireshark.org/review/28299
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-19 15:05:12 +00:00
Stig Bjørlykke 14720ace06 Fix comment end after SPDX identifier
Move */ to a separate line below the SPDX identifier.

Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f
Reviewed-on: https://code.wireshark.org/review/27211
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:56:37 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Dario Lombardo e52172c775 Qt: use SPDX identifiers.
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:36 +00:00
Gerald Combs 28dce11948 Qt RTP: Add the default device and adjust sample rates.
In the RTP player dialog, list the default audio device first, ensure
it's selected by default and ensure that the list items are unique.
According to

http://code.qt.io/cgit/qt/qtmultimedia.git/tree/src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp?h=5.9

the default device on Windows uses the special WAVE_MAPPER id, which
appears to support various sample rates even when the underlying
hardware doesn't.

Ensuring the names are unique fixes an issue I'm seeing on a test
machine here.

When decoding, check to see if our sample rate is supported by our
output device and adjust accordingly.

Bug: 13906
Change-Id: Iddc0beb2459bfac42276ff29d227c2619b0a8d90
Reviewed-on: https://code.wireshark.org/review/22756
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-07-21 21:09:26 +00:00