增加六通道配置拍照
parent
ef21a79659
commit
9ba5867814
@ -0,0 +1,21 @@
|
|||||||
|
package com.xypower.mppreview;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.camera.core.ImageAnalysis;
|
||||||
|
import androidx.camera.core.ImageProxy;
|
||||||
|
|
||||||
|
import com.xypower.mppreview.bean.Contants;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class MyAnalyzer implements ImageAnalysis.Analyzer{
|
||||||
|
@SuppressLint("UnsafeOptInUsageError")
|
||||||
|
@Override
|
||||||
|
public void analyze(@NonNull ImageProxy image) {
|
||||||
|
Log.d(Contants.TAG, "Image's stamp is " + Objects.requireNonNull(image.getImage()).getTimestamp());
|
||||||
|
image.close();
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,10 @@
|
|||||||
package com.xypower.mppreview.bean;
|
package com.xypower.mppreview.bean;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class Contants {
|
public class Contants {
|
||||||
|
public static final String TAG = "MpPriview";
|
||||||
public static final String HDRNUM = "hdrnum";
|
public static final String HDRNUM = "hdrnum";
|
||||||
|
public static final String CAMERAID = "CAMERAID";
|
||||||
|
public static final String FILENAME_FORMAT = "yyyy-MM-dd-HH-mm-ss-SSS";
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".CameraChannelActivity">
|
||||||
|
|
||||||
|
<androidx.camera.view.PreviewView
|
||||||
|
android:id="@+id/viewFinder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/image_capture_button"
|
||||||
|
android:layout_width="110dp"
|
||||||
|
android:layout_height="110dp"
|
||||||
|
android:layout_marginEnd="50dp"
|
||||||
|
android:layout_marginBottom="50dp"
|
||||||
|
android:elevation="2dp"
|
||||||
|
android:text="拍照"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/vertical_centerline"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/video_capture_button"
|
||||||
|
android:layout_width="110dp"
|
||||||
|
android:layout_height="110dp"
|
||||||
|
android:layout_marginStart="50dp"
|
||||||
|
android:layout_marginBottom="50dp"
|
||||||
|
android:elevation="2dp"
|
||||||
|
android:text="预览"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/vertical_centerline" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/vertical_centerline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent=".50" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue