public virtual void OnRender() { lock (lockObject) { if (isVideoStopped) { return; } if (mediaEngineEx != null) { long pts; if (mediaEngineEx.OnVideoStreamTick(out pts)) { if (OutputVideoTexture != null) { var desc = OutputVideoTexture.Description; var dxgiSurface = OutputVideoTexture.QueryInterface <SharpDX.DXGI.Surface>(); var region = new SharpDX.Mathematics.Interop.RawRectangle(0, 0, desc.Width, desc.Height); try { // Blit the frame to the supplied rendertarget mediaEngineEx.TransferVideoFrame(dxgiSurface, null, region, null); } catch (Exception) { // This exception can be worked around by using DirectX 9 only (see configuration) Debug.WriteLine("Exception during TransferVideoFrame"); } } } } } }
public virtual void OnRender(TargetBase targetBase) { lock (lockObject) { if (isVideoStopped) { return; } if (mediaEngineEx != null) { long pts; if (mediaEngineEx.OnVideoStreamTick(out pts)) { var backBuffer = OutputVideoTexture ?? targetBase.BackBuffer; if (backBuffer != null) { var desc = backBuffer.Description; var region = new Rectangle(0, 0, desc.Width, desc.Height); mediaEngineEx.TransferVideoFrame(backBuffer, null, region, (ColorBGRA)BackgroundColor); } } } } }
public virtual void OnRender() { lock (lockObject) { if (isVideoStopped) { return; } if (mediaEngineEx != null) { long pts; if (mediaEngineEx.OnVideoStreamTick(out pts)) { if (OutputVideoTexture != null) { var desc = OutputVideoTexture.Description; var region = new Rectangle(0, 0, desc.Width, desc.Height); try { // Blit the frame to the supplied rendertarget mediaEngineEx.TransferVideoFrame(OutputVideoTexture, null, region, (ColorBGRA)BackgroundColor); } catch (Exception) { // This exception can be worked around by using DirectX 9 only (see configuration) Debug.WriteLine("Exception during TransferVideoFrame"); } } } } } }