2 * codecs interface 2007 Tomas Kukosa
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/epan.h>
15 #include "ws_symbol_export.h"
16 #include "ws_attributes.h"
18 #include "wsutil/plugins.h"
23 #endif /* __cplusplus */
27 void (*register_codec_module)(void); /* routine to call to register a codec */
30 WS_DLL_PUBLIC void codecs_register_plugin(const codecs_plugin *plug);
34 * For all built-in codecs and codec plugins, call their register routines.
36 WS_DLL_PUBLIC void codecs_init(void);
38 WS_DLL_PUBLIC void codecs_cleanup(void);
41 * Get compile-time information for libraries used by libwscodecs.
43 WS_DLL_PUBLIC void codec_get_compiled_version_info(GString *str);
46 typedef struct codec_handle *codec_handle_t;
48 typedef void *(*codec_init_fn)(void);
49 typedef void (*codec_release_fn)(void *context);
50 typedef unsigned (*codec_get_channels_fn)(void *context);
51 typedef unsigned (*codec_get_frequency_fn)(void *context);
52 typedef size_t (*codec_decode_fn)(void *context, const void *input, size_t inputSizeBytes,
53 void *output, size_t *outputSizeBytes);
55 WS_DLL_PUBLIC gboolean register_codec(const char *name, codec_init_fn init_fn,
56 codec_release_fn release_fn, codec_get_channels_fn channels_fn,
57 codec_get_frequency_fn frequency_fn, codec_decode_fn decode_fn);
58 WS_DLL_PUBLIC gboolean deregister_codec(const char *name);
59 WS_DLL_PUBLIC codec_handle_t find_codec(const char *name);
60 WS_DLL_PUBLIC void *codec_init(codec_handle_t codec);
61 WS_DLL_PUBLIC void codec_release(codec_handle_t codec, void *context);
62 WS_DLL_PUBLIC unsigned codec_get_channels(codec_handle_t codec, void *context);
63 WS_DLL_PUBLIC unsigned codec_get_frequency(codec_handle_t codec, void *context);
64 WS_DLL_PUBLIC size_t codec_decode(codec_handle_t codec, void *context, const void *input,
65 size_t inputSizeBytes, void *output, size_t *outputSizeBytes);
69 #endif /* __cplusplus */
71 #endif /* _CODECS_H_ */
74 * Editor modelines - http://www.wireshark.org/tools/modelines.html
79 * indent-tabs-mode: nil
82 * vi: set shiftwidth=4 tabstop=8 expandtab:
83 * :indentSize=4:tabSize=8:noTabs=true: