From bef5dbfdd389690a5fe08d85d1be614e3e0b553d Mon Sep 17 00:00:00 2001 From: neilyhe <228429803@qq.com> Date: Wed, 22 Jan 2025 16:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=88=86=E7=BA=A2=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/tencent/iotvideo/link/decoder/VideoDecoder.java | 2 ++ .../java/com/tencent/iotvideo/link/encoder/AudioEncoder.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/com/tencent/iotvideo/link/decoder/VideoDecoder.java b/app/src/main/java/com/tencent/iotvideo/link/decoder/VideoDecoder.java index 2cdb664..f6b452a 100644 --- a/app/src/main/java/com/tencent/iotvideo/link/decoder/VideoDecoder.java +++ b/app/src/main/java/com/tencent/iotvideo/link/decoder/VideoDecoder.java @@ -2,6 +2,7 @@ import static com.tencent.iotvideo.link.util.UtilsKt.getFile; +import android.annotation.SuppressLint; import android.media.MediaCodec; import android.media.MediaCodecInfo; import android.media.MediaFormat; @@ -53,6 +54,7 @@ public void startVideo(int width, int height, Surface surface) throws IOExceptio } } + @SuppressLint("WrongConstant") private void initVideo(int width, int height, Surface surface) throws IOException { mVideoExecutor = Executors.newSingleThreadExecutor(); mVideoCodec = MediaCodec.createDecoderByType(MediaFormat.MIMETYPE_VIDEO_AVC); diff --git a/app/src/main/java/com/tencent/iotvideo/link/encoder/AudioEncoder.java b/app/src/main/java/com/tencent/iotvideo/link/encoder/AudioEncoder.java index 5bcc5b6..b3b61f6 100644 --- a/app/src/main/java/com/tencent/iotvideo/link/encoder/AudioEncoder.java +++ b/app/src/main/java/com/tencent/iotvideo/link/encoder/AudioEncoder.java @@ -1,5 +1,6 @@ package com.tencent.iotvideo.link.encoder; +import android.annotation.SuppressLint; import android.media.AudioRecord; import android.media.MediaCodec; import android.media.MediaCodecInfo; @@ -77,6 +78,7 @@ public void setOnEncodeListener(OnEncodeListener listener) { this.encodeListener = listener; } + @SuppressLint("MissingPermission") private void initAudio() { bufferSizeInBytes = 2 * AudioRecord.getMinBufferSize(micParam.getSampleRateInHz(), micParam.getChannelConfig(), micParam.getAudioFormat()); Log.d(TAG, "=====bufferSizeInBytes: " + bufferSizeInBytes);