Package tvi.webrtc
Interface VideoDecoder
- All Known Implementing Classes:
Dav1dDecoder
,LibaomAv1Decoder
,LibvpxVp8Decoder
,LibvpxVp9Decoder
,VideoDecoderFallback
,WrappedNativeVideoDecoder
public interface VideoDecoder
Interface for a video decoder that can be used in WebRTC. All calls to the class will be made on
a single decoding thread.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static class
Additional info for decoding.static class
Settings passed to the decoder by WebRTC. -
Method Summary
Modifier and TypeMethodDescriptiondefault long
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).decode
(EncodedImage frame, VideoDecoder.DecodeInfo info) Request the decoder to decode a frame.Should return a descriptive name for the implementation.initDecode
(VideoDecoder.Settings settings, VideoDecoder.Callback decodeCallback) Initializes the decoding process with specified settings.release()
Called when the decoder is no longer needed.
-
Method Details
-
createNativeVideoDecoder
default long createNativeVideoDecoder()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). For case 1), createNativeVideoDecoder() 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), createNativeVideoDecoder() 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. -
initDecode
Initializes the decoding process with specified settings. Will be called on the decoding thread before any decode calls. -
release
VideoCodecStatus release()Called when the decoder is no longer needed. Any more calls to decode will not be made. -
decode
Request the decoder to decode a frame. -
getImplementationName
String getImplementationName()Should return a descriptive name for the implementation. Gets called once and cached. May be called from arbitrary thread.
-