aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Nvdec.H264/Surface.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-10-11 06:09:38 -0300
committerGitHub <noreply@github.com>2020-10-11 11:09:38 +0200
commit14fd9aa640936d2455c9f0929fc904a5bdb2fada (patch)
tree7d18512c5646f62185a2ee49b32ad4dc46ff3e37 /Ryujinx.Graphics.Nvdec.H264/Surface.cs
parentc482718d2e1a6e4abe69c246bdaca8b21f898037 (diff)
Fix H264 output frame size when decoding videos of different sizes (#1606)
Diffstat (limited to 'Ryujinx.Graphics.Nvdec.H264/Surface.cs')
-rw-r--r--Ryujinx.Graphics.Nvdec.H264/Surface.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Nvdec.H264/Surface.cs b/Ryujinx.Graphics.Nvdec.H264/Surface.cs
index a6c16ba3..3dbc980e 100644
--- a/Ryujinx.Graphics.Nvdec.H264/Surface.cs
+++ b/Ryujinx.Graphics.Nvdec.H264/Surface.cs
@@ -8,6 +8,9 @@ namespace Ryujinx.Graphics.Nvdec.H264
{
public AVFrame* Frame { get; }
+ public int RequestedWidth { get; }
+ public int RequestedHeight { get; }
+
public Plane YPlane => new Plane((IntPtr)Frame->data[0], Stride * Height);
public Plane UPlane => new Plane((IntPtr)Frame->data[1], UvStride * UvHeight);
public Plane VPlane => new Plane((IntPtr)Frame->data[2], UvStride * UvHeight);
@@ -19,8 +22,11 @@ namespace Ryujinx.Graphics.Nvdec.H264
public int UvHeight => (Frame->height + 1) >> 1;
public int UvStride => Frame->linesize[1];
- public Surface()
+ public Surface(int width, int height)
{
+ RequestedWidth = width;
+ RequestedHeight = height;
+
Frame = ffmpeg.av_frame_alloc();
}