Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_video_stream_information.h
blobaa6d84b7437750a82632f3462f74141b637e45ac
1 #pragma once
2 // MESSAGE VIDEO_STREAM_INFORMATION PACKING
4 #define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION 269
7 typedef struct __mavlink_video_stream_information_t {
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 count; /*< Number of streams available.*/
17 uint8_t type; /*< Type of stream.*/
18 char name[32]; /*< Stream name.*/
19 char uri[160]; /*< Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).*/
20 } mavlink_video_stream_information_t;
22 #define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN 213
23 #define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN 213
24 #define MAVLINK_MSG_ID_269_LEN 213
25 #define MAVLINK_MSG_ID_269_MIN_LEN 213
27 #define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC 109
28 #define MAVLINK_MSG_ID_269_CRC 109
30 #define MAVLINK_MSG_VIDEO_STREAM_INFORMATION_FIELD_NAME_LEN 32
31 #define MAVLINK_MSG_VIDEO_STREAM_INFORMATION_FIELD_URI_LEN 160
33 #if MAVLINK_COMMAND_24BIT
34 #define MAVLINK_MESSAGE_INFO_VIDEO_STREAM_INFORMATION { \
35 269, \
36 "VIDEO_STREAM_INFORMATION", \
37 12, \
38 { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_video_stream_information_t, stream_id) }, \
39 { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_video_stream_information_t, count) }, \
40 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_video_stream_information_t, type) }, \
41 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_video_stream_information_t, flags) }, \
42 { "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_video_stream_information_t, framerate) }, \
43 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_video_stream_information_t, resolution_h) }, \
44 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_video_stream_information_t, resolution_v) }, \
45 { "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_video_stream_information_t, bitrate) }, \
46 { "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_video_stream_information_t, rotation) }, \
47 { "hfov", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_video_stream_information_t, hfov) }, \
48 { "name", NULL, MAVLINK_TYPE_CHAR, 32, 21, offsetof(mavlink_video_stream_information_t, name) }, \
49 { "uri", NULL, MAVLINK_TYPE_CHAR, 160, 53, offsetof(mavlink_video_stream_information_t, uri) }, \
50 } \
52 #else
53 #define MAVLINK_MESSAGE_INFO_VIDEO_STREAM_INFORMATION { \
54 "VIDEO_STREAM_INFORMATION", \
55 12, \
56 { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_video_stream_information_t, stream_id) }, \
57 { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_video_stream_information_t, count) }, \
58 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_video_stream_information_t, type) }, \
59 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_video_stream_information_t, flags) }, \
60 { "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_video_stream_information_t, framerate) }, \
61 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_video_stream_information_t, resolution_h) }, \
62 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_video_stream_information_t, resolution_v) }, \
63 { "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_video_stream_information_t, bitrate) }, \
64 { "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_video_stream_information_t, rotation) }, \
65 { "hfov", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_video_stream_information_t, hfov) }, \
66 { "name", NULL, MAVLINK_TYPE_CHAR, 32, 21, offsetof(mavlink_video_stream_information_t, name) }, \
67 { "uri", NULL, MAVLINK_TYPE_CHAR, 160, 53, offsetof(mavlink_video_stream_information_t, uri) }, \
68 } \
70 #endif
72 /**
73 * @brief Pack a video_stream_information message
74 * @param system_id ID of this system
75 * @param component_id ID of this component (e.g. 200 for IMU)
76 * @param msg The MAVLink message to compress the data into
78 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
79 * @param count Number of streams available.
80 * @param type Type of stream.
81 * @param flags Bitmap of stream status flags.
82 * @param framerate [Hz] Frame rate.
83 * @param resolution_h [pix] Horizontal resolution.
84 * @param resolution_v [pix] Vertical resolution.
85 * @param bitrate [bits/s] Bit rate.
86 * @param rotation [deg] Video image rotation clockwise.
87 * @param hfov [deg] Horizontal Field of view.
88 * @param name Stream name.
89 * @param uri Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
90 * @return length of the message in bytes (excluding serial stream start sign)
92 static inline uint16_t mavlink_msg_video_stream_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
93 uint8_t stream_id, uint8_t count, uint8_t type, uint16_t flags, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, uint16_t hfov, const char *name, const char *uri)
95 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
96 char buf[MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN];
97 _mav_put_float(buf, 0, framerate);
98 _mav_put_uint32_t(buf, 4, bitrate);
99 _mav_put_uint16_t(buf, 8, flags);
100 _mav_put_uint16_t(buf, 10, resolution_h);
101 _mav_put_uint16_t(buf, 12, resolution_v);
102 _mav_put_uint16_t(buf, 14, rotation);
103 _mav_put_uint16_t(buf, 16, hfov);
104 _mav_put_uint8_t(buf, 18, stream_id);
105 _mav_put_uint8_t(buf, 19, count);
106 _mav_put_uint8_t(buf, 20, type);
107 _mav_put_char_array(buf, 21, name, 32);
108 _mav_put_char_array(buf, 53, uri, 160);
109 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
110 #else
111 mavlink_video_stream_information_t packet;
112 packet.framerate = framerate;
113 packet.bitrate = bitrate;
114 packet.flags = flags;
115 packet.resolution_h = resolution_h;
116 packet.resolution_v = resolution_v;
117 packet.rotation = rotation;
118 packet.hfov = hfov;
119 packet.stream_id = stream_id;
120 packet.count = count;
121 packet.type = type;
122 mav_array_memcpy(packet.name, name, sizeof(char)*32);
123 mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
124 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
125 #endif
127 msg->msgid = MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION;
128 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
132 * @brief Pack a video_stream_information message on a channel
133 * @param system_id ID of this system
134 * @param component_id ID of this component (e.g. 200 for IMU)
135 * @param chan The MAVLink channel this message will be sent over
136 * @param msg The MAVLink message to compress the data into
137 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
138 * @param count Number of streams available.
139 * @param type Type of stream.
140 * @param flags Bitmap of stream status flags.
141 * @param framerate [Hz] Frame rate.
142 * @param resolution_h [pix] Horizontal resolution.
143 * @param resolution_v [pix] Vertical resolution.
144 * @param bitrate [bits/s] Bit rate.
145 * @param rotation [deg] Video image rotation clockwise.
146 * @param hfov [deg] Horizontal Field of view.
147 * @param name Stream name.
148 * @param uri Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
149 * @return length of the message in bytes (excluding serial stream start sign)
151 static inline uint16_t mavlink_msg_video_stream_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
152 mavlink_message_t* msg,
153 uint8_t stream_id,uint8_t count,uint8_t type,uint16_t flags,float framerate,uint16_t resolution_h,uint16_t resolution_v,uint32_t bitrate,uint16_t rotation,uint16_t hfov,const char *name,const char *uri)
155 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
156 char buf[MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN];
157 _mav_put_float(buf, 0, framerate);
158 _mav_put_uint32_t(buf, 4, bitrate);
159 _mav_put_uint16_t(buf, 8, flags);
160 _mav_put_uint16_t(buf, 10, resolution_h);
161 _mav_put_uint16_t(buf, 12, resolution_v);
162 _mav_put_uint16_t(buf, 14, rotation);
163 _mav_put_uint16_t(buf, 16, hfov);
164 _mav_put_uint8_t(buf, 18, stream_id);
165 _mav_put_uint8_t(buf, 19, count);
166 _mav_put_uint8_t(buf, 20, type);
167 _mav_put_char_array(buf, 21, name, 32);
168 _mav_put_char_array(buf, 53, uri, 160);
169 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
170 #else
171 mavlink_video_stream_information_t packet;
172 packet.framerate = framerate;
173 packet.bitrate = bitrate;
174 packet.flags = flags;
175 packet.resolution_h = resolution_h;
176 packet.resolution_v = resolution_v;
177 packet.rotation = rotation;
178 packet.hfov = hfov;
179 packet.stream_id = stream_id;
180 packet.count = count;
181 packet.type = type;
182 mav_array_memcpy(packet.name, name, sizeof(char)*32);
183 mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
184 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
185 #endif
187 msg->msgid = MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION;
188 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
192 * @brief Encode a video_stream_information struct
194 * @param system_id ID of this system
195 * @param component_id ID of this component (e.g. 200 for IMU)
196 * @param msg The MAVLink message to compress the data into
197 * @param video_stream_information C-struct to read the message contents from
199 static inline uint16_t mavlink_msg_video_stream_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_video_stream_information_t* video_stream_information)
201 return mavlink_msg_video_stream_information_pack(system_id, component_id, msg, video_stream_information->stream_id, video_stream_information->count, video_stream_information->type, video_stream_information->flags, video_stream_information->framerate, video_stream_information->resolution_h, video_stream_information->resolution_v, video_stream_information->bitrate, video_stream_information->rotation, video_stream_information->hfov, video_stream_information->name, video_stream_information->uri);
205 * @brief Encode a video_stream_information struct on a channel
207 * @param system_id ID of this system
208 * @param component_id ID of this component (e.g. 200 for IMU)
209 * @param chan The MAVLink channel this message will be sent over
210 * @param msg The MAVLink message to compress the data into
211 * @param video_stream_information C-struct to read the message contents from
213 static inline uint16_t mavlink_msg_video_stream_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_video_stream_information_t* video_stream_information)
215 return mavlink_msg_video_stream_information_pack_chan(system_id, component_id, chan, msg, video_stream_information->stream_id, video_stream_information->count, video_stream_information->type, video_stream_information->flags, video_stream_information->framerate, video_stream_information->resolution_h, video_stream_information->resolution_v, video_stream_information->bitrate, video_stream_information->rotation, video_stream_information->hfov, video_stream_information->name, video_stream_information->uri);
219 * @brief Send a video_stream_information message
220 * @param chan MAVLink channel to send the message
222 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
223 * @param count Number of streams available.
224 * @param type Type of stream.
225 * @param flags Bitmap of stream status flags.
226 * @param framerate [Hz] Frame rate.
227 * @param resolution_h [pix] Horizontal resolution.
228 * @param resolution_v [pix] Vertical resolution.
229 * @param bitrate [bits/s] Bit rate.
230 * @param rotation [deg] Video image rotation clockwise.
231 * @param hfov [deg] Horizontal Field of view.
232 * @param name Stream name.
233 * @param uri Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
235 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
237 static inline void mavlink_msg_video_stream_information_send(mavlink_channel_t chan, uint8_t stream_id, uint8_t count, uint8_t type, uint16_t flags, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, uint16_t hfov, const char *name, const char *uri)
239 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
240 char buf[MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN];
241 _mav_put_float(buf, 0, framerate);
242 _mav_put_uint32_t(buf, 4, bitrate);
243 _mav_put_uint16_t(buf, 8, flags);
244 _mav_put_uint16_t(buf, 10, resolution_h);
245 _mav_put_uint16_t(buf, 12, resolution_v);
246 _mav_put_uint16_t(buf, 14, rotation);
247 _mav_put_uint16_t(buf, 16, hfov);
248 _mav_put_uint8_t(buf, 18, stream_id);
249 _mav_put_uint8_t(buf, 19, count);
250 _mav_put_uint8_t(buf, 20, type);
251 _mav_put_char_array(buf, 21, name, 32);
252 _mav_put_char_array(buf, 53, uri, 160);
253 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION, buf, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
254 #else
255 mavlink_video_stream_information_t packet;
256 packet.framerate = framerate;
257 packet.bitrate = bitrate;
258 packet.flags = flags;
259 packet.resolution_h = resolution_h;
260 packet.resolution_v = resolution_v;
261 packet.rotation = rotation;
262 packet.hfov = hfov;
263 packet.stream_id = stream_id;
264 packet.count = count;
265 packet.type = type;
266 mav_array_memcpy(packet.name, name, sizeof(char)*32);
267 mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
268 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
269 #endif
273 * @brief Send a video_stream_information message
274 * @param chan MAVLink channel to send the message
275 * @param struct The MAVLink struct to serialize
277 static inline void mavlink_msg_video_stream_information_send_struct(mavlink_channel_t chan, const mavlink_video_stream_information_t* video_stream_information)
279 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
280 mavlink_msg_video_stream_information_send(chan, video_stream_information->stream_id, video_stream_information->count, video_stream_information->type, video_stream_information->flags, video_stream_information->framerate, video_stream_information->resolution_h, video_stream_information->resolution_v, video_stream_information->bitrate, video_stream_information->rotation, video_stream_information->hfov, video_stream_information->name, video_stream_information->uri);
281 #else
282 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION, (const char *)video_stream_information, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
283 #endif
286 #if MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
288 This varient of _send() can be used to save stack space by re-using
289 memory from the receive buffer. The caller provides a
290 mavlink_message_t which is the size of a full mavlink message. This
291 is usually the receive buffer for the channel, and allows a reply to an
292 incoming message with minimum stack space usage.
294 static inline void mavlink_msg_video_stream_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t stream_id, uint8_t count, uint8_t type, uint16_t flags, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, uint16_t hfov, const char *name, const char *uri)
296 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
297 char *buf = (char *)msgbuf;
298 _mav_put_float(buf, 0, framerate);
299 _mav_put_uint32_t(buf, 4, bitrate);
300 _mav_put_uint16_t(buf, 8, flags);
301 _mav_put_uint16_t(buf, 10, resolution_h);
302 _mav_put_uint16_t(buf, 12, resolution_v);
303 _mav_put_uint16_t(buf, 14, rotation);
304 _mav_put_uint16_t(buf, 16, hfov);
305 _mav_put_uint8_t(buf, 18, stream_id);
306 _mav_put_uint8_t(buf, 19, count);
307 _mav_put_uint8_t(buf, 20, type);
308 _mav_put_char_array(buf, 21, name, 32);
309 _mav_put_char_array(buf, 53, uri, 160);
310 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION, buf, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
311 #else
312 mavlink_video_stream_information_t *packet = (mavlink_video_stream_information_t *)msgbuf;
313 packet->framerate = framerate;
314 packet->bitrate = bitrate;
315 packet->flags = flags;
316 packet->resolution_h = resolution_h;
317 packet->resolution_v = resolution_v;
318 packet->rotation = rotation;
319 packet->hfov = hfov;
320 packet->stream_id = stream_id;
321 packet->count = count;
322 packet->type = type;
323 mav_array_memcpy(packet->name, name, sizeof(char)*32);
324 mav_array_memcpy(packet->uri, uri, sizeof(char)*160);
325 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
326 #endif
328 #endif
330 #endif
332 // MESSAGE VIDEO_STREAM_INFORMATION UNPACKING
336 * @brief Get field stream_id from video_stream_information message
338 * @return Video Stream ID (1 for first, 2 for second, etc.)
340 static inline uint8_t mavlink_msg_video_stream_information_get_stream_id(const mavlink_message_t* msg)
342 return _MAV_RETURN_uint8_t(msg, 18);
346 * @brief Get field count from video_stream_information message
348 * @return Number of streams available.
350 static inline uint8_t mavlink_msg_video_stream_information_get_count(const mavlink_message_t* msg)
352 return _MAV_RETURN_uint8_t(msg, 19);
356 * @brief Get field type from video_stream_information message
358 * @return Type of stream.
360 static inline uint8_t mavlink_msg_video_stream_information_get_type(const mavlink_message_t* msg)
362 return _MAV_RETURN_uint8_t(msg, 20);
366 * @brief Get field flags from video_stream_information message
368 * @return Bitmap of stream status flags.
370 static inline uint16_t mavlink_msg_video_stream_information_get_flags(const mavlink_message_t* msg)
372 return _MAV_RETURN_uint16_t(msg, 8);
376 * @brief Get field framerate from video_stream_information message
378 * @return [Hz] Frame rate.
380 static inline float mavlink_msg_video_stream_information_get_framerate(const mavlink_message_t* msg)
382 return _MAV_RETURN_float(msg, 0);
386 * @brief Get field resolution_h from video_stream_information message
388 * @return [pix] Horizontal resolution.
390 static inline uint16_t mavlink_msg_video_stream_information_get_resolution_h(const mavlink_message_t* msg)
392 return _MAV_RETURN_uint16_t(msg, 10);
396 * @brief Get field resolution_v from video_stream_information message
398 * @return [pix] Vertical resolution.
400 static inline uint16_t mavlink_msg_video_stream_information_get_resolution_v(const mavlink_message_t* msg)
402 return _MAV_RETURN_uint16_t(msg, 12);
406 * @brief Get field bitrate from video_stream_information message
408 * @return [bits/s] Bit rate.
410 static inline uint32_t mavlink_msg_video_stream_information_get_bitrate(const mavlink_message_t* msg)
412 return _MAV_RETURN_uint32_t(msg, 4);
416 * @brief Get field rotation from video_stream_information message
418 * @return [deg] Video image rotation clockwise.
420 static inline uint16_t mavlink_msg_video_stream_information_get_rotation(const mavlink_message_t* msg)
422 return _MAV_RETURN_uint16_t(msg, 14);
426 * @brief Get field hfov from video_stream_information message
428 * @return [deg] Horizontal Field of view.
430 static inline uint16_t mavlink_msg_video_stream_information_get_hfov(const mavlink_message_t* msg)
432 return _MAV_RETURN_uint16_t(msg, 16);
436 * @brief Get field name from video_stream_information message
438 * @return Stream name.
440 static inline uint16_t mavlink_msg_video_stream_information_get_name(const mavlink_message_t* msg, char *name)
442 return _MAV_RETURN_char_array(msg, name, 32, 21);
446 * @brief Get field uri from video_stream_information message
448 * @return Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
450 static inline uint16_t mavlink_msg_video_stream_information_get_uri(const mavlink_message_t* msg, char *uri)
452 return _MAV_RETURN_char_array(msg, uri, 160, 53);
456 * @brief Decode a video_stream_information message into a struct
458 * @param msg The message to decode
459 * @param video_stream_information C-struct to decode the message contents into
461 static inline void mavlink_msg_video_stream_information_decode(const mavlink_message_t* msg, mavlink_video_stream_information_t* video_stream_information)
463 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
464 video_stream_information->framerate = mavlink_msg_video_stream_information_get_framerate(msg);
465 video_stream_information->bitrate = mavlink_msg_video_stream_information_get_bitrate(msg);
466 video_stream_information->flags = mavlink_msg_video_stream_information_get_flags(msg);
467 video_stream_information->resolution_h = mavlink_msg_video_stream_information_get_resolution_h(msg);
468 video_stream_information->resolution_v = mavlink_msg_video_stream_information_get_resolution_v(msg);
469 video_stream_information->rotation = mavlink_msg_video_stream_information_get_rotation(msg);
470 video_stream_information->hfov = mavlink_msg_video_stream_information_get_hfov(msg);
471 video_stream_information->stream_id = mavlink_msg_video_stream_information_get_stream_id(msg);
472 video_stream_information->count = mavlink_msg_video_stream_information_get_count(msg);
473 video_stream_information->type = mavlink_msg_video_stream_information_get_type(msg);
474 mavlink_msg_video_stream_information_get_name(msg, video_stream_information->name);
475 mavlink_msg_video_stream_information_get_uri(msg, video_stream_information->uri);
476 #else
477 uint8_t len = msg->len < MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN;
478 memset(video_stream_information, 0, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
479 memcpy(video_stream_information, _MAV_PAYLOAD(msg), len);
480 #endif