Package tvi.webrtc
Class WrappedNativeVideoDecoder
- java.lang.Object
-
- tvi.webrtc.WrappedNativeVideoDecoder
-
- All Implemented Interfaces:
VideoDecoder
- Direct Known Subclasses:
LibvpxVp8Decoder
,LibvpxVp9Decoder
,VideoDecoderFallback
public abstract class WrappedNativeVideoDecoder extends java.lang.Object implements VideoDecoder
Wraps a native webrtc::VideoDecoder.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface tvi.webrtc.VideoDecoder
VideoDecoder.Callback, VideoDecoder.DecodeInfo, VideoDecoder.Settings
-
-
Constructor Summary
Constructors Constructor Description WrappedNativeVideoDecoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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).VideoCodecStatus
decode(EncodedImage frame, VideoDecoder.DecodeInfo info)
Request the decoder to decode a frame.java.lang.String
getImplementationName()
Should return a descriptive name for the implementation.boolean
getPrefersLateDecoding()
The decoder should return true if it prefers late decoding.VideoCodecStatus
initDecode(VideoDecoder.Settings settings, VideoDecoder.Callback decodeCallback)
Initializes the decoding process with specified settings.VideoCodecStatus
release()
Called when the decoder is no longer needed.
-
-
-
Method Detail
-
createNativeVideoDecoder
public abstract long createNativeVideoDecoder()
Description copied from interface:VideoDecoder
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.- Specified by:
createNativeVideoDecoder
in interfaceVideoDecoder
-
initDecode
public final VideoCodecStatus initDecode(VideoDecoder.Settings settings, VideoDecoder.Callback decodeCallback)
Description copied from interface:VideoDecoder
Initializes the decoding process with specified settings. Will be called on the decoding thread before any decode calls.- Specified by:
initDecode
in interfaceVideoDecoder
-
release
public final VideoCodecStatus release()
Description copied from interface:VideoDecoder
Called when the decoder is no longer needed. Any more calls to decode will not be made.- Specified by:
release
in interfaceVideoDecoder
-
decode
public final VideoCodecStatus decode(EncodedImage frame, VideoDecoder.DecodeInfo info)
Description copied from interface:VideoDecoder
Request the decoder to decode a frame.- Specified by:
decode
in interfaceVideoDecoder
-
getPrefersLateDecoding
public final boolean getPrefersLateDecoding()
Description copied from interface:VideoDecoder
The decoder should return true if it prefers late decoding. That is, it can not decode infinite number of frames before the decoded frame is consumed.- Specified by:
getPrefersLateDecoding
in interfaceVideoDecoder
-
getImplementationName
public final java.lang.String getImplementationName()
Description copied from interface:VideoDecoder
Should return a descriptive name for the implementation. Gets called once and cached. May be called from arbitrary thread.- Specified by:
getImplementationName
in interfaceVideoDecoder
-
-