調整releaseSurface的呼叫時機
This commit is contained in:
@@ -32,7 +32,7 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback {
|
||||
}
|
||||
|
||||
fun pause() {
|
||||
if (!isInit) return
|
||||
//if (!isInit) return
|
||||
nativePause()
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback {
|
||||
// Called from native code. Native code calls this once it has created its pipeline and
|
||||
// the main loop is running, so it is ready to accept commands.
|
||||
private fun onGStreamerInitialized() {
|
||||
Log.i("$TAG+$tag", "GStreamer initialized:")
|
||||
Log.i("$TAG+$tag", "GStreamer Initialization complete")
|
||||
if (gstCallback != null) {
|
||||
gstCallback!!.onStatus(GstStatus.READY)
|
||||
}
|
||||
@@ -127,8 +127,6 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback {
|
||||
|
||||
override fun surfaceCreated(holder: SurfaceHolder) {
|
||||
Log.d("$TAG+$tag", "Surface created: " + holder.surface)
|
||||
Log.i("$TAG+$tag", "GStreamer surfaceCreated")
|
||||
isInit = true
|
||||
nativeSurfaceInit(holder.surface)
|
||||
}
|
||||
|
||||
@@ -139,9 +137,9 @@ class GstLibrary(context: Context) : Closeable, SurfaceHolder.Callback {
|
||||
|
||||
override fun surfaceDestroyed(holder: SurfaceHolder) {
|
||||
Log.d("$TAG+$tag", "Surface destroyed")
|
||||
pause()
|
||||
releaseSurface()
|
||||
isInit = false
|
||||
//pause()
|
||||
//releaseSurface()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user