filter_plugin: allow open() to force an input format

Make the audio_format argument non-const.  Allow the open() method to
modify it, to indicate that it wants a different input audio format
than the one specified.  Check that condition in chain_filter_open(),
and fail.
This commit is contained in:
Max Kellermann
2009-12-25 14:27:32 +01:00
parent d2051c7f50
commit b54bde6f2b
8 changed files with 64 additions and 40 deletions
+8 -3
View File
@@ -50,10 +50,14 @@ struct filter_plugin {
/**
* Opens a filter.
*
* @param audio_format the audio format of incoming data; the
* plugin may modify the object to enforce another input
* format
*/
const struct audio_format *
(*open)(struct filter *filter,
const struct audio_format *audio_format,
struct audio_format *audio_format,
GError **error_r);
/**
@@ -108,13 +112,14 @@ filter_free(struct filter *filter);
* Opens the filter, preparing it for filter_filter().
*
* @param filter the filter object
* @param audio_format the audio format of incoming data
* @param audio_format the audio format of incoming data; the plugin
* may modify the object to enforce another input format
* @param error location to store the error occuring, or NULL to
* ignore errors.
* @return the format of outgoing data
*/
const struct audio_format *
filter_open(struct filter *filter, const struct audio_format *audio_format,
filter_open(struct filter *filter, struct audio_format *audio_format,
GError **error_r);
/**