public Record(IVideoEncoder videoEncoder, IAacEncoder aacEncoder) { State = RecAndLiveState.NotStart; _handle = VsNetRecordSdk.FileMuxer_AllocInstance(); VsNetRecordSdk.FileMuxer_EnableSync(_handle, true); _videoEncoder = videoEncoder; _aacEncoder = aacEncoder; }
public bool ResumeRecord() { if (VsNetRecordSdk.FileMuxer_Resume(_handle) == 0) { State = RecAndLiveState.Started; return(true); } return(false); }
public bool PauseRecord() { if (VsNetRecordSdk.FileMuxer_Pause(_handle) == 0) { State = RecAndLiveState.Pause; return(true); } return(false); }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { } VsNetRecordSdk.FileMuxer_FreeInstance(_handle); disposedValue = true; } }
public bool StopRecord() { if (!IsRecord) { return(true); } _videoEncoder.PushingData -= VideoEncoderPushingData; _aacEncoder.PushingData -= AACEncoderPushingData; _videoEncoder.StopVideoEncoder(); _aacEncoder.StopAudioEncoder(); if (VsNetRecordSdk.FileMuxer_EndWrite(_handle) == 0) { State = RecAndLiveState.NotStart; IsRecord = false; return(true); } return(false); }
private void VideoEncoderPushingData(VideoEncodedDataContext value) { VsNetRecordSdk.FileMuxer_WriteVideo(_handle, value.Data, value.DataLength, value.KeyFrame, value.TimeStamp); }
private void AACEncoderPushingData(AudioEncodedDataContext value) { VsNetRecordSdk.FileMuxer_WriteAudio(_handle, value.Data.ToInt32(), value.DataLength, value.KeyFrame); }
private bool SetRecordInfo(string fileSavePath) { return(VsNetRecordSdk.FileMuxer_BeginWrite(_handle, fileSavePath, _videoEncoder.IntBitmapInfoHeader, Marshal.SizeOf(new BitmapInfoHeader()), _aacEncoder.IntWaveFormatEx, 2) == 0); }