From a8bb1f12f40dbfb64677b159281beed5ab828527 Mon Sep 17 00:00:00 2001 From: liyi Date: Thu, 8 May 2025 10:12:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B0=83=E6=95=B4=E7=BC=93=E5=86=B2?= =?UTF-8?q?=E5=8C=BA=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/top/skychip/video_decode_plugin/VideoDecoder.kt | 4 ++-- ios/Classes/VideoDecoder.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/src/main/kotlin/top/skychip/video_decode_plugin/VideoDecoder.kt b/android/src/main/kotlin/top/skychip/video_decode_plugin/VideoDecoder.kt index 3c0bdbf..fba1a8a 100644 --- a/android/src/main/kotlin/top/skychip/video_decode_plugin/VideoDecoder.kt +++ b/android/src/main/kotlin/top/skychip/video_decode_plugin/VideoDecoder.kt @@ -48,7 +48,7 @@ class VideoDecoder( companion object { private const val TAG = "VideoDecoder" private const val TIMEOUT_US = 10000L - private const val INPUT_BUFFER_QUEUE_CAPACITY = 30 // 输入缓冲区容量 + private const val INPUT_BUFFER_QUEUE_CAPACITY = 7 // 输入缓冲区容量 } // region 成员变量定义 @@ -64,7 +64,7 @@ class VideoDecoder( private val frameSeqSet = Collections.newSetFromMap(ConcurrentHashMap()) // 防止重复帧入队 // 解码输出缓冲区,容量为100帧 - private val outputFrameQueue = LinkedBlockingQueue(17) + private val outputFrameQueue = LinkedBlockingQueue(7) // 渲染线程控制 @Volatile private var renderThreadRunning = true diff --git a/ios/Classes/VideoDecoder.swift b/ios/Classes/VideoDecoder.swift index cb2fec0..b12d275 100644 --- a/ios/Classes/VideoDecoder.swift +++ b/ios/Classes/VideoDecoder.swift @@ -46,12 +46,12 @@ class VideoDecoder { private let inputQueue = DispatchQueue(label: "video_decode_plugin.input.queue", attributes: .concurrent) private var inputBuffer: [(frameData: Data, frameType: Int, timestamp: Int64, frameSeq: Int, refIFrameSeq: Int?, sps: Data?, pps: Data?)] = [] private let inputBufferSemaphore = DispatchSemaphore(value: 1) - private let inputBufferMaxCount = 30 + private let inputBufferMaxCount = 7 /// 输出缓冲区(解码后帧队列),线程安全 private let outputQueue = DispatchQueue(label: "video_decode_plugin.output.queue", attributes: .concurrent) private var outputBuffer: [(pixelBuffer: CVPixelBuffer, timestamp: Int64)] = [] private let outputBufferSemaphore = DispatchSemaphore(value: 1) - private let outputBufferMaxCount = 20 + private let outputBufferMaxCount = 7 /// 渲染线程 private var renderThread: Thread? /// 渲染线程运行标志