From 1f06f73dc8cce4df10803e0c88b54d9ea22ce1f4 Mon Sep 17 00:00:00 2001 From: lingxiaopua <1083514716@qq.com> Date: Sat, 30 Mar 2019 22:41:15 +0800 Subject: [PATCH 1/2] update use system camera example with androidx --- app/src/main/AndroidManifest.xml | 12 +++++++++++ .../com/camera/lingxiao/camerademo/App.java | 2 +- .../lingxiao/camerademo/SplashActivity.java | 5 ++++- app/src/main/res/layout/activity_splash.xml | 20 +++++++++++++++++-- .../res/layout/activity_system_camera.xml | 2 +- .../media/lingxiao/harddecoder/Server.java | 8 ++++++-- .../harddecoder/decoder/AudioDecoder.java | 11 +--------- .../harddecoder/decoder/H264Decoder.java | 14 +++---------- .../lingxiao/harddecoder/tlv/TLVDecoder.java | 2 +- 9 files changed, 47 insertions(+), 29 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index db3e080..fb154c1 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -37,6 +37,18 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/camera/lingxiao/camerademo/App.java b/app/src/main/java/com/camera/lingxiao/camerademo/App.java index 837c20d..62a1ed0 100644 --- a/app/src/main/java/com/camera/lingxiao/camerademo/App.java +++ b/app/src/main/java/com/camera/lingxiao/camerademo/App.java @@ -12,6 +12,6 @@ public class App extends Application{ @Override public void onCreate() { super.onCreate(); - //CrashHandler.getInstance().init(this,true); + CrashHandler.getInstance().init(this,true); } } diff --git a/app/src/main/java/com/camera/lingxiao/camerademo/SplashActivity.java b/app/src/main/java/com/camera/lingxiao/camerademo/SplashActivity.java index 6aec329..dcf594a 100644 --- a/app/src/main/java/com/camera/lingxiao/camerademo/SplashActivity.java +++ b/app/src/main/java/com/camera/lingxiao/camerademo/SplashActivity.java @@ -48,7 +48,7 @@ protected void initWidget() { methodRequiresTwoPermission(); } - @OnClick({R.id.button_extractor,R.id.button_camera,R.id.button_audio}) + @OnClick({R.id.button_extractor,R.id.button_camera,R.id.button_audio,R.id.button_system_camera}) public void onClick(View v) { switch (v.getId()) { default: @@ -62,6 +62,9 @@ public void onClick(View v) { case R.id.button_audio: startActivity(new Intent(getApplicationContext(), AudioActivity.class)); break; + case R.id.button_system_camera: + startActivity(new Intent(getApplicationContext(), SystemCameraActivity.class)); + break; } } diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml index 58d5b3e..659be54 100644 --- a/app/src/main/res/layout/activity_splash.xml +++ b/app/src/main/res/layout/activity_splash.xml @@ -44,10 +44,10 @@ android:id="@+id/button_audio" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:layout_marginEnd="8dp" android:layout_marginStart="8dp" android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="8dp" android:text="音频采集" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -70,4 +70,20 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/button_extractor" app:layout_constraintVertical_bias="0.0" /> + +