class DJICodecManager
class DJICodecManager implements RecvDataCallback
Description:
Class that handles encoding and decoding of media.
Class Members:
method destroyCodec
Description:
Destroys the media codec.
method DJICodecManager
DJICodecManager(Context context, SurfaceTexture surfaceTexture,int width,int height)
Description:
Constructor for the class.
Context context The context. SurfaceTexture surfaceTexture The surface texture view. int width The width of surface texture view. int height The height of surface texture view.
method DJICodecManager
DJICodecManager(Context context, SurfaceHolder surfaceHolder, int width, int height)
Description:
Constructor for the class.
Context context The context. SurfaceHolder surfaceHolder The surface view. int width The width of surface texture view. int height The height of surface texture view.
method cleanSurface
Description:
Cleans the surface from the codec manager.
method switchSource
void switchSource (VideoSource source)
Description:
Switches the video source of the decoder.
method isDecoderOK
Description:
Determines whether the decoding status is normal.
Return:
boolean true
if the decoding status is normal, false otherwise.
Send Data To Decoder
method
method sendDataToDecoder
void sendDataToDecoder (byte [] videoBuffer, int size)
Description:
Sends H264 raw video data to the decoder.
byte[] videoBuffer The video buffer data. int size The data size.
method sendDataToDecoder
void sendDataToDecoder (byte [] videoBuffer, int size, VideoSource source)
Description:
Sends H264 raw video data to the decoder.
byte[] videoBuffer The video buffer data. int size The data size. VideoSource source The source of the data.
method sendDataToDecoder
void sendDataToDecoder (byte [] videoBuffer, int size, int source)
Description:
Sends H264 raw video data to the decoder with source id.
byte[] videoBuffer The video buffer data. int size The data size. int source source id.
method getVideoWidth
Description:
Get the video width.
Return:
Integer Video width Integer value.
method getVideoHeight
Description:
Get the video height.
Return:
Integer Video height Integer value.
Surface Size Changed
method
method onSurfaceSizeChanged
void onSurfaceSizeChanged (int width, int height,int degree)
Description:
Resizes the surface when the size of the surface texture view has changed.
int width The new width of the surface int height The new height of the surface int degree The new degree of the surface
method enabledYuvData
void enabledYuvData (Boolean enabled)
Description:
To enable the YUV data output to user which must set the surface as null to avoid native buffer.
Boolean enabled The YUV data callback.
Peak Focus Threshold
method
method setPeakFocusThresholdEnabled
void setPeakFocusThresholdEnabled (boolean isEnabled)
Description:
Enable Peak Focus Threshold.
boolean isEnabled Enable/disable focus threshold.
method setPeakFocusThreshold
void setPeakFocusThreshold (float peakFocusThresholdValue)
Description:
Set the peak focus threshold value.
float peakFocusThresholdValue A float value representing peak focus threshold.
Over Exposure Warning
method
method setOverexposureWarningEnabled
void setOverexposureWarningEnabled (boolean isEnabled)
Description:
Enable or disable the over exposure warning.
boolean isEnabled Enable/Disable the over exposure warning.
method setCodecName
void setCodecName (final String codecName)
Description:
Set the codec name. For some mobile phones that cannot display video stream normally. You can set the codec name through this interface so that MSDK can call the correct decoder for decoding and display. You can call android API:MediaCodecList to get available codec names for testing.
method setYuvDataCallback
void setYuvDataCallback (YuvDataCallback callback)
Description:
Sends YUV data from hardware decoder.
method getYuvDataCallback
YuvDataCallback getYuvDataCallback ()
Description:
Sends YUV data from hardware decoder.
Return:
method getYuvData
byte [] getYuvData(int width, int height)
Description:
Gets YUV data from hardware decoder. The obtained data of format is MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar
and the width and height must be even.
int width width of the video. int height height of the video.
Return:
byte[] The YUV data from the hardware decoder.
method getRgbaData
byte [] getRgbaData(int width, int height)
Description:
Gets RGBA data from hardware decoder.
int width width of the video. int height height of the video.
Return:
byte[] The RGBA data from the hardware decoder.
enum VideoSource
Description:
The source of the video feed.
Enum Members:
CAMERAThe source of the video feed is the main camera. FPVThe source of the video feed is the FPV camera. SECONDARY_CAMERAThe source of the video feed is the secondary camera. UNKNOWNThe source of the video feed is unknown.
Class Members: