public static byte[] GetSdkAudioBytes(IBMDSwitcherAudio frame) { byte[] res = new byte[frame.GetSize()]; frame.GetBytes(out IntPtr buffer); Marshal.Copy(buffer, res, 0, res.Length); return(res); }
public void Notify(_BMDSwitcherMediaPoolEventType eventType, IBMDSwitcherFrame frame, int frameIndex, IBMDSwitcherAudio audio, int clipIndex) { switch (eventType) { case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeValidChanged: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeNameChanged: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeHashChanged: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeAudioValidChanged: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeAudioNameChanged: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeAudioHashChanged: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockBusy: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockIdle: break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCancelled: case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferFailed: Result = eventType; Frame = frame; Audio = audio; Wait.Set(); break; default: throw new ArgumentOutOfRangeException(nameof(eventType), eventType, null); } }
void IBMDSwitcherClipCallback.Notify(_BMDSwitcherMediaPoolEventType EventType, IBMDSwitcherFrame Frame, int FrameIndex, IBMDSwitcherAudio Audio, int ClipIndex) { switch (EventType) { case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeAudioValidChanged): if (AudioValidChanged != null) AudioValidChanged(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeHashChanged): if (HashChanged != null) HashChanged(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockBusy): if (LockBusy != null) LockBusy(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockIdle): if (LockIdle != null) LockIdle(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeNameChanged): if (NameChanged != null) NameChanged(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCancelled): if (TransferCancelled != null) TransferCancelled(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted): if (TransferCompleted != null) TransferCompleted(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferFailed): if (TransferFailed != null) TransferFailed(this, null); break; case (_BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeValidChanged): if (ValidChanged != null) ValidChanged(this, null); break; } }
void IBMDSwitcherClipCallback.Notify(_BMDSwitcherMediaPoolEventType eventType, IBMDSwitcherFrame frame, int frameIndex, IBMDSwitcherAudio audio, int clipIndex) { this._switcherClipEventArgs = new SwitcherClipEventArgs { _frame = frame, _frameIndex = frameIndex, _audio = audio, _clipIndex = clipIndex }; switch (eventType) { case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeAudioHashChanged: this.SwitcherMediaPoolEventTypeAudioHashChanged?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeAudioNameChanged: this.SwitcherMediaPoolEventTypeAudioNameChanged?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeAudioValidChanged: this.SwitcherMediaPoolEventTypeAudioValidChanged?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeHashChanged: this.SwitcherMediaPoolEventTypeHashChanged?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockBusy: this.SwitcherMediaPoolEventTypeLockBusy?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeLockIdle: this.SwitcherMediaPoolEventTypeLockIdle?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeNameChanged: this.SwitcherMediaPoolEventTypeNameChanged?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCancelled: this.SwitcherMediaPoolEventTypeTransferCancelled?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted: this.SwitcherMediaPoolEventTypeTransferCompleted?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferFailed: this.SwitcherMediaPoolEventTypeTransferFailed?.Invoke(this, this._switcherClipEventArgs); break; case _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeValidChanged: this.SwitcherMediaPoolEventTypeValidChanged?.Invoke(this, this._switcherClipEventArgs); break; } }
public void UploadAudio(string name, IBMDSwitcherAudio audio) { this.Clip.UploadAudio(name, audio); }
public static void FillSdkAudio(IBMDSwitcherAudio frame, byte[] bytes) { frame.GetBytes(out IntPtr buffer); Marshal.Copy(bytes, 0, buffer, bytes.Length); }
public void Notify(_BMDSwitcherMediaPoolEventType eventType, IBMDSwitcherFrame frame, int frameIndex, IBMDSwitcherAudio audio, int clipIndex) { Log.Debug(String.Format("Clip Callback: {0}", eventType.ToString())); _BMDSwitcherMediaPoolEventType mediaPoolEventType = eventType; if (mediaPoolEventType != _BMDSwitcherMediaPoolEventType.bmdSwitcherMediaPoolEventTypeTransferCompleted) { return; } this.upload.onClipFrameUploadCompleted((uint)frameIndex); }