aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_audio_stream.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-02-25Fix lots of spellingsMartin Mathieson1-1/+1
2023-07-09codecs: Change interface, use SDP information for dynamic codecsJohn Thacker1-0/+2
RTP static registered payload types fully describe the codec, including clock rate and channels. For the payload formats that use dynamic payload type number assignment, while some formats have a fixed (or normal) clock rate and number of audio channels, there are some codecs that can accept several possible values. Change the codec plugin interface to accept these parameters, and move the codec-specific state to a member of a new struct. As an example, use this to implement the L16 media type for other clock rates and number of audio channels, both the standard PT=10 stereo type as well as other clock rates negotiated via a dynamic type. (See sip-rtp-l16.pcap on the SampleCaptures wiki page for an example.) Note that RTP Player doesn't support codecs returning output with more than one channel currently, so downmix to mono. The next step is adding the format parameters from fmtp to this. (See #17608)
2023-06-27RTP Player: Init resampler if it doesn't exist yetJohn Thacker1-11/+18
Check if the resampler has been initialized before trying to resample. If input rate of RTP stream changes more than once, second and later changes was using transcoder with incorrect input rate. The issue was found during solving of #19170. Changes: - input rate is remembered when resampler is initiated - resampler is reinitiated every time input rate changes - as consequence it makes no sense to keep resampler as instance property so it was moved as local variable of decodeAudio() Fix #19170
2022-12-16Windows: Use SpeexDSP binary packageJoão Valverde1-4/+0
Remove bundled code and use vcpkg binary library instead.
2022-10-08RTP Player: Fix: Only silence played on Windows with Qt 6.xj.novak@netsystem.cz1-0/+5
2022-07-21RTP player: fixed issue with no audio card available in Qt6Jirka Novak1-3/+4
2022-07-21Qt: Update the RTP stream UI to support Qt6Multimedia.Gerald Combs1-5/+75
Fixes #18115
2021-10-11Qt: Use new-style signals+slots in more places.Gerald Combs1-1/+1
2021-08-21RTP Player: Fix of resampling for visual waveformJirka Novak1-2/+2
When capture was longer (e.g. 800s), audio was decoded correctly, but visual waveform was shown incorrectly. Reason was exceeding range of guint32 during calculation. Calculation is now made in guint64 and then put back to guint32.
2021-05-03RTP Player: Player is able to skip silence during playbackJirka Novak1-0/+12
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-04-26RTP Player: Settings for enabling use of disk as temporarly storeJirka Novak1-1/+1
New advanced settings are created: - rtp_player_use_disk1 - controls if decoded samples are stored in memory or on disk. - rtp_player_use_disk2 - controls if dictionary for decoded samples is stored in memory or on disk. - documentation updated
2021-04-25RTP Player: Memory consumption improvementsJirka Novak1-122/+55
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-22RTP Player: Added button 'Refresh streams' for live capturej.novak@netsystem.cz1-28/+45
2021-04-15VoIP dialogs: Improvements and new functionsJirka Novak1-3/+11
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-14VoIP dialogs: Performance improvementsJirka Novak1-2/+3
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-13RTP Player: Parallel playlist operations avoidedJirka Novak1-16/+60
Changes: - UI is locked during adding new streams - When decoding of stream fails, it is reported in UI
2021-04-08RTP Player: Fixed issue with hanging the player at end of play on WindowsJirka Novak1-11/+12
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-01RTP Player: Added ability to save streams as .au and .wavj.novak@netsystem.cz1-0/+24
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-31RTP Player: Added ability to save streams as .au and .wavj.novak@netsystem.cz1-0/+10
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-30RTP Player: Allow a user to select output rateJirka Novak1-8/+25
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-30RTP Player: Dialog is nonmodal now and can be called multiple waysJirka Novak1-0/+11
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-27RTP Player: Decoding of audio improvedJirka Novak1-120/+141
Changes: In nearly all cases decoding match content of capture. The exception is #2270, where timestamps do not match recorded time which causes discrepancy in decoding. Decoding of audio correctly follows different soundcard rates. RTP Player shows first sample rate in each stream in place of rate of playing. Fixed incorrect time axis calculation Fixes #16837 Fixes #4960 Fixes #2270
2021-03-25wsutils: add local implementation of g_memdup2.Dario Lombardo1-2/+3
g_memdup() was deprecated and replaced with g_memdup2() in GLib 2.68, we provide our own copy of g_memdup2() for older GLib versions.
2021-03-24RTP Player: UI improvementsJirka Novak1-6/+5
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-22RTP Player: Visual waveform shows what is really playedJirka Novak1-41/+101
Visual waveform is derived from decoded audio. When audio is decoded incorrectly, waveform now shows it. E.g. on issue 14401 is now audio play aligned with waveform, but it exhibits that decoded audio is incorrect - about two times longer than pcap! Changes: - samplefile_ renamed to sample_file_ - tempfile_ is renamed to temp_file_ - decode() is separated to decodeAudio and decodeVisual - Frame info stores frame len and frame_num for every frame. We must hold it per frame as it may change in time. Info is stored in separate temp file as waveform samples.
2021-03-08Remove modelines in ui/qt.Gerald Combs1-13/+0
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-02-09RTP Player dialog improvedJirka Novak1-92/+73
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-08Refactored: Moved sample_bytes_ to rtp_media.h as SAMPLE_BYTESJirka Novak1-21/+20
2021-01-31RTP player: Doubled buffer for replay to avoid play stop caused by underrunsJirka Novak1-4/+14
Patch solves issue for case when QT plays audio faster than reads it from file. The change looks strange because there is no way how to get buffer size before starting the play. So code start the play, reads buffer and stop it. Then increases buffer size and start play again. Note: You still can receive ALSA notifications like: ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred but it do not stop audio replay.
2020-12-29RTP player: Added pause buttonJirka Novak1-0/+11
Pause button added. Button is visible only when media are played.
2020-09-05Tools: Clean up checkAPI and add ui/qt.Gerald Combs1-1/+1
Remove the --check-addtext and --build flags. They were used for checkAddTextCalls, which was removed in e2735ecfdd. Add the sources in ui/qt except for qcustomplot.{cpp,h}. Fix issues in main.cpp, rtp_audio_stream.cpp, and wireshark_zip_helper.cpp. Rename "index"es in packet-usb-hid.c.
2020-02-17Qt: initialize members (CID: 1457926).Dario Lombardo1-0/+3
Change-Id: I4c890db567a3668525bcf9915cb5687e2019c5c1 Reviewed-on: https://code.wireshark.org/review/36125 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-02-09Qt: add initializers.Dario Lombardo1-1/+2
CID: 1457926, 1446253. Change-Id: Ia9e727fd9d030b6a5db74aa5a9343c66df8c5e9b Reviewed-on: https://code.wireshark.org/review/36065 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-08rtp_player_dialog: Route audio for a stream to left/right speaker in RTP playerJirka Novak1-13/+56
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-07rtp_player: Player is able to set start of audio play by double clickJirka Novak1-14/+25
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>
2019-12-21UI: Fix compilation with Qt 5.14Orgad Shaneh1-1/+1
Change-Id: I8adae4609ff2857cb12bc803839ebb2c6afbd264 Reviewed-on: https://code.wireshark.org/review/35517 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-11-05RTP: rtp_audio_stream.cpp: fixed excess silence in visualisation on waveformJirka Novak1-2/+4
When silence is inserted to waveform (VaD, no RTP, ...), waveform is shifted to correct time in visualisation. Code was inserting silence to audio waveform too therefore following audio was shifted twice. This patch fixes it. Change-Id: I4f3e02328662f92b1dabec80ce9da31d0a839046 Reviewed-on: https://code.wireshark.org/review/34917 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-02CMake: Check for and use system SpeexDSP libraryJoão Valverde1-1/+1
Change-Id: I8443379d23a2946dd21c12e5e0bd5464ab73ca25 Reviewed-on: https://code.wireshark.org/review/31857 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-06-25RTP: Common functions for allocation/deallocation of rtpstream_info_tJiri Novak1-1/+5
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-23RTP: code cleanup 3Jiri Novak1-10/+10
*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-20RTP: Encapsulation of comparsion of two rtpstreamsJiri Novak1-15/+4
Changes: - rtpstream_id_t is introduced and its related functions. It encapsulates comparsion of two rtpstreams. - dest_* renamed to dst_* - src_port and dst_port are 16bits only. - sharkd_session.c use common id functions - IAX2 part related to RTP updated to common *id* function Change-Id: Id38728a4e5d80363480c7ce42ff9c6eaad069686 Reviewed-on: https://code.wireshark.org/review/28340 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-19RTP: Code clean upJiri Novak1-4/+4
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-05-01Fix comment end after SPDX identifierStig Bjørlykke1-1/+2
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-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
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-02Qt: use SPDX identifiers.Dario Lombardo1-14/+1
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3 Reviewed-on: https://code.wireshark.org/review/25563 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-21Qt RTP: Add the default device and adjust sample rates.Gerald Combs1-7/+27
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-04-05A bunch of "{Mac} OS X" -> "macOS" changes.Guy Harris1-1/+1
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X 10.0", for example. It was "Mac OS X" until 10.8 (although 10.7 was sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS X" from 10.8 to 10.11. Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3 Reviewed-on: https://code.wireshark.org/review/20933 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-08Qt: fix crash on undecodable RTP streamPeter Wu1-0/+5
When the sample rate is zero, a floating point exception (FPE) occurs in QAudioDeviceInfo::nearestFormat. Detect the error condition instead and show an error. Change-Id: Ie2eaa57847938fe15607fa26d0f4e08e7ddd23d1 Fixes: v2.3.0rc0-1664-gd59653f8d5 ("Qt: Make the RTP player output device selectable.") Reviewed-on: https://code.wireshark.org/review/19569 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-15Make some items that don't need to be size_t guint.Guy Harris1-1/+1
Those sizes are limited by the packet sizes we support, and we only support a maximum packet size of 2^32. This squelches some compiler warnings. Remove some casts that this renders unnecessary. Change-Id: Id9a7bcf8c2ce30bbed7be6c0e28deb9cf38002e0 Reviewed-on: https://code.wireshark.org/review/19279 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-06Qt: Make the RTP player output device selectable.Gerald Combs1-1/+41
Add a combobox for selecting the output device and populate it with our available devices. Let the user know if our output format isn't supported. Ping-Bug: 13105 Change-Id: I299c7d0f191bb66d93896338036000e2c377781f Reviewed-on: https://code.wireshark.org/review/19046 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>