mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 21:53:04 -04:00
Fixes
This commit is contained in:
parent
1c1654738f
commit
d126b89edc
2 changed files with 30 additions and 24 deletions
|
@ -11,7 +11,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
|||
### Extra included plugins
|
||||
|
||||
<details>
|
||||
<summary>183 additional plugins</summary>
|
||||
<summary>184 additional plugins</summary>
|
||||
|
||||
### All Platforms
|
||||
|
||||
|
@ -160,6 +160,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
|||
- StatusPresets by iamme
|
||||
- SteamStatusSync by niko
|
||||
- StickerBlocker by Samwich
|
||||
- StreamingCodecDisabler by davidkra230
|
||||
- TalkInReverse by Tolgchu
|
||||
- TeX by Kyuuhachi
|
||||
- TextToSpeech by Samwich
|
||||
|
|
|
@ -9,9 +9,9 @@ import { EquicordDevs } from "@utils/constants";
|
|||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findStoreLazy } from "@webpack";
|
||||
|
||||
let mediaEngine = findStoreLazy("MediaEngineStore");
|
||||
const mediaEngine = findStoreLazy("MediaEngineStore");
|
||||
|
||||
let originalCodecStatuses: {
|
||||
const originalCodecStatuses: {
|
||||
AV1: boolean,
|
||||
H265: boolean,
|
||||
H264: boolean;
|
||||
|
@ -21,27 +21,30 @@ let originalCodecStatuses: {
|
|||
H264: true
|
||||
};
|
||||
|
||||
const settings = definePluginSettings({
|
||||
disableAv1Codec: {
|
||||
description: "Make Discord not consider using AV1 for streaming.",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
disableH265Codec: {
|
||||
description: "Make Discord not consider using H265 for streaming.",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
disableH264Codec: {
|
||||
description: "Make Discord not consider using H264 for streaming.",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
});
|
||||
|
||||
export default definePlugin({
|
||||
name: "StreamingCodecDisabler",
|
||||
description: "Disable codecs for streaming of your choice! (for multi-gpu setups and forcing encoding on a non-primary (and less capable) gpu)",
|
||||
description: "Disable codecs for streaming of your choice",
|
||||
authors: [EquicordDevs.davidkra230],
|
||||
settings: definePluginSettings({
|
||||
disableAv1Codec: {
|
||||
description: "Make Discord not consider using AV1 for streaming.",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
disableH265Codec: {
|
||||
description: "Make Discord not consider using H265 for streaming.",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
disableH264Codec: {
|
||||
description: "Make Discord not consider using H264 for streaming.",
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false
|
||||
},
|
||||
}),
|
||||
settings,
|
||||
|
||||
patches: [
|
||||
{
|
||||
find: "setVideoBroadcast(this.shouldConnectionBroadcastVideo",
|
||||
|
@ -51,6 +54,7 @@ export default definePlugin({
|
|||
},
|
||||
}
|
||||
],
|
||||
|
||||
async updateDisabledCodecs() {
|
||||
mediaEngine.setAv1Enabled(originalCodecStatuses.AV1 && !Settings.plugins.StreamingCodecDisabler.disableAv1Codec);
|
||||
mediaEngine.setH265Enabled(originalCodecStatuses.H265 && !Settings.plugins.StreamingCodecDisabler.disableH265Codec);
|
||||
|
@ -58,16 +62,17 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
async start() {
|
||||
mediaEngine = mediaEngine.getMediaEngine();
|
||||
let options = Object.keys(originalCodecStatuses);
|
||||
const engine = mediaEngine.getMediaEngine();
|
||||
const options = Object.keys(originalCodecStatuses);
|
||||
// [{"codec":"","decode":false,"encode":false}]
|
||||
let CodecCapabilities = JSON.parse(await new Promise((res) => mediaEngine.getCodecCapabilities(res)));
|
||||
const CodecCapabilities = JSON.parse(await new Promise(res => engine.getCodecCapabilities(res)));
|
||||
CodecCapabilities.forEach((codec: { codec: string; encode: boolean; }) => {
|
||||
if (options.includes(codec.codec)) {
|
||||
originalCodecStatuses[codec.codec] = codec.encode;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
async stop() {
|
||||
mediaEngine.setAv1Enabled(originalCodecStatuses.AV1);
|
||||
mediaEngine.setH265Enabled(originalCodecStatuses.H265);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue