Commit Graph

32 Commits

Author SHA1 Message Date
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 c06bfeae0a RTP: Code cleanup 2
Removed unused items.

Change-Id: Ic83d7bfae12424f11e3fc2a9a678c28a0ff6b72e
Reviewed-on: https://code.wireshark.org/review/28345
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-20 13:19:46 +00:00
Jiri Novak 1b4b5e59e9 RTP: Encapsulation of comparsion of two rtpstreams
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-20 08:26:31 +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
Roland Knall 3a928f1f87 Qt: Remove checks for version below 5.2
This stops the main source from being buildable by Qt 4.x

Change-Id: I61edbae04ac2b3bf0ae8ee8e09d335083945c176
Reviewed-on: https://code.wireshark.org/review/26756
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-04-05 18:48:57 +00:00
Peter Wu 802223829e tap: fix remaining potential memleaks with register_tap_listener
Additionally, add an attribute to the tap function to prevent future
callers from leaking this memory.

Change-Id: Ief6af2bbc74d19153628f09d7b273e85cb2284ab
Reviewed-on: https://code.wireshark.org/review/26642
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-27 04:51:00 +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
Jens Kilian e9b8a5839f Qt: Fix errors when compiling for Qt4.
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-08-31 12:02:41 +00:00
Roland Knall ddfc1d37cc Qt: Move utils to separate utils directory
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-26 10:11:55 +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
Erik de Jong 9e35c0bc8b Fix QT UI bugs in RTP dialogs
- 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-03-23 11:53:03 +00:00
Roland Knall 3df81a0550 Qt: Remove unneccessary Q_DECLARE_METATYPE
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>
2017-01-12 16:04:00 +00:00
Jiri Novak 7ad655c9b6 rtp_player_dialog.cpp: fix usage of unsupported method 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-12 23:10:13 +00:00
Gerald Combs 0af0532ccd Qt: Fixup the currentOutputDeviceName Q_PROPERTY.
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-07 19:48:54 +00:00
Gerald Combs d59653f8d5 Qt: Make the RTP player output device selectable.
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-06 22:36:55 +00:00
Peter Wu f5e22a1487 codecs: Add support for G.722 and G.726
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-12-06 17:51:47 +00:00
Martin Kaiser dda2acc06f qt: use #include <file.h> for generated include files
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-13 21:17:06 +00:00
Gerald Combs 0ec5a271ea Qt: RTP audio stream fixups.
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-06-06 23:37:01 +00:00
Stig Bjørlykke 1a716800e3 Qt: Add dialog geometry restore
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>
2016-02-28 18:25:50 +00:00
Gerald Combs 79f7edba15 Qt: Don't expose ColorUtils::graph_colors_.
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-12-01 05:17:59 +00:00
Peter Wu 0fef9d752f Fix crash in RTP Player on stop and close
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-11-17 22:49:35 +00:00
Gerald Combs 2ccb9d2d95 Add jitter logic to RtpAudioStream.
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-27 18:00:32 +00:00
Gerald Combs 8682eb49ef Split RTP player tapping, decoding, and plotting.
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-21 17:52:15 +00:00
Gerald Combs fe3e0df160 RTP player: Always include QPushButton.
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-12 17:33:31 +00:00
Gerald Combs 5bdfb5c36b Make sure we can compile without QtMultimedia.
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-09 22:34:30 +00:00
Gerald Combs f274902be5 Qt: Add a play button to the RTP Stream Analysis dialog.
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-08 20:14:35 +00:00
João Valverde c00420efa2 Move utf8_entities.h to wsutil
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-05 14:34:53 +00:00
Peter Wu 5b1d142f52 Fix warnings introduced by "Qt: Initial RTP playback"
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-05 03:21:46 +00:00
YFdyh000 908cdc68a1 Fix typos in rtp_player_dialog files
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-05 03:17:05 +00:00
Gerald Combs 3687d39304 Qt: Initial RTP playback.
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>
2015-10-02 18:26:05 +00:00