From 918fe2bc12adc4d6911d8cdb39b156d8e090e74d Mon Sep 17 00:00:00 2001 From: xufulong <839789740@qq.com> Date: Wed, 8 Apr 2020 00:11:00 +0800 Subject: [PATCH] translate the note of HardwareDecode into English translate the note of HardwareDecode into English --- .../frank/ffmpeg/hardware/HardwareDecode.java | 27 ++++++++++--------- .../ffmpeg/listener/OnHandleListener.java | 2 +- .../ffmpeg/listener/OnItemClickListener.java | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/frank/ffmpeg/hardware/HardwareDecode.java b/app/src/main/java/com/frank/ffmpeg/hardware/HardwareDecode.java index 55ba7b8..3e82dcd 100644 --- a/app/src/main/java/com/frank/ffmpeg/hardware/HardwareDecode.java +++ b/app/src/main/java/com/frank/ffmpeg/hardware/HardwareDecode.java @@ -10,7 +10,7 @@ import android.view.Surface; import java.nio.ByteBuffer; /** - * 使用MediaExtractor抽帧,MediaCodec解码,然后渲染到Surface + * Extract by MediaExtractor, decode by MediaCodec, and render to Surface * Created by frank on 2019/11/16. */ @@ -99,13 +99,14 @@ public class HardwareDecode { if (mediaExtractor != null) { mediaExtractor.release(); } - }catch (Exception e) { + } catch (Exception e) { Log.e(TAG, "release error=" + e.toString()); } } /** - * 根据原分辨率大小动态设置预览分辨率 + * setting the preview resolution according to video aspect ratio + * * @param mediaFormat mediaFormat */ private void setPreviewRatio(MediaFormat mediaFormat) { @@ -126,7 +127,7 @@ public class HardwareDecode { } int previewWidth = videoWidth / previewRatio; int previewHeight = videoHeight / previewRatio; - Log.e(TAG, "videoWidth=" + videoWidth +"--videoHeight=" + videoHeight + Log.e(TAG, "videoWidth=" + videoWidth + "--videoHeight=" + videoHeight + "--previewWidth=" + previewWidth + "--previewHeight=" + previewHeight); mediaFormat.setInteger(MediaFormat.KEY_WIDTH, previewWidth); mediaFormat.setInteger(MediaFormat.KEY_HEIGHT, previewHeight); @@ -141,10 +142,10 @@ public class HardwareDecode { String mimeType = ""; try { mediaExtractor.setDataSource(mFilePath); - for (int i=0; i