Files
better-genshin-impact/BetterGenshinImpact/Core/Video/VideoRecorderFactory.cs
辉鸭蛋 9c93cb465d fix path
2024-12-29 14:07:45 +08:00

31 lines
976 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using BetterGenshinImpact.GameTask.Common;
using Microsoft.Extensions.Logging;
namespace BetterGenshinImpact.Core.Video;
public class VideoRecorderFactory
{
private static ObsRecorder? _obsRecorder;
public static IVideoRecorder Create(string recorderType, string fileName)
{
switch (recorderType)
{
case "ffmpeg":
var ffmpegRecorder = new FfmpegRecorder(fileName);
return ffmpegRecorder;
case "obs":
if (_obsRecorder == null)
{
_obsRecorder = new ObsRecorder();
// TaskControl.Logger.LogInformation("当前选择使用OBS录制OBS首次启动较慢请耐心等待...");
}
_obsRecorder.FileName = fileName;
return _obsRecorder;
default:
throw new ArgumentException("不支持的录制工具");
}
}
}