diff options
author | Rodeo <[email protected]> | 2012-08-27 21:17:59 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-08-27 21:17:59 +0000 |
commit | d5cd2171f6bd69ec44d4568926728b890f7d1f97 (patch) | |
tree | 025fb0ecb885310f114eeed654ff165d539d3c17 /libhb/audio_resample.h | |
parent | 09a30794cb6388909e273f0801ede2e6001bf955 (diff) |
hb_audio_resample: move setters out of hb_audio_resample_update(), to dedicated functions.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4922 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/audio_resample.h')
-rw-r--r-- | libhb/audio_resample.h | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/libhb/audio_resample.h b/libhb/audio_resample.h index 29a7f91d0..c853fc2e2 100644 --- a/libhb/audio_resample.h +++ b/libhb/audio_resample.h @@ -32,8 +32,6 @@ typedef struct struct { - int channels; - int linesize; uint64_t channel_layout; double center_mix_level; double surround_mix_level; @@ -43,7 +41,15 @@ typedef struct struct { int channels; - int linesize; + uint64_t channel_layout; + double center_mix_level; + double surround_mix_level; + enum AVSampleFormat sample_fmt; + } resample; + + struct + { + int channels; int sample_size; int normalize_mix_level; uint64_t channel_layout; @@ -55,25 +61,38 @@ typedef struct /* Initialize an hb_audio_resample_t for converting audio to the requested * sample_fmt and channel_layout, using the specified matrix_encoding. * - * Input characteristics are set via hb_audio_resample_update(). + * Also sets the default audio input characteristics, so that they are the same + * as the output characteristics (no conversion needed). */ hb_audio_resample_t* hb_audio_resample_init(enum AVSampleFormat output_sample_fmt, uint64_t output_channel_layout, enum AVMatrixEncoding matrix_encoding, int normalize_mix_level); -/* Update an hb_audio_resample_t, setting the input sample characteristics. +/* The following functions set the audio input characteristics. + * + * They should be called whenever the relevant characteristic(s) differ from the + * requested output characteristics, or if they may have changed in the source. * - * Can be called whenever the input type may change. + * Note: channel_layout is automatically sanitized. + */ + +void hb_audio_resample_set_channel_layout(hb_audio_resample_t *resample, + uint64_t channel_layout, + int channels); + +void hb_audio_resample_set_mix_levels(hb_audio_resample_t *resample, + double surround_mix_level, + double center_mix_level); + +void hb_audio_resample_set_sample_fmt(hb_audio_resample_t *resample, + enum AVSampleFormat sample_fmt); + +/* Update an hb_audio_resample_t. * - * new_channel_layout is sanitized automatically. + * Must be called after using any of the above functions. */ -int hb_audio_resample_update(hb_audio_resample_t *resample, - enum AVSampleFormat new_sample_fmt, - uint64_t new_channel_layout, - double new_surroundmixlev, - double new_centermixlev, - int new_channels); +int hb_audio_resample_update(hb_audio_resample_t *resample); /* Free an hb_audio_remsample_t. */ void hb_audio_resample_free(hb_audio_resample_t *resample); |