Skip to content

Commit

Permalink
fix(core): getSupportedProfiles only return one of each supported p…
Browse files Browse the repository at this point in the history
…rofiles
  • Loading branch information
ThibaultBee committed Nov 21, 2023
1 parent a13439e commit 6d446ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ object MediaCodecHelper {
fun getProfileLevel(
mimeType: String,
): List<MediaCodecInfo.CodecProfileLevel> =
getCodecCapabilities(mimeType).profileLevels.toList()
getCodecCapabilities(mimeType).profileLevels.toList().toSet().toList()

/**
* Get encoder supported profile level list for the specified encoder.
Expand All @@ -230,7 +230,7 @@ object MediaCodecHelper {
mimeType: String,
name: String
): List<MediaCodecInfo.CodecProfileLevel> =
getCodecCapabilities(mimeType, name).profileLevels.toList()
getCodecCapabilities(mimeType, name).profileLevels.toList().toSet().toList()

/**
* Get encoder supported profiles list for the default encoder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ open class VideoStreamerConfigurationHelper(private val videoMuxerHelper: IVideo
else -> throw InvalidParameterException("Unknown mimetype $mimeType")
}
val supportedProfiles = MediaCodecHelper.getProfiles(mimeType)
return supportedProfiles.filter { profiles.contains(it) }
return profiles.filter { supportedProfiles.contains(it) }
}

private val avcProfiles = listOf(
Expand Down

0 comments on commit 6d446ca

Please sign in to comment.