Updated library & main.yaml
This commit is contained in:
parent
bd3125ed44
commit
f152533cba
23
.github/workflows/main.yml
vendored
23
.github/workflows/main.yml
vendored
@ -17,9 +17,15 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
|
||||
- name: Cache CommonCode Gradle dependencies
|
||||
id: cache-gradle
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('CommonCode/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
|
||||
- name: Build CommonCode
|
||||
if: steps.cache-gradle.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd CommonCode
|
||||
chmod +x ./gradlew
|
||||
@ -44,6 +50,14 @@ jobs:
|
||||
echo "::set-output name=changed::false"
|
||||
fi
|
||||
|
||||
- name: Cache CommonCode Gradle dependencies
|
||||
id: cache-gradle
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('CommonCode/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
|
||||
|
||||
- name: Build Encode module
|
||||
id: build-encode
|
||||
run: |
|
||||
@ -97,6 +111,13 @@ jobs:
|
||||
echo "::set-output name=changed::false"
|
||||
fi
|
||||
|
||||
- name: Cache CommonCode Gradle dependencies
|
||||
id: cache-gradle
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('CommonCode/gradle/wrapper/gradle-wrapper.properties') }}
|
||||
|
||||
- name: Build Reader module
|
||||
id: build-reader
|
||||
run: |
|
||||
|
||||
@ -23,7 +23,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("no.iktdev.streamit.library:streamit-library-kafka:0.0.2-alpha39")
|
||||
implementation("no.iktdev.streamit.library:streamit-library-kafka:0.0.2-alpha41")
|
||||
implementation("no.iktdev:exfl:0.0.4-SNAPSHOT")
|
||||
|
||||
implementation("com.github.pgreze:kotlin-process:1.3.1")
|
||||
|
||||
@ -27,31 +27,36 @@ class EncodedDeserializers {
|
||||
|
||||
val mediaStreams = object : IMessageDataDeserialization<MediaStreams> {
|
||||
override fun deserialize(incomingMessage: Message): MediaStreams? {
|
||||
if (incomingMessage.status.statusType != StatusType.SUCCESS) {
|
||||
return null
|
||||
}
|
||||
/*return gson.fromJson(streams.value().data as String, MediaStreams::class.java)*/
|
||||
val jsonObject = gson.fromJson(incomingMessage.dataAsJson(), JsonObject::class.java)
|
||||
return try {
|
||||
if (incomingMessage.status.statusType != StatusType.SUCCESS) {
|
||||
return null
|
||||
}
|
||||
/*return gson.fromJson(streams.value().data as String, MediaStreams::class.java)*/
|
||||
val jsonObject = gson.fromJson(incomingMessage.dataAsJson(), JsonObject::class.java)
|
||||
|
||||
val streamsJsonArray = jsonObject.getAsJsonArray("streams")
|
||||
val streamsJsonArray = jsonObject.getAsJsonArray("streams")
|
||||
|
||||
val rstreams = streamsJsonArray.mapNotNull { streamJson ->
|
||||
val streamObject = streamJson.asJsonObject
|
||||
val rstreams = streamsJsonArray.mapNotNull { streamJson ->
|
||||
val streamObject = streamJson.asJsonObject
|
||||
|
||||
val codecType = streamObject.get("codec_type").asString
|
||||
if (streamObject.has("codec_name") && streamObject.get("codec_name").asString == "mjpeg") {
|
||||
null
|
||||
} else {
|
||||
when (codecType) {
|
||||
"video" -> gson.fromJson(streamObject, VideoStream::class.java)
|
||||
"audio" -> gson.fromJson(streamObject, AudioStream::class.java)
|
||||
"subtitle" -> gson.fromJson(streamObject, SubtitleStream::class.java)
|
||||
else -> null //throw IllegalArgumentException("Unknown stream type: $codecType")
|
||||
val codecType = streamObject.get("codec_type").asString
|
||||
if (streamObject.has("codec_name") && streamObject.get("codec_name").asString == "mjpeg") {
|
||||
null
|
||||
} else {
|
||||
when (codecType) {
|
||||
"video" -> gson.fromJson(streamObject, VideoStream::class.java)
|
||||
"audio" -> gson.fromJson(streamObject, AudioStream::class.java)
|
||||
"subtitle" -> gson.fromJson(streamObject, SubtitleStream::class.java)
|
||||
else -> null //throw IllegalArgumentException("Unknown stream type: $codecType")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return MediaStreams(rstreams)
|
||||
return MediaStreams(rstreams)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user