Beispiel #1
0
        public void Dispose()
        {
            if (isDisposed)
            {
                return;
            }

            isDisposed = true;

            videoContextHandle?.Dispose();
            videoDecoderHandle?.Dispose();
            decoderConfigHandle?.Dispose();
            decoderOuputViewsHandle?.Dispose();

#if XENKO_GRAPHICS_API_DIRECT3D11
            videoHardwareDecoder?.Dispose();
            videoHardwareDecoderView?.Dispose();
#endif

            DecoderOutputTexture?.Dispose();
            DecoderOutputTexture = null;

            var pHWDeviceContextLocal = pHWDeviceContext;
            ffmpeg.av_buffer_unref(&pHWDeviceContextLocal);

            var pAVCodecContextLocal = pAVCodecContext;
            ffmpeg.avcodec_close(pAVCodecContextLocal);
            ffmpeg.avcodec_free_context(&pAVCodecContextLocal);
        }
Beispiel #2
0
        public override unsafe void PrepareForSending()
        {
            base.PrepareForSending();
            pinnedArray?.Dispose();

            var array = new NativeArray <long>(Tabs.Count);

            for (int i = 0; i < Tabs.Count; i++)
            {
                var c = Tabs[i];
                c.PrepareForSending();
                array[i] = c;
            }
            pinnedArray = array;
            GetBackingStruct <MultiChildRenderObjectWidgetStruct>().Children = pinnedArray;
        }