Open neilyoung opened 5 years ago
And what is the mystery behind this?
if (Build.VERSION.SDK_INT <= 23){
oldSaveYuvDataToJPEG(bytes, width, height);
}else {
newSaveYuvDataToJPEG(bytes, width, height);
}
What has the SDK version to do with this?
Oh, WTF.. .my post is scrambled. Here again:
I'm talking about this routine in the sample:
First there is a bug: To test yuvFrame.length to be >= withheight is necessary, but not sufficient. Actually .length has to be tested to be exactly 1.5 widht * height.
Then please confirm: Am I seeing this correctly
You are treating the incoming YUV buffer to be NV21 (https://wiki.videolan.org/YUV): Y followed by interleaved U and V, starting with V.
Then you are making it NV12 (Y then U and V interleaved, starting with U)
just to provide it to a function, which seams to expect NV21.
??
private void newSaveYuvDataToJPEG(byte[] yuvFrame, int width, int height){
if (yuvFrame.length < width * height) {
//DJILog.d(TAG, "yuvFrame size is too small " + yuvFrame.length);
return;
}
int length = width * height;
byte[] u = new byte[width * height / 4];
byte[] v = new byte[width * height / 4];
for (int i = 0; i < u.length; i++) {
v[i] = yuvFrame[length + 2 * i];
u[i] = yuvFrame[length + 2 * i + 1];
}
for (int i = 0; i < u.length; i++) {
yuvFrame[length + 2 * i] = u[i];
yuvFrame[length + 2 * i + 1] = v[i];
}
screenShot(yuvFrame,Environment.getExternalStorageDirectory() + "/DJI_ScreenShot", width, height);
}
later
YuvImage yuvImage = new YuvImage(buf,
ImageFormat.NV21,
width,
height,
null);
I'm having a ticket open at your support regarding this (24417). No answer yet. Would you mind to explain?
Hey @neilyoung, thanks for the feedback! we have received your ticket (24417), it will be delivered to our developer soon, if the developer give the feedback, we will reply your email ASAP, thanks! BTW we might need you to provide some info regarding this issue, please check the email later, thanks again!
Public comment from Luce Luo in Zendesk ticket #24678:
Dear Customer,
Thank you for contacting DJI.
To collect questions in detail, please fill in the form below, including your context, mobile device and android system info, and we will handle this ticket as soon as we receive it.
https://formcrafts.com/a/dji-developer-feedback-en
Thanks,
Luce Luo
DJI Dev Team
@dji-dev It is not an issue, it is just a question. Maybe all the problems are gone if you answer me to 24417 :)
https://github.com/accuware/djistreamerlib
Maybe this is of interest in this case
Removed and corrected below...