aboutsummaryrefslogtreecommitdiffstats
path: root/include/gapk/codecs.h
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-01-17 20:46:06 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2018-01-17 20:54:03 +0600
commit7a79fc11692779a1f9377b416b6208f1245e7612 (patch)
tree96998b59cbc1f4dceabd54c7a6980d7e63b3fa89 /include/gapk/codecs.h
parent30493c78b3579b562b4d71224857d11fbf1b56b6 (diff)
parent6f34c8f3017629ea4865543e901b61ac893e0356 (diff)
Merge branch 'fixeria/lib' into master
The previous GAPK implementation was represented by a single executable. So, all audio transcoding operations were available only via calling the 'gapk' binary. This approach didn't allow external applications to benefit from using GAPK API directly. The following set of changes separates the common code into a shared library called 'libosmogapk', linking the 'gapk' binary against it: - 95e6664 Introduce a shared 'libosmogapk' library - 30209ce Install GAPK headers to '${includedir}/osmocom/gapk/' - a8d4657 Add an 'osmo_gapk' prefix to the exposed symbols - 40d59f1 Add a pkg-config manifest for libosmogapk - 4f0a47d Add the symbol export map for libosmogapk All memory management operations are now based on talloc library: - 3c20dac libosmogapk: use talloc for memory management - 5cabe1e osmo-gapk: use talloc for memory management Integrated Osmocom logging framework: - c35ba8a libosmogapk: use Osmocom logging framework - 4b7cd2c osmo-gapk: drop useless printf calls - 0fe18af osmo-gapk: use Osmocom logging framework - 11943bf osmo-gapk: adjust application verbosity Integrated GNU Autotest environment and basic test coverage: - f069eb3 Init automake test environment - 1fe6a9b tests: add procqueue test - 3e9e57f tests: add pq_file test - 9d2b15d tests: add pq_rtp test - f59f3f1 tests: add format / codec transcoding tests For more details, see commits history. Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da
Diffstat (limited to 'include/gapk/codecs.h')
-rw-r--r--include/gapk/codecs.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/include/gapk/codecs.h b/include/gapk/codecs.h
deleted file mode 100644
index aa1c829..0000000
--- a/include/gapk/codecs.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Codecs handling */
-
-/*
- * This file is part of gapk (GSM Audio Pocket Knife).
- *
- * gapk is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * gapk is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with gapk. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GAPK_CODECS_H__
-#define __GAPK_CODECS_H__
-
-#include <stdint.h>
-
-#define FR_CANON_LEN 33
-#define HR_CANON_LEN 14
-#define EFR_CANON_LEN 31
-#define PCM_CANON_LEN (160*sizeof(uint16_t))
-#define HR_REF_ENC_LEN (20 * sizeof(uint16_t))
-#define HR_REF_DEC_LEN (22 * sizeof(uint16_t))
-
-enum codec_type {
- CODEC_INVALID = 0,
- CODEC_PCM, /* 16 bits PCM samples */
- CODEC_HR, /* GSM Half Rate codec GSM 06.20 */
- CODEC_FR, /* GSM Full Rate codec GSM 06.10 */
- CODEC_EFR, /* GSM Enhanced Full Rate codec GSM 06.60 */
- CODEC_AMR, /* GSM Adaptive Multi Rate codec GSM 26.071 */
- _CODEC_MAX,
-};
-
-#include <gapk/formats.h> /* need to import here because or enum interdep */
-
-/*! call-back for actual codec conversion function
- * \param[in] state opaque state pointer (returned by codec->init)
- * \param[out] dst caller-allocated buffer for output data
- * \param[in] src input data
- * \param[in] src_len length of input data \a src
- * \returns number of output bytes written to \a dst; negative on error */
-typedef int (*codec_conv_cb_t)(void *state, uint8_t *dst, const uint8_t *src, unsigned int src_len);
-
-struct codec_desc {
- enum codec_type type;
- const char * name;
- const char * description;
- /*! canonical frame size (in bytes); 0 in case of variable length */
- unsigned int canon_frame_len;
-
- enum format_type codec_enc_format_type; /* what the encoder provides */
- enum format_type codec_dec_format_type; /* what to give the decoder */
- /*! codec initialization function pointer, returns opaque state */
- void * (*codec_init)(void);
- /*! codec exit function pointer, gets passed opaque state */
- void (*codec_exit)(void *state);
- codec_conv_cb_t codec_encode;
- codec_conv_cb_t codec_decode;
-};
-
-const struct codec_desc *codec_get_from_type(enum codec_type type);
-
-#endif /* __GAPK_CODECS_H__ */