示例#1
0
        private void UnregisterMediaPacketPreviewCallback()
        {
            Native.UnsetMediaPacketPreviewCallback(_handle).
            ThrowIfFailed("Failed to unset media packet preview callback.");

            _mediaPacketPreviewCallback = null;
        }
示例#2
0
文件: Camera.cs 项目: yourina/TizenFX
        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");
        }
示例#3
0
        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.");
        }
示例#4
0
文件: Camera.cs 项目: yourina/TizenFX
 private void UnregisterMediaPacketPreviewCallback()
 {
     CameraErrorFactory.ThrowIfError(Native.UnsetMediaPacketPreviewCallback(_handle),
                                     "Unsetting media packet preview callback failed");
     _mediaPacketPreviewCallback = null;
 }