Package com.telnyx.webrtc.lib
Class WrappedNativeVideoDecoder
java.lang.Object
com.telnyx.webrtc.lib.WrappedNativeVideoDecoder
- All Implemented Interfaces:
VideoDecoder
- Direct Known Subclasses:
Dav1dDecoder,LibvpxVp8Decoder,LibvpxVp9Decoder,VideoDecoderFallback
Wraps a native webrtc::VideoDecoder.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.telnyx.webrtc.lib.VideoDecoder
VideoDecoder.Callback, VideoDecoder.DecodeInfo, VideoDecoder.Settings -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract longcreateNative(long webrtcEnvRef) The decoder implementation backing this interface is either 1) a Java decoder (e.g., an Android platform decoder), or alternatively 2) a native decoder (e.g., a software decoder or a C++ decoder adapter).final VideoCodecStatusdecode(EncodedImage frame, VideoDecoder.DecodeInfo info) Request the decoder to decode a frame.final StringShould return a descriptive name for the implementation.final VideoCodecStatusinitDecode(VideoDecoder.Settings settings, VideoDecoder.Callback decodeCallback) Initializes the decoding process with specified settings.final VideoCodecStatusrelease()Called when the decoder is no longer needed.
-
Constructor Details
-
WrappedNativeVideoDecoder
public WrappedNativeVideoDecoder()
-
-
Method Details
-
createNative
public abstract long createNative(long webrtcEnvRef) Description copied from interface:VideoDecoderThe decoder implementation backing this interface is either 1) a Java decoder (e.g., an Android platform decoder), or alternatively 2) a native decoder (e.g., a software decoder or a C++ decoder adapter). For case 1), createNative() should return zero. In this case, we expect the native library to call the decoder through JNI using the Java interface declared below. For case 2), createNative() should return a non-zero value. In this case, we expect the native library to treat the returned value as a raw pointer of type webrtc::VideoDecoder* (ownership is transferred to the caller). The native library should then directly call the webrtc::VideoDecoder interface without going through JNI. All calls to the Java interface methods declared below should thus throw an UnsupportedOperationException.- Specified by:
createNativein interfaceVideoDecoder
-
initDecode
public final VideoCodecStatus initDecode(VideoDecoder.Settings settings, VideoDecoder.Callback decodeCallback) Description copied from interface:VideoDecoderInitializes the decoding process with specified settings. Will be called on the decoding thread before any decode calls.- Specified by:
initDecodein interfaceVideoDecoder
-
release
Description copied from interface:VideoDecoderCalled when the decoder is no longer needed. Any more calls to decode will not be made.- Specified by:
releasein interfaceVideoDecoder
-
decode
Description copied from interface:VideoDecoderRequest the decoder to decode a frame.- Specified by:
decodein interfaceVideoDecoder
-
getImplementationName
Description copied from interface:VideoDecoderShould return a descriptive name for the implementation. Gets called once and cached. May be called from arbitrary thread.- Specified by:
getImplementationNamein interfaceVideoDecoder
-