public SpectrumVideoCanvas(SpectrumVideoSource source, SpectrumVideoCanvasConfig config, IOutputProvider outputProvider)
        {
            //Set
            width               = config.video_output.width;
            label               = config.label;
            decimation          = config.baseband.decimation;
            frameRate           = config.video_output.frameRate;
            this.outputProvider = outputProvider;
            this.source         = source;

            //Create IQ decimator and oscilator
            oscillator = new Oscillator(SampleRate, config.baseband.freqOffset);
            decimator  = new ComplexDecimator(SampleRate, DecimatedSampleRate, config.baseband.decimation, config.baseband.decimationAttenuation, DecimatedSampleRate * config.baseband.decimationTransitionRatio);

            //Create all audio resources
            foreach (var o in config.audio_outputs)
            {
                AddResource(new AudioResource(o, this));
            }

            //Create all components
            components       = new SpectrumVideoComponent[config.components.Count];
            componentOffsets = new int[config.components.Count];
            for (int i = 0; i < components.Length; i++)
            {
                components[i] = ComponentFactory.MakeComponent(this, config.components[i]);
            }

            //Get the image dimensions by calculating the total height
            height = 0;
            for (int i = 0; i < components.Length; i++)
            {
                componentOffsets[i] = height * ImageWidth;
                height += components[i].Height;
            }

            //Create misc
            videoOutput   = outputProvider.GetVideoOutput(config.video_output.filename, ImageWidth, ImageHeight, config.video_output.frameRate, BufferSize);
            frameBuffer   = UnsafeBuffer.Create(ImageWidth * ImageHeight, out frameBufferPtr);
            buffer        = UnsafeBuffer.Create(BufferSize, out bufferPtr);
            textGenerator = FontStore.CreateRenderer(ImageWidth, ImageHeight);

            //Fill the entire canvas with black
            for (int i = 0; i < ImageWidth * ImageHeight; i++)
            {
                frameBufferPtr[i] = new UnsafeColor(0, 0, 0);
            }

            //Init all components
            for (int i = 0; i < components.Length; i++)
            {
                components[i].Init();
                components[i].InitFrame(frameBufferPtr + componentOffsets[i]);
            }
        }