#include "ws_symbol_export.h"
#include "ws_attributes.h"
#include <stdbool.h>
#include "wsutil/wmem/wmem_map.h"
Go to the source code of this file.
|
WS_DLL_PUBLIC void | codecs_register_plugin (const codecs_plugin *plug) |
|
WS_DLL_PUBLIC void | codecs_init (void) |
|
WS_DLL_PUBLIC void | codecs_cleanup (void) |
|
WS_DLL_PUBLIC void | codec_get_compiled_version_info (GString *str) |
|
WS_DLL_PUBLIC bool | register_codec (const char *name, codec_init_fn init_fn, codec_release_fn release_fn, codec_get_channels_fn channels_fn, codec_get_frequency_fn frequency_fn, codec_decode_fn decode_fn) |
|
WS_DLL_PUBLIC bool | deregister_codec (const char *name) |
|
WS_DLL_PUBLIC codec_handle_t | find_codec (const char *name) |
|
WS_DLL_PUBLIC void * | codec_init (codec_handle_t codec, codec_context_t *context) |
|
WS_DLL_PUBLIC void | codec_release (codec_handle_t codec, codec_context_t *context) |
|
WS_DLL_PUBLIC unsigned | codec_get_channels (codec_handle_t codec, codec_context_t *context) |
|
WS_DLL_PUBLIC unsigned | codec_get_frequency (codec_handle_t codec, codec_context_t *context) |
|
WS_DLL_PUBLIC size_t | codec_decode (codec_handle_t codec, codec_context_t *context, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) |
|
codecs interface 2007 Tomas Kukosa
Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
◆ codec_decode_fn
typedef size_t(* codec_decode_fn) (codec_context_t *context, const void *inputBytes, size_t inputBytesSize, void *outputSamples, size_t *outputSamplesSize) |
Decode one frame of payload Function is called twice, with different values of parameters: (1) To query size of required buffer in bytes for decoded samples pointed by inputBytes: outputSamples or outputSamplesSize must be set NULL (2) To decode samples: outputSamples points to allocated memory, outputSamplesSize is set to value returned in step (1)
- Parameters
-
context | Pointer to codec context |
inputBytes | Pointer to input frame |
inputBytesSize | Length of input frame in bytes (count of bytes to decode) |
outputSamples | Pointer to output buffer with samples |
outputSamplesSize | Length of output buffer in bytes (not samples!) Function can override this value. All codecs set it to same value as it returns in (2) when (2) is called. |
- Returns
- Count of reqired bytes (!not samples) to allocate in (1) or Count of decoded bytes (!not samples) in (2)
◆ codec_get_channels_fn
Get count of channels provided by the codec
- Parameters
-
context | Pointer to codec context |
- Returns
- Count of channels (e.g. 1)
◆ codec_get_frequency_fn
Get frequency/rate provided by the codec
- Parameters
-
context | Pointer to codec context |
- Returns
- Frequency (e.g. 8000)
◆ codec_init_fn
Initialize context of codec. Context can contain any information required by codec to pass between calls Note: There is just one codec context in runtime therefore no RTP stream related information should be stored in the context!
- Returns
- Pointer to codec context
◆ codec_release_fn
Destroy context of codec
- Parameters
-
context | Pointer to codec context |
◆ codec_get_compiled_version_info()
WS_DLL_PUBLIC void codec_get_compiled_version_info |
( |
GString * |
str | ) |
|
Get compile-time information for libraries used by libwscodecs.
◆ codecs_init()
WS_DLL_PUBLIC void codecs_init |
( |
void |
| ) |
|
For all built-in codecs and codec plugins, call their register routines.