Feature: add CameraFilterActivity

pull/221/head
xufuji456 2 years ago
parent e108a15a8c
commit a30527f8fc
  1. 1
      CameraFilter/src/main/java/com/frank/camerafilter/widget/CameraRender.java
  2. 1
      app/src/main/AndroidManifest.xml
  3. 35
      app/src/main/java/com/frank/ffmpeg/activity/CameraFilterActivity.kt
  4. 5
      app/src/main/java/com/frank/ffmpeg/activity/MainActivity.kt
  5. 16
      app/src/main/res/layout/activity_camera_filter.xml
  6. 3
      app/src/main/res/values-en/strings.xml
  7. 3
      app/src/main/res/values/strings.xml

@ -83,6 +83,7 @@ public class CameraRender implements GLSurfaceView.Renderer, SurfaceTexture.OnFr
if (cameraManager.getCamera() == null) if (cameraManager.getCamera() == null)
cameraManager.openCamera(); cameraManager.openCamera();
Camera.Size size = cameraManager.getPreviewSize(); Camera.Size size = cameraManager.getPreviewSize();
// rotation=90 or rotation=270, we need to exchange width and height
if (cameraManager.getOrientation() == 90 || cameraManager.getOrientation() == 270) { if (cameraManager.getOrientation() == 90 || cameraManager.getOrientation() == 270) {
mImageWidth = size.height; mImageWidth = size.height;
mImageHeight = size.width; mImageHeight = size.width;

@ -49,6 +49,7 @@
<activity android:name=".activity.AudioEffectActivity" /> <activity android:name=".activity.AudioEffectActivity" />
<activity android:name=".activity.AudioPlayActivity" /> <activity android:name=".activity.AudioPlayActivity" />
<activity android:name=".activity.EqualizerActivity" /> <activity android:name=".activity.EqualizerActivity" />
<activity android:name=".activity.CameraFilterActivity" />
</application> </application>
</manifest> </manifest>

@ -0,0 +1,35 @@
package com.frank.ffmpeg.activity
import android.os.Bundle
import android.view.SurfaceView
import android.view.View
import com.frank.camerafilter.widget.BeautyCameraView
import com.frank.ffmpeg.FFMediaPlayer
import com.frank.ffmpeg.R
class CameraFilterActivity : BaseActivity() {
private var cameraView: BeautyCameraView ?= null
override val layoutId: Int
get() = R.layout.activity_camera_filter
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initView()
}
fun initView() {
cameraView = getView(R.id.surface_camera_filter)
}
override fun onViewClick(view: View) {
}
override fun onSelectedFile(filePath: String) {
}
}

@ -35,7 +35,8 @@ class MainActivity : BaseActivity() {
getString(R.string.video_filter), getString(R.string.video_filter),
getString(R.string.video_preview), getString(R.string.video_preview),
getString(R.string.media_probe), getString(R.string.media_probe),
getString(R.string.audio_effect)) getString(R.string.audio_effect),
getString(R.string.camera_filter))
val viewWaterfall: RecyclerView = findViewById(R.id.list_main_item) val viewWaterfall: RecyclerView = findViewById(R.id.list_main_item)
val layoutManager = StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL) val layoutManager = StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)
@ -71,6 +72,8 @@ class MainActivity : BaseActivity() {
-> intent.setClass(this@MainActivity, ProbeFormatActivity::class.java) -> intent.setClass(this@MainActivity, ProbeFormatActivity::class.java)
8 //audio effect 8 //audio effect
-> intent.setClass(this@MainActivity, AudioEffectActivity::class.java) -> intent.setClass(this@MainActivity, AudioEffectActivity::class.java)
9 //camera filter
-> intent.setClass(this@MainActivity, CameraFilterActivity::class.java)
else -> { else -> {
} }
} }

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.CameraFilterActivity"
android:layout_marginTop="66dp"
android:layout_marginBottom="66dp">
<com.frank.camerafilter.widget.BeautyCameraView
android:id="@+id/surface_camera_filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"/>
</RelativeLayout>

@ -53,7 +53,8 @@
<string name="video_extract_frame">Extract frame</string> <string name="video_extract_frame">Extract frame</string>
<string name="video_part_zoom">Video zoom</string> <string name="video_part_zoom">Video zoom</string>
<string name="video_play">Video play</string> <string name="video_play">Video play</string>
<string name="video_filter">Video filter</string> <string name="video_filter">FFmpeg filter</string>
<string name="camera_filter">Camera filter</string>
<string name="video_slow">Video slow</string> <string name="video_slow">Video slow</string>
<string name="video_fast">Video fast</string> <string name="video_fast">Video fast</string>
<string name="video_multi">Video multi</string> <string name="video_multi">Video multi</string>

@ -53,7 +53,8 @@
<string name="video_extract_frame">视频抽帧</string> <string name="video_extract_frame">视频抽帧</string>
<string name="video_part_zoom">视频局部放大</string> <string name="video_part_zoom">视频局部放大</string>
<string name="video_play">视频播放</string> <string name="video_play">视频播放</string>
<string name="video_filter">滤镜特效</string> <string name="video_filter">FFmpeg滤镜</string>
<string name="camera_filter">Camera滤镜</string>
<string name="video_slow">慢放</string> <string name="video_slow">慢放</string>
<string name="video_fast">快进</string> <string name="video_fast">快进</string>
<string name="video_multi">画面拼接</string> <string name="video_multi">画面拼接</string>

Loading…
Cancel
Save