Package org.lwjgl.util.opus
Interface OPDecodeCBFuncI
-
- All Superinterfaces:
org.lwjgl.system.CallbackI,org.lwjgl.system.Pointer
- All Known Implementing Classes:
OPDecodeCBFunc
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface OPDecodeCBFuncI extends org.lwjgl.system.CallbackIInstances of this interface may be passed to theOpusFile.op_set_decode_callback(long, org.lwjgl.util.opus.OPDecodeCBFuncI, long)method.Type
int (*invoke(long, long, long, long, int, int, int, int)) ( void *_ctx, OpusMSDecoder *_decoder, void *_pcm, ogg_packet const *_op, int _nsamples, int _nchannels, int _format, int _li )
-
-
Field Summary
Fields Modifier and Type Field Description static org.lwjgl.system.libffi.FFICIFCIF
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcallback(long ret, long args)default org.lwjgl.system.libffi.FFICIFgetCallInterface()intinvoke(long _ctx, long _decoder, long _pcm, long _op, int _nsamples, int _nchannels, int _format, int _li)Called to decode an Opus packet.
-
-
-
Method Detail
-
getCallInterface
default org.lwjgl.system.libffi.FFICIF getCallInterface()
- Specified by:
getCallInterfacein interfaceorg.lwjgl.system.CallbackI
-
callback
default void callback(long ret, long args)- Specified by:
callbackin interfaceorg.lwjgl.system.CallbackI
-
invoke
int invoke(long _ctx, long _decoder, long _pcm, long _op, int _nsamples, int _nchannels, int _format, int _li)Called to decode an Opus packet.This should invoke the functional equivalent of
multistream_decodeormultistream_decode_float, except that it returns0on success instead of the number of decoded samples (which is known a priori).- Parameters:
_ctx- the application-provided callback context_decoder- the decoder to use to decode the packet_pcm- the buffer to decode into.This will always have enough room for
_nchannelsof_nsamplessamples, which should be placed into this buffer interleaved._op- the packet to decode. This will always have its granule position set to a valid value._nsamples- the number of samples expected from the packet_nchannels- the number of channels expected from the packet_format- the desired sample output format. This is eitherDEC_FORMAT_SHORTorDEC_FORMAT_FLOAT._li- the index of the link from which this packet was decoded- Returns:
- a non-negative value on success, or a negative value on error.
Any error codes should be the same as those returned by
multistream_decodeormultistream_decode_float. Success codes are as follows:0: Decoding was successful. The application has filled the buffer with exactly_nsamples* _nchannelssamples in the requested format.DEC_USE_DEFAULT: No decoding was done. libopusfile should do the decoding by itself instead.
-
-