private void UnregisterMediaPacketPreviewCallback() { Native.UnsetMediaPacketPreviewCallback(_handle). ThrowIfFailed("Failed to unset media packet preview callback."); _mediaPacketPreviewCallback = null; }
private void RegisterMediaPacketPreviewCallback() { _mediaPacketPreviewCallback = (IntPtr mediaPacket, IntPtr userData) => { MediaPacket packet = MediaPacket.From(mediaPacket); var eventHandler = _mediaPacketPreview; if (eventHandler != null) { eventHandler.Invoke(this, new MediaPacketPreviewEventArgs(packet)); } else { packet.Dispose(); } }; CameraErrorFactory.ThrowIfError(Native.SetMediaPacketPreviewCallback(_handle, _mediaPacketPreviewCallback, IntPtr.Zero), "Setting media packet preview callback failed"); }
private void RegisterMediaPacketPreviewCallback() { _mediaPacketPreviewCallback = (mediaPacket, _) => { MediaPacket packet = MediaPacket.From(mediaPacket); var eventHandler = _mediaPacketPreview; if (eventHandler != null) { eventHandler.Invoke(this, new MediaPacketPreviewEventArgs(packet)); } packet.Dispose(); }; Native.SetMediaPacketPreviewCallback(_handle, _mediaPacketPreviewCallback). ThrowIfFailed("Failed to set media packet preview callback."); }
private void UnregisterMediaPacketPreviewCallback() { CameraErrorFactory.ThrowIfError(Native.UnsetMediaPacketPreviewCallback(_handle), "Unsetting media packet preview callback failed"); _mediaPacketPreviewCallback = null; }