mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
modargs: Add pa_modargs_get_resample_method()
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
This commit is contained in:
parent
68156d3f79
commit
22ee1b9d53
2 changed files with 22 additions and 0 deletions
|
|
@ -428,6 +428,24 @@ int pa_modargs_get_channel_map(pa_modargs *ma, const char *name, pa_channel_map
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pa_modargs_get_resample_method(pa_modargs *ma, pa_resample_method_t *rmethod) {
|
||||||
|
const char *m;
|
||||||
|
|
||||||
|
pa_assert(ma);
|
||||||
|
pa_assert(rmethod);
|
||||||
|
|
||||||
|
if ((m = pa_modargs_get_value(ma, "resample_method", NULL))) {
|
||||||
|
pa_resample_method_t method = pa_parse_resample_method(m);
|
||||||
|
|
||||||
|
if (method == PA_RESAMPLER_INVALID)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
*rmethod = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int pa_modargs_get_sample_spec_and_channel_map(
|
int pa_modargs_get_sample_spec_and_channel_map(
|
||||||
pa_modargs *ma,
|
pa_modargs *ma,
|
||||||
pa_sample_spec *rss,
|
pa_sample_spec *rss,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include <pulse/proplist.h>
|
#include <pulse/proplist.h>
|
||||||
#include <pulse/volume.h>
|
#include <pulse/volume.h>
|
||||||
#include <pulsecore/macro.h>
|
#include <pulsecore/macro.h>
|
||||||
|
#include <pulsecore/resampler.h>
|
||||||
|
|
||||||
typedef struct pa_modargs pa_modargs;
|
typedef struct pa_modargs pa_modargs;
|
||||||
|
|
||||||
|
|
@ -58,6 +59,9 @@ int pa_modargs_get_sample_spec(pa_modargs *ma, pa_sample_spec *ss);
|
||||||
/* Return channel map data from the argument "channel_map" if name is NULL, otherwise read from the specified argument */
|
/* Return channel map data from the argument "channel_map" if name is NULL, otherwise read from the specified argument */
|
||||||
int pa_modargs_get_channel_map(pa_modargs *ma, const char *name, pa_channel_map *map);
|
int pa_modargs_get_channel_map(pa_modargs *ma, const char *name, pa_channel_map *map);
|
||||||
|
|
||||||
|
/* Return resample method from the argument "resample_method" */
|
||||||
|
int pa_modargs_get_resample_method(pa_modargs *ma, pa_resample_method_t *method);
|
||||||
|
|
||||||
/* Combination of pa_modargs_get_sample_spec() and
|
/* Combination of pa_modargs_get_sample_spec() and
|
||||||
pa_modargs_get_channel_map(). Not always suitable, since this routine
|
pa_modargs_get_channel_map(). Not always suitable, since this routine
|
||||||
initializes the map parameter based on the channels field of the ss
|
initializes the map parameter based on the channels field of the ss
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue