Skip to content

Commit

Permalink
squid:S881 - Increment (++) and decrement (--) operators should not b…
Browse files Browse the repository at this point in the history
…e mixed with other operators in an expression
  • Loading branch information
Mohamed Ezzat committed May 24, 2016
1 parent 565308a commit 3ee6860
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions app/src/main/java/com/qd/recorder/FFmpegRecorderActivity.java
Expand Up @@ -842,8 +842,10 @@ private byte[] rotateYUV420Degree180(byte[] data, int imageWidth, int imageHeigh

for (i = imageWidth * imageHeight * 3 / 2 - 1; i >= imageWidth
* imageHeight; i -= 2) {
yuv[count++] = data[i - 1];
yuv[count++] = data[i];
yuv[count] = data[i - 1];
count++;
yuv[count] = data[i];
count++;
}
return yuv;
}
Expand Down Expand Up @@ -919,15 +921,17 @@ public byte[] cropYUV420(byte[] data,int imageW,int imageH,int newImageH){
count = 0;
for(j=cropH;j<cropH+newImageH;j++){
for(i=0;i<imageW;i++){
yuv[count++] = data[j*imageW+i];
yuv[count] = data[j*imageW+i];
count++;
}
}

//Cr Cb
tmp = imageH+cropH/2;
for(j=tmp;j<tmp + newImageH/2;j++){
for(i=0;i<imageW;i++){
yuv[count++] = data[j*imageW+i];
yuv[count] = data[j*imageW+i];
count++;
}
}

Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/qd/recorder/RecorderThread.java
Expand Up @@ -36,7 +36,8 @@ public RecorderThread(opencv_core.IplImage yuvIplImage,NewFFmpegFrameRecorder vi

public void putByteData(SavedFrames lastSavedframe){
if(mByteBuffer != null && mByteBuffer.hasRemaining()){
mTime[mIndex++] = lastSavedframe.getTimeStamp();
mTime[mIndex] = lastSavedframe.getTimeStamp();
mIndex++;
mByteBuffer.put(lastSavedframe.getFrameBytesData());
}
}
Expand All @@ -58,7 +59,8 @@ public void run() {
}

pos += mSize;
mVideoRecorder.setTimestamp(mTime[timeIndex++]);
mVideoRecorder.setTimestamp(mTime[timeIndex]);
timeIndex++;
mYuvIplImage.getByteBuffer().put(mBytes);

try {
Expand Down

0 comments on commit 3ee6860

Please sign in to comment.