GCC Code Coverage Report


Directory: ./
File: channeloutput/processors/OverrideZeroOutputProcessor.cpp
Date: 2026-10-29 08:11:58
Exec Total Coverage
Lines: 14 16 87.5%
Functions: 2 3 66.7%
Branches: 16 28 57.1%

Line Branch Exec Source
1 /*
2 * This file is part of the Falcon Player (FPP) and is Copyright (C)
3 * 2013-2022 by the Falcon Player Developers.
4 *
5 * The Falcon Player (FPP) is free software, and is covered under
6 * multiple Open Source licenses. Please see the included 'LICENSES'
7 * file for descriptions of what files are covered by each license.
8 *
9 * This source file is covered under the LGPL v2.1 as described in the
10 * included LICENSE.LGPL file.
11 */
12
13 #include "fpp-pch.h"
14
15 #include "fpp-json.h"
16
17 #include "../../log.h"
18
19 #include "OverrideZeroOutputProcessor.h"
20
21 1 OverrideZeroOutputProcessor::OverrideZeroOutputProcessor(const Json::Value& config) {
22
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 description = config["description"].asString();
23
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 active = config["active"].asInt() ? true : false;
24
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 start = config["start"].asInt();
25
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 count = config["count"].asInt();
26
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 value = config["value"].asInt();
27
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 ProcessModelConfig(config, model, start, count);
28
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 LogInfo(VB_CHANNELOUT, "Override Zero Channel Range: %d-%d Value: %d, Model: %s\n",
29 start + 1, start + count, value, model.c_str());
30 1 }
31
32 ✗ OverrideZeroOutputProcessor::~OverrideZeroOutputProcessor() {
33 ✗ }
34
35 15 void OverrideZeroOutputProcessor::ProcessData(unsigned char* channelData) const {
36
2/2
✓ Branch 0 taken 450 times.
✓ Branch 1 taken 15 times.
465 for (int x = 0; x < count; x++) {
37
2/2
✓ Branch 0 taken 174 times.
✓ Branch 1 taken 276 times.
450 if (channelData[x + start] == 0) {
38 174 channelData[x + start] = value;
39 }
40 }
41 15 }
42