react-native-compressor 1.19.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -788,32 +788,21 @@ object Compressor {
|
|
|
788
788
|
inputFormat: MediaFormat,
|
|
789
789
|
outputSurface: OutputSurface,
|
|
790
790
|
): MediaCodec {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
//
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
//
|
|
797
|
-
//
|
|
798
|
-
|
|
799
|
-
inputFormat.
|
|
800
|
-
MediaFormat.
|
|
801
|
-
} else {
|
|
802
|
-
originalMime
|
|
791
|
+
// Some inputs (e.g. iPhone .MOV files) report a "video/dolby-vision" MIME
|
|
792
|
+
// type that many devices cannot decode. Remap to a decodable base-layer
|
|
793
|
+
// codec, or fail with a clear error, before creating the decoder (#398).
|
|
794
|
+
ensureDecodableVideoFormat(inputFormat)
|
|
795
|
+
|
|
796
|
+
// Clear Dolby Vision specific profile and level to prevent configuration failures
|
|
797
|
+
// when the MIME type has been remapped to AVC/HEVC.
|
|
798
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
799
|
+
inputFormat.removeKey(MediaFormat.KEY_PROFILE)
|
|
800
|
+
inputFormat.removeKey(MediaFormat.KEY_LEVEL)
|
|
803
801
|
}
|
|
804
802
|
|
|
805
|
-
val decoder = MediaCodec.createDecoderByType(
|
|
806
|
-
|
|
807
|
-
try {
|
|
808
|
-
decoder.configure(inputFormat, outputSurface.getSurface(), null, 0)
|
|
809
|
-
} catch (e: Exception) {
|
|
810
|
-
// A codec that throws from configure() is unusable; release it so a
|
|
811
|
-
// configure failure here doesn't leak the decoder handle.
|
|
812
|
-
runCatching { decoder.release() }
|
|
813
|
-
throw e
|
|
814
|
-
}
|
|
803
|
+
val decoder = MediaCodec.createDecoderByType(inputFormat.getString(MediaFormat.KEY_MIME)!!)
|
|
815
804
|
|
|
816
|
-
|
|
805
|
+
decoder.configure(inputFormat, outputSurface.getSurface(), null, 0)
|
|
817
806
|
|
|
818
807
|
return decoder
|
|
819
808
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-compressor",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"description": "Compress Image, Video, and Audio same like Whatsapp & Auto/Manual Compression | Background Upload | Download File | Create Video Thumbnail",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|