73 lines
2.6 KiB
TypeScript
73 lines
2.6 KiB
TypeScript
// Metro module 10747 (f10748).
|
|
import { ApplicationStreamFPS, ApplicationStreamPresets, ApplicationStreamResolutions } from "../StreamSettingsConstants";
|
|
import GoLiveVideoPresetResolutionExperiment from "../GoLiveVideoPresetResolutionExperiment";
|
|
import canStreamWithSettings from "./canStreamWithSettings";
|
|
let getStreamSettingsForPreset;
|
|
const getApplicationStreamPresetValues = function getApplicationStreamPresetValues() {
|
|
const videoPresetResolutionMax = GoLiveVideoPresetResolutionExperiment.getConfig({
|
|
location: "getApplicationStreamPresetValues"
|
|
}).videoPresetResolutionMax;
|
|
const r15 = {};
|
|
r15[ApplicationStreamPresets.PRESET_DOCUMENTS] = [{
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_SOURCE,
|
|
fps: ApplicationStreamFPS.FPS_15
|
|
}, {
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_SOURCE,
|
|
fps: ApplicationStreamFPS.FPS_5
|
|
}];
|
|
r15[ApplicationStreamPresets.PRESET_VIDEO] = [{
|
|
resolution: videoPresetResolutionMax,
|
|
fps: ApplicationStreamFPS.FPS_60
|
|
}, {
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_1080,
|
|
fps: ApplicationStreamFPS.FPS_60
|
|
}, {
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_720,
|
|
fps: ApplicationStreamFPS.FPS_60
|
|
}, {
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_720,
|
|
fps: ApplicationStreamFPS.FPS_30
|
|
}];
|
|
r15[ApplicationStreamPresets.PRESET_AUTO] = [];
|
|
r15[ApplicationStreamPresets.PRESET_CUSTOM] = [];
|
|
r15[ApplicationStreamPresets.PRESET_MOBILE_DEFAULT] = [{
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_720,
|
|
fps: ApplicationStreamFPS.FPS_30
|
|
}];
|
|
r15[ApplicationStreamPresets.PRESET_MOBILE_PERFORMANCE] = [{
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_480,
|
|
fps: ApplicationStreamFPS.FPS_30
|
|
}];
|
|
r15[ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY] = [{
|
|
resolution: ApplicationStreamResolutions.RESOLUTION_1080,
|
|
fps: ApplicationStreamFPS.FPS_60
|
|
}];
|
|
return r15;
|
|
};
|
|
getStreamSettingsForPreset = function getStreamSettingsForPreset(a0, a1, a2) {
|
|
const r9 = getApplicationStreamPresetValues()[a0];
|
|
if (r9 == null) {
|
|
return null;
|
|
}
|
|
for (const item of r9) {
|
|
if (!canStreamWithSettings(a0, item.resolution, item.fps, a1, a2)) {
|
|
continue;
|
|
}
|
|
return [item.resolution, item.fps];
|
|
}
|
|
return null;
|
|
};
|
|
export default getStreamSettingsForPreset;
|
|
export { getApplicationStreamPresetValues };
|
|
export function getMaxSettingsForPreset(a0) {
|
|
const r7 = getApplicationStreamPresetValues()[a0];
|
|
let r8 = r7 == null ? void 0 : r7[0];
|
|
if (r8 == null) {
|
|
r8 = null;
|
|
}
|
|
return r8;
|
|
}
|
|
export function canStreamWithPreset(a0, a1, a2) {
|
|
return getStreamSettingsForPreset(a0, a1, a2) != null;
|
|
}
|