aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_player_dialog.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-08-31Qt: Fix errors when compiling for Qt4.Jens Kilian1-0/+5
This allows Wireshark to be built on RedHat EL 7.2, with Qt 4.8.5. Bug: 13909 Change-Id: Ia39a288cc342afa2bd0217cb59dac84c3227086c Reviewed-on: https://code.wireshark.org/review/23322 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-26Qt: Move utils to separate utils directoryRoland Knall1-5/+5
Following the move for widgets directory, moving utils to the utils directory. Guidelines for this directory are: - Generic use but not a widget - Utility functionality used by many classes Note: additionally all includes affected by this move have been changed to absolute path includes, instead of relative ones. Change-Id: I019ae4b6e6f6d06a5745a63ed195edbd36fb936b Reviewed-on: https://code.wireshark.org/review/22602 Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2017-07-21Qt RTP: Add the default device and adjust sample rates.Gerald Combs1-11/+16
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-03-23Fix QT UI bugs in RTP dialogsErik de Jong1-1/+1
- RTP analysis and player dialogs are modal whereas they were not modal in GTK UI Only fixed calling up the RTP analysis window being modal when called from the RTP streams dialog as it is modeless when called from the menu in the main window with a stream packet selected. - Action 'Next problem packet' triggers an infinite loop when there are no 'problem packets' and first packet is selected when calling the action. - Crosshairs not implemented in RTP player/crosshairs context menu item not working. Context menu item commented out. bug: 13500 Change-Id: I0ba954f895b85605462c316e4426280ec4d437b2 Reviewed-on: https://code.wireshark.org/review/20660 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-12Qt: Remove unneccessary Q_DECLARE_METATYPERoland Knall1-3/+0
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls to QVariant conversions with VariantPointer where necessary Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec Reviewed-on: https://code.wireshark.org/review/19611 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-12-12rtp_player_dialog.cpp: fix usage of unsupported method ↵Jiri Novak1-0/+7
QComboBox::setCurrentText with Qt4.x QComboBox::setCurrentText() method is available in Qt5.x. Older versions code won't compile with it. Bug: 13235 Change-Id: Ia2e2713fefe0f2be01a0b77ff1ac39c9162fd0d1 Reviewed-on: https://code.wireshark.org/review/19219 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-07Qt: Fixup the currentOutputDeviceName Q_PROPERTY.Gerald Combs1-1/+1
The CONSTANT attribute indicates that the same value will be returned every time. That isn't the case here so remove it. Change-Id: Ie7451e6aabcb4fa1a6960762d96ad190f32b3d7a Reviewed-on: https://code.wireshark.org/review/19130 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-06Qt: Make the RTP player output device selectable.Gerald Combs1-2/+31
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>
2016-12-06codecs: Add support for G.722 and G.726Peter Wu1-1/+1
Integrate the Spandsp library for G.722 and G.726 support. Adds support for G.722 and all eight variants of G.726. Note: this also fixes a crash in Qt (buffer overrun, reading too much data) caused by confusion of the larger output buffer (resample_buff) with the smaller input buffer (decode_buff). It was not triggered before because the sample rate was always 8k, but with the addition of the new codecs, a different sample rate became possible (16k). Fix also a crash which occurs when the RTP_STREAM_DEBUG macro is enabled and the VOIP Calls dialog is opened (the begin frame, start_fd, is not yet known and therfore a NULL dereference could occur). Passes testing (plays normally without bad RTP timing errors) with SampleCaptures files: sip-rtp-g722.pcap and sip-rtp-g726.pcap. Tested with cmake (Qt), autotools (Qt and GTK+) with ASAN enabled. Bug: 5619 Change-Id: I5661908d193927bba50901079119eeff0c04991f Reviewed-on: https://code.wireshark.org/review/18939 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-06-13qt: use #include <file.h> for generated include filesMartin Kaiser1-1/+1
make sure that generated include files are picked up only from the directories set by -I (or /I), not from the current directory if we use #include "file.h", Visual Studio searches for file.h in the same diretory as the source file that includes file.h if we do an out-of-tree build with cmake and the source directory contains files from an in-tree build (done with autotools), we might end up including the wrong file Change-Id: Iaaed2626258b6ff0c12485fe3f436bd03bbb5adf Reviewed-on: https://code.wireshark.org/review/15873 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-06Qt: RTP audio stream fixups.Gerald Combs1-1/+2
Make sure audio_stream_ is non-NULL before we try to use it. Delete audio_stream_ more gracefully and add a note about mutexes on OS X and Windows. Bug: 12166 Change-Id: I12e76c49e631bc1de813c5c7d82c7d928c71237e Reviewed-on: https://code.wireshark.org/review/15759 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-02-28Qt: Add dialog geometry restoreStig Bjørlykke1-1/+1
Add GeometryStateDialog class to handle load and save dialog geometry. The QDialog class name will be used as window name. For shared classes the UAT name or the statistics title or abbr will be used. Change-Id: I5a019598307fb3861518f41e733de834788184d8 Reviewed-on: https://code.wireshark.org/review/14139 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-01Qt: Don't expose ColorUtils::graph_colors_.Gerald Combs1-1/+1
Make graph_colors_ private and accessible via getters. Blind attempt at fixing bug 11833. Bug: 11833 Change-Id: I03b7e90c686374d2d0f046f7e5fe87e43939dc82 Reviewed-on: https://code.wireshark.org/review/12318 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-17Fix crash in RTP Player on stop and closePeter Wu1-0/+17
When dragging the UI, this somehow causes a great lag. Then by spam-clicking on the Stop button, a double free seems to occur. Fix this by moving the audio cleanup to the outputStateChanged callback as documented at https://doc.qt.io/qt-5/qaudiooutput.html. Note that calling stop() in the IdleState also triggers a change event, resulting in the desired cleanup. Stop streams before the dialog is closed (via accept/reject). This *cannot* be done in the destrutor of RtpPlayerDialog because destructing QAudioOutput processes events from the event queue, resulting in preature destruction of other objects... crash. Change-Id: I6bfb33c9396e9bc1ffd346519d22390a97b6bdaf Reviewed-on: https://code.wireshark.org/review/11894 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-27Add jitter logic to RtpAudioStream.Gerald Combs1-4/+81
Copy the jitter logic from rtp_player.c to rtp_audio_stream.cpp. This still isn't correct but the RTP player should now be complete enough to start looking at the bug list at the top of rtp_player_dialog.cpp. Disable timing and jitter controls while we're playing while we're here. Fixes bug 11635. Bug: 11635 Change-Id: Ie583ade522702cbe1bbcea4475a535caa1d74fa2 Reviewed-on: https://code.wireshark.org/review/11295 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-21Split RTP player tapping, decoding, and plotting.Gerald Combs1-8/+19
In RtpAudioStream split tapping+decoding into separate member functions. Store RTP payloads in memory. In RtpPlayerDialog split tapping+plotting. This more closely resembles what we're doing in the GTK+ UI and paves the way for jitter support and other changes. Change-Id: I244c225cec8930545622e6582b7be35ebe45b237 Reviewed-on: https://code.wireshark.org/review/11195 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-12RTP player: Always include QPushButton.Gerald Combs1-3/+1
It looks like QPushButton gets included via ui_rtp_player_dialog.h in Qt 5 but not in Qt 4. Make sure we include it explicitly whether or not QT_MULTIMEDIA_LIB is defined. Change-Id: I8203a1cc6f7b9beef0f749b93836a75885f85edd Reviewed-on: https://code.wireshark.org/review/10962 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-09Make sure we can compile without QtMultimedia.Gerald Combs1-11/+15
Change-Id: I8db453a735956435fc6e2e4276961adb1f7ed11a Reviewed-on: https://code.wireshark.org/review/10892 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-08Qt: Add a play button to the RTP Stream Analysis dialog.Gerald Combs1-0/+10
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>
2015-10-05Move utf8_entities.h to wsutilJoão Valverde1-1/+1
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0 Reviewed-on: https://code.wireshark.org/review/10786 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05Fix warnings introduced by "Qt: Initial RTP playback"Peter Wu1-0/+2
Change-Id: I28ae077be535f32ef81ac370d6782033f219017d Reviewed-on: https://code.wireshark.org/review/10777 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: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05Fix typos in rtp_player_dialog filesYFdyh0001-1/+1
Change-Id: I0df33dc156601187a6a180d8786ef18c5c05467a Reviewed-on: https://code.wireshark.org/review/10787 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-02Qt: Initial RTP playback.Gerald Combs1-0/+656
Note the "initial". This is woefully incomplete. See the "to do" lists below and in the code. This differs a bit from the GTK+ version in that you specify one or more streams to be decoded. Instead of showing waveforms in individual widgets, add them all to a single QCustomPlot. This conserves screen real estate and lets us more easily take advantage of the QCP API. It also looks better IMHO. Change a bunch of checks for QtMultimediaWidgets to QtMultimedia. We probably won't use the widgets until we make 5.0 our minimum Qt version and plain old QtMultimedia lets us support Qt 4 more easily (in theory at least). Add resampling code from libspeex. I initially used this to resample each packet to match the preferred rate of our output device, but this resulted in poorer audio quality than expected. Leave it in and use to create visual samples for QCP and to match rates any time the rate changes. The latter is currently untested. Add some debugging macros. Note that both the RTP player and RTP analysis dialogs decode audio data using different code. Note that voip_calls_packet and voip_calls_init_tap appear to be dead code. To do: - Add silence frames where needed. - Implement the jitter buffer. - Implement the playback timing controls. - Tapping / scanning streams might be too slow. Change-Id: I20dd3b66d3df53c9b1f3501262dc01458849f6b4 Bug: 9007 Reviewed-on: https://code.wireshark.org/review/10458 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>