DJI-Mobile-SDK-Tutorials / Android-VideoStreamDecodingSample

This sample project demonstrates how to use FFmpeg for video frame parsing and to use MediaCodec for hardware decoding on DJI Products.
MIT License
170 stars 81 forks source link

Problem with changing camera mode. #2

Closed tito91 closed 7 years ago

tito91 commented 7 years ago

I'm having problems with solving issue that I have in my project and can be reproduced here. After changing camera mode with DJICameraSettingsDef.CameraPhotoAspectRatio.AspectRatio_16_9 or DJICameraSettingsDef.CameraPhotoAspectRatio.AspectRatio_4_3 video preview just stops most of the times. Does anybody have any suggestion how to solve this?

EDIT: In case someone else will be trying to do this: the problem can be fixed with changing the condition for reinitializing decoder in onFrameQueueIn method in DJIVideoStreamDecoder. In my case only one dimention of the video frame changed, and the condition expected both of them to change in order to trigger reinitialization.