Update
This commit is contained in:
parent
b57ea20e3a
commit
64eeda69fc
@ -23,7 +23,7 @@ repositories {
|
||||
dependencies {
|
||||
implementation(project(":CommonCode"))
|
||||
|
||||
implementation("no.iktdev.streamit.library:streamit-library-kafka:0.0.2-alpha63")
|
||||
implementation("no.iktdev.streamit.library:streamit-library-kafka:0.0.2-alpha69")
|
||||
implementation("no.iktdev:exfl:0.0.12-SNAPSHOT")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
|
||||
|
||||
@ -14,10 +14,14 @@ class EncodeDaemon(val referenceId: String, val work: EncodeWork, val daemonInte
|
||||
var outputCache = observableListOf<String>()
|
||||
private val decoder = ProgressDecoder()
|
||||
private fun produceProgress(items: List<String>) {
|
||||
val progress = decoder.parseVideoProgress(items)
|
||||
if (progress != null) {
|
||||
daemonInterface.onProgress(referenceId, work, progress)
|
||||
outputCache.clear()
|
||||
try {
|
||||
val progress = decoder.parseVideoProgress(items)
|
||||
if (progress != null) {
|
||||
daemonInterface.onProgress(referenceId, work, progress)
|
||||
outputCache.clear()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.message
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,15 +40,20 @@ class RunnerCoordinator {
|
||||
|
||||
fun addEncodeMessageToQueue(message: Message) {
|
||||
encodeExecutor.execute {
|
||||
runBlocking {
|
||||
if (message.data is EncodeWork) {
|
||||
val data: EncodeWork = message.data as EncodeWork
|
||||
val encodeDaemon = EncodeDaemon(message.referenceId, data, encodeListener)
|
||||
encodeDaemon.runUsingWorkItem()
|
||||
} else {
|
||||
producer.sendMessage(KafkaEvents.EVENT_ENCODER_STARTED_VIDEO_FILE.event, message.withNewStatus(Status(StatusType.ERROR, "Data is not an instance of EncodeWork")))
|
||||
try {
|
||||
runBlocking {
|
||||
if (message.data is EncodeWork) {
|
||||
val data: EncodeWork = message.data as EncodeWork
|
||||
val encodeDaemon = EncodeDaemon(message.referenceId, data, encodeListener)
|
||||
encodeDaemon.runUsingWorkItem()
|
||||
} else {
|
||||
producer.sendMessage(KafkaEvents.EVENT_ENCODER_STARTED_VIDEO_FILE.event, message.withNewStatus(Status(StatusType.ERROR, "Data is not an instance of EncodeWork")))
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
producer.sendMessage(KafkaEvents.EVENT_ENCODER_ENDED_VIDEO_FILE.event, message.withNewStatus(Status(StatusType.ERROR, e.message)))
|
||||
}
|
||||
|
||||
}
|
||||
producer.sendMessage(KafkaEvents.EVENT_ENCODER_STARTED_VIDEO_FILE.event, message.withNewStatus(Status(StatusType.PENDING)))
|
||||
}
|
||||
@ -56,12 +61,16 @@ class RunnerCoordinator {
|
||||
fun addExtractMessageToQueue(message: Message) {
|
||||
extractExecutor.execute {
|
||||
runBlocking {
|
||||
if (message.data is ExtractWork) {
|
||||
val data: ExtractWork = message.data as ExtractWork
|
||||
val extractDaemon = ExtractDaemon(message.referenceId, data, extractListener)
|
||||
extractDaemon.runUsingWorkItem()
|
||||
} else {
|
||||
producer.sendMessage(KafkaEvents.EVENT_ENCODER_STARTED_SUBTITLE_FILE.event, message.withNewStatus(Status(StatusType.ERROR, "Data is not an instance of ExtractWork")))
|
||||
try {
|
||||
if (message.data is ExtractWork) {
|
||||
val data: ExtractWork = message.data as ExtractWork
|
||||
val extractDaemon = ExtractDaemon(message.referenceId, data, extractListener)
|
||||
extractDaemon.runUsingWorkItem()
|
||||
} else {
|
||||
producer.sendMessage(KafkaEvents.EVENT_ENCODER_STARTED_SUBTITLE_FILE.event, message.withNewStatus(Status(StatusType.ERROR, "Data is not an instance of ExtractWork")))
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
producer.sendMessage(KafkaEvents.EVENT_ENCODER_ENDED_SUBTITLE_FILE.event, message.withNewStatus(Status(StatusType.ERROR, e.message)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("no.iktdev.streamit.library:streamit-library-kafka:0.0.2-alpha68")
|
||||
implementation("no.iktdev.streamit.library:streamit-library-kafka:0.0.2-alpha69")
|
||||
implementation("no.iktdev:exfl:0.0.12-SNAPSHOT")
|
||||
|
||||
implementation("no.iktdev.streamit.library:streamit-library-db:0.0.6-alpha7")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user