示例#1
0
        private void PresentNV12P010(MediaFrame frame, bool dispose = true)
        {
            // TODO: Possible process it directly after decoding (back to FFmpeg) to avoid Flush?
            try
            {
                Utilities.Dispose(ref vpiv);
                videoDevice1.CreateVideoProcessorInputView(frame.textureHW, vpe, vpivd, out vpiv);

                VideoProcessorStream vps = new VideoProcessorStream()
                {
                    PInputSurface = vpiv,
                    Enable        = new RawBool(true)
                };
                vpsa[0] = vps;
                videoContext1.VideoProcessorBlt(videoProcessor, vpov, 0, 1, vpsa);

                context.PixelShader.SetShaderResource(0, srvRGB);
                context.PixelShader.Set(pixelShader);
            } catch (Exception) {
            } finally { if (dispose)
                        {
                            Utilities.Dispose(ref frame.textureHW);
                        }
            }
        }