优化实现

hdrplus
Matthew 1 year ago
parent a7e1c4496c
commit 99f36a2c9e

@ -134,7 +134,7 @@ public class Camera2VideoActivity extends AppCompatActivity {
try { try {
long ts = System.currentTimeMillis(); long ts = System.currentTimeMillis();
Bitmap bm = Bitmap.createBitmap(mPreviewWidth, mPreviewHeight, Bitmap.Config.ARGB_8888); Bitmap bm = Bitmap.createBitmap(mPreviewView.getMeasuredWidth(), mPreviewView.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
Bitmap oldBm = null; Bitmap oldBm = null;
Canvas canvas = new Canvas(bm); Canvas canvas = new Canvas(bm);
@ -330,13 +330,8 @@ public class Camera2VideoActivity extends AppCompatActivity {
} }
int statusHeight = mStatusBarHeight; int statusHeight = mStatusBarHeight;
int bmWidth = 1620; int bmWidth = bm.getWidth();
int bmHeight = 1080; int bmHeight = bm.getHeight();
AspectRatioFrameLayout frameLayout = (AspectRatioFrameLayout)findViewById(R.id.wrap_view);
int w = frameLayout.getWidth();
int h = frameLayout.getMeasuredHeight();
int margin = mOSDMargin; int margin = mOSDMargin;
int x = 0; int x = 0;
@ -474,7 +469,7 @@ public class Camera2VideoActivity extends AppCompatActivity {
String[] items = mOSDRightBottom.split("\n"); String[] items = mOSDRightBottom.split("\n");
Point origin = new Point(bmWidth - margin, bmHeight - margin); Point origin = new Point(bmWidth - margin, bmHeight - margin);
for(int idx = items.length-1; idx >= 0; idx--) { for(int idx = items.length - 1; idx >= 0; idx--) {
int mask = 0; int mask = 0;
String item = items[idx]; String item = items[idx];
@ -508,7 +503,6 @@ public class Camera2VideoActivity extends AppCompatActivity {
origin.y -= (textBounds.height() * 3) >> 1; origin.y -= (textBounds.height() * 3) >> 1;
} }
} }
} }
private void updateOSD(Bitmap bm, long ts) { private void updateOSD(Bitmap bm, long ts) {
@ -658,8 +652,6 @@ public class Camera2VideoActivity extends AppCompatActivity {
private void setUpCamera() { private void setUpCamera() {
setUpCameraView(); setUpCameraView();
if (mNextVideoAbsolutePath == null || mNextVideoAbsolutePath.isEmpty()) { if (mNextVideoAbsolutePath == null || mNextVideoAbsolutePath.isEmpty()) {
mNextVideoAbsolutePath = getVideoFilePath(this); mNextVideoAbsolutePath = getVideoFilePath(this);
} }

Loading…
Cancel
Save