Skip to content

Commit 5d07e65

Browse files
committed
fix codecutil
1 parent f99f49c commit 5d07e65

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ allprojects {
5151
}
5252
}
5353
dependencies {
54-
implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.3'
54+
implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.4'
5555
}
5656
5757
```

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
buildscript {
44
ext.kotlin_version = '1.5.31'
55
ext.library_group = "com.github.pedroSG94"
6-
ext.version_code = 213
7-
ext.version_name = "2.1.3"
6+
ext.version_code = 214
7+
ext.version_name = "2.1.4"
88

99
repositories {
1010
google()

encoder/src/main/java/com/pedro/encoder/utils/CodecUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ private static boolean isHardwareAccelerated(MediaCodecInfo codecInfo) {
349349
*/
350350
private static boolean isSoftwareOnly(MediaCodecInfo mediaCodecInfo) {
351351
if (Build.VERSION.SDK_INT >= 29) {
352-
return mediaCodecInfo.isSoftwareOnly();
352+
//mediaCodecInfo.isSoftwareOnly() is not working on emulators.
353+
//Use !mediaCodecInfo.isHardwareAccelerated() to make sure that all codecs are classified as software or hardware
354+
return !mediaCodecInfo.isHardwareAccelerated();
353355
}
354356
String name = mediaCodecInfo.getName().toLowerCase();
355357
if (name.startsWith("arc.")) { // App Runtime for Chrome (ARC) codecs

0 commit comments

Comments
 (0)