From 5f1cb3ccc4c32bd3bedba69a5c38618d66178ed3 Mon Sep 17 00:00:00 2001 From: yujiaxinwt <1157613664@qq.com> Date: Wed, 29 Nov 2023 16:26:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BD=BF=E5=8F=82=E6=95=B0decoder=5Ftype?= =?UTF-8?q?=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/demo/demo.html | 1 - sdk/index.html | 1 - sdk/src/AppController.js | 2 +- sdk/src/CPHCloudApp.js | 4 +++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/demo/demo.html b/sdk/demo/demo.html index cb58d92..da8381b 100644 --- a/sdk/demo/demo.html +++ b/sdk/demo/demo.html @@ -582,7 +582,6 @@ Copyright 2022 Huawei Cloud Computing Technology Co., Ltd. _debug: true, auto_rotate: true, libPath: commonLibPath, // 配置库文件地址 - decoder_type: 'H264', // H265\H264 microPhoneOutputType: 'OPUS' // PCM或OPUS }; try { diff --git a/sdk/index.html b/sdk/index.html index cb58d92..da8381b 100644 --- a/sdk/index.html +++ b/sdk/index.html @@ -582,7 +582,6 @@ Copyright 2022 Huawei Cloud Computing Technology Co., Ltd. _debug: true, auto_rotate: true, libPath: commonLibPath, // 配置库文件地址 - decoder_type: 'H264', // H265\H264 microPhoneOutputType: 'OPUS' // PCM或OPUS }; try { diff --git a/sdk/src/AppController.js b/sdk/src/AppController.js index dea0ea2..76a04ca 100644 --- a/sdk/src/AppController.js +++ b/sdk/src/AppController.js @@ -973,7 +973,7 @@ class AppController { client_type: '3', media_config: { ...this.options.mediaConfig, - frame_type: FRAME_TYPE_MAP.TYPE265, + frame_type: this.options.decoderType ? this.options.decoderType.toLowerCase() : FRAME_TYPE_MAP.TYPE265, quality: PROTOCOL_CONFIG[DEFAULT_DEFINITION].quality } }; diff --git a/sdk/src/CPHCloudApp.js b/sdk/src/CPHCloudApp.js index 480a4b7..f34dfa1 100644 --- a/sdk/src/CPHCloudApp.js +++ b/sdk/src/CPHCloudApp.js @@ -81,13 +81,15 @@ class CPHCloudApp { needHeatBeat: userOptions.need_heartbeat === undefined ? true : userOptions.need_heartbeat, reconnectTimes: userOptions.reconnect_times === undefined ? DEFAULT_RECONNECT_TIMES : userOptions.reconnect_times, libPath: userOptions.libPath, - decoderType: userOptions.decoder_type, microPhoneOutputType: userOptions.microPhoneOutputType }; options.autoRotate = userOptions.auto_rotate && options.isMobile; if (userOptions.media_config) { options.mediaConfig = userOptions.media_config; } + if (userOptions.decoder_type) { + options.decoderType = userOptions.decoder_type; + } return new AppController(options); } -- Gitee From 454d5d290eb6862e03e6ea078f36866ef18df5b5 Mon Sep 17 00:00:00 2001 From: yujiaxinwt <1157613664@qq.com> Date: Wed, 29 Nov 2023 16:56:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?frame=5Ftype=E9=BB=98=E8=AE=A4h264?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/src/AppController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/src/AppController.js b/sdk/src/AppController.js index 76a04ca..4e9085d 100644 --- a/sdk/src/AppController.js +++ b/sdk/src/AppController.js @@ -973,7 +973,7 @@ class AppController { client_type: '3', media_config: { ...this.options.mediaConfig, - frame_type: this.options.decoderType ? this.options.decoderType.toLowerCase() : FRAME_TYPE_MAP.TYPE265, + frame_type: this.options.decoderType ? this.options.decoderType.toLowerCase() : FRAME_TYPE_MAP.TYPE264, quality: PROTOCOL_CONFIG[DEFAULT_DEFINITION].quality } }; -- Gitee