Coverage Report

Created: 2025-06-20 06:55

/src/connectedhomeip/zzz_generated/app-common/clusters/CameraAvStreamManagement/Structs.ipp
Line
Count
Source (jump to first uncovered line)
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::kMinKeyFrameInterval), minKeyFrameInterval);
80
0
    encoder.Encode(to_underlying(Fields::kMaxKeyFrameInterval), maxKeyFrameInterval);
81
0
    encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled);
82
0
    encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled);
83
0
    encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount);
84
0
    return encoder.Finalize();
85
0
}
86
87
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
88
0
{
89
0
    detail::StructDecodeIterator __iterator(reader);
90
0
    while (true)
91
0
    {
92
0
        uint8_t __context_tag = 0;
93
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
94
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
95
0
        ReturnErrorOnFailure(err);
96
97
0
        if (__context_tag == to_underlying(Fields::kVideoStreamID))
98
0
        {
99
0
            err = DataModel::Decode(reader, videoStreamID);
100
0
        }
101
0
        else if (__context_tag == to_underlying(Fields::kStreamUsage))
102
0
        {
103
0
            err = DataModel::Decode(reader, streamUsage);
104
0
        }
105
0
        else if (__context_tag == to_underlying(Fields::kVideoCodec))
106
0
        {
107
0
            err = DataModel::Decode(reader, videoCodec);
108
0
        }
109
0
        else if (__context_tag == to_underlying(Fields::kMinFrameRate))
110
0
        {
111
0
            err = DataModel::Decode(reader, minFrameRate);
112
0
        }
113
0
        else if (__context_tag == to_underlying(Fields::kMaxFrameRate))
114
0
        {
115
0
            err = DataModel::Decode(reader, maxFrameRate);
116
0
        }
117
0
        else if (__context_tag == to_underlying(Fields::kMinResolution))
118
0
        {
119
0
            err = DataModel::Decode(reader, minResolution);
120
0
        }
121
0
        else if (__context_tag == to_underlying(Fields::kMaxResolution))
122
0
        {
123
0
            err = DataModel::Decode(reader, maxResolution);
124
0
        }
125
0
        else if (__context_tag == to_underlying(Fields::kMinBitRate))
126
0
        {
127
0
            err = DataModel::Decode(reader, minBitRate);
128
0
        }
129
0
        else if (__context_tag == to_underlying(Fields::kMaxBitRate))
130
0
        {
131
0
            err = DataModel::Decode(reader, maxBitRate);
132
0
        }
133
0
        else if (__context_tag == to_underlying(Fields::kMinKeyFrameInterval))
134
0
        {
135
0
            err = DataModel::Decode(reader, minKeyFrameInterval);
136
0
        }
137
0
        else if (__context_tag == to_underlying(Fields::kMaxKeyFrameInterval))
138
0
        {
139
0
            err = DataModel::Decode(reader, maxKeyFrameInterval);
140
0
        }
141
0
        else if (__context_tag == to_underlying(Fields::kWatermarkEnabled))
142
0
        {
143
0
            err = DataModel::Decode(reader, watermarkEnabled);
144
0
        }
145
0
        else if (__context_tag == to_underlying(Fields::kOSDEnabled))
146
0
        {
147
0
            err = DataModel::Decode(reader, OSDEnabled);
148
0
        }
149
0
        else if (__context_tag == to_underlying(Fields::kReferenceCount))
150
0
        {
151
0
            err = DataModel::Decode(reader, referenceCount);
152
0
        }
153
154
0
        ReturnErrorOnFailure(err);
155
0
    }
156
0
}
157
158
} // namespace VideoStreamStruct
159
160
namespace SnapshotStreamStruct {
161
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
162
0
{
163
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
164
0
    encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID);
165
0
    encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec);
166
0
    encoder.Encode(to_underlying(Fields::kFrameRate), frameRate);
167
0
    encoder.Encode(to_underlying(Fields::kMinResolution), minResolution);
168
0
    encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution);
169
0
    encoder.Encode(to_underlying(Fields::kQuality), quality);
170
0
    encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount);
171
0
    encoder.Encode(to_underlying(Fields::kEncodedPixels), encodedPixels);
172
0
    encoder.Encode(to_underlying(Fields::kHardwareEncoder), hardwareEncoder);
173
0
    encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled);
174
0
    encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled);
175
0
    return encoder.Finalize();
176
0
}
177
178
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
179
0
{
180
0
    detail::StructDecodeIterator __iterator(reader);
181
0
    while (true)
182
0
    {
183
0
        uint8_t __context_tag = 0;
184
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
185
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
186
0
        ReturnErrorOnFailure(err);
187
188
0
        if (__context_tag == to_underlying(Fields::kSnapshotStreamID))
189
0
        {
190
0
            err = DataModel::Decode(reader, snapshotStreamID);
191
0
        }
192
0
        else if (__context_tag == to_underlying(Fields::kImageCodec))
193
0
        {
194
0
            err = DataModel::Decode(reader, imageCodec);
195
0
        }
196
0
        else if (__context_tag == to_underlying(Fields::kFrameRate))
197
0
        {
198
0
            err = DataModel::Decode(reader, frameRate);
199
0
        }
200
0
        else if (__context_tag == to_underlying(Fields::kMinResolution))
201
0
        {
202
0
            err = DataModel::Decode(reader, minResolution);
203
0
        }
204
0
        else if (__context_tag == to_underlying(Fields::kMaxResolution))
205
0
        {
206
0
            err = DataModel::Decode(reader, maxResolution);
207
0
        }
208
0
        else if (__context_tag == to_underlying(Fields::kQuality))
209
0
        {
210
0
            err = DataModel::Decode(reader, quality);
211
0
        }
212
0
        else if (__context_tag == to_underlying(Fields::kReferenceCount))
213
0
        {
214
0
            err = DataModel::Decode(reader, referenceCount);
215
0
        }
216
0
        else if (__context_tag == to_underlying(Fields::kEncodedPixels))
217
0
        {
218
0
            err = DataModel::Decode(reader, encodedPixels);
219
0
        }
220
0
        else if (__context_tag == to_underlying(Fields::kHardwareEncoder))
221
0
        {
222
0
            err = DataModel::Decode(reader, hardwareEncoder);
223
0
        }
224
0
        else if (__context_tag == to_underlying(Fields::kWatermarkEnabled))
225
0
        {
226
0
            err = DataModel::Decode(reader, watermarkEnabled);
227
0
        }
228
0
        else if (__context_tag == to_underlying(Fields::kOSDEnabled))
229
0
        {
230
0
            err = DataModel::Decode(reader, OSDEnabled);
231
0
        }
232
233
0
        ReturnErrorOnFailure(err);
234
0
    }
235
0
}
236
237
} // namespace SnapshotStreamStruct
238
239
namespace SnapshotCapabilitiesStruct {
240
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
241
0
{
242
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
243
0
    encoder.Encode(to_underlying(Fields::kResolution), resolution);
244
0
    encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate);
245
0
    encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec);
246
0
    encoder.Encode(to_underlying(Fields::kRequiresEncodedPixels), requiresEncodedPixels);
247
0
    encoder.Encode(to_underlying(Fields::kRequiresHardwareEncoder), requiresHardwareEncoder);
248
0
    return encoder.Finalize();
249
0
}
250
251
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
252
0
{
253
0
    detail::StructDecodeIterator __iterator(reader);
254
0
    while (true)
255
0
    {
256
0
        uint8_t __context_tag = 0;
257
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
258
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
259
0
        ReturnErrorOnFailure(err);
260
261
0
        if (__context_tag == to_underlying(Fields::kResolution))
262
0
        {
263
0
            err = DataModel::Decode(reader, resolution);
264
0
        }
265
0
        else if (__context_tag == to_underlying(Fields::kMaxFrameRate))
266
0
        {
267
0
            err = DataModel::Decode(reader, maxFrameRate);
268
0
        }
269
0
        else if (__context_tag == to_underlying(Fields::kImageCodec))
270
0
        {
271
0
            err = DataModel::Decode(reader, imageCodec);
272
0
        }
273
0
        else if (__context_tag == to_underlying(Fields::kRequiresEncodedPixels))
274
0
        {
275
0
            err = DataModel::Decode(reader, requiresEncodedPixels);
276
0
        }
277
0
        else if (__context_tag == to_underlying(Fields::kRequiresHardwareEncoder))
278
0
        {
279
0
            err = DataModel::Decode(reader, requiresHardwareEncoder);
280
0
        }
281
282
0
        ReturnErrorOnFailure(err);
283
0
    }
284
0
}
285
286
} // namespace SnapshotCapabilitiesStruct
287
288
namespace RateDistortionTradeOffPointsStruct {
289
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
290
0
{
291
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
292
0
    encoder.Encode(to_underlying(Fields::kCodec), codec);
293
0
    encoder.Encode(to_underlying(Fields::kResolution), resolution);
294
0
    encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate);
295
0
    return encoder.Finalize();
296
0
}
297
298
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
299
0
{
300
0
    detail::StructDecodeIterator __iterator(reader);
301
0
    while (true)
302
0
    {
303
0
        uint8_t __context_tag = 0;
304
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
305
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
306
0
        ReturnErrorOnFailure(err);
307
308
0
        if (__context_tag == to_underlying(Fields::kCodec))
309
0
        {
310
0
            err = DataModel::Decode(reader, codec);
311
0
        }
312
0
        else if (__context_tag == to_underlying(Fields::kResolution))
313
0
        {
314
0
            err = DataModel::Decode(reader, resolution);
315
0
        }
316
0
        else if (__context_tag == to_underlying(Fields::kMinBitRate))
317
0
        {
318
0
            err = DataModel::Decode(reader, minBitRate);
319
0
        }
320
321
0
        ReturnErrorOnFailure(err);
322
0
    }
323
0
}
324
325
} // namespace RateDistortionTradeOffPointsStruct
326
327
namespace AudioCapabilitiesStruct {
328
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
329
0
{
330
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
331
0
    encoder.Encode(to_underlying(Fields::kMaxNumberOfChannels), maxNumberOfChannels);
332
0
    encoder.Encode(to_underlying(Fields::kSupportedCodecs), supportedCodecs);
333
0
    encoder.Encode(to_underlying(Fields::kSupportedSampleRates), supportedSampleRates);
334
0
    encoder.Encode(to_underlying(Fields::kSupportedBitDepths), supportedBitDepths);
335
0
    return encoder.Finalize();
336
0
}
337
338
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
339
0
{
340
0
    detail::StructDecodeIterator __iterator(reader);
341
0
    while (true)
342
0
    {
343
0
        uint8_t __context_tag = 0;
344
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
345
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
346
0
        ReturnErrorOnFailure(err);
347
348
0
        if (__context_tag == to_underlying(Fields::kMaxNumberOfChannels))
349
0
        {
350
0
            err = DataModel::Decode(reader, maxNumberOfChannels);
351
0
        }
352
0
        else if (__context_tag == to_underlying(Fields::kSupportedCodecs))
353
0
        {
354
0
            err = DataModel::Decode(reader, supportedCodecs);
355
0
        }
356
0
        else if (__context_tag == to_underlying(Fields::kSupportedSampleRates))
357
0
        {
358
0
            err = DataModel::Decode(reader, supportedSampleRates);
359
0
        }
360
0
        else if (__context_tag == to_underlying(Fields::kSupportedBitDepths))
361
0
        {
362
0
            err = DataModel::Decode(reader, supportedBitDepths);
363
0
        }
364
365
0
        ReturnErrorOnFailure(err);
366
0
    }
367
0
}
368
369
} // namespace AudioCapabilitiesStruct
370
371
namespace AudioStreamStruct {
372
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
373
0
{
374
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
375
0
    encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID);
376
0
    encoder.Encode(to_underlying(Fields::kStreamUsage), streamUsage);
377
0
    encoder.Encode(to_underlying(Fields::kAudioCodec), audioCodec);
378
0
    encoder.Encode(to_underlying(Fields::kChannelCount), channelCount);
379
0
    encoder.Encode(to_underlying(Fields::kSampleRate), sampleRate);
380
0
    encoder.Encode(to_underlying(Fields::kBitRate), bitRate);
381
0
    encoder.Encode(to_underlying(Fields::kBitDepth), bitDepth);
382
0
    encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount);
383
0
    return encoder.Finalize();
384
0
}
385
386
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
387
0
{
388
0
    detail::StructDecodeIterator __iterator(reader);
389
0
    while (true)
390
0
    {
391
0
        uint8_t __context_tag = 0;
392
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
393
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
394
0
        ReturnErrorOnFailure(err);
395
396
0
        if (__context_tag == to_underlying(Fields::kAudioStreamID))
397
0
        {
398
0
            err = DataModel::Decode(reader, audioStreamID);
399
0
        }
400
0
        else if (__context_tag == to_underlying(Fields::kStreamUsage))
401
0
        {
402
0
            err = DataModel::Decode(reader, streamUsage);
403
0
        }
404
0
        else if (__context_tag == to_underlying(Fields::kAudioCodec))
405
0
        {
406
0
            err = DataModel::Decode(reader, audioCodec);
407
0
        }
408
0
        else if (__context_tag == to_underlying(Fields::kChannelCount))
409
0
        {
410
0
            err = DataModel::Decode(reader, channelCount);
411
0
        }
412
0
        else if (__context_tag == to_underlying(Fields::kSampleRate))
413
0
        {
414
0
            err = DataModel::Decode(reader, sampleRate);
415
0
        }
416
0
        else if (__context_tag == to_underlying(Fields::kBitRate))
417
0
        {
418
0
            err = DataModel::Decode(reader, bitRate);
419
0
        }
420
0
        else if (__context_tag == to_underlying(Fields::kBitDepth))
421
0
        {
422
0
            err = DataModel::Decode(reader, bitDepth);
423
0
        }
424
0
        else if (__context_tag == to_underlying(Fields::kReferenceCount))
425
0
        {
426
0
            err = DataModel::Decode(reader, referenceCount);
427
0
        }
428
429
0
        ReturnErrorOnFailure(err);
430
0
    }
431
0
}
432
433
} // namespace AudioStreamStruct
434
435
namespace VideoSensorParamsStruct {
436
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
437
0
{
438
0
    DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
439
0
    encoder.Encode(to_underlying(Fields::kSensorWidth), sensorWidth);
440
0
    encoder.Encode(to_underlying(Fields::kSensorHeight), sensorHeight);
441
0
    encoder.Encode(to_underlying(Fields::kMaxFPS), maxFPS);
442
0
    encoder.Encode(to_underlying(Fields::kMaxHDRFPS), maxHDRFPS);
443
0
    return encoder.Finalize();
444
0
}
445
446
CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
447
0
{
448
0
    detail::StructDecodeIterator __iterator(reader);
449
0
    while (true)
450
0
    {
451
0
        uint8_t __context_tag = 0;
452
0
        CHIP_ERROR err        = __iterator.Next(__context_tag);
453
0
        VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR);
454
0
        ReturnErrorOnFailure(err);
455
456
0
        if (__context_tag == to_underlying(Fields::kSensorWidth))
457
0
        {
458
0
            err = DataModel::Decode(reader, sensorWidth);
459
0
        }
460
0
        else if (__context_tag == to_underlying(Fields::kSensorHeight))
461
0
        {
462
0
            err = DataModel::Decode(reader, sensorHeight);
463
0
        }
464
0
        else if (__context_tag == to_underlying(Fields::kMaxFPS))
465
0
        {
466
0
            err = DataModel::Decode(reader, maxFPS);
467
0
        }
468
0
        else if (__context_tag == to_underlying(Fields::kMaxHDRFPS))
469
0
        {
470
0
            err = DataModel::Decode(reader, maxHDRFPS);
471
0
        }
472
473
0
        ReturnErrorOnFailure(err);
474
0
    }
475
0
}
476
477
} // namespace VideoSensorParamsStruct
478
} // namespace Structs
479
} // namespace CameraAvStreamManagement
480
} // namespace Clusters
481
} // namespace app
482
} // namespace chip