public class swresample extends swresample
Modifier and Type | Field and Description |
---|---|
static int |
SWR_DITHER_NB
enum SwrDitherType
|
static int |
SWR_DITHER_NONE
enum SwrDitherType
|
static int |
SWR_DITHER_NS
enum SwrDitherType
|
static int |
SWR_DITHER_NS_F_WEIGHTED
enum SwrDitherType
|
static int |
SWR_DITHER_NS_HIGH_SHIBATA
enum SwrDitherType
|
static int |
SWR_DITHER_NS_IMPROVED_E_WEIGHTED
enum SwrDitherType
|
static int |
SWR_DITHER_NS_LIPSHITZ
enum SwrDitherType
|
static int |
SWR_DITHER_NS_LOW_SHIBATA
enum SwrDitherType
|
static int |
SWR_DITHER_NS_MODIFIED_E_WEIGHTED
enum SwrDitherType
|
static int |
SWR_DITHER_NS_SHIBATA
enum SwrDitherType
|
static int |
SWR_DITHER_RECTANGULAR
enum SwrDitherType
|
static int |
SWR_DITHER_TRIANGULAR
enum SwrDitherType
|
static int |
SWR_DITHER_TRIANGULAR_HIGHPASS
enum SwrDitherType
|
static int |
SWR_ENGINE_NB
enum SwrEngine
|
static int |
SWR_ENGINE_SOXR
enum SwrEngine
|
static int |
SWR_ENGINE_SWR
enum SwrEngine
|
static int |
SWR_FILTER_TYPE_BLACKMAN_NUTTALL
enum SwrFilterType
|
static int |
SWR_FILTER_TYPE_CUBIC
enum SwrFilterType
|
static int |
SWR_FILTER_TYPE_KAISER
enum SwrFilterType
|
static int |
SWR_FLAG_RESAMPLE
Force resampling even if equal sample rate
|
Constructor and Description |
---|
swresample() |
Modifier and Type | Method and Description |
---|---|
static SwrContext |
swr_alloc_set_opts(SwrContext s,
long out_ch_layout,
int out_sample_fmt,
int out_sample_rate,
long in_ch_layout,
int in_sample_fmt,
int in_sample_rate,
int log_offset,
Pointer log_ctx)
Allocate SwrContext if needed and set/reset common parameters.
|
static SwrContext |
swr_alloc()
Allocate SwrContext.
|
static int |
swr_build_matrix(long in_layout,
long out_layout,
double center_mix_level,
double surround_mix_level,
double lfe_mix_level,
double rematrix_maxval,
double rematrix_volume,
double[] matrix,
int stride,
int matrix_encoding,
Pointer log_ctx) |
static int |
swr_build_matrix(long in_layout,
long out_layout,
double center_mix_level,
double surround_mix_level,
double lfe_mix_level,
double rematrix_maxval,
double rematrix_volume,
DoubleBuffer matrix,
int stride,
int matrix_encoding,
Pointer log_ctx) |
static int |
swr_build_matrix(long in_layout,
long out_layout,
double center_mix_level,
double surround_mix_level,
double lfe_mix_level,
double rematrix_maxval,
double rematrix_volume,
DoublePointer matrix,
int stride,
int matrix_encoding,
Pointer log_ctx)
Generate a channel mixing matrix.
|
static void |
swr_close(SwrContext s)
Closes the context so that swr_is_initialized() returns 0.
|
static int |
swr_config_frame(SwrContext swr,
AVFrame out,
AVFrame in)
Configure or reconfigure the SwrContext using the information
provided by the AVFrames.
|
static int |
swr_convert_frame(SwrContext swr,
AVFrame output,
AVFrame input)
Convert the samples in the input AVFrame and write them to the output AVFrame.
|
static int |
swr_convert(SwrContext s,
byte[] out,
int out_count,
byte[] in,
int in_count) |
static int |
swr_convert(SwrContext s,
ByteBuffer out,
int out_count,
ByteBuffer in,
int in_count) |
static int |
swr_convert(SwrContext s,
BytePointer out,
int out_count,
BytePointer in,
int in_count) |
static int |
swr_convert(SwrContext s,
PointerPointer out,
int out_count,
PointerPointer in,
int in_count)
Convert audio.
|
static int |
swr_drop_output(SwrContext s,
int count)
Drops the specified number of output samples.
|
static void |
swr_free(PointerPointer s)
Free the given SwrContext and set the pointer to NULL.
|
static void |
swr_free(SwrContext s) |
static AVClass |
swr_get_class()
Get the AVClass for SwrContext.
|
static long |
swr_get_delay(SwrContext s,
long base)
Gets the delay the next input sample will experience relative to the next output sample.
|
static int |
swr_get_out_samples(SwrContext s,
int in_samples)
Find an upper bound on the number of samples that the next swr_convert
call will output, if called with in_samples of input samples.
|
static int |
swr_init(SwrContext s)
Initialize context after user parameters have been set.
|
static int |
swr_inject_silence(SwrContext s,
int count)
Injects the specified number of silence samples.
|
static int |
swr_is_initialized(SwrContext s)
Check whether an swr context has been initialized or not.
|
static long |
swr_next_pts(SwrContext s,
long pts)
Convert the next timestamp from input to output
timestamps are in 1/(in_sample_rate * out_sample_rate) units.
|
static int |
swr_set_channel_mapping(SwrContext s,
int[] channel_map) |
static int |
swr_set_channel_mapping(SwrContext s,
IntBuffer channel_map) |
static int |
swr_set_channel_mapping(SwrContext s,
IntPointer channel_map)
Set a customized input channel mapping.
|
static int |
swr_set_compensation(SwrContext s,
int sample_delta,
int compensation_distance)
Activate resampling compensation ("soft" compensation).
|
static int |
swr_set_matrix(SwrContext s,
double[] matrix,
int stride) |
static int |
swr_set_matrix(SwrContext s,
DoubleBuffer matrix,
int stride) |
static int |
swr_set_matrix(SwrContext s,
DoublePointer matrix,
int stride)
Set a customized remix matrix.
|
static BytePointer |
swresample_configuration()
Return the swr build-time configuration.
|
static BytePointer |
swresample_license()
Return the swr license.
|
static int |
swresample_version()
Return the \ref LIBSWRESAMPLE_VERSION_INT constant.
|
map
public static final int SWR_FLAG_RESAMPLE
public static final int SWR_DITHER_NONE
public static final int SWR_DITHER_RECTANGULAR
public static final int SWR_DITHER_TRIANGULAR
public static final int SWR_DITHER_TRIANGULAR_HIGHPASS
public static final int SWR_DITHER_NS
public static final int SWR_DITHER_NS_LIPSHITZ
public static final int SWR_DITHER_NS_F_WEIGHTED
public static final int SWR_DITHER_NS_MODIFIED_E_WEIGHTED
public static final int SWR_DITHER_NS_IMPROVED_E_WEIGHTED
public static final int SWR_DITHER_NS_SHIBATA
public static final int SWR_DITHER_NS_LOW_SHIBATA
public static final int SWR_DITHER_NS_HIGH_SHIBATA
public static final int SWR_DITHER_NB
public static final int SWR_ENGINE_SWR
public static final int SWR_ENGINE_SOXR
public static final int SWR_ENGINE_NB
public static final int SWR_FILTER_TYPE_CUBIC
public static final int SWR_FILTER_TYPE_BLACKMAN_NUTTALL
public static final int SWR_FILTER_TYPE_KAISER
@NoException @Const public static AVClass swr_get_class()
av_opt_find().
@NoException public static SwrContext swr_alloc()
swr_alloc_set_opts(), swr_init(), swr_free()
@NoException public static int swr_init(SwrContext s)
s
- [in,out] Swr context to initializeav_opt_set_int()
,
av_opt_set_dict()
@NoException public static int swr_is_initialized(SwrContext s)
s
- [in] Swr context to checkswr_init()
@NoException public static SwrContext swr_alloc_set_opts(SwrContext s, @Cast(value="int64_t") long out_ch_layout, @Cast(value="AVSampleFormat") int out_sample_fmt, int out_sample_rate, @Cast(value="int64_t") long in_ch_layout, @Cast(value="AVSampleFormat") int in_sample_fmt, int in_sample_rate, int log_offset, Pointer log_ctx)
s
- existing Swr context if available, or NULL if notout_ch_layout
- output channel layout (AV_CH_LAYOUT_*)out_sample_fmt
- output sample format (AV_SAMPLE_FMT_*).out_sample_rate
- output sample rate (frequency in Hz)in_ch_layout
- input channel layout (AV_CH_LAYOUT_*)in_sample_fmt
- input sample format (AV_SAMPLE_FMT_*).in_sample_rate
- input sample rate (frequency in Hz)log_offset
- logging level offsetlog_ctx
- parent logging context, can be NULLswr_init(), swr_free()
@NoException public static void swr_free(@Cast(value="SwrContext**") PointerPointer s)
s
- [in] a pointer to a pointer to Swr context@NoException public static void swr_free(@ByPtrPtr SwrContext s)
@NoException public static void swr_close(SwrContext s)
s
- [in,out] Swr context to be closed@NoException public static int swr_convert(SwrContext s, @Cast(value="uint8_t**") PointerPointer out, int out_count, @Cast(value="const uint8_t**") PointerPointer in, int in_count)
s
- allocated Swr context, with parameters setout
- output buffers, only the first one need be set in case of packed audioout_count
- amount of space available for output in samples per channelin
- input buffers, only the first one need to be set in case of packed audioin_count
- number of input samples available in one channel@NoException public static int swr_convert(SwrContext s, @Cast(value="uint8_t**") @ByPtrPtr BytePointer out, int out_count, @Cast(value="const uint8_t**") @ByPtrPtr BytePointer in, int in_count)
@NoException public static int swr_convert(SwrContext s, @Cast(value="uint8_t**") @ByPtrPtr ByteBuffer out, int out_count, @Cast(value="const uint8_t**") @ByPtrPtr ByteBuffer in, int in_count)
@NoException public static int swr_convert(SwrContext s, @Cast(value="uint8_t**") @ByPtrPtr byte[] out, int out_count, @Cast(value="const uint8_t**") @ByPtrPtr byte[] in, int in_count)
@NoException @Cast(value="int64_t") public static long swr_next_pts(SwrContext s, @Cast(value="int64_t") long pts)
s[in]
- initialized Swr contextpts[in]
- timestamp for the next input sample, INT64_MIN if unknownswr_set_compensation(), swr_drop_output(), and swr_inject_silence() are
function used internally for timestamp compensation.
@NoException public static int swr_set_compensation(SwrContext s, int sample_delta, int compensation_distance)
s
- [in,out] allocated Swr context. If it is not initialized,
or SWR_FLAG_RESAMPLE is not set, swr_init() is
called with the flag set.sample_delta
- [in] delta in PTS per samplecompensation_distance
- [in] number of samples to compensate for@NoException public static int swr_set_channel_mapping(SwrContext s, @Const IntPointer channel_map)
s
- [in,out] allocated Swr context, not yet initializedchannel_map
- [in] customized input channel mapping (array of channel
indexes, -1 for a muted channel)@NoException public static int swr_set_channel_mapping(SwrContext s, @Const IntBuffer channel_map)
@NoException public static int swr_set_channel_mapping(SwrContext s, @Const int[] channel_map)
@NoException public static int swr_build_matrix(@Cast(value="uint64_t") long in_layout, @Cast(value="uint64_t") long out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double rematrix_maxval, double rematrix_volume, DoublePointer matrix, int stride, @Cast(value="AVMatrixEncoding") int matrix_encoding, Pointer log_ctx)
in_layout
- input channel layoutout_layout
- output channel layoutcenter_mix_level
- mix level for the center channelsurround_mix_level
- mix level for the surround channel(s)lfe_mix_level
- mix level for the low-frequency effects channelrematrix_maxval
- if 1.0, coefficients will be normalized to prevent
overflow. if INT_MAX, coefficients will not be
normalized.matrix
- [out] mixing coefficients; matrix[i + stride * o] is
the weight of input channel i in output channel o.stride
- distance between adjacent input channels in the
matrix arraymatrix_encoding
- matrixed stereo downmix mode (e.g. dplii)log_ctx
- parent logging context, can be NULL@NoException public static int swr_build_matrix(@Cast(value="uint64_t") long in_layout, @Cast(value="uint64_t") long out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double rematrix_maxval, double rematrix_volume, DoubleBuffer matrix, int stride, @Cast(value="AVMatrixEncoding") int matrix_encoding, Pointer log_ctx)
@NoException public static int swr_build_matrix(@Cast(value="uint64_t") long in_layout, @Cast(value="uint64_t") long out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, double rematrix_maxval, double rematrix_volume, double[] matrix, int stride, @Cast(value="AVMatrixEncoding") int matrix_encoding, Pointer log_ctx)
@NoException public static int swr_set_matrix(SwrContext s, @Const DoublePointer matrix, int stride)
s
- allocated Swr context, not yet initializedmatrix
- remix coefficients; matrix[i + stride * o] is
the weight of input channel i in output channel ostride
- offset between lines of the matrix@NoException public static int swr_set_matrix(SwrContext s, @Const DoubleBuffer matrix, int stride)
@NoException public static int swr_set_matrix(SwrContext s, @Const double[] matrix, int stride)
@NoException public static int swr_drop_output(SwrContext s, int count)
s
- allocated Swr contextcount
- number of samples to be dropped@NoException public static int swr_inject_silence(SwrContext s, int count)
s
- allocated Swr contextcount
- number of samples to be dropped@NoException @Cast(value="int64_t") public static long swr_get_delay(SwrContext s, @Cast(value="int64_t") long base)
s
- swr contextbase
- timebase in which the returned delay will be:
\li if it's set to 1 the returned delay is in seconds
\li if it's set to 1000 the returned delay is in milliseconds
\li if it's set to the input sample rate then the returned
delay is in input samples
\li if it's set to the output sample rate then the returned
delay is in output samples
\li if it's the least common multiple of in_sample_rate and
out_sample_rate then an exact rounding-free delay will be
returned@NoException public static int swr_get_out_samples(SwrContext s, int in_samples)
in_samples
- number of input samples.
\note any call to swr_inject_silence(), swr_convert(), swr_next_pts()
or swr_set_compensation() invalidates this limit
\note it is recommended to pass the correct available buffer size
to all functions like swr_convert() even if swr_get_out_samples()
indicates that less would be used.@NoException @Cast(value="unsigned") public static int swresample_version()
@NoException @Cast(value="const char*") public static BytePointer swresample_configuration()
@NoException @Cast(value="const char*") public static BytePointer swresample_license()
@NoException public static int swr_convert_frame(SwrContext swr, AVFrame output, @Const AVFrame input)
swr
- audio resample contextoutput
- output AVFrameinput
- input AVFrameswr_delay()
,
swr_convert()
,
swr_get_delay()
@NoException public static int swr_config_frame(SwrContext swr, @Const AVFrame out, @Const AVFrame in)
swr
- audio resample contextoutput
- output AVFrameinput
- input AVFrameswr_close();
Copyright © 2020. All rights reserved.