|
|
|
@ -5,6 +5,11 @@ import android.app.Service |
|
|
|
import android.content.ContentValues |
|
|
|
import android.content.ContentValues |
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
import android.content.Intent |
|
|
|
import android.content.Intent |
|
|
|
|
|
|
|
import android.graphics.Bitmap |
|
|
|
|
|
|
|
import android.media.MediaCodec |
|
|
|
|
|
|
|
import android.media.MediaCodecInfo |
|
|
|
|
|
|
|
import android.media.MediaFormat |
|
|
|
|
|
|
|
import android.media.MediaMuxer |
|
|
|
import android.net.Uri |
|
|
|
import android.net.Uri |
|
|
|
import android.os.Binder |
|
|
|
import android.os.Binder |
|
|
|
import android.os.Build |
|
|
|
import android.os.Build |
|
|
|
@ -12,14 +17,11 @@ import android.os.Environment |
|
|
|
import android.os.IBinder |
|
|
|
import android.os.IBinder |
|
|
|
import android.provider.MediaStore |
|
|
|
import android.provider.MediaStore |
|
|
|
import androidx.core.content.FileProvider |
|
|
|
import androidx.core.content.FileProvider |
|
|
|
import android.graphics.Bitmap |
|
|
|
|
|
|
|
import android.media.MediaCodec |
|
|
|
|
|
|
|
import android.media.MediaCodecInfo |
|
|
|
|
|
|
|
import android.media.MediaFormat |
|
|
|
|
|
|
|
import android.media.MediaMuxer |
|
|
|
|
|
|
|
import java.nio.ByteBuffer |
|
|
|
|
|
|
|
import io.realm.Realm |
|
|
|
import io.realm.Realm |
|
|
|
import kotlinx.coroutines.* |
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
|
|
|
|
import kotlinx.coroutines.GlobalScope |
|
|
|
|
|
|
|
import kotlinx.coroutines.async |
|
|
|
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
@ -30,7 +32,7 @@ import net.pokeranalytics.android.util.video.AnimatedGIFWriter |
|
|
|
import timber.log.Timber |
|
|
|
import timber.log.Timber |
|
|
|
import java.io.File |
|
|
|
import java.io.File |
|
|
|
import java.io.FileOutputStream |
|
|
|
import java.io.FileOutputStream |
|
|
|
import java.util.* |
|
|
|
import java.util.Date |
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
|
|
|
|
|
|
|
|
enum class FileType(var value: String) { |
|
|
|
enum class FileType(var value: String) { |
|
|
|
@ -252,7 +254,7 @@ class ReplayExportService : Service() { |
|
|
|
Timber.d("Generate frames...") |
|
|
|
Timber.d("Generate frames...") |
|
|
|
|
|
|
|
|
|
|
|
animator.frames(context) { bitmap, visualOccurrences -> |
|
|
|
animator.frames(context) { bitmap, visualOccurrences -> |
|
|
|
Timber.d(">>> Generated frame, visualOccurrences = $visualOccurrences") |
|
|
|
// Timber.d(">>> Generated frame, visualOccurrences = $visualOccurrences") |
|
|
|
|
|
|
|
|
|
|
|
val yuvData = convertBitmapToYUV420(bitmap, width, height) |
|
|
|
val yuvData = convertBitmapToYUV420(bitmap, width, height) |
|
|
|
repeat(visualOccurrences) { |
|
|
|
repeat(visualOccurrences) { |
|
|
|
|