Coverage Report

Created: 2026-05-16 06:48

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/connectedhomeip/zzz_generated/app-common/clusters/CameraAvStreamManagement/Structs.ipp
Line
Count
Source
1
/*
2
 *
3
 *    Copyright (c) 2022 Project CHIP Authors
4
 *
5
 *    Licensed under the Apache License, Version 2.0 (the "License");
6
 *    you may not use this file except in compliance with the License.
7
 *    You may obtain a copy of the License at
8
 *
9
 *        http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 *    Unless required by applicable law or agreed to in writing, software
12
 *    distributed under the License is distributed on an "AS IS" BASIS,
13
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 *    See the License for the specific language governing permissions and
15
 *    limitations under the License.
16
 */
17
18
// THIS FILE IS GENERATED BY ZAP
19
// This file is generated from clusters-Structs.ipp.zapt
20
21
#include <clusters/CameraAvStreamManagement/Structs.h>
22
23
#include <app/data-model/StructDecodeIterator.h>
24
#include <app/data-model/WrappedStructEncoder.h>
25
26
namespace chip {
27
namespace app {
28
namespace Clusters {
29
namespace CameraAvStreamManagement {
30
namespace Structs {
31
32
namespace VideoResolutionStruct {
33
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
34
0
{
35
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
36
0
    encoder.Encode(to_underlying(Fields::kWidth), width);
37
0
    encoder.Encode(to_underlying(Fields::kHeight), height);
38
0
    return encoder.Finalize();
39
0
}
40
41
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
42
0
{
43
0
    detail::StructDecodeIterator __iterator(reader);
44
0
    while (true)
45
0
    {
46
0
        uint8_t __context_tag = 0;
47
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
48
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
49
0
        ReturnErrorOnFailure(err);
50
51
0
        if (__context_tag == to_underlying(Fields::kWidth))
52
0
        {
53
0
            err = DataModel::Decode(reader, width);
54
0
        }
55
0
        else if (__context_tag == to_underlying(Fields::kHeight))
56
0
        {
57
0
            err = DataModel::Decode(reader, height);
58
0
        }
59
60
0
        ReturnErrorOnFailure(err);
61
0
    }
62
0
}
63
64
} // namespace VideoResolutionStruct
65
66
namespace VideoStreamStruct {
67
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
68
0
{
69
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
70
0
    encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID);
71
0
    encoder.Encode(to_underlying(Fields::kStreamUsage), streamUsage);
72
0
    encoder.Encode(to_underlying(Fields::kVideoCodec), videoCodec);
73
0
    encoder.Encode(to_underlying(Fields::kMinFrameRate), minFrameRate);
74
0
    encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate);
75
0
    encoder.Encode(to_underlying(Fields::kMinResolution), minResolution);
76
0
    encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution);
77
0
    encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate);
78
0
    encoder.Encode(to_underlying(Fields::kMaxBitRate), maxBitRate);
79
0
    encoder.Encode(to_underlying(Fields::kKeyFrameInterval), keyFrameInterval);
80
0
    encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled);
81
0
    encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled);
82
0
    encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount);
83
0
    return encoder.Finalize();
84
0
}
85
86
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
87
0
{
88
0
    detail::StructDecodeIterator __iterator(reader);
89
0
    while (true)
90
0
    {
91
0
        uint8_t __context_tag = 0;
92
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
93
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
94
0
        ReturnErrorOnFailure(err);
95
96
0
        if (__context_tag == to_underlying(Fields::kVideoStreamID))
97
0
        {
98
0
            err = DataModel::Decode(reader, videoStreamID);
99
0
        }
100
0
        else if (__context_tag == to_underlying(Fields::kStreamUsage))
101
0
        {
102
0
            err = DataModel::Decode(reader, streamUsage);
103
0
        }
104
0
        else if (__context_tag == to_underlying(Fields::kVideoCodec))
105
0
        {
106
0
            err = DataModel::Decode(reader, videoCodec);
107
0
        }
108
0
        else if (__context_tag == to_underlying(Fields::kMinFrameRate))
109
0
        {
110
0
            err = DataModel::Decode(reader, minFrameRate);
111
0
        }
112
0
        else if (__context_tag == to_underlying(Fields::kMaxFrameRate))
113
0
        {
114
0
            err = DataModel::Decode(reader, maxFrameRate);
115
0
        }
116
0
        else if (__context_tag == to_underlying(Fields::kMinResolution))
117
0
        {
118
0
            err = DataModel::Decode(reader, minResolution);
119
0
        }
120
0
        else if (__context_tag == to_underlying(Fields::kMaxResolution))
121
0
        {
122
0
            err = DataModel::Decode(reader, maxResolution);
123
0
        }
124
0
        else if (__context_tag == to_underlying(Fields::kMinBitRate))
125
0
        {
126
0
            err = DataModel::Decode(reader, minBitRate);
127
0
        }
128
0
        else if (__context_tag == to_underlying(Fields::kMaxBitRate))
129
0
        {
130
0
            err = DataModel::Decode(reader, maxBitRate);
131
0
        }
132
0
        else if (__context_tag == to_underlying(Fields::kKeyFrameInterval))
133
0
        {
134
0
            err = DataModel::Decode(reader, keyFrameInterval);
135
0
        }
136
0
        else if (__context_tag == to_underlying(Fields::kWatermarkEnabled))
137
0
        {
138
0
            err = DataModel::Decode(reader, watermarkEnabled);
139
0
        }
140
0
        else if (__context_tag == to_underlying(Fields::kOSDEnabled))
141
0
        {
142
0
            err = DataModel::Decode(reader, OSDEnabled);
143
0
        }
144
0
        else if (__context_tag == to_underlying(Fields::kReferenceCount))
145
0
        {
146
0
            err = DataModel::Decode(reader, referenceCount);
147
0
        }
148
149
0
        ReturnErrorOnFailure(err);
150
0
    }
151
0
}
152
153
} // namespace VideoStreamStruct
154
155
namespace SnapshotStreamStruct {
156
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
157
0
{
158
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
159
0
    encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID);
160
0
    encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec);
161
0
    encoder.Encode(to_underlying(Fields::kFrameRate), frameRate);
162
0
    encoder.Encode(to_underlying(Fields::kMinResolution), minResolution);
163
0
    encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution);
164
0
    encoder.Encode(to_underlying(Fields::kQuality), quality);
165
0
    encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount);
166
0
    encoder.Encode(to_underlying(Fields::kEncodedPixels), encodedPixels);
167
0
    encoder.Encode(to_underlying(Fields::kHardwareEncoder), hardwareEncoder);
168
0
    encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled);
169
0
    encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled);
170
0
    return encoder.Finalize();
171
0
}
172
173
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
174
0
{
175
0
    detail::StructDecodeIterator __iterator(reader);
176
0
    while (true)
177
0
    {
178
0
        uint8_t __context_tag = 0;
179
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
180
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
181
0
        ReturnErrorOnFailure(err);
182
183
0
        if (__context_tag == to_underlying(Fields::kSnapshotStreamID))
184
0
        {
185
0
            err = DataModel::Decode(reader, snapshotStreamID);
186
0
        }
187
0
        else if (__context_tag == to_underlying(Fields::kImageCodec))
188
0
        {
189
0
            err = DataModel::Decode(reader, imageCodec);
190
0
        }
191
0
        else if (__context_tag == to_underlying(Fields::kFrameRate))
192
0
        {
193
0
            err = DataModel::Decode(reader, frameRate);
194
0
        }
195
0
        else if (__context_tag == to_underlying(Fields::kMinResolution))
196
0
        {
197
0
            err = DataModel::Decode(reader, minResolution);
198
0
        }
199
0
        else if (__context_tag == to_underlying(Fields::kMaxResolution))
200
0
        {
201
0
            err = DataModel::Decode(reader, maxResolution);
202
0
        }
203
0
        else if (__context_tag == to_underlying(Fields::kQuality))
204
0
        {
205
0
            err = DataModel::Decode(reader, quality);
206
0
        }
207
0
        else if (__context_tag == to_underlying(Fields::kReferenceCount))
208
0
        {
209
0
            err = DataModel::Decode(reader, referenceCount);
210
0
        }
211
0
        else if (__context_tag == to_underlying(Fields::kEncodedPixels))
212
0
        {
213
0
            err = DataModel::Decode(reader, encodedPixels);
214
0
        }
215
0
        else if (__context_tag == to_underlying(Fields::kHardwareEncoder))
216
0
        {
217
0
            err = DataModel::Decode(reader, hardwareEncoder);
218
0
        }
219
0
        else if (__context_tag == to_underlying(Fields::kWatermarkEnabled))
220
0
        {
221
0
            err = DataModel::Decode(reader, watermarkEnabled);
222
0
        }
223
0
        else if (__context_tag == to_underlying(Fields::kOSDEnabled))
224
0
        {
225
0
            err = DataModel::Decode(reader, OSDEnabled);
226
0
        }
227
228
0
        ReturnErrorOnFailure(err);
229
0
    }
230
0
}
231
232
} // namespace SnapshotStreamStruct
233
234
namespace SnapshotCapabilitiesStruct {
235
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
236
0
{
237
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
238
0
    encoder.Encode(to_underlying(Fields::kResolution), resolution);
239
0
    encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate);
240
0
    encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec);
241
0
    encoder.Encode(to_underlying(Fields::kRequiresEncodedPixels), requiresEncodedPixels);
242
0
    encoder.Encode(to_underlying(Fields::kRequiresHardwareEncoder), requiresHardwareEncoder);
243
0
    return encoder.Finalize();
244
0
}
245
246
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
247
0
{
248
0
    detail::StructDecodeIterator __iterator(reader);
249
0
    while (true)
250
0
    {
251
0
        uint8_t __context_tag = 0;
252
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
253
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
254
0
        ReturnErrorOnFailure(err);
255
256
0
        if (__context_tag == to_underlying(Fields::kResolution))
257
0
        {
258
0
            err = DataModel::Decode(reader, resolution);
259
0
        }
260
0
        else if (__context_tag == to_underlying(Fields::kMaxFrameRate))
261
0
        {
262
0
            err = DataModel::Decode(reader, maxFrameRate);
263
0
        }
264
0
        else if (__context_tag == to_underlying(Fields::kImageCodec))
265
0
        {
266
0
            err = DataModel::Decode(reader, imageCodec);
267
0
        }
268
0
        else if (__context_tag == to_underlying(Fields::kRequiresEncodedPixels))
269
0
        {
270
0
            err = DataModel::Decode(reader, requiresEncodedPixels);
271
0
        }
272
0
        else if (__context_tag == to_underlying(Fields::kRequiresHardwareEncoder))
273
0
        {
274
0
            err = DataModel::Decode(reader, requiresHardwareEncoder);
275
0
        }
276
277
0
        ReturnErrorOnFailure(err);
278
0
    }
279
0
}
280
281
} // namespace SnapshotCapabilitiesStruct
282
283
namespace RateDistortionTradeOffPointsStruct {
284
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
285
0
{
286
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
287
0
    encoder.Encode(to_underlying(Fields::kCodec), codec);
288
0
    encoder.Encode(to_underlying(Fields::kResolution), resolution);
289
0
    encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate);
290
0
    return encoder.Finalize();
291
0
}
292
293
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
294
0
{
295
0
    detail::StructDecodeIterator __iterator(reader);
296
0
    while (true)
297
0
    {
298
0
        uint8_t __context_tag = 0;
299
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
300
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
301
0
        ReturnErrorOnFailure(err);
302
303
0
        if (__context_tag == to_underlying(Fields::kCodec))
304
0
        {
305
0
            err = DataModel::Decode(reader, codec);
306
0
        }
307
0
        else if (__context_tag == to_underlying(Fields::kResolution))
308
0
        {
309
0
            err = DataModel::Decode(reader, resolution);
310
0
        }
311
0
        else if (__context_tag == to_underlying(Fields::kMinBitRate))
312
0
        {
313
0
            err = DataModel::Decode(reader, minBitRate);
314
0
        }
315
316
0
        ReturnErrorOnFailure(err);
317
0
    }
318
0
}
319
320
} // namespace RateDistortionTradeOffPointsStruct
321
322
namespace AudioCapabilitiesStruct {
323
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
324
0
{
325
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
326
0
    encoder.Encode(to_underlying(Fields::kMaxNumberOfChannels), maxNumberOfChannels);
327
0
    encoder.Encode(to_underlying(Fields::kSupportedCodecs), supportedCodecs);
328
0
    encoder.Encode(to_underlying(Fields::kSupportedSampleRates), supportedSampleRates);
329
0
    encoder.Encode(to_underlying(Fields::kSupportedBitDepths), supportedBitDepths);
330
0
    return encoder.Finalize();
331
0
}
332
333
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
334
0
{
335
0
    detail::StructDecodeIterator __iterator(reader);
336
0
    while (true)
337
0
    {
338
0
        uint8_t __context_tag = 0;
339
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
340
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
341
0
        ReturnErrorOnFailure(err);
342
343
0
        if (__context_tag == to_underlying(Fields::kMaxNumberOfChannels))
344
0
        {
345
0
            err = DataModel::Decode(reader, maxNumberOfChannels);
346
0
        }
347
0
        else if (__context_tag == to_underlying(Fields::kSupportedCodecs))
348
0
        {
349
0
            err = DataModel::Decode(reader, supportedCodecs);
350
0
        }
351
0
        else if (__context_tag == to_underlying(Fields::kSupportedSampleRates))
352
0
        {
353
0
            err = DataModel::Decode(reader, supportedSampleRates);
354
0
        }
355
0
        else if (__context_tag == to_underlying(Fields::kSupportedBitDepths))
356
0
        {
357
0
            err = DataModel::Decode(reader, supportedBitDepths);
358
0
        }
359
360
0
        ReturnErrorOnFailure(err);
361
0
    }
362
0
}
363
364
} // namespace AudioCapabilitiesStruct
365
366
namespace AudioStreamStruct {
367
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
368
0
{
369
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
370
0
    encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID);
371
0
    encoder.Encode(to_underlying(Fields::kStreamUsage), streamUsage);
372
0
    encoder.Encode(to_underlying(Fields::kAudioCodec), audioCodec);
373
0
    encoder.Encode(to_underlying(Fields::kChannelCount), channelCount);
374
0
    encoder.Encode(to_underlying(Fields::kSampleRate), sampleRate);
375
0
    encoder.Encode(to_underlying(Fields::kBitRate), bitRate);
376
0
    encoder.Encode(to_underlying(Fields::kBitDepth), bitDepth);
377
0
    encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount);
378
0
    return encoder.Finalize();
379
0
}
380
381
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
382
0
{
383
0
    detail::StructDecodeIterator __iterator(reader);
384
0
    while (true)
385
0
    {
386
0
        uint8_t __context_tag = 0;
387
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
388
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
389
0
        ReturnErrorOnFailure(err);
390
391
0
        if (__context_tag == to_underlying(Fields::kAudioStreamID))
392
0
        {
393
0
            err = DataModel::Decode(reader, audioStreamID);
394
0
        }
395
0
        else if (__context_tag == to_underlying(Fields::kStreamUsage))
396
0
        {
397
0
            err = DataModel::Decode(reader, streamUsage);
398
0
        }
399
0
        else if (__context_tag == to_underlying(Fields::kAudioCodec))
400
0
        {
401
0
            err = DataModel::Decode(reader, audioCodec);
402
0
        }
403
0
        else if (__context_tag == to_underlying(Fields::kChannelCount))
404
0
        {
405
0
            err = DataModel::Decode(reader, channelCount);
406
0
        }
407
0
        else if (__context_tag == to_underlying(Fields::kSampleRate))
408
0
        {
409
0
            err = DataModel::Decode(reader, sampleRate);
410
0
        }
411
0
        else if (__context_tag == to_underlying(Fields::kBitRate))
412
0
        {
413
0
            err = DataModel::Decode(reader, bitRate);
414
0
        }
415
0
        else if (__context_tag == to_underlying(Fields::kBitDepth))
416
0
        {
417
0
            err = DataModel::Decode(reader, bitDepth);
418
0
        }
419
0
        else if (__context_tag == to_underlying(Fields::kReferenceCount))
420
0
        {
421
0
            err = DataModel::Decode(reader, referenceCount);
422
0
        }
423
424
0
        ReturnErrorOnFailure(err);
425
0
    }
426
0
}
427
428
} // namespace AudioStreamStruct
429
430
namespace VideoSensorParamsStruct {
431
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
432
0
{
433
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
434
0
    encoder.Encode(to_underlying(Fields::kSensorWidth), sensorWidth);
435
0
    encoder.Encode(to_underlying(Fields::kSensorHeight), sensorHeight);
436
0
    encoder.Encode(to_underlying(Fields::kMaxFPS), maxFPS);
437
0
    encoder.Encode(to_underlying(Fields::kMaxHDRFPS), maxHDRFPS);
438
0
    return encoder.Finalize();
439
0
}
440
441
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
442
0
{
443
0
    detail::StructDecodeIterator __iterator(reader);
444
0
    while (true)
445
0
    {
446
0
        uint8_t __context_tag = 0;
447
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
448
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
449
0
        ReturnErrorOnFailure(err);
450
451
0
        if (__context_tag == to_underlying(Fields::kSensorWidth))
452
0
        {
453
0
            err = DataModel::Decode(reader, sensorWidth);
454
0
        }
455
0
        else if (__context_tag == to_underlying(Fields::kSensorHeight))
456
0
        {
457
0
            err = DataModel::Decode(reader, sensorHeight);
458
0
        }
459
0
        else if (__context_tag == to_underlying(Fields::kMaxFPS))
460
0
        {
461
0
            err = DataModel::Decode(reader, maxFPS);
462
0
        }
463
0
        else if (__context_tag == to_underlying(Fields::kMaxHDRFPS))
464
0
        {
465
0
            err = DataModel::Decode(reader, maxHDRFPS);
466
0
        }
467
468
0
        ReturnErrorOnFailure(err);
469
0
    }
470
0
}
471
472
} // namespace VideoSensorParamsStruct
473
} // namespace Structs
474
} // namespace CameraAvStreamManagement
475
} // namespace Clusters
476
} // namespace app
477
} // namespace chip