From 4a8fb55fc8ed365a95da95c93885b5c1cd8f5ea3 Mon Sep 17 00:00:00 2001 From: Raymond Yang Date: Mon, 22 May 2023 13:37:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=BF=E6=8E=89LOG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gstreamer_demo_app/ui/mainScreen/MainActivity.kt | 6 +----- .../src/com/hisharp/gstreamer_player/GstLibrary.kt | 12 ++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/ray650128/gstreamer_demo_app/ui/mainScreen/MainActivity.kt b/app/src/main/java/com/ray650128/gstreamer_demo_app/ui/mainScreen/MainActivity.kt index 295b785..4e8cbc1 100644 --- a/app/src/main/java/com/ray650128/gstreamer_demo_app/ui/mainScreen/MainActivity.kt +++ b/app/src/main/java/com/ray650128/gstreamer_demo_app/ui/mainScreen/MainActivity.kt @@ -94,8 +94,7 @@ class MainActivity : AppCompatActivity() { } } - private fun reloadVideoViews(list: List>?) = MainScope().launch { - val oldListCount = videoPageList.size + private fun reloadVideoViews(list: List>?) { for (videoPage in videoPageList) { supportFragmentManager.commit { remove(videoPage) @@ -104,9 +103,6 @@ class MainActivity : AppCompatActivity() { binding.viewPager.removeAllViews() videoPageList.clear() - if (oldListCount > 0) { - delay(500L) - } // 如果群組內沒有裝置,則顯示底圖 if (list.isNullOrEmpty()) { binding.viewPager.setBackgroundResource(R.drawable.bg_not_in_playing) diff --git a/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt b/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt index 1deb042..e10a07c 100644 --- a/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt +++ b/gstreamer_player/src/com/hisharp/gstreamer_player/GstLibrary.kt @@ -142,12 +142,12 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback, TextureV } override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) { - Log.d("$TAG+$tag", String.format("Surface changed, format: %d, width: %d, height: %d", format, width, height)) + //Log.d("$TAG+$tag", String.format("Surface changed, format: %d, width: %d, height: %d", format, width, height)) /*setSurfaceHolder(holder);*/ } override fun surfaceDestroyed(holder: SurfaceHolder) { - Log.d("$TAG+$tag", "Surface destroyed") + //Log.d("$TAG+$tag", "Surface destroyed") this.isInit = false this.surface = null releaseSurface() @@ -156,22 +156,22 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback, TextureV override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) { this.surface = Surface(surface) this.surface?.let { nativeSurfaceInit(it) } - Log.d("$TAG+$tag", "Surface onSurfaceTextureAvailable: $surface") + //Log.d("$TAG+$tag", "Surface onSurfaceTextureAvailable: $surface") } override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) { - Log.d("$TAG+$tag", "Surface onSurfaceTextureSizeChanged: $surface") + //Log.d("$TAG+$tag", "Surface onSurfaceTextureSizeChanged: $surface") } override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean { - Log.d("$TAG+$tag", "Surface onSurfaceTextureDestroyed: $surface") + //Log.d("$TAG+$tag", "Surface onSurfaceTextureDestroyed: $surface") this.isInit = false this.surface = null return isInit } override fun onSurfaceTextureUpdated(surface: SurfaceTexture) { - Log.d("$TAG+$tag", "Surface onSurfaceTextureUpdated: $surface") + //Log.d("$TAG+$tag", "Surface onSurfaceTextureUpdated: $surface") } companion object {