├── tests
└── MMALSharp.Tests
│ ├── xunit.runner.json
│ ├── TestMember.cs
│ ├── Data
│ ├── BasicImageData.cs
│ ├── RawImageData.cs
│ ├── CustomConnectionCallbackHandler.cs
│ ├── ImageData.cs
│ ├── VideoData.cs
│ └── ImageFxData.cs
│ ├── DisplayTestMethodNameAttribute.cs
│ ├── NLog.config
│ ├── MMALSharp.Tests.csproj
│ ├── MMALFixture.cs
│ ├── TestHelper.cs
│ ├── ColorConversionTests.cs
│ └── FFmpegTests.cs
├── src
├── MMALSharp
│ ├── App.config
│ ├── Callbacks
│ │ ├── ICallbackHandler.cs
│ │ ├── IVideoOutputCallbackHandler.cs
│ │ ├── IOutputCallbackHandler.cs
│ │ ├── DefaultConnectionCallbackHandler.cs
│ │ ├── IInputCallbackHandler.cs
│ │ ├── DefaultPortCallbackHandler.cs
│ │ ├── DefaultInputPortCallbackHandler.cs
│ │ ├── DefaultOutputPortCallbackHandler.cs
│ │ ├── IConnectionCallbackHandler.cs
│ │ ├── FastImageOutputCallbackHandler.cs
│ │ ├── ConnectionCallbackHandler.cs
│ │ └── InputPortCallbackHandler.cs
│ ├── Ports
│ │ ├── Outputs
│ │ │ ├── IStillPort.cs
│ │ │ ├── IVideoPort.cs
│ │ │ ├── SplitterStillPort.cs
│ │ │ ├── SplitterOutputPort.cs
│ │ │ ├── SplitterVideoPort.cs
│ │ │ ├── IOutputPort.cs
│ │ │ └── StillPort.cs
│ │ ├── Controls
│ │ │ └── IControlPort.cs
│ │ ├── PortType.cs
│ │ ├── Clocks
│ │ │ └── ClockPort.cs
│ │ ├── Inputs
│ │ │ ├── OverlayPort.cs
│ │ │ └── IInputPort.cs
│ │ ├── GenericPort.cs
│ │ └── IMMALPortConfig.cs
│ ├── Components
│ │ ├── EncoderComponents
│ │ │ ├── IEncoder.cs
│ │ │ ├── IImageDecoder.cs
│ │ │ ├── IVideoDecoder.cs
│ │ │ ├── IVideoEncoder.cs
│ │ │ ├── IMMALConvert.cs
│ │ │ ├── MMALEncoderBase.cs
│ │ │ ├── IImageEncoder.cs
│ │ │ ├── MMALVideoDecoder.cs
│ │ │ └── MMALImageDecoder.cs
│ │ ├── IDownstreamHandlerComponent.cs
│ │ ├── ICameraInfoComponent.cs
│ │ ├── MMALDownstreamHandlerComponent.cs
│ │ ├── MMALResizerComponent.cs
│ │ ├── ICameraComponent.cs
│ │ ├── MMALSplitterComponent.cs
│ │ └── MMALIspComponent.cs
│ ├── Config
│ │ ├── ExifTag.cs
│ │ ├── Split.cs
│ │ ├── TimelapseMode.cs
│ │ ├── Timelapse.cs
│ │ ├── ColourEffects.cs
│ │ ├── PreviewOverlayConfiguration.cs
│ │ ├── StereoMode.cs
│ │ ├── Zoom.cs
│ │ ├── JpegThumbnail.cs
│ │ └── PreviewConfiguration.cs
│ ├── Parameter.cs
│ ├── MMALBootstrapper.cs
│ ├── IMMALObject.cs
│ ├── MMALObject.cs
│ ├── Native
│ │ ├── BcmHost.cs
│ │ ├── MMALCommon.cs
│ │ ├── MMALQueue.cs
│ │ ├── MMALEvents.cs
│ │ └── MMALPool.cs
│ ├── IBufferPool.cs
│ ├── IBufferQueue.cs
│ ├── MMALSharp.csproj
│ ├── IBufferEvent.cs
│ └── MMALPoolImpl.cs
├── MMALSharp.Common
│ ├── Enumerations.cs
│ ├── BufferMetadata.cs
│ ├── Utility
│ │ ├── CancellationTokenExtensions.cs
│ │ ├── Helpers.cs
│ │ └── Logging.cs
│ ├── MMALSharp.Common.csproj
│ ├── ImageContext.cs
│ └── GenericExtensions.cs
├── MMALSharp.Processing
│ ├── Processors
│ │ ├── Bayer
│ │ │ ├── DemosaicProcessor.cs
│ │ │ ├── BayerOperationsExtensions.cs
│ │ │ └── BayerMetaProcessor.cs
│ │ ├── Motion
│ │ │ ├── MotionType.cs
│ │ │ ├── MotionVectorAnalyser.cs
│ │ │ ├── MotionConfig.cs
│ │ │ └── IMotionAlgorithm.cs
│ │ ├── IFrameAnalyser.cs
│ │ ├── IFrameProcessor.cs
│ │ ├── IFrameProcessingContext.cs
│ │ ├── FrameProcessingContext.cs
│ │ ├── Effects
│ │ │ ├── BoxBlur.cs
│ │ │ ├── SharpenProcessor.cs
│ │ │ ├── CustomConvolutionProcessor.cs
│ │ │ ├── EdgeDetection.cs
│ │ │ └── GaussianProcessor.cs
│ │ └── FrameAnalysisMetadata.cs
│ ├── Handlers
│ │ ├── IVideoCaptureHandler.cs
│ │ ├── ICaptureHandler.cs
│ │ ├── IInputCaptureHandler.cs
│ │ ├── IOutputCaptureHandler.cs
│ │ ├── IMotionVectorCaptureHandler.cs
│ │ ├── IFileStreamCaptureHandler.cs
│ │ ├── MemoryStreamCaptureHandler.cs
│ │ ├── ImageStreamCaptureHandler.cs
│ │ ├── ProcessResult.cs
│ │ ├── ProcessedFileResult.cs
│ │ ├── IMotionCaptureHandler.cs
│ │ ├── InMemoryCaptureHandler.cs
│ │ ├── InputCaptureHandler.cs
│ │ ├── OutputCaptureHandler.cs
│ │ ├── StreamCaptureHandler.cs
│ │ └── ExternalProcessCaptureHandlerOptions.cs
│ └── MMALSharp.Processing.csproj
├── MMALSharp.Demo
│ ├── MMALSharp.Demo.csproj
│ ├── OpsBase.cs
│ ├── Program.cs
│ └── VideoOps.cs
└── MMALSharp.FFmpeg
│ ├── MMALSharp.FFmpeg.csproj
│ └── VideoUtilities.cs
├── NuGet.config
├── LICENSE.txt
├── run-sonar.ps1
└── .gitattributes
/tests/MMALSharp.Tests/xunit.runner.json:
--------------------------------------------------------------------------------
1 | {
2 | "parallelizeTestCollections": false,
3 | "shadowCopy": false,
4 | "maxParallelThreads": -1
5 | }
--------------------------------------------------------------------------------
/src/MMALSharp/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/MMALSharp.Common/Enumerations.cs:
--------------------------------------------------------------------------------
1 | namespace MMALSharp.Common
2 | {
3 | ///
4 | /// Represents a Raspberry Pi camera module model.
5 | ///
6 | public enum CameraVersion
7 | {
8 | ///
9 | /// SUNNY OV5647.
10 | ///
11 | OV5647,
12 |
13 | ///
14 | /// Sony IMX219.
15 | ///
16 | IMX219
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/MMALSharp/Callbacks/ICallbackHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Callbacks
7 | {
8 | ///
9 | /// Represents a callback handler.
10 | ///
11 | public interface ICallbackHandler
12 | {
13 | }
14 | }
--------------------------------------------------------------------------------
/src/MMALSharp/Ports/Outputs/IStillPort.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Ports.Outputs
7 | {
8 | ///
9 | /// Represents a still port.
10 | ///
11 | public interface IStillPort : IOutputPort
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp/Ports/Outputs/IVideoPort.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Ports.Outputs
7 | {
8 | ///
9 | /// Represents a video port.
10 | ///
11 | public interface IVideoPort : IOutputPort
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp/Components/EncoderComponents/IEncoder.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Components.EncoderComponents
7 | {
8 | ///
9 | /// Represents an encoder component.
10 | ///
11 | public interface IEncoder : IDownstreamHandlerComponent
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp/Components/EncoderComponents/IImageDecoder.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Components.EncoderComponents
7 | {
8 | ///
9 | /// Represents a image decoder component.
10 | ///
11 | public interface IImageDecoder : IEncoder
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp/Components/EncoderComponents/IVideoDecoder.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Components.EncoderComponents
7 | {
8 | ///
9 | /// Represents a video decoder component.
10 | ///
11 | public interface IVideoDecoder : IEncoder
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp/Components/EncoderComponents/IVideoEncoder.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Components.EncoderComponents
7 | {
8 | ///
9 | /// Represents a video encoder component.
10 | ///
11 | public interface IVideoEncoder : IEncoder
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp/Callbacks/IVideoOutputCallbackHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Callbacks
7 | {
8 | ///
9 | /// Represents a video output port callback handler.
10 | ///
11 | public interface IVideoOutputCallbackHandler
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp.Processing/Processors/Bayer/DemosaicProcessor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using MMALSharp.Common;
3 |
4 | namespace MMALSharp.Processors.Bayer
5 | {
6 | ///
7 | /// The DemosaicProcessor is used to apply a demosaic algorithm to Bayer metadata.
8 | ///
9 | public class DemosaicProcessor : IFrameProcessor
10 | {
11 | ///
12 | public void Apply(ImageContext context)
13 | {
14 | throw new NotImplementedException();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/MMALSharp/Components/IDownstreamHandlerComponent.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Components
7 | {
8 | ///
9 | /// Represents a downstream handler component.
10 | ///
11 | public interface IDownstreamHandlerComponent : IDownstreamComponent
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/MMALSharp.Demo/MMALSharp.Demo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | netcoreapp2.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/MMALSharp/Ports/Controls/IControlPort.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Ports.Controls
7 | {
8 | ///
9 | /// Represents a control port.
10 | ///
11 | public interface IControlPort : IPort
12 | {
13 | ///
14 | /// Starts the control port.
15 | ///
16 | void Start();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tests/MMALSharp.Tests/TestMember.cs:
--------------------------------------------------------------------------------
1 | using MMALSharp.Common;
2 | using MMALSharp.Native;
3 |
4 | namespace MMALSharp.Tests
5 | {
6 | public class TestMember
7 | {
8 | public string Extension { get; set; }
9 | public MMALEncoding EncodingType { get; set; }
10 | public MMALEncoding PixelFormat { get; set; }
11 |
12 | public TestMember(string extension, MMALEncoding encodingType, MMALEncoding pixelFormat)
13 | {
14 | this.Extension = extension;
15 | this.EncodingType = encodingType;
16 | this.PixelFormat = pixelFormat;
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/MMALSharp.Processing/Handlers/IVideoCaptureHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Handlers
7 | {
8 | ///
9 | /// Represents a VideoCaptureHandler for use when recording video frames.
10 | ///
11 | public interface IVideoCaptureHandler : IOutputCaptureHandler
12 | {
13 | ///
14 | /// Signals that we should begin writing to a new video file.
15 | ///
16 | void Split();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/MMALSharp.Processing/Processors/Motion/MotionType.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | namespace MMALSharp.Processors.Motion
7 | {
8 | ///
9 | /// Describes motion detection type to use.
10 | ///
11 | public enum MotionType
12 | {
13 | ///
14 | /// Frame difference.
15 | ///
16 | FrameDiff,
17 |
18 | ///
19 | /// Motion vector comparison.
20 | ///
21 | MotionVector
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/tests/MMALSharp.Tests/Data/BasicImageData.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) Ian Auty and contributors. All rights reserved.
3 | // Licensed under the MIT License. Please see LICENSE.txt for License info.
4 | //
5 |
6 | using System.Collections.Generic;
7 |
8 | namespace MMALSharp.Tests
9 | {
10 | public class BasicImageData
11 | {
12 | public static IEnumerable