[*] 日常优化
This commit is contained in:
30
.github/workflows/codeql.yml
vendored
30
.github/workflows/codeql.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: codeql
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ "cpp", "java", "javascript" ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 17
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -3,12 +3,12 @@
|
||||
.classpath
|
||||
.factorypath
|
||||
|
||||
package-lock.json
|
||||
|
||||
.vscode
|
||||
|
||||
dist
|
||||
logs
|
||||
build
|
||||
target
|
||||
node_modules
|
||||
|
||||
.vscode
|
||||
|
||||
package-lock.json
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
----
|
||||
|
||||
> 当前程序处于开发阶段,大部分功能没有实现,可以使用的功能也没有经过大量测试,建议不要用于生产。
|
||||
|
||||
## 模块
|
||||
|
||||
|模块|名称|描述|
|
||||
@@ -45,7 +43,7 @@
|
||||
|控制|支持|完成|部分控制信令|
|
||||
|拍照|支持|完成|拍照|
|
||||
|录像|支持|完成|录制|
|
||||
|混音|支持|暂未实现|多路混音|
|
||||
|混音|支持|完成|多路混音|
|
||||
|水印|支持|完成|视频水印|
|
||||
|
||||
> 注意:Web终端不支持同时进入多个视频房间,安卓终端支持同时进入多个视频房间。
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
## 计划任务
|
||||
|
||||
* 录制底噪
|
||||
* 分辨率调整
|
||||
* 查询消费者生产者信息
|
||||
|
||||
|
||||
@@ -117,13 +117,15 @@ public class MixerProcesser extends Thread implements JavaAudioDeviceModule.Samp
|
||||
if(this.source == Source.NATIVE) {
|
||||
recordSize = this.audioRecord.read(byteBuffer, byteBuffer.capacity());
|
||||
if(recordSize != byteBuffer.capacity()) {
|
||||
Thread.yield();
|
||||
continue;
|
||||
}
|
||||
recordData = Arrays.copyOfRange(byteBuffer.array(), byteBuffer.arrayOffset(), byteBuffer.capacity() + byteBuffer.arrayOffset());
|
||||
pts += recordData.length * (1_000_000 / this.sampleRate / 2);
|
||||
this.recordClient.onPcm(pts, recordData);
|
||||
} else if(this.source == Source.WEBRTC) {
|
||||
local = this.local.poll(100, TimeUnit.MILLISECONDS);
|
||||
// 平均10毫秒
|
||||
local = this.local.poll(64, TimeUnit.MILLISECONDS);
|
||||
remote = this.remote.poll();
|
||||
if(local != null && remote != null) {
|
||||
// Log.d(MixerProcesser.class.getSimpleName(), String.format("""
|
||||
@@ -161,9 +163,11 @@ public class MixerProcesser extends Thread implements JavaAudioDeviceModule.Samp
|
||||
pts += remoteData.length * (1_000_000 / remote.getSampleRate() / 2);
|
||||
this.recordClient.onPcm(pts, remoteData);
|
||||
} else {
|
||||
Thread.yield();
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
Thread.yield();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(MixerProcesser.class.getSimpleName(), "音频处理异常", e);
|
||||
|
||||
@@ -233,7 +233,7 @@ public class RecordClient extends Client implements VideoSink {
|
||||
bufferInfo.presentationTimeUs -= pts;
|
||||
this.mediaMuxer.writeSampleData(trackIndex, outputBuffer, bufferInfo);
|
||||
this.audioCodec.releaseOutputBuffer(outputIndex, false);
|
||||
Log.d(RecordClient.class.getSimpleName(), "录制音频帧(时间戳):" + bufferInfo.flags + " - " + (bufferInfo.presentationTimeUs / 1_000_000F));
|
||||
// Log.d(RecordClient.class.getSimpleName(), "录制音频帧(时间戳):" + (bufferInfo.presentationTimeUs / 1_000_000F));
|
||||
// if (bufferInfo.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME == MediaCodec.BUFFER_FLAG_KEY_FRAME) {
|
||||
// } else if (bufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG == MediaCodec.BUFFER_FLAG_CODEC_CONFIG) {
|
||||
// } else if (bufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
|
||||
@@ -327,7 +327,7 @@ public class RecordClient extends Client implements VideoSink {
|
||||
bufferInfo.presentationTimeUs -= pts;
|
||||
this.mediaMuxer.writeSampleData(trackIndex, outputBuffer, bufferInfo);
|
||||
this.videoCodec.releaseOutputBuffer(outputIndex, false);
|
||||
Log.d(RecordClient.class.getSimpleName(), "录制视频帧(时间戳):" + (bufferInfo.presentationTimeUs / 1_000_000F));
|
||||
// Log.d(RecordClient.class.getSimpleName(), "录制视频帧(时间戳):" + (bufferInfo.presentationTimeUs / 1_000_000F));
|
||||
// if (bufferInfo.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME == MediaCodec.BUFFER_FLAG_KEY_FRAME) {
|
||||
// } else if (bufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG == MediaCodec.BUFFER_FLAG_CODEC_CONFIG) {
|
||||
// } else if (bufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
|
||||
|
||||
Reference in New Issue
Block a user