Refactorgin

hh
Laurent 5 years ago
parent 995c476467
commit a5c95d2131
  1. 10
      app/src/main/java/net/pokeranalytics/android/util/video/MMediaMuxer.kt

@ -27,7 +27,7 @@ class MMediaMuxer {
private var bitList: MutableList<ByteArray>? = null private var bitList: MutableList<ByteArray>? = null
private var bitFirst: MutableList<ByteArray>? = null private var bitFirst: MutableList<ByteArray>? = null
private var bitLast: MutableList<ByteArray>? = null private var bitLast: MutableList<ByteArray>? = null
private var current_index_frame = 0 private var currentIndexFrame = 0
private var outputPath: String? = null private var outputPath: String? = null
private var _activity: Activity? = null private var _activity: Activity? = null
private var pd: ProgressDialog? = null private var pd: ProgressDialog? = null
@ -83,7 +83,7 @@ class MMediaMuxer {
} }
fun CreateVideo() { fun CreateVideo() {
current_index_frame = 0 currentIndexFrame = 0
Logd("Prepare Frames Data") Logd("Prepare Frames Data")
bitFirst!!.addAll(bitList!!) bitFirst!!.addAll(bitList!!)
bitFirst!!.addAll(bitLast!!) bitFirst!!.addAll(bitLast!!)
@ -224,7 +224,7 @@ class MMediaMuxer {
FRAME_RATE FRAME_RATE
) )
if (inputBufIndex >= 0) { if (inputBufIndex >= 0) {
val input = bitFirst!![current_index_frame] val input = bitFirst!![currentIndexFrame]
val inputBuffer = mediaCodec!!.getInputBuffer(inputBufIndex) val inputBuffer = mediaCodec!!.getInputBuffer(inputBufIndex)
inputBuffer.clear() inputBuffer.clear()
inputBuffer.put(input) inputBuffer.put(input)
@ -258,8 +258,8 @@ class MMediaMuxer {
mediaCodec!!.releaseOutputBuffer(encoderStatus, false) mediaCodec!!.releaseOutputBuffer(encoderStatus, false)
} }
} }
current_index_frame++ currentIndexFrame++
if (current_index_frame > MAX_FRAME_VIDEO - 1) { if (currentIndexFrame > MAX_FRAME_VIDEO - 1) {
Log.d(TAG, "mRunning = false;") Log.d(TAG, "mRunning = false;")
mRunning = false mRunning = false
} }

Loading…
Cancel
Save