Top Description Inners Constructors Methods
org.lwjgl.util.opus

public abstract Class OPDecodeCBFunc

extends Callback
implements OPDecodeCBFuncI
Class Inheritance
All Implemented Interfaces
org.lwjgl.util.opus.OPDecodeCBFuncI, org.lwjgl.system.CallbackI, org.lwjgl.system.Pointer
Known Direct Subclasses
org.lwjgl.util.opus.OPDecodeCBFunc.Container
Imports
javax.annotation.*, org.lwjgl.system.*

Instances of this class may be passed to the OpusFile#op_set_decode_callback method.

Type


int (*invoke) (
    void *_ctx,
    OpusMSDecoder *_decoder,
    void *_pcm,
    ogg_packet const *_op,
    int _nsamples,
    int _nchannels,
    int _format,
    int _li
)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
protected
pack-priv
OPDecodeCBFunc(long functionPointer)

Method Summary

Modifier and TypeMethod and Description
public static OPDecodeCBFunc

Returns:

the new OPDecodeCBFunc
create
(long functionPointer)

Creates a OPDecodeCBFunc instance from the specified function pointer.

public static OPDecodeCBFunc
create(OPDecodeCBFuncI instance)

Creates a OPDecodeCBFunc instance that delegates to the specified OPDecodeCBFuncI instance.

public static OPDecodeCBFunc
createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

Inherited from org.lwjgl.system.Callback:
addressequalsfreefreegetgetSafehashCodetoString

Constructor Detail

OPDecodeCBFuncback to summary
protected OPDecodeCBFunc()
OPDecodeCBFuncback to summary
pack-priv OPDecodeCBFunc(long functionPointer)

Method Detail

createback to summary
public static OPDecodeCBFunc create(long functionPointer)

Creates a OPDecodeCBFunc instance from the specified function pointer.

Returns:OPDecodeCBFunc

the new OPDecodeCBFunc

createback to summary
public static OPDecodeCBFunc create(OPDecodeCBFuncI instance)

Creates a OPDecodeCBFunc instance that delegates to the specified OPDecodeCBFuncI instance.

createSafeback to summary
public static OPDecodeCBFunc createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

Annotations
@Nullable
org.lwjgl.util.opus back to summary

private final Class OPDecodeCBFunc.Container

extends OPDecodeCBFunc
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final OPDecodeCBFuncI

Constructor Summary

AccessConstructor and Description
pack-priv
Container(long functionPointer, OPDecodeCBFuncI delegate)

Method Summary

Modifier and TypeMethod and Description
public int
invoke(long
the application-provided callback context
_ctx
,
long
the decoder to use to decode the packet
_decoder
,
long
the buffer to decode into.

This will always have enough room for _nchannels of _nsamples samples, which should be placed into this buffer interleaved.

_pcm
,
long
the packet to decode. This will always have its granule position set to a valid value.
_op
,
int
the number of samples expected from the packet
_nsamples
,
int
the number of channels expected from the packet
_nchannels
,
int
the desired sample output format. This is either DEC_FORMAT_SHORT or DEC_FORMAT_FLOAT.
_format
,
int
the index of the link from which this packet was decoded
_li
)

Implements org.lwjgl.util.opus.OPDecodeCBFuncI.invoke.

Called to decode an Opus packet.
Inherited from org.lwjgl.util.opus.OPDecodeCBFunc:
createcreatecreateSafe

Field Detail

delegateback to summary
private final OPDecodeCBFuncI delegate

Constructor Detail

Containerback to summary
pack-priv Container(long functionPointer, OPDecodeCBFuncI delegate)

Method Detail

invokeback to summary
public int invoke(long _ctx, long _decoder, long _pcm, long _op, int _nsamples, int _nchannels, int _format, int _li)

Implements org.lwjgl.util.opus.OPDecodeCBFuncI.invoke.

Doc from org.lwjgl.util.opus.OPDecodeCBFuncI.invoke.

Called to decode an Opus packet.

This should invoke the functional equivalent of multistream_decode or multistream_decode_float, except that it returns 0 on success instead of the number of decoded samples (which is known a priori).

Parameters
_ctx:long

the application-provided callback context

_decoder:long

the decoder to use to decode the packet

_pcm:long

the buffer to decode into.

This will always have enough room for _nchannels of _nsamples samples, which should be placed into this buffer interleaved.

_op:long

the packet to decode. This will always have its granule position set to a valid value.

_nsamples:int

the number of samples expected from the packet

_nchannels:int

the number of channels expected from the packet

_format:int

the desired sample output format. This is either DEC_FORMAT_SHORT or DEC_FORMAT_FLOAT.

_li:int

the index of the link from which this packet was decoded

Returns:int

a non-negative value on success, or a negative value on error.

Any error codes should be the same as those returned by multistream_decode or multistream_decode_float. Success codes are as follows:

  • 0: Decoding was successful. The application has filled the buffer with exactly _nsamples* _nchannels samples in the requested format.
  • DEC_USE_DEFAULT: No decoding was done. libopusfile should do the decoding by itself instead.
Annotations
@Override