• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mavlink / MAVSDK / 24114167644

08 Apr 2026 02:17AM UTC coverage: 50.468% (+0.003%) from 50.465%
24114167644

push

github

web-flow
core: hide symbols by default, export only public API (#2855)

* core: hide symbols by default, export only public API

Backport of #2824 to v3. Fixes segfault when MAVSDK is used alongside
ROS2 (or any library sharing bundled dependencies like OpenSSL/tinyxml2)
due to symbol conflicts from leaked third-party symbols.

- Add mavsdk_export.h with MAVSDK_PUBLIC, MAVSDK_TEST_EXPORT, and
  MAVSDK_TEMPL_INST macros
- Set CXX_VISIBILITY_PRESET=hidden and VISIBILITY_INLINES_HIDDEN=ON
- MAVSDK_SHARED compile definition gates dllexport/dllimport so that
  static builds on Windows are unaffected
- Annotate all public classes, free functions, operator overloads,
  and explicit template instantiations
- Update jinja2 templates to emit MAVSDK_PUBLIC on generated
  operator== and operator<< definitions
- Disable MSVC C4251 warning for DLL interface on STL members

Fixes #2852

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove stale asio includes from mission transfer client header

The backport patch incorrectly added asio includes that don't exist on
v3 (they were added on main after v3 branched).

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

15 of 379 new or added lines in 39 files covered. (3.96%)

4 existing lines in 3 files now uncovered.

19248 of 38139 relevant lines covered (50.47%)

672.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

9.79
/src/mavsdk/plugins/camera/camera.cpp
1
// WARNING: THIS FILE IS AUTOGENERATED! As such, it should not be edited.
2
// Edits need to be made to the proto files
3
// (see https://github.com/mavlink/MAVSDK-Proto/blob/master/protos/camera/camera.proto)
4

5
#include <iomanip>
6

7
#include "camera_impl.h"
8
#include "plugins/camera/camera.h"
9

10
namespace mavsdk {
11

12
using Option = Camera::Option;
13
using Setting = Camera::Setting;
14
using SettingOptions = Camera::SettingOptions;
15
using VideoStreamSettings = Camera::VideoStreamSettings;
16
using VideoStreamInfo = Camera::VideoStreamInfo;
17
using ModeUpdate = Camera::ModeUpdate;
18
using VideoStreamUpdate = Camera::VideoStreamUpdate;
19
using Storage = Camera::Storage;
20
using StorageUpdate = Camera::StorageUpdate;
21
using CurrentSettingsUpdate = Camera::CurrentSettingsUpdate;
22
using PossibleSettingOptionsUpdate = Camera::PossibleSettingOptionsUpdate;
23

24
using Position = Camera::Position;
25
using Quaternion = Camera::Quaternion;
26
using EulerAngle = Camera::EulerAngle;
27
using CaptureInfo = Camera::CaptureInfo;
28
using Information = Camera::Information;
29
using CameraList = Camera::CameraList;
30

31
Camera::Camera(System& system) : PluginBase(), _impl{std::make_unique<CameraImpl>(system)} {}
×
32

33
Camera::Camera(std::shared_ptr<System> system) :
11✔
34
    PluginBase(),
35
    _impl{std::make_unique<CameraImpl>(system)}
11✔
36
{}
11✔
37

38
Camera::~Camera() {}
11✔
39

40
void Camera::take_photo_async(int32_t component_id, const ResultCallback callback)
×
41
{
42
    _impl->take_photo_async(component_id, callback);
×
43
}
×
44

45
Camera::Result Camera::take_photo(int32_t component_id) const
1✔
46
{
47
    return _impl->take_photo(component_id);
1✔
48
}
49

50
void Camera::start_photo_interval_async(
×
51
    int32_t component_id, float interval_s, const ResultCallback callback)
52
{
53
    _impl->start_photo_interval_async(component_id, interval_s, callback);
×
54
}
×
55

56
Camera::Result Camera::start_photo_interval(int32_t component_id, float interval_s) const
1✔
57
{
58
    return _impl->start_photo_interval(component_id, interval_s);
1✔
59
}
60

61
void Camera::stop_photo_interval_async(int32_t component_id, const ResultCallback callback)
×
62
{
63
    _impl->stop_photo_interval_async(component_id, callback);
×
64
}
×
65

66
Camera::Result Camera::stop_photo_interval(int32_t component_id) const
1✔
67
{
68
    return _impl->stop_photo_interval(component_id);
1✔
69
}
70

71
void Camera::start_video_async(int32_t component_id, const ResultCallback callback)
×
72
{
73
    _impl->start_video_async(component_id, callback);
×
74
}
×
75

76
Camera::Result Camera::start_video(int32_t component_id) const
×
77
{
78
    return _impl->start_video(component_id);
×
79
}
80

81
void Camera::stop_video_async(int32_t component_id, const ResultCallback callback)
×
82
{
83
    _impl->stop_video_async(component_id, callback);
×
84
}
×
85

86
Camera::Result Camera::stop_video(int32_t component_id) const
×
87
{
88
    return _impl->stop_video(component_id);
×
89
}
90

91
Camera::Result Camera::start_video_streaming(int32_t component_id, int32_t stream_id) const
×
92
{
93
    return _impl->start_video_streaming(component_id, stream_id);
×
94
}
95

96
Camera::Result Camera::stop_video_streaming(int32_t component_id, int32_t stream_id) const
×
97
{
98
    return _impl->stop_video_streaming(component_id, stream_id);
×
99
}
100

101
void Camera::set_mode_async(int32_t component_id, Mode mode, const ResultCallback callback)
×
102
{
103
    _impl->set_mode_async(component_id, mode, callback);
×
104
}
×
105

106
Camera::Result Camera::set_mode(int32_t component_id, Mode mode) const
2✔
107
{
108
    return _impl->set_mode(component_id, mode);
2✔
109
}
110

111
void Camera::list_photos_async(
×
112
    int32_t component_id, PhotosRange photos_range, const ListPhotosCallback callback)
113
{
114
    _impl->list_photos_async(component_id, photos_range, callback);
×
115
}
×
116

117
std::pair<Camera::Result, std::vector<Camera::CaptureInfo>>
118
Camera::list_photos(int32_t component_id, PhotosRange photos_range) const
×
119
{
120
    return _impl->list_photos(component_id, photos_range);
×
121
}
122

123
Camera::CameraListHandle Camera::subscribe_camera_list(const CameraListCallback& callback)
1✔
124
{
125
    return _impl->subscribe_camera_list(callback);
1✔
126
}
127

128
void Camera::unsubscribe_camera_list(CameraListHandle handle)
1✔
129
{
130
    _impl->unsubscribe_camera_list(handle);
1✔
131
}
1✔
132

133
Camera::CameraList Camera::camera_list() const
109✔
134
{
135
    return _impl->camera_list();
109✔
136
}
137

138
Camera::ModeHandle Camera::subscribe_mode(const ModeCallback& callback)
×
139
{
140
    return _impl->subscribe_mode(callback);
×
141
}
142

143
void Camera::unsubscribe_mode(ModeHandle handle)
×
144
{
145
    _impl->unsubscribe_mode(handle);
×
146
}
×
147

148
std::pair<Camera::Result, Camera::Mode> Camera::get_mode(int32_t component_id) const
1✔
149
{
150
    return _impl->get_mode(component_id);
1✔
151
}
152

153
Camera::VideoStreamInfoHandle
154
Camera::subscribe_video_stream_info(const VideoStreamInfoCallback& callback)
1✔
155
{
156
    return _impl->subscribe_video_stream_info(callback);
1✔
157
}
158

159
void Camera::unsubscribe_video_stream_info(VideoStreamInfoHandle handle)
×
160
{
161
    _impl->unsubscribe_video_stream_info(handle);
×
162
}
×
163

164
std::pair<Camera::Result, Camera::VideoStreamInfo>
165
Camera::get_video_stream_info(int32_t component_id) const
×
166
{
167
    return _impl->get_video_stream_info(component_id);
×
168
}
169

170
Camera::CaptureInfoHandle Camera::subscribe_capture_info(const CaptureInfoCallback& callback)
2✔
171
{
172
    return _impl->subscribe_capture_info(callback);
2✔
173
}
174

175
void Camera::unsubscribe_capture_info(CaptureInfoHandle handle)
2✔
176
{
177
    _impl->unsubscribe_capture_info(handle);
2✔
178
}
2✔
179

180
Camera::StorageHandle Camera::subscribe_storage(const StorageCallback& callback)
1✔
181
{
182
    return _impl->subscribe_storage(callback);
1✔
183
}
184

185
void Camera::unsubscribe_storage(StorageHandle handle)
×
186
{
187
    _impl->unsubscribe_storage(handle);
×
188
}
×
189

190
std::pair<Camera::Result, Camera::Storage> Camera::get_storage(int32_t component_id) const
60✔
191
{
192
    return _impl->get_storage(component_id);
60✔
193
}
194

195
Camera::CurrentSettingsHandle
196
Camera::subscribe_current_settings(const CurrentSettingsCallback& callback)
1✔
197
{
198
    return _impl->subscribe_current_settings(callback);
1✔
199
}
200

201
void Camera::unsubscribe_current_settings(CurrentSettingsHandle handle)
1✔
202
{
203
    _impl->unsubscribe_current_settings(handle);
1✔
204
}
1✔
205

206
std::pair<Camera::Result, std::vector<Camera::Setting>>
207
Camera::get_current_settings(int32_t component_id) const
2✔
208
{
209
    return _impl->get_current_settings(component_id);
2✔
210
}
211

212
Camera::PossibleSettingOptionsHandle
213
Camera::subscribe_possible_setting_options(const PossibleSettingOptionsCallback& callback)
1✔
214
{
215
    return _impl->subscribe_possible_setting_options(callback);
1✔
216
}
217

218
void Camera::unsubscribe_possible_setting_options(PossibleSettingOptionsHandle handle)
×
219
{
220
    _impl->unsubscribe_possible_setting_options(handle);
×
221
}
×
222

223
std::pair<Camera::Result, std::vector<Camera::SettingOptions>>
224
Camera::get_possible_setting_options(int32_t component_id) const
4✔
225
{
226
    return _impl->get_possible_setting_options(component_id);
4✔
227
}
228

229
void Camera::set_setting_async(int32_t component_id, Setting setting, const ResultCallback callback)
×
230
{
231
    _impl->set_setting_async(component_id, setting, callback);
×
232
}
×
233

234
Camera::Result Camera::set_setting(int32_t component_id, Setting setting) const
3✔
235
{
236
    return _impl->set_setting(component_id, setting);
3✔
237
}
238

239
void Camera::get_setting_async(
×
240
    int32_t component_id, Setting setting, const GetSettingCallback callback)
241
{
242
    _impl->get_setting_async(component_id, setting, callback);
×
243
}
×
244

245
std::pair<Camera::Result, Camera::Setting>
246
Camera::get_setting(int32_t component_id, Setting setting) const
2✔
247
{
248
    return _impl->get_setting(component_id, setting);
2✔
249
}
250

251
void Camera::format_storage_async(
×
252
    int32_t component_id, int32_t storage_id, const ResultCallback callback)
253
{
254
    _impl->format_storage_async(component_id, storage_id, callback);
×
255
}
×
256

257
Camera::Result Camera::format_storage(int32_t component_id, int32_t storage_id) const
1✔
258
{
259
    return _impl->format_storage(component_id, storage_id);
1✔
260
}
261

262
void Camera::reset_settings_async(int32_t component_id, const ResultCallback callback)
×
263
{
264
    _impl->reset_settings_async(component_id, callback);
×
265
}
×
266

267
Camera::Result Camera::reset_settings(int32_t component_id) const
1✔
268
{
269
    return _impl->reset_settings(component_id);
1✔
270
}
271

272
void Camera::zoom_in_start_async(int32_t component_id, const ResultCallback callback)
×
273
{
274
    _impl->zoom_in_start_async(component_id, callback);
×
275
}
×
276

277
Camera::Result Camera::zoom_in_start(int32_t component_id) const
×
278
{
279
    return _impl->zoom_in_start(component_id);
×
280
}
281

282
void Camera::zoom_out_start_async(int32_t component_id, const ResultCallback callback)
×
283
{
284
    _impl->zoom_out_start_async(component_id, callback);
×
285
}
×
286

287
Camera::Result Camera::zoom_out_start(int32_t component_id) const
×
288
{
289
    return _impl->zoom_out_start(component_id);
×
290
}
291

292
void Camera::zoom_stop_async(int32_t component_id, const ResultCallback callback)
×
293
{
294
    _impl->zoom_stop_async(component_id, callback);
×
295
}
×
296

297
Camera::Result Camera::zoom_stop(int32_t component_id) const
×
298
{
299
    return _impl->zoom_stop(component_id);
×
300
}
301

302
void Camera::zoom_range_async(int32_t component_id, float range, const ResultCallback callback)
×
303
{
304
    _impl->zoom_range_async(component_id, range, callback);
×
305
}
×
306

307
Camera::Result Camera::zoom_range(int32_t component_id, float range) const
×
308
{
309
    return _impl->zoom_range(component_id, range);
×
310
}
311

312
void Camera::track_point_async(
×
313
    int32_t component_id, float point_x, float point_y, float radius, const ResultCallback callback)
314
{
315
    _impl->track_point_async(component_id, point_x, point_y, radius, callback);
×
316
}
×
317

318
Camera::Result
319
Camera::track_point(int32_t component_id, float point_x, float point_y, float radius) const
×
320
{
321
    return _impl->track_point(component_id, point_x, point_y, radius);
×
322
}
323

324
void Camera::track_rectangle_async(
×
325
    int32_t component_id,
326
    float top_left_x,
327
    float top_left_y,
328
    float bottom_right_x,
329
    float bottom_right_y,
330
    const ResultCallback callback)
331
{
332
    _impl->track_rectangle_async(
×
333
        component_id, top_left_x, top_left_y, bottom_right_x, bottom_right_y, callback);
334
}
×
335

336
Camera::Result Camera::track_rectangle(
×
337
    int32_t component_id,
338
    float top_left_x,
339
    float top_left_y,
340
    float bottom_right_x,
341
    float bottom_right_y) const
342
{
343
    return _impl->track_rectangle(
×
344
        component_id, top_left_x, top_left_y, bottom_right_x, bottom_right_y);
×
345
}
346

347
void Camera::track_stop_async(int32_t component_id, const ResultCallback callback)
×
348
{
349
    _impl->track_stop_async(component_id, callback);
×
350
}
×
351

352
Camera::Result Camera::track_stop(int32_t component_id) const
×
353
{
354
    return _impl->track_stop(component_id);
×
355
}
356

357
void Camera::focus_in_start_async(int32_t component_id, const ResultCallback callback)
×
358
{
359
    _impl->focus_in_start_async(component_id, callback);
×
360
}
×
361

362
Camera::Result Camera::focus_in_start(int32_t component_id) const
×
363
{
364
    return _impl->focus_in_start(component_id);
×
365
}
366

367
void Camera::focus_out_start_async(int32_t component_id, const ResultCallback callback)
×
368
{
369
    _impl->focus_out_start_async(component_id, callback);
×
370
}
×
371

372
Camera::Result Camera::focus_out_start(int32_t component_id) const
×
373
{
374
    return _impl->focus_out_start(component_id);
×
375
}
376

377
void Camera::focus_stop_async(int32_t component_id, const ResultCallback callback)
×
378
{
379
    _impl->focus_stop_async(component_id, callback);
×
380
}
×
381

382
Camera::Result Camera::focus_stop(int32_t component_id) const
×
383
{
384
    return _impl->focus_stop(component_id);
×
385
}
386

387
void Camera::focus_range_async(int32_t component_id, float range, const ResultCallback callback)
×
388
{
389
    _impl->focus_range_async(component_id, range, callback);
×
390
}
×
391

392
Camera::Result Camera::focus_range(int32_t component_id, float range) const
×
393
{
394
    return _impl->focus_range(component_id, range);
×
395
}
396

NEW
397
MAVSDK_PUBLIC bool operator==(const Camera::Option& lhs, const Camera::Option& rhs)
×
398
{
399
    return (rhs.option_id == lhs.option_id) && (rhs.option_description == lhs.option_description);
×
400
}
401

NEW
402
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Option const& option)
×
403
{
404
    str << std::setprecision(15);
×
405
    str << "option:" << '\n' << "{\n";
×
406
    str << "    option_id: " << option.option_id << '\n';
×
407
    str << "    option_description: " << option.option_description << '\n';
×
408
    str << '}';
×
409
    return str;
×
410
}
411

NEW
412
MAVSDK_PUBLIC bool operator==(const Camera::Setting& lhs, const Camera::Setting& rhs)
×
413
{
414
    return (rhs.setting_id == lhs.setting_id) &&
×
415
           (rhs.setting_description == lhs.setting_description) && (rhs.option == lhs.option) &&
×
416
           (rhs.is_range == lhs.is_range);
×
417
}
418

NEW
419
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Setting const& setting)
×
420
{
421
    str << std::setprecision(15);
×
422
    str << "setting:" << '\n' << "{\n";
×
423
    str << "    setting_id: " << setting.setting_id << '\n';
×
424
    str << "    setting_description: " << setting.setting_description << '\n';
×
425
    str << "    option: " << setting.option << '\n';
×
426
    str << "    is_range: " << setting.is_range << '\n';
×
427
    str << '}';
×
428
    return str;
×
429
}
430

NEW
431
MAVSDK_PUBLIC bool operator==(const Camera::SettingOptions& lhs, const Camera::SettingOptions& rhs)
×
432
{
433
    return (rhs.component_id == lhs.component_id) && (rhs.setting_id == lhs.setting_id) &&
×
434
           (rhs.setting_description == lhs.setting_description) && (rhs.options == lhs.options) &&
×
435
           (rhs.is_range == lhs.is_range);
×
436
}
437

438
MAVSDK_PUBLIC std::ostream&
NEW
439
operator<<(std::ostream& str, Camera::SettingOptions const& setting_options)
×
440
{
441
    str << std::setprecision(15);
×
442
    str << "setting_options:" << '\n' << "{\n";
×
443
    str << "    component_id: " << setting_options.component_id << '\n';
×
444
    str << "    setting_id: " << setting_options.setting_id << '\n';
×
445
    str << "    setting_description: " << setting_options.setting_description << '\n';
×
446
    str << "    options: [";
×
447
    for (auto it = setting_options.options.begin(); it != setting_options.options.end(); ++it) {
×
448
        str << *it;
×
449
        str << (it + 1 != setting_options.options.end() ? ", " : "]\n");
×
450
    }
451
    str << "    is_range: " << setting_options.is_range << '\n';
×
452
    str << '}';
×
453
    return str;
×
454
}
455

456
MAVSDK_PUBLIC bool
NEW
457
operator==(const Camera::VideoStreamSettings& lhs, const Camera::VideoStreamSettings& rhs)
×
458
{
459
    return ((std::isnan(rhs.frame_rate_hz) && std::isnan(lhs.frame_rate_hz)) ||
×
460
            rhs.frame_rate_hz == lhs.frame_rate_hz) &&
×
461
           (rhs.horizontal_resolution_pix == lhs.horizontal_resolution_pix) &&
×
462
           (rhs.vertical_resolution_pix == lhs.vertical_resolution_pix) &&
×
463
           (rhs.bit_rate_b_s == lhs.bit_rate_b_s) && (rhs.rotation_deg == lhs.rotation_deg) &&
×
464
           (rhs.uri == lhs.uri) &&
×
465
           ((std::isnan(rhs.horizontal_fov_deg) && std::isnan(lhs.horizontal_fov_deg)) ||
×
466
            rhs.horizontal_fov_deg == lhs.horizontal_fov_deg);
×
467
}
468

469
MAVSDK_PUBLIC std::ostream&
470
operator<<(std::ostream& str, Camera::VideoStreamSettings const& video_stream_settings)
×
471
{
472
    str << std::setprecision(15);
×
473
    str << "video_stream_settings:" << '\n' << "{\n";
×
474
    str << "    frame_rate_hz: " << video_stream_settings.frame_rate_hz << '\n';
×
475
    str << "    horizontal_resolution_pix: " << video_stream_settings.horizontal_resolution_pix
×
476
        << '\n';
×
477
    str << "    vertical_resolution_pix: " << video_stream_settings.vertical_resolution_pix << '\n';
×
478
    str << "    bit_rate_b_s: " << video_stream_settings.bit_rate_b_s << '\n';
×
479
    str << "    rotation_deg: " << video_stream_settings.rotation_deg << '\n';
×
480
    str << "    uri: " << video_stream_settings.uri << '\n';
×
481
    str << "    horizontal_fov_deg: " << video_stream_settings.horizontal_fov_deg << '\n';
×
482
    str << '}';
×
483
    return str;
×
484
}
485

486
MAVSDK_PUBLIC std::ostream&
487
operator<<(std::ostream& str, Camera::VideoStreamInfo::VideoStreamStatus const& video_stream_status)
×
488
{
489
    switch (video_stream_status) {
×
490
        case Camera::VideoStreamInfo::VideoStreamStatus::NotRunning:
×
491
            return str << "Not Running";
×
492
        case Camera::VideoStreamInfo::VideoStreamStatus::InProgress:
×
493
            return str << "In Progress";
×
494
        default:
×
495
            return str << "Unknown";
×
496
    }
497
}
498

NEW
499
MAVSDK_PUBLIC std::ostream& operator<<(
×
500
    std::ostream& str, Camera::VideoStreamInfo::VideoStreamSpectrum const& video_stream_spectrum)
501
{
502
    switch (video_stream_spectrum) {
×
503
        case Camera::VideoStreamInfo::VideoStreamSpectrum::Unknown:
×
504
            return str << "Unknown";
×
505
        case Camera::VideoStreamInfo::VideoStreamSpectrum::VisibleLight:
×
506
            return str << "Visible Light";
×
507
        case Camera::VideoStreamInfo::VideoStreamSpectrum::Infrared:
×
508
            return str << "Infrared";
×
509
        default:
×
510
            return str << "Unknown";
×
511
    }
512
}
513
MAVSDK_PUBLIC bool
NEW
514
operator==(const Camera::VideoStreamInfo& lhs, const Camera::VideoStreamInfo& rhs)
×
515
{
516
    return (rhs.stream_id == lhs.stream_id) && (rhs.settings == lhs.settings) &&
×
517
           (rhs.status == lhs.status) && (rhs.spectrum == lhs.spectrum);
×
518
}
519

520
MAVSDK_PUBLIC std::ostream&
NEW
521
operator<<(std::ostream& str, Camera::VideoStreamInfo const& video_stream_info)
×
522
{
523
    str << std::setprecision(15);
×
524
    str << "video_stream_info:" << '\n' << "{\n";
×
525
    str << "    stream_id: " << video_stream_info.stream_id << '\n';
×
526
    str << "    settings: " << video_stream_info.settings << '\n';
×
527
    str << "    status: " << video_stream_info.status << '\n';
×
528
    str << "    spectrum: " << video_stream_info.spectrum << '\n';
×
529
    str << '}';
×
530
    return str;
×
531
}
532

NEW
533
MAVSDK_PUBLIC bool operator==(const Camera::ModeUpdate& lhs, const Camera::ModeUpdate& rhs)
×
534
{
535
    return (rhs.component_id == lhs.component_id) && (rhs.mode == lhs.mode);
×
536
}
537

NEW
538
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::ModeUpdate const& mode_update)
×
539
{
540
    str << std::setprecision(15);
×
541
    str << "mode_update:" << '\n' << "{\n";
×
542
    str << "    component_id: " << mode_update.component_id << '\n';
×
543
    str << "    mode: " << mode_update.mode << '\n';
×
544
    str << '}';
×
545
    return str;
×
546
}
547

548
MAVSDK_PUBLIC bool
NEW
549
operator==(const Camera::VideoStreamUpdate& lhs, const Camera::VideoStreamUpdate& rhs)
×
550
{
551
    return (rhs.component_id == lhs.component_id) &&
×
552
           (rhs.video_stream_info == lhs.video_stream_info);
×
553
}
554

555
MAVSDK_PUBLIC std::ostream&
NEW
556
operator<<(std::ostream& str, Camera::VideoStreamUpdate const& video_stream_update)
×
557
{
558
    str << std::setprecision(15);
×
559
    str << "video_stream_update:" << '\n' << "{\n";
×
560
    str << "    component_id: " << video_stream_update.component_id << '\n';
×
561
    str << "    video_stream_info: " << video_stream_update.video_stream_info << '\n';
×
562
    str << '}';
×
563
    return str;
×
564
}
565

566
MAVSDK_PUBLIC std::ostream&
NEW
567
operator<<(std::ostream& str, Camera::Storage::StorageStatus const& storage_status)
×
568
{
569
    switch (storage_status) {
×
570
        case Camera::Storage::StorageStatus::NotAvailable:
×
571
            return str << "Not Available";
×
572
        case Camera::Storage::StorageStatus::Unformatted:
×
573
            return str << "Unformatted";
×
574
        case Camera::Storage::StorageStatus::Formatted:
×
575
            return str << "Formatted";
×
576
        case Camera::Storage::StorageStatus::NotSupported:
×
577
            return str << "Not Supported";
×
578
        default:
×
579
            return str << "Unknown";
×
580
    }
581
}
582

583
MAVSDK_PUBLIC std::ostream&
NEW
584
operator<<(std::ostream& str, Camera::Storage::StorageType const& storage_type)
×
585
{
586
    switch (storage_type) {
×
587
        case Camera::Storage::StorageType::Unknown:
×
588
            return str << "Unknown";
×
589
        case Camera::Storage::StorageType::UsbStick:
×
590
            return str << "Usb Stick";
×
591
        case Camera::Storage::StorageType::Sd:
×
592
            return str << "Sd";
×
593
        case Camera::Storage::StorageType::Microsd:
×
594
            return str << "Microsd";
×
595
        case Camera::Storage::StorageType::Hd:
×
596
            return str << "Hd";
×
597
        case Camera::Storage::StorageType::Other:
×
598
            return str << "Other";
×
599
        default:
×
600
            return str << "Unknown";
×
601
    }
602
}
NEW
603
MAVSDK_PUBLIC bool operator==(const Camera::Storage& lhs, const Camera::Storage& rhs)
×
604
{
605
    return (rhs.component_id == lhs.component_id) && (rhs.video_on == lhs.video_on) &&
×
606
           (rhs.photo_interval_on == lhs.photo_interval_on) &&
×
607
           ((std::isnan(rhs.used_storage_mib) && std::isnan(lhs.used_storage_mib)) ||
×
608
            rhs.used_storage_mib == lhs.used_storage_mib) &&
×
609
           ((std::isnan(rhs.available_storage_mib) && std::isnan(lhs.available_storage_mib)) ||
×
610
            rhs.available_storage_mib == lhs.available_storage_mib) &&
×
611
           ((std::isnan(rhs.total_storage_mib) && std::isnan(lhs.total_storage_mib)) ||
×
612
            rhs.total_storage_mib == lhs.total_storage_mib) &&
×
613
           ((std::isnan(rhs.recording_time_s) && std::isnan(lhs.recording_time_s)) ||
×
614
            rhs.recording_time_s == lhs.recording_time_s) &&
×
615
           (rhs.media_folder_name == lhs.media_folder_name) &&
×
616
           (rhs.storage_status == lhs.storage_status) && (rhs.storage_id == lhs.storage_id) &&
×
617
           (rhs.storage_type == lhs.storage_type);
×
618
}
619

NEW
620
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Storage const& storage)
×
621
{
622
    str << std::setprecision(15);
×
623
    str << "storage:" << '\n' << "{\n";
×
624
    str << "    component_id: " << storage.component_id << '\n';
×
625
    str << "    video_on: " << storage.video_on << '\n';
×
626
    str << "    photo_interval_on: " << storage.photo_interval_on << '\n';
×
627
    str << "    used_storage_mib: " << storage.used_storage_mib << '\n';
×
628
    str << "    available_storage_mib: " << storage.available_storage_mib << '\n';
×
629
    str << "    total_storage_mib: " << storage.total_storage_mib << '\n';
×
630
    str << "    recording_time_s: " << storage.recording_time_s << '\n';
×
631
    str << "    media_folder_name: " << storage.media_folder_name << '\n';
×
632
    str << "    storage_status: " << storage.storage_status << '\n';
×
633
    str << "    storage_id: " << storage.storage_id << '\n';
×
634
    str << "    storage_type: " << storage.storage_type << '\n';
×
635
    str << '}';
×
636
    return str;
×
637
}
638

NEW
639
MAVSDK_PUBLIC bool operator==(const Camera::StorageUpdate& lhs, const Camera::StorageUpdate& rhs)
×
640
{
641
    return (rhs.component_id == lhs.component_id) && (rhs.storage == lhs.storage);
×
642
}
643

644
MAVSDK_PUBLIC std::ostream&
NEW
645
operator<<(std::ostream& str, Camera::StorageUpdate const& storage_update)
×
646
{
647
    str << std::setprecision(15);
×
648
    str << "storage_update:" << '\n' << "{\n";
×
649
    str << "    component_id: " << storage_update.component_id << '\n';
×
650
    str << "    storage: " << storage_update.storage << '\n';
×
651
    str << '}';
×
652
    return str;
×
653
}
654

655
MAVSDK_PUBLIC bool
NEW
656
operator==(const Camera::CurrentSettingsUpdate& lhs, const Camera::CurrentSettingsUpdate& rhs)
×
657
{
658
    return (rhs.component_id == lhs.component_id) && (rhs.current_settings == lhs.current_settings);
×
659
}
660

661
MAVSDK_PUBLIC std::ostream&
662
operator<<(std::ostream& str, Camera::CurrentSettingsUpdate const& current_settings_update)
×
663
{
664
    str << std::setprecision(15);
×
665
    str << "current_settings_update:" << '\n' << "{\n";
×
666
    str << "    component_id: " << current_settings_update.component_id << '\n';
×
667
    str << "    current_settings: [";
×
668
    for (auto it = current_settings_update.current_settings.begin();
×
669
         it != current_settings_update.current_settings.end();
×
670
         ++it) {
×
671
        str << *it;
×
672
        str << (it + 1 != current_settings_update.current_settings.end() ? ", " : "]\n");
×
673
    }
674
    str << '}';
×
675
    return str;
×
676
}
677

NEW
678
MAVSDK_PUBLIC bool operator==(
×
679
    const Camera::PossibleSettingOptionsUpdate& lhs,
680
    const Camera::PossibleSettingOptionsUpdate& rhs)
681
{
682
    return (rhs.component_id == lhs.component_id) && (rhs.setting_options == lhs.setting_options);
×
683
}
684

NEW
685
MAVSDK_PUBLIC std::ostream& operator<<(
×
686
    std::ostream& str, Camera::PossibleSettingOptionsUpdate const& possible_setting_options_update)
687
{
688
    str << std::setprecision(15);
×
689
    str << "possible_setting_options_update:" << '\n' << "{\n";
×
690
    str << "    component_id: " << possible_setting_options_update.component_id << '\n';
×
691
    str << "    setting_options: [";
×
692
    for (auto it = possible_setting_options_update.setting_options.begin();
×
693
         it != possible_setting_options_update.setting_options.end();
×
694
         ++it) {
×
695
        str << *it;
×
696
        str << (it + 1 != possible_setting_options_update.setting_options.end() ? ", " : "]\n");
×
697
    }
698
    str << '}';
×
699
    return str;
×
700
}
701

NEW
702
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Result const& result)
×
703
{
704
    switch (result) {
×
705
        case Camera::Result::Unknown:
×
706
            return str << "Unknown";
×
707
        case Camera::Result::Success:
×
708
            return str << "Success";
×
709
        case Camera::Result::InProgress:
×
710
            return str << "In Progress";
×
711
        case Camera::Result::Busy:
×
712
            return str << "Busy";
×
713
        case Camera::Result::Denied:
×
714
            return str << "Denied";
×
715
        case Camera::Result::Error:
×
716
            return str << "Error";
×
717
        case Camera::Result::Timeout:
×
718
            return str << "Timeout";
×
719
        case Camera::Result::WrongArgument:
×
720
            return str << "Wrong Argument";
×
721
        case Camera::Result::NoSystem:
×
722
            return str << "No System";
×
723
        case Camera::Result::ProtocolUnsupported:
×
724
            return str << "Protocol Unsupported";
×
725
        case Camera::Result::Unavailable:
×
726
            return str << "Unavailable";
×
727
        case Camera::Result::CameraIdInvalid:
×
728
            return str << "Camera Id Invalid";
×
729
        case Camera::Result::ActionUnsupported:
×
730
            return str << "Action Unsupported";
×
731
        default:
×
732
            return str << "Unknown";
×
733
    }
734
}
735

NEW
736
MAVSDK_PUBLIC bool operator==(const Camera::Position& lhs, const Camera::Position& rhs)
×
737
{
738
    return ((std::isnan(rhs.latitude_deg) && std::isnan(lhs.latitude_deg)) ||
×
739
            rhs.latitude_deg == lhs.latitude_deg) &&
×
740
           ((std::isnan(rhs.longitude_deg) && std::isnan(lhs.longitude_deg)) ||
×
741
            rhs.longitude_deg == lhs.longitude_deg) &&
×
742
           ((std::isnan(rhs.absolute_altitude_m) && std::isnan(lhs.absolute_altitude_m)) ||
×
743
            rhs.absolute_altitude_m == lhs.absolute_altitude_m) &&
×
744
           ((std::isnan(rhs.relative_altitude_m) && std::isnan(lhs.relative_altitude_m)) ||
×
745
            rhs.relative_altitude_m == lhs.relative_altitude_m);
×
746
}
747

NEW
748
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Position const& position)
×
749
{
750
    str << std::setprecision(15);
×
751
    str << "position:" << '\n' << "{\n";
×
752
    str << "    latitude_deg: " << position.latitude_deg << '\n';
×
753
    str << "    longitude_deg: " << position.longitude_deg << '\n';
×
754
    str << "    absolute_altitude_m: " << position.absolute_altitude_m << '\n';
×
755
    str << "    relative_altitude_m: " << position.relative_altitude_m << '\n';
×
756
    str << '}';
×
757
    return str;
×
758
}
759

NEW
760
MAVSDK_PUBLIC bool operator==(const Camera::Quaternion& lhs, const Camera::Quaternion& rhs)
×
761
{
762
    return ((std::isnan(rhs.w) && std::isnan(lhs.w)) || rhs.w == lhs.w) &&
×
763
           ((std::isnan(rhs.x) && std::isnan(lhs.x)) || rhs.x == lhs.x) &&
×
764
           ((std::isnan(rhs.y) && std::isnan(lhs.y)) || rhs.y == lhs.y) &&
×
765
           ((std::isnan(rhs.z) && std::isnan(lhs.z)) || rhs.z == lhs.z);
×
766
}
767

NEW
768
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Quaternion const& quaternion)
×
769
{
770
    str << std::setprecision(15);
×
771
    str << "quaternion:" << '\n' << "{\n";
×
772
    str << "    w: " << quaternion.w << '\n';
×
773
    str << "    x: " << quaternion.x << '\n';
×
774
    str << "    y: " << quaternion.y << '\n';
×
775
    str << "    z: " << quaternion.z << '\n';
×
776
    str << '}';
×
777
    return str;
×
778
}
779

NEW
780
MAVSDK_PUBLIC bool operator==(const Camera::EulerAngle& lhs, const Camera::EulerAngle& rhs)
×
781
{
782
    return ((std::isnan(rhs.roll_deg) && std::isnan(lhs.roll_deg)) ||
×
783
            rhs.roll_deg == lhs.roll_deg) &&
×
784
           ((std::isnan(rhs.pitch_deg) && std::isnan(lhs.pitch_deg)) ||
×
785
            rhs.pitch_deg == lhs.pitch_deg) &&
×
786
           ((std::isnan(rhs.yaw_deg) && std::isnan(lhs.yaw_deg)) || rhs.yaw_deg == lhs.yaw_deg);
×
787
}
788

NEW
789
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::EulerAngle const& euler_angle)
×
790
{
791
    str << std::setprecision(15);
×
792
    str << "euler_angle:" << '\n' << "{\n";
×
793
    str << "    roll_deg: " << euler_angle.roll_deg << '\n';
×
794
    str << "    pitch_deg: " << euler_angle.pitch_deg << '\n';
×
795
    str << "    yaw_deg: " << euler_angle.yaw_deg << '\n';
×
796
    str << '}';
×
797
    return str;
×
798
}
799

NEW
800
MAVSDK_PUBLIC bool operator==(const Camera::CaptureInfo& lhs, const Camera::CaptureInfo& rhs)
×
801
{
802
    return (rhs.component_id == lhs.component_id) && (rhs.position == lhs.position) &&
×
803
           (rhs.attitude_quaternion == lhs.attitude_quaternion) &&
×
804
           (rhs.attitude_euler_angle == lhs.attitude_euler_angle) &&
×
805
           (rhs.time_utc_us == lhs.time_utc_us) && (rhs.is_success == lhs.is_success) &&
×
806
           (rhs.index == lhs.index) && (rhs.file_url == lhs.file_url);
×
807
}
808

NEW
809
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::CaptureInfo const& capture_info)
×
810
{
811
    str << std::setprecision(15);
×
812
    str << "capture_info:" << '\n' << "{\n";
×
813
    str << "    component_id: " << capture_info.component_id << '\n';
×
814
    str << "    position: " << capture_info.position << '\n';
×
815
    str << "    attitude_quaternion: " << capture_info.attitude_quaternion << '\n';
×
816
    str << "    attitude_euler_angle: " << capture_info.attitude_euler_angle << '\n';
×
817
    str << "    time_utc_us: " << capture_info.time_utc_us << '\n';
×
818
    str << "    is_success: " << capture_info.is_success << '\n';
×
819
    str << "    index: " << capture_info.index << '\n';
×
820
    str << "    file_url: " << capture_info.file_url << '\n';
×
821
    str << '}';
×
822
    return str;
×
823
}
824

NEW
825
MAVSDK_PUBLIC bool operator==(const Camera::Information& lhs, const Camera::Information& rhs)
×
826
{
827
    return (rhs.component_id == lhs.component_id) && (rhs.vendor_name == lhs.vendor_name) &&
×
828
           (rhs.model_name == lhs.model_name) &&
×
829
           ((std::isnan(rhs.focal_length_mm) && std::isnan(lhs.focal_length_mm)) ||
×
830
            rhs.focal_length_mm == lhs.focal_length_mm) &&
×
831
           ((std::isnan(rhs.horizontal_sensor_size_mm) &&
×
832
             std::isnan(lhs.horizontal_sensor_size_mm)) ||
×
833
            rhs.horizontal_sensor_size_mm == lhs.horizontal_sensor_size_mm) &&
×
834
           ((std::isnan(rhs.vertical_sensor_size_mm) && std::isnan(lhs.vertical_sensor_size_mm)) ||
×
835
            rhs.vertical_sensor_size_mm == lhs.vertical_sensor_size_mm) &&
×
836
           (rhs.horizontal_resolution_px == lhs.horizontal_resolution_px) &&
×
837
           (rhs.vertical_resolution_px == lhs.vertical_resolution_px);
×
838
}
839

NEW
840
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Information const& information)
×
841
{
842
    str << std::setprecision(15);
×
843
    str << "information:" << '\n' << "{\n";
×
844
    str << "    component_id: " << information.component_id << '\n';
×
845
    str << "    vendor_name: " << information.vendor_name << '\n';
×
846
    str << "    model_name: " << information.model_name << '\n';
×
847
    str << "    focal_length_mm: " << information.focal_length_mm << '\n';
×
848
    str << "    horizontal_sensor_size_mm: " << information.horizontal_sensor_size_mm << '\n';
×
849
    str << "    vertical_sensor_size_mm: " << information.vertical_sensor_size_mm << '\n';
×
850
    str << "    horizontal_resolution_px: " << information.horizontal_resolution_px << '\n';
×
851
    str << "    vertical_resolution_px: " << information.vertical_resolution_px << '\n';
×
852
    str << '}';
×
853
    return str;
×
854
}
855

NEW
856
MAVSDK_PUBLIC bool operator==(const Camera::CameraList& lhs, const Camera::CameraList& rhs)
×
857
{
858
    return (rhs.cameras == lhs.cameras);
×
859
}
860

NEW
861
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::CameraList const& camera_list)
×
862
{
863
    str << std::setprecision(15);
×
864
    str << "camera_list:" << '\n' << "{\n";
×
865
    str << "    cameras: [";
×
866
    for (auto it = camera_list.cameras.begin(); it != camera_list.cameras.end(); ++it) {
×
867
        str << *it;
×
868
        str << (it + 1 != camera_list.cameras.end() ? ", " : "]\n");
×
869
    }
870
    str << '}';
×
871
    return str;
×
872
}
873

NEW
874
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::Mode const& mode)
×
875
{
876
    switch (mode) {
×
877
        case Camera::Mode::Unknown:
×
878
            return str << "Unknown";
×
879
        case Camera::Mode::Photo:
×
880
            return str << "Photo";
×
881
        case Camera::Mode::Video:
×
882
            return str << "Video";
×
883
        default:
×
884
            return str << "Unknown";
×
885
    }
886
}
887

NEW
888
MAVSDK_PUBLIC std::ostream& operator<<(std::ostream& str, Camera::PhotosRange const& photos_range)
×
889
{
890
    switch (photos_range) {
×
891
        case Camera::PhotosRange::All:
×
892
            return str << "All";
×
893
        case Camera::PhotosRange::SinceConnection:
×
894
            return str << "Since Connection";
×
895
        default:
×
896
            return str << "Unknown";
×
897
    }
898
}
899

900
} // namespace mavsdk
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc