Age | Commit message (Collapse) | Author | Files | Lines |
|
In order to simplify memory leak debugging, this change introduces
the library's internal talloc context that may be changed by
external application by calling the osmo_gapk_set_talloc_ctx().
|
|
In some cases it's required to wait for some queue items
to finish processing. For example, the ALSA sink writes the
audio samples to the buffer in non-blocking mode, so as soon
as all of them will be written, a program may finish execution,
causing the playback abort.
To prevent that, this change extends the library's API, allowing
each queue item to have a processing state callback that returns
a positive integer if processing is not finished yet,
and 0 otherwise.
|
|
Since this change, the libosmogapk uses the Osmocom logging
framework. By default, logging is disabled and could be enabled
by the external applications calling the osmo_gapk_log_init()
with a desired log target as an argument.
|
|
The usage of linuxlist is more flexible than having a limited
array of pointers. This approach allows to have as much items
in a processing queue as required.
|
|
An output buffer belongs to its queue item, so it will be more
correctly to store its pointer inside the osmo_gapk_pq_item.
|
|
A frame size cannot be negative, so 'unsigned' is more
suitable for frame size fields.
|
|
To simplify the benchrarking process via the library API, this
change introduces two new functions, which are intended to
provide total cycle and frame count.
|
|
Having statically allocated memory for benchmark data of every
codec causes high memory usage, especially if actual benchmarking
is not required for a particular use case. Instead of that, let's
provide an optional opportunity to enable benchmarking for a
particular codec by calling the osmo_gapk_bench_enable(). The
required amount of memory would be allocated, and then can be
freed by calling the osmo_gapk_bench_free() or manually.
|
|
The usage of a 'static inline' function definition in the 'bench.h'
is resulting in separate independent function definitions in each
translation unit from which the header is included. This is
increasing the size of compiled code unnecessarily.
|
|
There is no need to expose the implementation details of both
BENCHMARK_START and BENCHMARK_STOP macros via public header.
This change moves them to a separate private header 'bench.h'.
|
|
The benchmark_dump() is only used by the osmo-gapk binary, and
is intended to prepare and print benchmarking results to stderr,
what is most likely unusable for the library users.
|
|
To avoid a naming conflict between libosmogapk and other projects
during linkage, all the exposed symbols should have an unique
prefix. Let's use 'osmo_gapk' for that.
|
|
To be able to use processing queues from outside, the pq struct
should be shared in the corresponding header file.
|
|
The most compilers today do support the '#pragma once', which is
designed to cause the current source file to be included only once
in a single compilation. One has several advantages, including:
less code, avoidance of name clashes, and sometimes improvement
in compilation speed.
See: https://en.wikipedia.org/wiki/Pragma_once for details.
|
|
To be able to use the library, external applications need to know,
which symbols are exposed. This information is provided by header
files, which are being installed to a system's ${includedir}
since this change.
|
|
This is incompatible with the ETSI TS 101 318 format!
|
|
|
|
The RTP EFR payload is a bit like the FR payload: one nibble magic
marker, then followed by the actual codec bits. So we need to
add/remove that magic marker and shift the remainder by one nibble.
|
|
The ETSI reference codec actually uses an array of 20/22 16bit values
rather than a "canonical" format. The conversion is what fmt_hr_ref.c
is doing. However, codec_hr.c must then subsequently not check for the
canonical input/output sizes, but those specific to it.
|
|
After merging this change, there is support for the AMR codec (by means
of libopencore-amr, which is already used for EFR).
In terms of gapk formats, we introdude
* the "amr-opencore" format, which serves both as the canonical format,
and as the input format to opencore-amrnb itself.
* the "rtp-amr" format, which is the payload of RFC4867 octet-aligned mode
You can use the following command for a real-time RTP playback for AMR
frames:
./gapk -I 0.0.0.0/30000 -f rtp-amr -A default -g rawpcm-s16le
|
|
|
|
The existing architecture was modelled around fixed-length codec frame
sizes, which of course fails with multi-rate codecs such as AMR.
|
|
|
|
The ALSA source/sink uses the pcm-s16le format.
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
|
|
This enables benchmarking of the codec. It will print
the amount of CPU cycles needed for encoding/decoding a single
20ms frame on average.
|
|
Instead of having only file-based I/O, this enables gapk to receive and
send RTP streams, e.g. from live GSM network equipment like
sysmoBTS/nanoBTS.
Support is currently simplistic. On transmit, there is hard-coded codec
type of full-rate GSM. On receive-side, we should auto-detect the
format based on frame size and/or payload type, but we don't do that yet
at all.
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Not functional yet, just the autotools magic to make a library
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Very simple header support, but that's all we need for AMR
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Yes ... they use a different format for the decoder input than for the
encoder output ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|