From d6b06d16f70410bc5f308baf6cbaa3b9dc843076 Mon Sep 17 00:00:00 2001 From: xucz Date: Thu, 27 Jun 2024 14:14:36 +0800 Subject: [PATCH] [Android]TansparentRendering add encodeAlpha config and etc --- .../api/example/examples/advanced/LocalVideoTranscoding.java | 3 +-- .../api/example/examples/advanced/TransparentRendering.java | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/LocalVideoTranscoding.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/LocalVideoTranscoding.java index 7852f5d6d..8e64a1256 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/LocalVideoTranscoding.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/LocalVideoTranscoding.java @@ -6,7 +6,6 @@ import android.annotation.SuppressLint; import android.content.Context; -import android.graphics.Color; import android.os.Bundle; import android.util.DisplayMetrics; import android.util.Log; @@ -472,7 +471,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (buttonView == switchTransparentBackground) { engine.enableVirtualBackground(isChecked, new VirtualBackgroundSource(VirtualBackgroundSource.BACKGROUND_COLOR, - Color.TRANSPARENT, "", + 0x00000000, "", VirtualBackgroundSource.BLUR_DEGREE_HIGH), new SegmentationProperty()); } diff --git a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/TransparentRendering.java b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/TransparentRendering.java index afab73e38..1583744b8 100644 --- a/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/TransparentRendering.java +++ b/Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/TransparentRendering.java @@ -239,6 +239,7 @@ private void joinChannel(String channelId) { STANDARD_BITRATE, VideoEncoderConfiguration.ORIENTATION_MODE.valueOf(((MainApplication) getActivity().getApplication()).getGlobalSettings().getVideoEncodingOrientation()) ); + config.advanceOptions.encodeAlpha = true; engine.setVideoEncoderConfiguration(config); engine.setExternalVideoSource(true, true, Constants.ExternalVideoSourceType.VIDEO_FRAME);