diff --git a/app/src/main/java/com/frank/ffmpeg/activity/FilterActivity.kt b/app/src/main/java/com/frank/ffmpeg/activity/FilterActivity.kt index 415e1d8..d42c24a 100644 --- a/app/src/main/java/com/frank/ffmpeg/activity/FilterActivity.kt +++ b/app/src/main/java/com/frank/ffmpeg/activity/FilterActivity.kt @@ -106,14 +106,16 @@ class FilterActivity : BaseActivity(), SurfaceHolder.Callback { } private fun registerLister() { - horizontalAdapter!!.setOnItemClickListener(OnItemClickListener { position -> - if (!surfaceCreated) - return@OnItemClickListener - if (!FileUtil.checkFileExist(videoPath)) { - showSelectFile() - return@OnItemClickListener + horizontalAdapter!!.setOnItemClickListener(object : OnItemClickListener { + override fun onItemClick(position: Int) { + if (!surfaceCreated) + return + if (!FileUtil.checkFileExist(videoPath)) { + showSelectFile() + return + } + doFilterPlay(position) } - doFilterPlay(position) }) surfaceView!!.setOnClickListener { @@ -167,7 +169,7 @@ class FilterActivity : BaseActivity(), SurfaceHolder.Callback { super.onDestroy() isPlaying = false //FIXME - // videoPlayer.release(); +// videoPlayer?.release() videoPlayer = null horizontalAdapter = null } @@ -187,8 +189,8 @@ class FilterActivity : BaseActivity(), SurfaceHolder.Callback { companion object { - private val MSG_HIDE = 222 - private val DELAY_TIME = 5000 + private const val MSG_HIDE = 222 + private const val DELAY_TIME = 5000 } } diff --git a/app/src/main/java/com/frank/ffmpeg/format/VideoLayout.java b/app/src/main/java/com/frank/ffmpeg/format/VideoLayout.java deleted file mode 100644 index a5c688b..0000000 --- a/app/src/main/java/com/frank/ffmpeg/format/VideoLayout.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.frank.ffmpeg.format; - -/** - * layout of video - * Created by frank on 2018/6/18. - */ - -public class VideoLayout { - - //horizontal join - public final static int LAYOUT_HORIZONTAL = 1; - //vertical join - public final static int LAYOUT_VERTICAL = 2; - -} diff --git a/app/src/main/java/com/frank/ffmpeg/format/VideoLayout.kt b/app/src/main/java/com/frank/ffmpeg/format/VideoLayout.kt new file mode 100644 index 0000000..916c26b --- /dev/null +++ b/app/src/main/java/com/frank/ffmpeg/format/VideoLayout.kt @@ -0,0 +1,15 @@ +package com.frank.ffmpeg.format + +/** + * layout of video + * Created by frank on 2018/6/18. + */ + +object VideoLayout { + + //horizontal join + const val LAYOUT_HORIZONTAL = 1 + //vertical join + const val LAYOUT_VERTICAL = 2 + +} diff --git a/app/src/main/java/com/frank/ffmpeg/handler/FFmpegHandler.java b/app/src/main/java/com/frank/ffmpeg/handler/FFmpegHandler.java index 7e4871a..f6f597a 100644 --- a/app/src/main/java/com/frank/ffmpeg/handler/FFmpegHandler.java +++ b/app/src/main/java/com/frank/ffmpeg/handler/FFmpegHandler.java @@ -130,6 +130,11 @@ public class FFmpegHandler { mHandler.obtainMessage(MSG_BEGIN).sendToTarget(); } + @Override + public void onProgress(int progress, int duration) { + + } + @Override public void onEnd(int resultCode, String resultMsg) { Log.i(TAG, "handle ffprobe onEnd result=" + resultMsg); diff --git a/app/src/main/java/com/frank/ffmpeg/listener/OnHandleListener.java b/app/src/main/java/com/frank/ffmpeg/listener/OnHandleListener.java deleted file mode 100644 index cc54ab5..0000000 --- a/app/src/main/java/com/frank/ffmpeg/listener/OnHandleListener.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.frank.ffmpeg.listener; - -/** - * listener of FFmpeg processing - * Created by frank on 2019/11/11. - */ -public interface OnHandleListener { - void onBegin(); - default void onProgress(int progress, int duration){} - void onEnd(int resultCode, String resultMsg); -} diff --git a/app/src/main/java/com/frank/ffmpeg/listener/OnHandleListener.kt b/app/src/main/java/com/frank/ffmpeg/listener/OnHandleListener.kt new file mode 100644 index 0000000..026be1b --- /dev/null +++ b/app/src/main/java/com/frank/ffmpeg/listener/OnHandleListener.kt @@ -0,0 +1,11 @@ +package com.frank.ffmpeg.listener + +/** + * listener of FFmpeg processing + * Created by frank on 2019/11/11. + */ +interface OnHandleListener { + fun onBegin() + fun onProgress(progress: Int, duration: Int) + fun onEnd(resultCode: Int, resultMsg: String) +} diff --git a/app/src/main/java/com/frank/ffmpeg/listener/OnItemClickListener.java b/app/src/main/java/com/frank/ffmpeg/listener/OnItemClickListener.java deleted file mode 100644 index d46444e..0000000 --- a/app/src/main/java/com/frank/ffmpeg/listener/OnItemClickListener.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.frank.ffmpeg.listener; - -/** - * listener of RecyclerView item clicking - * Created by frank on 2018/6/6. - */ - -public interface OnItemClickListener { - - void onItemClick(int position); -} diff --git a/app/src/main/java/com/frank/ffmpeg/listener/OnItemClickListener.kt b/app/src/main/java/com/frank/ffmpeg/listener/OnItemClickListener.kt new file mode 100644 index 0000000..c6b8553 --- /dev/null +++ b/app/src/main/java/com/frank/ffmpeg/listener/OnItemClickListener.kt @@ -0,0 +1,11 @@ +package com.frank.ffmpeg.listener + +/** + * listener of RecyclerView item clicking + * Created by frank on 2018/6/6. + */ + +interface OnItemClickListener { + + fun onItemClick(position: Int) +}