Browse Source

Microphone Detector and Video Detector and Recorder working simultaniously

bk_video_test
Bastian Kohler 1 year ago
parent
commit
f329fab62d

+ 14
- 0
app/src/main/java/com/example/ueberwachungssystem/MainActivity.java View File

import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ToggleButton; import android.widget.ToggleButton;


import com.example.ueberwachungssystem.Detection.DetectionReport; import com.example.ueberwachungssystem.Detection.DetectionReport;
import com.example.ueberwachungssystem.Detection.Detector; import com.example.ueberwachungssystem.Detection.Detector;
import com.example.ueberwachungssystem.Detection.VideoDetector; import com.example.ueberwachungssystem.Detection.VideoDetector;
import com.example.ueberwachungssystem.logger.Logger;
import com.jjoe64.graphview.GraphView;


@ExperimentalGetImage @ExperimentalGetImage
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
PreviewView previewView = findViewById(R.id.previewView); PreviewView previewView = findViewById(R.id.previewView);




// Mic stuff
TextView textView= (TextView) findViewById(R.id.textView); //Set textview for showing logged content
Logger logger = new Logger(this.getClass().getSimpleName(), textView, "");
GraphView graph = (GraphView) findViewById(R.id.graph);
MicrophoneDetector mic = new MicrophoneDetector(this, logger, graph);
mic.startDetection();




// video Stuff
VideoDetector vd = new VideoDetector(this); VideoDetector vd = new VideoDetector(this);
//vd.setPreviewView(previewView); //vd.setPreviewView(previewView);
vd.debugProcessing(inputImageView, outputImageView); vd.debugProcessing(inputImageView, outputImageView);

+ 19
- 1
app/src/main/res/layout/activity_main.xml View File

tools:context=".MainActivity"> tools:context=".MainActivity">




<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="TextView" />

<androidx.camera.view.PreviewView <androidx.camera.view.PreviewView
android:id="@+id/previewView" android:id="@+id/previewView"
android:layout_width="match_parent" android:layout_width="match_parent"
<ImageView <ImageView
android:id="@+id/outputImageView" android:id="@+id/outputImageView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="1dp"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />


<com.jjoe64.graphview.GraphView
android:id="@+id/graph"
android:layout_width="match_parent"
android:layout_height="200dip"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.499" />



</LinearLayout> </LinearLayout>

Loading…
Cancel
Save