Commit Graph

15 Commits

Author SHA1 Message Date
Harald Welte 75df4ca2a3 gapk: add optional throttling
When throttling is enabled, one voice frame will be processed every
20ms.  This is useful for e.g. playback of a file as a RTP stream.

Without this option, the entire file would generate a flood of RTP
messages, rather than a continuous stream.

Change-Id: I0dcd4248cc800b82142722aa36a811f0657b3e0c
2020-08-01 19:00:37 +02:00
Vadim Yanitskiy 89c1082b3d Make RTP payload type configurable
For a long time the RTP payload type was hard-coded for outgoing
frames. The problem is that according to RFC 3551 only GSM FR has
a static payload type value (see table 4, value 3). For other
codecs the payload type may be negotiated between the both
sides dynamically (i.e. in range 96-127).

Let's allow a binary/API user to configure this manually.

Change-Id: Ia07ed4e13b4a70c8bb4181564a8190861fd269da
Closes: OS#2482
2018-07-09 22:16:45 +07:00
Vadim Yanitskiy 379b657c57 app_osmo_gapk.c: use recommended osmo_init_logging2()
The osmo_init_logging() was deprecated.

Change-Id: Ic30a924571feb273274587998e87c86b688c3544
2018-06-29 20:54:04 +07:00
Vadim Yanitskiy 10076f0acc osmo-gapk: fix I/O count check condition
The stdin / stdout operation was broken by a new check condition,
introduced by the 15fa605576a81803c57a144231e9e9720aa133a1.
2017-12-31 12:21:00 +01:00
Vadim Yanitskiy 3839a88ea6 procqueue: separate queue check function
In order to give advanced control over a processing queue,
it would be better to have the checking function separated from
the osmo_gapk_pq_prepare(). Moreover, this change introduces an
additional 'strict' checking mode that requires a queue to have
a source item first and a sink item in the last position.
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy 2286a36ace procqueue: add human-readable name to osmo_gapk_pq
Since this change, every processing queue may optionally have
an associated human-readable name. If name is not required,
NULL should be passed to the osmo_gapk_pq_create().
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy 5cabe1eeec osmo-gapk: use talloc for memory management 2017-12-31 12:20:59 +01:00
Vadim Yanitskiy a4d88ae13b osmo-gapk: fix I/O combinations check
Previously both ALSA source and sink were out of attention.
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy 01f5c5bebf osmo-gapk: wait until sink finish processing
Previously the osmo-gapk application used to exit as soon as all
the frames are processed, no matter has the sink finished its
internal processing (e.g. ALSA playback).
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy b40a54dc97 osmo-gapk: abort the processing queue on SIGINT
Instead of immediately shutting down the application, it is
better to try to break the processing queue first, and stop
the execution immediately if second SIGINT is received.
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy 11943bf320 osmo-gapk: adjust application verbosity
This change allows user to enable advanced verbosity using the
'-v' command line option, which is disabled by default.
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy 0fe18af82d osmo-gapk: use Osmocom logging framework 2017-12-31 12:20:59 +01:00
Vadim Yanitskiy 4b7cd2c677 osmo-gapk: drop useless printf calls
The printf() writes the text into stdout, which may be undesirable
in some use cases. Moreover, the printed information was redundant.
So, let's drop such calls.
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy c35ba8a725 libosmogapk: use Osmocom logging framework
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.
2017-12-31 12:20:59 +01:00
Vadim Yanitskiy f8d91a07b4 osmo-gapk: use more convenient name for the source file
Since GAPK package contains a library and the representative
osmo-gapk application, the 'main.c' looks a bit confusing. Let's
use the common naming scheme.
2017-12-31 12:20:59 +01:00