Beispiel #1
0
 void RenderFrame()
 {
     if (destinationTarget != null)
     {
         lock (ResourceLock)
         {
             var args = new VideoEffectHandlerArgs()
             {
                 InputFrame  = sourceTarget,
                 OutputFrame = destinationTarget,
                 ID          = ID,
                 Properties  = Properties,
                 Device      = CanvasDevice
             };
             bool effectsAdded = VideoEffectManager.ProcessFrame(args);
             using (var ds = CanvasComposition.CreateDrawingSession(DrawingSurface))
             {
                 ds.DrawImage(destinationTarget);
             }
         }
     }
     else
     {
         Container.RunOnUIThread(createDestinationTarget);
     }
 }
Beispiel #2
0
 public void ProcessFrame(ProcessVideoFrameContext context)
 {
     using (var output = CanvasRenderTarget.CreateFromDirect3D11Surface(device, context.OutputFrame.Direct3DSurface))
         using (var input = CanvasRenderTarget.CreateFromDirect3D11Surface(device, context.InputFrame.Direct3DSurface))
         {
             var args = new VideoEffectHandlerArgs()
             {
                 ID          = id,
                 Device      = device,
                 InputFrame  = input,
                 OutputFrame = output,
                 Properties  = properties
             };
             VideoEffectManager.ProcessFrame(args);
         }
 }