Commit Graph

11 Commits

Author SHA1 Message Date
João Valverde 7f32c90ab9 plugins: Add a codecs API level
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-14 16:18:35 +00:00
Gerald Combs 8285a9775f Convert wsutil to C99 types
Ping #19116
2023-09-24 19:05:10 +00:00
John Thacker d871c6c6af codecs: Change interface, use SDP information for dynamic codecs
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-09 21:16:28 +00:00
John Thacker a49c8ea101 codecs: Register and lookup case-insensitively
RFC 4855 3. Mapping to SDP Parameters

  Note that the payload format (encoding) names defined in the RTP
  Profile [4] are commonly shown in upper case.  Media subtype names
  are commonly shown in lower case.  These names are case-insensitive
  in both places.

Store and lookup codec names in an ASCII case-insensitive manner,
so that RTP Player works if the codec name is sent in SDP in a
different case.

This also has the effect of making AMR playback after using Decode
As (e.g., for a RTP stream set up heuristically without an SDP) work,
because the dissector is registered with a lower-case name of "amr"
(compare Opus, which is lower-case both in the dissector short name
and in the canonical IANA media type registration.)

Related to #17608
2023-06-30 07:09:16 -04:00
João Valverde 129046b518 wsutil: Fix incorrect header include
wsutil should not have any dependency on epan, replace the
extraneous header.
2021-06-25 03:14:22 +00:00
Dario Lombardo f62138c0d5 Fix some includes. 2021-06-22 19:25:43 +00:00
João Valverde 39df3ae3c0 Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
João Valverde 89fee9321e Avoid exposing HAVE_PLUGINS in the public API
Instead *_register_plugin() is turned into a noop (with a warning).

The test suit is failing with ENABLE_PLUGINS=Off (it was already failing
before and this patch didn't affect that).

Closes #17202.
2021-02-06 16:35:51 +00:00
Moshe Kaplan e16166a74c Detect and replace bad allocation patterns
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-12-22 14:56:38 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
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-07-26 18:44:40 +00:00
João Valverde 63af1da7e7 Kill libwscodecs plugin library, just use plugins
Change-Id: I085d04840acb53b0b7681787429a2b4e10547cd5
Reviewed-on: https://code.wireshark.org/review/33068
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-11 20:59:39 +00:00