diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/libwebrtc/sdk/android | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/sdk/android')
7 files changed, 20 insertions, 19 deletions
diff --git a/third_party/libwebrtc/sdk/android/api/org/webrtc/Dav1dDecoder.java b/third_party/libwebrtc/sdk/android/api/org/webrtc/Dav1dDecoder.java index ecb16bc3a1..2a79988470 100644 --- a/third_party/libwebrtc/sdk/android/api/org/webrtc/Dav1dDecoder.java +++ b/third_party/libwebrtc/sdk/android/api/org/webrtc/Dav1dDecoder.java @@ -12,7 +12,7 @@ package org.webrtc; public class Dav1dDecoder extends WrappedNativeVideoDecoder { @Override - public long createNativeVideoDecoder() { + public long createNative(long webrtcEnvRef) { return nativeCreateDecoder(); } diff --git a/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp8Decoder.java b/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp8Decoder.java index 54ad0aa137..7d3e95973d 100644 --- a/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp8Decoder.java +++ b/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp8Decoder.java @@ -12,9 +12,9 @@ package org.webrtc; public class LibvpxVp8Decoder extends WrappedNativeVideoDecoder { @Override - public long createNativeVideoDecoder() { - return nativeCreateDecoder(); + public long createNative(long webrtcEnvRef) { + return nativeCreateDecoder(webrtcEnvRef); } - static native long nativeCreateDecoder(); + static native long nativeCreateDecoder(long webrtcEnvRef); } diff --git a/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp9Decoder.java b/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp9Decoder.java index 90a24433a3..34718cfa8c 100644 --- a/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp9Decoder.java +++ b/third_party/libwebrtc/sdk/android/api/org/webrtc/LibvpxVp9Decoder.java @@ -12,7 +12,7 @@ package org.webrtc; public class LibvpxVp9Decoder extends WrappedNativeVideoDecoder { @Override - public long createNativeVideoDecoder() { + public long createNative(long webrtcEnvRef) { return nativeCreateDecoder(); } diff --git a/third_party/libwebrtc/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java b/third_party/libwebrtc/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java index 2ac42e834e..1b1cd44a92 100644 --- a/third_party/libwebrtc/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java +++ b/third_party/libwebrtc/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java @@ -11,7 +11,6 @@ package org.webrtc; import androidx.annotation.Nullable; -import java.util.Arrays; import java.util.List; public class SoftwareVideoDecoderFactory implements VideoDecoderFactory { @@ -26,16 +25,14 @@ public class SoftwareVideoDecoderFactory implements VideoDecoderFactory { @Nullable @Override public VideoDecoder createDecoder(VideoCodecInfo info) { - long nativeDecoder = nativeCreateDecoder(nativeFactory, info); - if (nativeDecoder == 0) { + if (!nativeIsSupported(nativeFactory, info)) { Logging.w(TAG, "Trying to create decoder for unsupported format. " + info); return null; } - return new WrappedNativeVideoDecoder() { @Override - public long createNativeVideoDecoder() { - return nativeDecoder; + public long createNative(long webrtcEnvRef) { + return nativeCreate(nativeFactory, webrtcEnvRef, info); } }; } @@ -47,7 +44,10 @@ public class SoftwareVideoDecoderFactory implements VideoDecoderFactory { private static native long nativeCreateFactory(); - private static native long nativeCreateDecoder(long factory, VideoCodecInfo videoCodecInfo); + private static native boolean nativeIsSupported(long factory, VideoCodecInfo info); + + private static native long nativeCreate( + long factory, long webrtcEnvRef, VideoCodecInfo info); private static native List<VideoCodecInfo> nativeGetSupportedCodecs(long factory); } diff --git a/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoder.java b/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoder.java index a80fa4fef2..195daf5260 100644 --- a/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoder.java +++ b/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoder.java @@ -56,11 +56,11 @@ public interface VideoDecoder { * decoder (e.g., an Android platform decoder), or alternatively 2) a native * decoder (e.g., a software decoder or a C++ decoder adapter). * - * For case 1), createNativeVideoDecoder() should return zero. + * For case 1), createNative() should return zero. * In this case, we expect the native library to call the decoder through * JNI using the Java interface declared below. * - * For case 2), createNativeVideoDecoder() should return a non-zero value. + * For case 2), createNative() should return a non-zero value. * In this case, we expect the native library to treat the returned value as * a raw pointer of type webrtc::VideoDecoder* (ownership is transferred to * the caller). The native library should then directly call the @@ -69,7 +69,7 @@ public interface VideoDecoder { * UnsupportedOperationException. */ @CalledByNative - default long createNativeVideoDecoder() { + default long createNative(long webrtcEnvRef) { return 0; } diff --git a/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoderFallback.java b/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoderFallback.java index ddfa3ecd40..1e7bae9b27 100644 --- a/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoderFallback.java +++ b/third_party/libwebrtc/sdk/android/api/org/webrtc/VideoDecoderFallback.java @@ -23,9 +23,10 @@ public class VideoDecoderFallback extends WrappedNativeVideoDecoder { } @Override - public long createNativeVideoDecoder() { - return nativeCreateDecoder(fallback, primary); + public long createNative(long webrtcEnvRef) { + return nativeCreate(webrtcEnvRef, fallback, primary); } - private static native long nativeCreateDecoder(VideoDecoder fallback, VideoDecoder primary); + private static native long nativeCreate( + long webrtcEnvRef, VideoDecoder fallback, VideoDecoder primary); } diff --git a/third_party/libwebrtc/sdk/android/api/org/webrtc/WrappedNativeVideoDecoder.java b/third_party/libwebrtc/sdk/android/api/org/webrtc/WrappedNativeVideoDecoder.java index 027120e48e..d762e757e4 100644 --- a/third_party/libwebrtc/sdk/android/api/org/webrtc/WrappedNativeVideoDecoder.java +++ b/third_party/libwebrtc/sdk/android/api/org/webrtc/WrappedNativeVideoDecoder.java @@ -14,7 +14,7 @@ package org.webrtc; * Wraps a native webrtc::VideoDecoder. */ public abstract class WrappedNativeVideoDecoder implements VideoDecoder { - @Override public abstract long createNativeVideoDecoder(); + @Override public abstract long createNative(long webrtcEnvRef); @Override public final VideoCodecStatus initDecode(Settings settings, Callback decodeCallback) { |