aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/codecs
AgeCommit message (Collapse)AuthorFilesLines
2024-06-19plugins/codecs: convert to C99 typesPascal Quantin5-20/+20
2024-04-19Revert "plugins: Fill in short description field"Balint Reczey9-9/+0
This reverts commit 60f1972fa3700d8d702e0f9b0df6ec1980d97ecb.
2024-04-19Revert "CMake: Refactor plugin add_library() macros"Balint Reczey9-9/+9
This reverts commit b51a3933ba8ace3f583259f5fd420a47912c86ad.
2024-04-19Revert "plugins: Add a codecs API level"Balint Reczey9-9/+18
This reverts commit 7f32c90ab9b7c6f19fb38011d5cb0b7ce815046c.
2024-04-19Revert "Rename some codec plugin folders to lowercase"Balint Reczey10-0/+0
This reverts commit 36065ab3568b309aa075caa01a838228a082b411.
2024-02-06Fix some more spelling errorsMartin Mathieson1-1/+1
2023-12-14Rename some codec plugin folders to lowercaseJoão Valverde10-0/+0
2023-12-14plugins: Add a codecs API levelJoão Valverde9-18/+9
Add a minimum and maximum API level. Backward-compatible changes to the API only bump the maximum API level. Backward incompatible changes bump the maximum API level and the mininum, to the new (maximum) level. This may allow codec plugins to continue working without recompilation, possibly with reduced functionality. The API level is only defined for codecs because it is a small and easy to define API, and very stable. Maybe we could do the same for wiretap (file type) plugins. For the various epan plugin types it seems pointless and futile. I cannot see a scenario where a new Wireshark minor release does not increase the minimum API level.
2023-12-14CMake: Refactor plugin add_library() macrosJoão Valverde9-9/+9
Replace the macro subfolder argument with type specific plugin macros.
2023-12-03plugins: Fill in short description fieldJoão Valverde9-0/+9
Fill-in the short description field for plugins that was left as a FIXME in commit 3b59ce90c31df5d77ddd4d08ad13cb0f0e818117. We should add a similar field for extcap extensions and Lua scripts eventually.
2023-07-14codecs: Pass in fmtp, decode bandwidth efficient AMRJohn Thacker1-8/+104
Pass the wmem_map of format parameters. Use this to decide whether we have octet-aligned or bandwidth-efficient AMR, and decode accordingly. If we don't have a map of format parameters, because the conversation wasn't set up by SDP but by Decode As, use the default preferences from the dissector Fix #17608
2023-07-09codecs: Change interface, use SDP information for dynamic codecsJohn Thacker9-91/+139
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-07-05opus: Decode Opus packets with more than one frameJohn Thacker1-5/+10
https://datatracker.ietf.org/doc/html/rfc7587#section-4.2 "Further, an arbitrary number of frames can be combined into a packet, up to a maximum packet duration representing 120 ms of speech or audio data. The grouping of one or more Opus frames into a single Opus packet is defined in Section 3 of [RFC6716]." Handle opus packets with more than one frame in the packet by asking the Opus decoder for the number of samples in the packet.
2023-06-29G729 codec: Support Annex B SID/CN framesJohn Thacker1-10/+19
The bcg729 library interface supports decoding SID frames, so do so. rtp_audio_stream would have to be reworked a bit to allow processing of missing frames by a decoder (which bcg729 supports, but not all decoders do) instead of generating our own silence, but this change reduces the number of silence samples we generate. Fix #14343
2023-06-28AMR: Support RTP payloads with multiple framesJohn Thacker1-14/+96
OpenCORE-AMR doesn't really support RTP payloads with multiple frames (the F bit set), so this is a bit of a chore. Test the payload to see if there are multiple frames contained in it. If there are, then we have to copy things around so that the corresponding TOC byte is adjacent to the speech bytes for passing to the decoder. (Just wait until bandwidth-efficient mode.) See the pcap attached to #9477 for an example with multiple AMR speech frames in one RTP payload.
2023-03-21Add AMR codec supportHarald Welte2-0/+161
2022-04-04CMake: Finish splitting ADD_PLUGIN_LIBRARY.Gerald Combs8-8/+8
Rename add_plugin_library to add_wireshark_plugin_library and add a backward compatibility wrapper. Make Falco Bridge a Logwolf plugin.
2021-12-21Add a ws_posix_compat.h headerJoão Valverde1-1/+1
Currently used to define ssize_t on platforms that lack it. Fix some Windows build errors caused by moving the definition into a separate header. Fix some narrowing warnings on Windows x64 from changing the definition of ssize_t from long int to int64_t. The casts in dumpcap are ugly but necessary. The whole code needs to be rewritten for portability, or the warnings disabled.
2021-07-14CMake: Fixup SpanDSP's TIFF includes.Gerald Combs2-10/+2
Add TIFF_INCLUDE_DIR to SPANDSP_INCLUDE_DIRS, but only if TIFF has been found. Ping #17477.
2021-07-14CMake: Adjust wsutil includes and linking.Gerald Combs2-2/+10
Mark wsutil's includes SYSTEM PRIVATE. This exposed a lot of targets that were indirectly picking up include paths via the wsutil target, so add direct includes where needed. The G.722 and G.726 codecs were implicilty including tiffio.h; find it explicitly instead. Mark some of wsutil's libraries PRIVATE, but leave commonly-used ones PUBLIC. Ping #17477.
2021-06-22CMake: Mark our plugin include directories PRIVATE.Gerald Combs8-0/+16
Use target_include_directories to mark our local include directories PRIVATE, similar to what we do elsewhere.
2021-04-16Plugins: Add missing prototypes.Gerald Combs7-0/+14
Fixes -Wmissing-prototypes found by Clang.
2021-03-29CMake: Remove non existent '/codecs' include pathJoão Valverde8-40/+0
The '/codecs' dir was removed in g63af1da7e7. Avoid using include_directories(), prefer target_include_directories(). Remove some unnecessary CMAKE_CURRENT_*_DIR includes and some other small cleanups while at it.
2021-03-01CMake: Use CheckAPI's abort/termoutput with dissectors onlyJoão Valverde8-8/+0
I believe this was the original intention, to use these API restricitons with dissectors only (not that I necessarily agree with that policy either), and through copy-paste and lack of clear guidelines it spread to other parts of the build. Rename the checkAPI groups to make it very clear that this is dissector-only. This doesn't mean, of course, that good programming practices shouldn't be followed everywhere. In particular assertions need to be used properly. Don't use them to catch runtime errors or validate input data. This commit will be followed by another removing the various ugly hacks people have been using to get around the checkAPI hammer.
2020-12-28iLBC: fix deprecation type and cast.Dario Lombardo1-0/+9
Starting from libilbc 3.0.0 the type iLBC_decinst_t has been marked deprecated. Other fixes rely on function prototype requiring uint8_t pointer.
2020-12-22Detect and replace bad allocation patternsMoshe Kaplan1-1/+1
Adds a pre-commit hook for detecting and replacing occurrences of `g_malloc()` and `wmem_alloc()` with `g_new()` and `wmem_new()`, to improve the readability of Wireshark's code, and occurrences of `g_malloc(sizeof(struct myobj) * foo)` with `g_new(struct myobj, foo)` to prevent integer overflows Also fixes all existing occurrences across the codebase.
2020-10-03RTP: opus playbackLin Sun2-0/+165
It's possible to play opus payload with libopus (https://opus-codec.org/). Closes #16882. Helped-by: Pascal Quantin <pascal.quantin@gmail.com> Signed-off-by: Lin Sun <lin.sun@zoom.us> Signed-off-by: Yuanzhi Li <ryanlee@mail.ustc.edu.cn>
2020-09-05Tools: Clean up checkAPI and add ui/qt.Gerald Combs7-7/+7
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-01-20RTP: decode iLBC payloadJirka Novak2-0/+199
It is possible to decode iLBC payload. It uses libilbc library (https://github.com/TimothyGu/libilbc). Bug: 16314 Change-Id: Id4cad7ae32305a0e94ef32beb24e07733d7f834e Reviewed-on: https://code.wireshark.org/review/35686 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-12-30codecs API: Added description of API usageJirka Novak5-48/+49
Added API description clarifies when bytes/samples are used. New variable names proposed and all existing codecs are adapted to it. Change is just renaming... Change-Id: I75dba64a49eb3f4369ec7160cb793dda4b44c810 Reviewed-on: https://code.wireshark.org/review/35576 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-07-26HTTPS (almost) everywhere.Guy Harris12-12/+12
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-11Kill libwscodecs plugin library, just use pluginsJoão Valverde12-12/+12
Change-Id: I085d04840acb53b0b7681787429a2b4e10547cd5 Reviewed-on: https://code.wireshark.org/review/33068 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-11Move codec plugins to /pluginsJoão Valverde10-0/+1011
Change-Id: I56d61e2ef737e4326080d75a2302c73a4075e8a1 Reviewed-on: https://code.wireshark.org/review/33067 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-04l16_mono: fix a typo in CMakeLists.txtPascal Quantin1-1/+1
Change-Id: I344354fa50c14828dd5d430ac6a377766b0afeb6 Reviewed-on: https://code.wireshark.org/review/27328 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-04-18Remove autotools build system.Dario Lombardo2-90/+0
It has been replaced by cmake. Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a Reviewed-on: https://code.wireshark.org/review/26969 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-21l16 (plugins/codecs): fix no previous prototype for ‘codec_register_l16’ ↵Alexis La Goutte1-0/+2
[-Wmissing-prototypes] Change-Id: I5f3bd624f2c5b327e40194fc29f34a11cfd48267 Reviewed-on: https://code.wireshark.org/review/26568 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-03-08The routines that implement a codec don't need to be public.Guy Harris1-5/+5
Pointers to them are passed to register_codec(), so they can be static to l16decode.c. Change-Id: I2303cc4374e81a2e5a77eaa275ca601d99a4f608 Reviewed-on: https://code.wireshark.org/review/26355 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-28L16_mono: Add L16 monaural codec plugin as functional exampleJaap Keuter5-0/+204
This codec plugin serves a dual purpose. First it is to add L16 codec suppport to Wireshark. Second it is an illustration of a basic codec plugin module. Change-Id: I64394dab3257ae49dece0257b16cd969503918e2 Reviewed-on: https://code.wireshark.org/review/26131 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot 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-01-21autotools: Rework the plugin MakefilesJaap Keuter1-0/+42
The plugin.c generation in an autotools build comes in from an included Makefile.am file. The various types of plugins need different parameters for the generation script. Put the plugin.c production rule is a seperate include file so each plugin type build can include its own variant. Also amend the README.plugins file with regards to the new directory structure and the fact that there are multiple types of plugins, not just dissector plugins. Change-Id: I3a815d0d767baa555356cf428861b18697401355 Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-on: https://code.wireshark.org/review/25398 Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Michael Mann <mmann78@netscape.net>