mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Improved SkiaSharp CreateVideoFrame performance
This commit is contained in:
parent
2458b4ae9c
commit
a66bdba211
1 changed files with 2 additions and 1 deletions
|
@ -50,10 +50,11 @@ public static Extensions.SkiaSharp.BitmapVideoFrameWrapper CreateVideoFrame(int
|
||||||
{
|
{
|
||||||
var bitmap = new SKBitmap(w, h, fmt, SKAlphaType.Opaque);
|
var bitmap = new SKBitmap(w, h, fmt, SKAlphaType.Opaque);
|
||||||
|
|
||||||
|
using var bitmapCanvas = new SKCanvas(bitmap);
|
||||||
SetVideoFramePixels(index, w, h, scaleNoise, offset, ((int x, int y, byte red, byte green, byte blue) args) =>
|
SetVideoFramePixels(index, w, h, scaleNoise, offset, ((int x, int y, byte red, byte green, byte blue) args) =>
|
||||||
{
|
{
|
||||||
var color = new SKColor(args.red, args.blue, args.green);
|
var color = new SKColor(args.red, args.blue, args.green);
|
||||||
bitmap.SetPixel(args.x, args.y, color);
|
bitmapCanvas.DrawPoint(args.x, args.y, color);
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Extensions.SkiaSharp.BitmapVideoFrameWrapper(bitmap);
|
return new Extensions.SkiaSharp.BitmapVideoFrameWrapper(bitmap);
|
||||||
|
|
Loading…
Reference in a new issue