trtc-electron-sdk
Version:
trtc electron sdk
31 lines (30 loc) • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertFillModeFromLive = exports.convertPixelFormatFromLive = void 0;
const trtc_define_1 = require("../trtc_define");
const live_define_1 = require("./live_define");
// converter
function convertPixelFormatFromLive(format) {
switch (format) {
case live_define_1.V2LivePixelFormat.V2LivePixelFormatI420:
return trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
case live_define_1.V2LivePixelFormat.V2LivePixelFormatBGRA32:
return trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_BGRA32;
case live_define_1.V2LivePixelFormat.V2LivePixelFormatRGBA32:
return trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_RGBA32;
default:
return trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_Unknown;
}
}
exports.convertPixelFormatFromLive = convertPixelFormatFromLive;
function convertFillModeFromLive(fillMode) {
switch (fillMode) {
case live_define_1.V2LiveFillMode.V2LiveFillModeFill:
return trtc_define_1.TRTCVideoFillMode.TRTCVideoFillMode_Fill;
case live_define_1.V2LiveFillMode.V2LiveFillModeFit:
return trtc_define_1.TRTCVideoFillMode.TRTCVideoFillMode_Fit;
default:
return trtc_define_1.TRTCVideoFillMode.TRTCVideoFillMode_Fill;
}
}
exports.convertFillModeFromLive = convertFillModeFromLive;