mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-12 13:30:10 -05:00
format, core-format: Constify some function parameters
This commit is contained in:
parent
71816ecb7f
commit
a3a795ef3d
4 changed files with 32 additions and 32 deletions
|
|
@ -171,7 +171,7 @@ error:
|
|||
goto out;
|
||||
}
|
||||
|
||||
int pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second) {
|
||||
int pa_format_info_is_compatible(const pa_format_info *first, const pa_format_info *second) {
|
||||
const char *key;
|
||||
void *state = NULL;
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ int pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second)
|
|||
return true;
|
||||
}
|
||||
|
||||
pa_format_info* pa_format_info_from_sample_spec(pa_sample_spec *ss, pa_channel_map *map) {
|
||||
pa_format_info* pa_format_info_from_sample_spec(const pa_sample_spec *ss, const pa_channel_map *map) {
|
||||
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
|
||||
pa_format_info *f;
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ pa_format_info* pa_format_info_from_sample_spec(pa_sample_spec *ss, pa_channel_m
|
|||
}
|
||||
|
||||
/* For PCM streams */
|
||||
int pa_format_info_to_sample_spec(pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map) {
|
||||
int pa_format_info_to_sample_spec(const pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map) {
|
||||
pa_assert(f);
|
||||
pa_assert(ss);
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ int pa_format_info_to_sample_spec(pa_format_info *f, pa_sample_spec *ss, pa_chan
|
|||
return 0;
|
||||
}
|
||||
|
||||
pa_prop_type_t pa_format_info_get_prop_type(pa_format_info *f, const char *key) {
|
||||
pa_prop_type_t pa_format_info_get_prop_type(const pa_format_info *f, const char *key) {
|
||||
const char *str;
|
||||
json_object *o, *o1;
|
||||
pa_prop_type_t type;
|
||||
|
|
@ -310,7 +310,7 @@ pa_prop_type_t pa_format_info_get_prop_type(pa_format_info *f, const char *key)
|
|||
return type;
|
||||
}
|
||||
|
||||
int pa_format_info_get_prop_int(pa_format_info *f, const char *key, int *v) {
|
||||
int pa_format_info_get_prop_int(const pa_format_info *f, const char *key, int *v) {
|
||||
const char *str;
|
||||
json_object *o;
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ int pa_format_info_get_prop_int(pa_format_info *f, const char *key, int *v) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_format_info_get_prop_int_range(pa_format_info *f, const char *key, int *min, int *max) {
|
||||
int pa_format_info_get_prop_int_range(const pa_format_info *f, const char *key, int *min, int *max) {
|
||||
const char *str;
|
||||
json_object *o, *o1;
|
||||
int ret = -PA_ERR_INVALID;
|
||||
|
|
@ -377,7 +377,7 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int pa_format_info_get_prop_int_array(pa_format_info *f, const char *key, int **values, int *n_values) {
|
||||
int pa_format_info_get_prop_int_array(const pa_format_info *f, const char *key, int **values, int *n_values) {
|
||||
const char *str;
|
||||
json_object *o, *o1;
|
||||
int i, ret = -PA_ERR_INVALID;
|
||||
|
|
@ -420,7 +420,7 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int pa_format_info_get_prop_string(pa_format_info *f, const char *key, char **v) {
|
||||
int pa_format_info_get_prop_string(const pa_format_info *f, const char *key, char **v) {
|
||||
const char *str = NULL;
|
||||
json_object *o;
|
||||
|
||||
|
|
@ -447,7 +447,7 @@ int pa_format_info_get_prop_string(pa_format_info *f, const char *key, char **v)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pa_format_info_get_prop_string_array(pa_format_info *f, const char *key, char ***values, int *n_values) {
|
||||
int pa_format_info_get_prop_string_array(const pa_format_info *f, const char *key, char ***values, int *n_values) {
|
||||
const char *str;
|
||||
json_object *o, *o1;
|
||||
int i, ret = -PA_ERR_INVALID;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ int pa_format_info_is_pcm(const pa_format_info *f);
|
|||
* stream's format is compatible with a given sink. In such a case,
|
||||
* \a first would be the sink's format and \a second would be the
|
||||
* stream's. \since 1.0 */
|
||||
int pa_format_info_is_compatible(pa_format_info *first, pa_format_info *second);
|
||||
int pa_format_info_is_compatible(const pa_format_info *first, const pa_format_info *second);
|
||||
|
||||
/** Maximum required string length for
|
||||
* pa_format_info_snprint(). Please note that this value can change
|
||||
|
|
@ -131,14 +131,14 @@ char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f);
|
|||
pa_format_info* pa_format_info_from_string(const char *str);
|
||||
|
||||
/** Utility function to take a \a pa_sample_spec and generate the corresponding \a pa_format_info. \since 2.0 */
|
||||
pa_format_info* pa_format_info_from_sample_spec(pa_sample_spec *ss, pa_channel_map *map);
|
||||
pa_format_info* pa_format_info_from_sample_spec(const pa_sample_spec *ss, const pa_channel_map *map);
|
||||
|
||||
/** Utility function to generate a \a pa_sample_spec and \a pa_channel_map corresponding to a given \a pa_format_info. The
|
||||
* conversion for PCM formats is straight-forward. For non-PCM formats, if there is a fixed size-time conversion (i.e. all
|
||||
* IEC61937-encapsulated formats), a "fake" sample spec whose size-time conversion corresponds to this format is provided and
|
||||
* the channel map argument is ignored. For formats with variable size-time conversion, this function will fail. Returns a
|
||||
* negative integer if conversion failed and 0 on success. \since 2.0 */
|
||||
int pa_format_info_to_sample_spec(pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map);
|
||||
int pa_format_info_to_sample_spec(const pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map);
|
||||
|
||||
/** Represents the type of value type of a property on a \ref pa_format_info. \since 2.0 */
|
||||
typedef enum pa_prop_type_t {
|
||||
|
|
@ -171,24 +171,24 @@ typedef enum pa_prop_type_t {
|
|||
/** \endcond */
|
||||
|
||||
/** Gets the type of property \a key in a given \ref pa_format_info. \since 2.0 */
|
||||
pa_prop_type_t pa_format_info_get_prop_type(pa_format_info *f, const char *key);
|
||||
pa_prop_type_t pa_format_info_get_prop_type(const pa_format_info *f, const char *key);
|
||||
|
||||
/** Gets an integer property from the given format info. Returns 0 on success and a negative integer on failure. \since 2.0 */
|
||||
int pa_format_info_get_prop_int(pa_format_info *f, const char *key, int *v);
|
||||
int pa_format_info_get_prop_int(const pa_format_info *f, const char *key, int *v);
|
||||
/** Gets an integer range property from the given format info. Returns 0 on success and a negative integer on failure.
|
||||
* \since 2.0 */
|
||||
int pa_format_info_get_prop_int_range(pa_format_info *f, const char *key, int *min, int *max);
|
||||
int pa_format_info_get_prop_int_range(const pa_format_info *f, const char *key, int *min, int *max);
|
||||
/** Gets an integer array property from the given format info. \a values contains the values and \a n_values contains the
|
||||
* number of elements. The caller must free \a values using \ref pa_xfree. Returns 0 on success and a negative integer on
|
||||
* failure. \since 2.0 */
|
||||
int pa_format_info_get_prop_int_array(pa_format_info *f, const char *key, int **values, int *n_values);
|
||||
int pa_format_info_get_prop_int_array(const pa_format_info *f, const char *key, int **values, int *n_values);
|
||||
/** Gets a string property from the given format info. The caller must free the returned string using \ref pa_xfree. Returns
|
||||
* 0 on success and a negative integer on failure. \since 2.0 */
|
||||
int pa_format_info_get_prop_string(pa_format_info *f, const char *key, char **v);
|
||||
int pa_format_info_get_prop_string(const pa_format_info *f, const char *key, char **v);
|
||||
/** Gets a string array property from the given format info. \a values contains the values and \a n_values contains
|
||||
* the number of elements. The caller must free \a values using \ref pa_format_info_free_string_array. Returns 0 on success and
|
||||
* a negative integer on failure. \since 2.0 */
|
||||
int pa_format_info_get_prop_string_array(pa_format_info *f, const char *key, char ***values, int *n_values);
|
||||
int pa_format_info_get_prop_string_array(const pa_format_info *f, const char *key, char ***values, int *n_values);
|
||||
|
||||
/** Frees a string array returned by \ref pa_format_info_get_prop_string_array. \since 2.0 */
|
||||
void pa_format_info_free_string_array(char **values, int n_values);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue