If you are developing a payload using PSDK 2.2.0+ and MSDK 4.14+, you first need to use the isDJIVideoStreamingChannelAvailable method to confirm whether the video stream format is DJI FORMAT H264 or CUSTOM H264.
If the isDJIVideoStreamingChannelAvailable returns true, it indicates that the video stream format is DJI H264. In this case, you should use the traditional getPrimaryVideoFeed or getSecondaryVideoFeed to retrieve the data and then decode it in the normal way (similar to how DJI cameras work).
If this interface returns false, it means that the video stream format is CUS H264. In this scenario, you should use the setVideoDataReceivedCallback interface in the payload class for decoding. An example is provided below.
payload.setVideoDataReceivedCallback(new Payload.VideoDataReceivedCallback() {
@Override
public void onVideoDataReceived(byte[] var1, int var2) {
if (mCodecManager != null) {
mCodecManager.sendDataToDecoder(var1, var2, DJICodecManager.VideoSource.SECONDARY_CAMERA);
}
}
});
Comments
0 comments
Please sign in to leave a comment.