mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-22 09:04:32 +01:00
Add FFmpeg-kit Sub-Module
This commit is contained in:
parent
bfb0f800ad
commit
408205122a
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -4,3 +4,6 @@
|
||||
[submodule "mosaic"]
|
||||
path = mosaic
|
||||
url = https://github.com/JakeWharton/mosaic
|
||||
[submodule "ffmpeg-kit"]
|
||||
path = ffmpeg-kit
|
||||
url = https://github.com/tanersener/ffmpeg-kit
|
||||
|
@ -36,11 +36,8 @@ import com.shabinder.common.models.event.coroutines.SuspendableEvent
|
||||
import com.shabinder.common.models.event.coroutines.failure
|
||||
import com.shabinder.common.models.event.coroutines.map
|
||||
import com.shabinder.database.Database
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.jetbrains.skija.Image
|
||||
import org.koin.dsl.bind
|
||||
import org.koin.dsl.module
|
||||
@ -103,7 +100,7 @@ class DesktopFileManager(
|
||||
File(imageCacheDir()).deleteRecursively()
|
||||
}
|
||||
|
||||
override suspend fun cacheImage(image: Any, path: String) {
|
||||
override suspend fun cacheImage(image: Any, path: String): Unit = withContext(dispatcherIO) {
|
||||
try {
|
||||
(image as? BufferedImage)?.let {
|
||||
ImageIO.write(it, "jpeg", File(path))
|
||||
@ -185,6 +182,7 @@ class DesktopFileManager(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
private suspend fun freshImage(url: String, reqWidth: Int, reqHeight: Int): ImageBitmap? {
|
||||
return withContext(Dispatchers.IO) {
|
||||
|
1
ffmpeg-kit
Submodule
1
ffmpeg-kit
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 46afc3f34a91efffb3c2bc595d64e2d714d48245
|
Loading…
Reference in New Issue
Block a user