From b7b80f99a28f805ff33c06620afee6d8f9469757 Mon Sep 17 00:00:00 2001 From: Techyian Date: Mon, 30 Dec 2019 11:10:42 +0000 Subject: [PATCH] #47. ISP component has 2 output ports. --- src/MMALSharp/Components/MMALIspComponent.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/MMALSharp/Components/MMALIspComponent.cs b/src/MMALSharp/Components/MMALIspComponent.cs index 1ca7d1dd..a215842e 100644 --- a/src/MMALSharp/Components/MMALIspComponent.cs +++ b/src/MMALSharp/Components/MMALIspComponent.cs @@ -33,7 +33,11 @@ public unsafe MMALIspComponent() { // Default to use still image port behaviour. this.Inputs.Add(new InputPort((IntPtr)(&(*this.Ptr->Input[0])), this, Guid.NewGuid())); - this.Outputs.Add(new StillPort((IntPtr)(&(*this.Ptr->Output[0])), this, Guid.NewGuid())); + + for (var i = 0; i < this.Ptr->OutputNum; i++) + { + this.Outputs.Add(new StillPort((IntPtr)(&(*this.Ptr->Output[i])), this, Guid.NewGuid())); + } } /// @@ -45,7 +49,11 @@ public unsafe MMALIspComponent(Type outputPortType) : base(MMAL_COMPONENT_ISP) { this.Inputs.Add(new InputPort((IntPtr)(&(*this.Ptr->Input[0])), this, Guid.NewGuid())); - this.Outputs.Add((IOutputPort)Activator.CreateInstance(outputPortType, (IntPtr)(&(*this.Ptr->Output[0])), this, Guid.NewGuid())); + + for (var i = 0; i < this.Ptr->OutputNum; i++) + { + this.Outputs.Add((IOutputPort)Activator.CreateInstance(outputPortType, (IntPtr)(&(*this.Ptr->Output[i])), this, Guid.NewGuid())); + } } } }