From c063a79846eeaac8076650672f4ce08e3731bb56 Mon Sep 17 00:00:00 2001 From: luohao Date: Thu, 23 Jun 2022 17:02:25 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=89=8D=E7=BD=AE=E7=AB=96=E5=B1=8F?= =?UTF-8?q?=E9=A2=A0=E5=80=92=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtmpx_library/build.gradle | 2 +- .../src/main/java/com/rtmpx/library/publish/PublisherX.java | 2 +- .../src/main/java/com/rtmpx/library/utils/ConvertUtils.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtmpx_library/build.gradle b/rtmpx_library/build.gradle index 5e47815..5d07376 100644 --- a/rtmpx_library/build.gradle +++ b/rtmpx_library/build.gradle @@ -1,7 +1,7 @@ plugins { id 'com.android.library' } -apply from: './publish.gradle' +//apply from: './publish.gradle' android { compileSdkVersion 30 diff --git a/rtmpx_library/src/main/java/com/rtmpx/library/publish/PublisherX.java b/rtmpx_library/src/main/java/com/rtmpx/library/publish/PublisherX.java index a91db83..1336f56 100644 --- a/rtmpx_library/src/main/java/com/rtmpx/library/publish/PublisherX.java +++ b/rtmpx_library/src/main/java/com/rtmpx/library/publish/PublisherX.java @@ -105,7 +105,7 @@ public void onAudioRecordError(String message) { @Override public void handleImage(ImageProxy image, int rotation) { if (!RTMPPublisher.getInstance().isWorked()) { - Log.d(TAG, "rtmp not worked no handle handleImage"); + Log.d(TAG, "rtmp not worked no handle handleImage "+rotation + " image rotation "+image.getImageInfo().getRotationDegrees()); return; } byte[] data = ConvertUtils.YUV_420_888toNV12(image, rotation); diff --git a/rtmpx_library/src/main/java/com/rtmpx/library/utils/ConvertUtils.java b/rtmpx_library/src/main/java/com/rtmpx/library/utils/ConvertUtils.java index 3f4cf17..0c4778b 100644 --- a/rtmpx_library/src/main/java/com/rtmpx/library/utils/ConvertUtils.java +++ b/rtmpx_library/src/main/java/com/rtmpx/library/utils/ConvertUtils.java @@ -53,7 +53,7 @@ public static byte[] YUV_420_888toLandscapeNV12(ImageProxy image, int rotation) public static byte[] YUV_420_888toPortraitNV12(ImageProxy image, int rotation) { YuvFrame yuvFrame = YuvHelper.convertToI420(image.getImage()); //TODO optimization of vertical screen libyuv rotation - byte[] bytes = YuvHelper.rotate(yuvFrame, 90).asArray(); + byte[] bytes = YuvHelper.rotate(yuvFrame, image.getImageInfo().getRotationDegrees()).asArray(); if (null == mPortraitYUV || mPortraitYUV.length != bytes.length) { mPortraitYUV = new byte[bytes.length]; }