提交
This commit is contained in:
@@ -25,7 +25,7 @@ public class XrealMixedRecorder : IVideoRecorder, IController
|
||||
|
||||
public ResolutionLevel resolutionLevel = ResolutionLevel.High;
|
||||
public BlendMode blendMode = BlendMode.Blend;
|
||||
public AudioState audioState = AudioState.ApplicationAndMicAudio;
|
||||
public AudioState audioState = AudioState.MicAudio;
|
||||
public CaptureSide captureside = CaptureSide.Single;
|
||||
public bool useGreenBackGround = false;
|
||||
|
||||
@@ -37,27 +37,22 @@ public class XrealMixedRecorder : IVideoRecorder, IController
|
||||
|
||||
private GalleryDataProvider _galleryDataTool;
|
||||
|
||||
|
||||
|
||||
/// <summary> Save the video to Application.persistentDataPath. </summary>
|
||||
/// <value> The full pathname of the video save file. </value>
|
||||
private string VideoSaveExtension => Path.Combine(Application.persistentDataPath, "Recording");
|
||||
|
||||
private string VideoSavePath
|
||||
public string VideoSavePath
|
||||
{
|
||||
get
|
||||
{
|
||||
var timeStamp = Time.time.ToString().Replace(".", "").Replace(":", "");
|
||||
var filename =
|
||||
$"{this.GetSystem<IGlobalConfigSystem>().GetConnectionId()}{timeStamp}.mp4";
|
||||
return Path.Combine(Application.persistentDataPath, VideoSaveExtension, filename);
|
||||
string timeStamp = Time.time.ToString().Replace(".", "").Replace(":", "");
|
||||
string filename = string.Format("Xreal_Record_{0}.mp4", timeStamp);
|
||||
return Path.Combine(Application.persistentDataPath, filename);
|
||||
}
|
||||
}
|
||||
|
||||
private string _videoSavePath;
|
||||
|
||||
|
||||
public void StartRecording()
|
||||
{
|
||||
_videoSavePath = VideoSavePath;
|
||||
if (_videoCapture == null)
|
||||
CreateVideoCapture(StartVideoCapture);
|
||||
else if (_videoCapture.IsRecording)
|
||||
@@ -112,9 +107,10 @@ public class XrealMixedRecorder : IVideoRecorder, IController
|
||||
|
||||
var encoder = _videoCapture.GetContext().GetEncoder() as VideoEncoder;
|
||||
var path = encoder.EncodeConfig.outPutPath;
|
||||
Debug.Log("Stopped Video Capture Mode!--path"+path);
|
||||
var filename = string.Format("Xreal_Shot_Video_{0}.mp4",
|
||||
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString());
|
||||
|
||||
Debug.Log("Stopped Video Capture Mode!--path"+filename);
|
||||
await DelayInsertVideoToGallery(path, filename, "Record");
|
||||
OnStoppedRecordingVideoAction?.Invoke(path);
|
||||
// Release video capture resource.
|
||||
@@ -221,7 +217,18 @@ public class XrealMixedRecorder : IVideoRecorder, IController
|
||||
|
||||
Debug.Log("Started Video Capture Mode!");
|
||||
|
||||
_videoCapture.StartRecordingAsync(_videoSavePath, (a) => OnStartedRecordingVideo?.Invoke());
|
||||
_videoCapture.StartRecordingAsync(VideoSavePath, (a) =>
|
||||
{
|
||||
OnStartedRecordingVideo?.Invoke();
|
||||
if (!a.success)
|
||||
{
|
||||
Debug.Log("Started Recording Video Faild!");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("Started Recording Video!");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public IArchitecture GetArchitecture()
|
||||
|
||||
Reference in New Issue
Block a user