Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_video_stream_status.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE VIDEO_STREAM_STATUS PACKING
3
4#define MAVLINK_MSG_ID_VIDEO_STREAM_STATUS 270
5
6
8 float framerate; /*< [Hz] Frame rate*/
9 uint32_t bitrate; /*< [bits/s] Bit rate*/
10 uint16_t flags; /*< Bitmap of stream status flags*/
11 uint16_t resolution_h; /*< [pix] Horizontal resolution*/
12 uint16_t resolution_v; /*< [pix] Vertical resolution*/
13 uint16_t rotation; /*< [deg] Video image rotation clockwise*/
14 uint16_t hfov; /*< [deg] Horizontal Field of view*/
15 uint8_t stream_id; /*< Video Stream ID (1 for first, 2 for second, etc.)*/
16 uint8_t camera_device_id; /*< Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).*/
17} mavlink_video_stream_status_t;
18
19#define MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN 20
20#define MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN 19
21#define MAVLINK_MSG_ID_270_LEN 20
22#define MAVLINK_MSG_ID_270_MIN_LEN 19
23
24#define MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC 59
25#define MAVLINK_MSG_ID_270_CRC 59
26
27
28
29#if MAVLINK_COMMAND_24BIT
30#define MAVLINK_MESSAGE_INFO_VIDEO_STREAM_STATUS {
31 270,
32 "VIDEO_STREAM_STATUS",
33 9,
34 { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_video_stream_status_t, stream_id) },
35 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_video_stream_status_t, flags) },
36 { "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_video_stream_status_t, framerate) },
37 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_video_stream_status_t, resolution_h) },
38 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_video_stream_status_t, resolution_v) },
39 { "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_video_stream_status_t, bitrate) },
40 { "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_video_stream_status_t, rotation) },
41 { "hfov", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_video_stream_status_t, hfov) },
42 { "camera_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_video_stream_status_t, camera_device_id) },
43 } \
44}
45#else
46#define MAVLINK_MESSAGE_INFO_VIDEO_STREAM_STATUS {
47 "VIDEO_STREAM_STATUS",
48 9,
49 { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_video_stream_status_t, stream_id) },
50 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_video_stream_status_t, flags) },
51 { "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_video_stream_status_t, framerate) },
52 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_video_stream_status_t, resolution_h) },
53 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_video_stream_status_t, resolution_v) },
54 { "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_video_stream_status_t, bitrate) },
55 { "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_video_stream_status_t, rotation) },
56 { "hfov", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_video_stream_status_t, hfov) },
57 { "camera_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_video_stream_status_t, camera_device_id) },
58 } \
59}
60#endif
61
62/**
63 * @brief Pack a video_stream_status message
64 * @param system_id ID of this system
65 * @param component_id ID of this component (e.g. 200 for IMU)
66 * @param msg The MAVLink message to compress the data into
67 *
68 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
69 * @param flags Bitmap of stream status flags
70 * @param framerate [Hz] Frame rate
71 * @param resolution_h [pix] Horizontal resolution
72 * @param resolution_v [pix] Vertical resolution
73 * @param bitrate [bits/s] Bit rate
74 * @param rotation [deg] Video image rotation clockwise
75 * @param hfov [deg] Horizontal Field of view
76 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
77 * @return length of the message in bytes (excluding serial stream start sign)
78 */
79static inline uint16_t mavlink_msg_video_stream_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint8_t stream_id, uint16_t flags, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, uint16_t hfov, uint8_t camera_device_id)
81{
82#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 _mav_put_float(buf, 0, framerate);
85 _mav_put_uint32_t(buf, 4, bitrate);
86 _mav_put_uint16_t(buf, 8, flags);
87 _mav_put_uint16_t(buf, 10, resolution_h);
88 _mav_put_uint16_t(buf, 12, resolution_v);
89 _mav_put_uint16_t(buf, 14, rotation);
90 _mav_put_uint16_t(buf, 16, hfov);
91 _mav_put_uint8_t(buf, 18, stream_id);
92 _mav_put_uint8_t(buf, 19, camera_device_id);
93
94 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
95#else
96 mavlink_video_stream_status_t packet;
97 packet.framerate = framerate;
98 packet.bitrate = bitrate;
99 packet.flags = flags;
100 packet.resolution_h = resolution_h;
101 packet.resolution_v = resolution_v;
102 packet.rotation = rotation;
103 packet.hfov = hfov;
104 packet.stream_id = stream_id;
105 packet.camera_device_id = camera_device_id;
106
107 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
108#endif
109
112}
113
114/**
115 * @brief Pack a video_stream_status message
116 * @param system_id ID of this system
117 * @param component_id ID of this component (e.g. 200 for IMU)
118 * @param status MAVLink status structure
119 * @param msg The MAVLink message to compress the data into
120 *
121 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
122 * @param flags Bitmap of stream status flags
123 * @param framerate [Hz] Frame rate
124 * @param resolution_h [pix] Horizontal resolution
125 * @param resolution_v [pix] Vertical resolution
126 * @param bitrate [bits/s] Bit rate
127 * @param rotation [deg] Video image rotation clockwise
128 * @param hfov [deg] Horizontal Field of view
129 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
130 * @return length of the message in bytes (excluding serial stream start sign)
131 */
132static inline uint16_t mavlink_msg_video_stream_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
133 uint8_t stream_id, uint16_t flags, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, uint16_t hfov, uint8_t camera_device_id)
134{
135#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
137 _mav_put_float(buf, 0, framerate);
138 _mav_put_uint32_t(buf, 4, bitrate);
139 _mav_put_uint16_t(buf, 8, flags);
140 _mav_put_uint16_t(buf, 10, resolution_h);
141 _mav_put_uint16_t(buf, 12, resolution_v);
142 _mav_put_uint16_t(buf, 14, rotation);
143 _mav_put_uint16_t(buf, 16, hfov);
144 _mav_put_uint8_t(buf, 18, stream_id);
145 _mav_put_uint8_t(buf, 19, camera_device_id);
146
147 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
148#else
149 mavlink_video_stream_status_t packet;
150 packet.framerate = framerate;
151 packet.bitrate = bitrate;
152 packet.flags = flags;
153 packet.resolution_h = resolution_h;
154 packet.resolution_v = resolution_v;
155 packet.rotation = rotation;
156 packet.hfov = hfov;
157 packet.stream_id = stream_id;
158 packet.camera_device_id = camera_device_id;
159
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
161#endif
162
164#if MAVLINK_CRC_EXTRA
165 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC);
166#else
167 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
168#endif
169}
170
171/**
172 * @brief Pack a video_stream_status message on a channel
173 * @param system_id ID of this system
174 * @param component_id ID of this component (e.g. 200 for IMU)
175 * @param chan The MAVLink channel this message will be sent over
176 * @param msg The MAVLink message to compress the data into
177 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
178 * @param flags Bitmap of stream status flags
179 * @param framerate [Hz] Frame rate
180 * @param resolution_h [pix] Horizontal resolution
181 * @param resolution_v [pix] Vertical resolution
182 * @param bitrate [bits/s] Bit rate
183 * @param rotation [deg] Video image rotation clockwise
184 * @param hfov [deg] Horizontal Field of view
185 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
186 * @return length of the message in bytes (excluding serial stream start sign)
187 */
188static inline uint16_t mavlink_msg_video_stream_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
189 mavlink_message_t* msg,
190 uint8_t stream_id,uint16_t flags,float framerate,uint16_t resolution_h,uint16_t resolution_v,uint32_t bitrate,uint16_t rotation,uint16_t hfov,uint8_t camera_device_id)
191{
192#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
194 _mav_put_float(buf, 0, framerate);
195 _mav_put_uint32_t(buf, 4, bitrate);
196 _mav_put_uint16_t(buf, 8, flags);
197 _mav_put_uint16_t(buf, 10, resolution_h);
198 _mav_put_uint16_t(buf, 12, resolution_v);
199 _mav_put_uint16_t(buf, 14, rotation);
200 _mav_put_uint16_t(buf, 16, hfov);
201 _mav_put_uint8_t(buf, 18, stream_id);
202 _mav_put_uint8_t(buf, 19, camera_device_id);
203
204 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
205#else
206 mavlink_video_stream_status_t packet;
207 packet.framerate = framerate;
208 packet.bitrate = bitrate;
209 packet.flags = flags;
210 packet.resolution_h = resolution_h;
211 packet.resolution_v = resolution_v;
212 packet.rotation = rotation;
213 packet.hfov = hfov;
214 packet.stream_id = stream_id;
215 packet.camera_device_id = camera_device_id;
216
217 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
218#endif
219
221 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC);
222}
223
224/**
225 * @brief Encode a video_stream_status struct
226 *
227 * @param system_id ID of this system
228 * @param component_id ID of this component (e.g. 200 for IMU)
229 * @param msg The MAVLink message to compress the data into
230 * @param video_stream_status C-struct to read the message contents from
231 */
232static inline uint16_t mavlink_msg_video_stream_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_video_stream_status_t* video_stream_status)
233{
234 return mavlink_msg_video_stream_status_pack(system_id, component_id, msg, video_stream_status->stream_id, video_stream_status->flags, video_stream_status->framerate, video_stream_status->resolution_h, video_stream_status->resolution_v, video_stream_status->bitrate, video_stream_status->rotation, video_stream_status->hfov, video_stream_status->camera_device_id);
235}
236
237/**
238 * @brief Encode a video_stream_status struct on a channel
239 *
240 * @param system_id ID of this system
241 * @param component_id ID of this component (e.g. 200 for IMU)
242 * @param chan The MAVLink channel this message will be sent over
243 * @param msg The MAVLink message to compress the data into
244 * @param video_stream_status C-struct to read the message contents from
245 */
246static inline uint16_t mavlink_msg_video_stream_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_video_stream_status_t* video_stream_status)
247{
248 return mavlink_msg_video_stream_status_pack_chan(system_id, component_id, chan, msg, video_stream_status->stream_id, video_stream_status->flags, video_stream_status->framerate, video_stream_status->resolution_h, video_stream_status->resolution_v, video_stream_status->bitrate, video_stream_status->rotation, video_stream_status->hfov, video_stream_status->camera_device_id);
249}
250
251/**
252 * @brief Encode a video_stream_status struct with provided status structure
253 *
254 * @param system_id ID of this system
255 * @param component_id ID of this component (e.g. 200 for IMU)
256 * @param status MAVLink status structure
257 * @param msg The MAVLink message to compress the data into
258 * @param video_stream_status C-struct to read the message contents from
259 */
260static inline uint16_t mavlink_msg_video_stream_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_video_stream_status_t* video_stream_status)
261{
262 return mavlink_msg_video_stream_status_pack_status(system_id, component_id, _status, msg, video_stream_status->stream_id, video_stream_status->flags, video_stream_status->framerate, video_stream_status->resolution_h, video_stream_status->resolution_v, video_stream_status->bitrate, video_stream_status->rotation, video_stream_status->hfov, video_stream_status->camera_device_id);
263}
264
265/**
266 * @brief Send a video_stream_status message
267 * @param chan MAVLink channel to send the message
268 *
269 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
270 * @param flags Bitmap of stream status flags
271 * @param framerate [Hz] Frame rate
272 * @param resolution_h [pix] Horizontal resolution
273 * @param resolution_v [pix] Vertical resolution
274 * @param bitrate [bits/s] Bit rate
275 * @param rotation [deg] Video image rotation clockwise
276 * @param hfov [deg] Horizontal Field of view
277 * @param camera_device_id Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
278 */
279#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
280
281static inline void mavlink_msg_video_stream_status_send(mavlink_channel_t chan, uint8_t stream_id, uint16_t flags, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, uint16_t hfov, uint8_t camera_device_id)
282{
283#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
284 char buf[MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN];
285 _mav_put_float(buf, 0, framerate);
286 _mav_put_uint32_t(buf, 4, bitrate);
287 _mav_put_uint16_t(buf, 8, flags);
288 _mav_put_uint16_t(buf, 10, resolution_h);
289 _mav_put_uint16_t(buf, 12, resolution_v);
290 _mav_put_uint16_t(buf, 14, rotation);
291 _mav_put_uint16_t(buf, 16, hfov);
292 _mav_put_uint8_t(buf, 18, stream_id);
293 _mav_put_uint8_t(buf, 19, camera_device_id);
294
295 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS, buf, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC);
296#else
297 mavlink_video_stream_status_t packet;
298 packet.framerate = framerate;
299 packet.bitrate = bitrate;
300 packet.flags = flags;
301 packet.resolution_h = resolution_h;
302 packet.resolution_v = resolution_v;
303 packet.rotation = rotation;
304 packet.hfov = hfov;
305 packet.stream_id = stream_id;
306 packet.camera_device_id = camera_device_id;
307
308 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS, (const char *)&packet, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC);
309#endif
310}
311
312/**
313 * @brief Send a video_stream_status message
314 * @param chan MAVLink channel to send the message
315 * @param struct The MAVLink struct to serialize
316 */
317static inline void mavlink_msg_video_stream_status_send_struct(mavlink_channel_t chan, const mavlink_video_stream_status_t* video_stream_status)
318{
319#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
320 mavlink_msg_video_stream_status_send(chan, video_stream_status->stream_id, video_stream_status->flags, video_stream_status->framerate, video_stream_status->resolution_h, video_stream_status->resolution_v, video_stream_status->bitrate, video_stream_status->rotation, video_stream_status->hfov, video_stream_status->camera_device_id);
321#else
322 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS, (const char *)video_stream_status, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC);
323#endif
324}
325
326#if MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
327/*
328 This variant of _send() can be used to save stack space by reusing
329 memory from the receive buffer. The caller provides a
330 mavlink_message_t which is the size of a full mavlink message. This
331 is usually the receive buffer for the channel, and allows a reply to an
332 incoming message with minimum stack space usage.
333 */
334static inline void mavlink_msg_video_stream_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t stream_id, uint16_t flags, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, uint16_t hfov, uint8_t camera_device_id)
335{
336#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
337 char *buf = (char *)msgbuf;
338 _mav_put_float(buf, 0, framerate);
339 _mav_put_uint32_t(buf, 4, bitrate);
340 _mav_put_uint16_t(buf, 8, flags);
341 _mav_put_uint16_t(buf, 10, resolution_h);
342 _mav_put_uint16_t(buf, 12, resolution_v);
343 _mav_put_uint16_t(buf, 14, rotation);
344 _mav_put_uint16_t(buf, 16, hfov);
345 _mav_put_uint8_t(buf, 18, stream_id);
346 _mav_put_uint8_t(buf, 19, camera_device_id);
347
348 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS, buf, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC);
349#else
350 mavlink_video_stream_status_t *packet = (mavlink_video_stream_status_t *)msgbuf;
351 packet->framerate = framerate;
352 packet->bitrate = bitrate;
353 packet->flags = flags;
354 packet->resolution_h = resolution_h;
355 packet->resolution_v = resolution_v;
356 packet->rotation = rotation;
357 packet->hfov = hfov;
358 packet->stream_id = stream_id;
359 packet->camera_device_id = camera_device_id;
360
361 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS, (const char *)packet, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_CRC);
362#endif
363}
364#endif
365
366#endif
367
368// MESSAGE VIDEO_STREAM_STATUS UNPACKING
369
370
371/**
372 * @brief Get field stream_id from video_stream_status message
373 *
374 * @return Video Stream ID (1 for first, 2 for second, etc.)
375 */
376static inline uint8_t mavlink_msg_video_stream_status_get_stream_id(const mavlink_message_t* msg)
377{
378 return _MAV_RETURN_uint8_t(msg, 18);
379}
380
381/**
382 * @brief Get field flags from video_stream_status message
383 *
384 * @return Bitmap of stream status flags
385 */
386static inline uint16_t mavlink_msg_video_stream_status_get_flags(const mavlink_message_t* msg)
387{
388 return _MAV_RETURN_uint16_t(msg, 8);
389}
390
391/**
392 * @brief Get field framerate from video_stream_status message
393 *
394 * @return [Hz] Frame rate
395 */
396static inline float mavlink_msg_video_stream_status_get_framerate(const mavlink_message_t* msg)
397{
398 return _MAV_RETURN_float(msg, 0);
399}
400
401/**
402 * @brief Get field resolution_h from video_stream_status message
403 *
404 * @return [pix] Horizontal resolution
405 */
406static inline uint16_t mavlink_msg_video_stream_status_get_resolution_h(const mavlink_message_t* msg)
407{
408 return _MAV_RETURN_uint16_t(msg, 10);
409}
410
411/**
412 * @brief Get field resolution_v from video_stream_status message
413 *
414 * @return [pix] Vertical resolution
415 */
416static inline uint16_t mavlink_msg_video_stream_status_get_resolution_v(const mavlink_message_t* msg)
417{
418 return _MAV_RETURN_uint16_t(msg, 12);
419}
420
421/**
422 * @brief Get field bitrate from video_stream_status message
423 *
424 * @return [bits/s] Bit rate
425 */
426static inline uint32_t mavlink_msg_video_stream_status_get_bitrate(const mavlink_message_t* msg)
427{
428 return _MAV_RETURN_uint32_t(msg, 4);
429}
430
431/**
432 * @brief Get field rotation from video_stream_status message
433 *
434 * @return [deg] Video image rotation clockwise
435 */
436static inline uint16_t mavlink_msg_video_stream_status_get_rotation(const mavlink_message_t* msg)
437{
438 return _MAV_RETURN_uint16_t(msg, 14);
439}
440
441/**
442 * @brief Get field hfov from video_stream_status message
443 *
444 * @return [deg] Horizontal Field of view
445 */
446static inline uint16_t mavlink_msg_video_stream_status_get_hfov(const mavlink_message_t* msg)
447{
448 return _MAV_RETURN_uint16_t(msg, 16);
449}
450
451/**
452 * @brief Get field camera_device_id from video_stream_status message
453 *
454 * @return Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id).
455 */
456static inline uint8_t mavlink_msg_video_stream_status_get_camera_device_id(const mavlink_message_t* msg)
457{
458 return _MAV_RETURN_uint8_t(msg, 19);
459}
460
461/**
462 * @brief Decode a video_stream_status message into a struct
463 *
464 * @param msg The message to decode
465 * @param video_stream_status C-struct to decode the message contents into
466 */
467static inline void mavlink_msg_video_stream_status_decode(const mavlink_message_t* msg, mavlink_video_stream_status_t* video_stream_status)
468{
469#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
470 video_stream_status->framerate = mavlink_msg_video_stream_status_get_framerate(msg);
471 video_stream_status->bitrate = mavlink_msg_video_stream_status_get_bitrate(msg);
472 video_stream_status->flags = mavlink_msg_video_stream_status_get_flags(msg);
473 video_stream_status->resolution_h = mavlink_msg_video_stream_status_get_resolution_h(msg);
474 video_stream_status->resolution_v = mavlink_msg_video_stream_status_get_resolution_v(msg);
475 video_stream_status->rotation = mavlink_msg_video_stream_status_get_rotation(msg);
476 video_stream_status->hfov = mavlink_msg_video_stream_status_get_hfov(msg);
477 video_stream_status->stream_id = mavlink_msg_video_stream_status_get_stream_id(msg);
478 video_stream_status->camera_device_id = mavlink_msg_video_stream_status_get_camera_device_id(msg);
479#else
480 uint8_t len = msg->len < MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN? msg->len : MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN;
481 memset(video_stream_status, 0, MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_LEN);
482 memcpy(video_stream_status, _MAV_PAYLOAD(msg), len);
483#endif
484}