Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_video_stream_information.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE VIDEO_STREAM_INFORMATION PACKING
3
4#define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION 269
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 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 uint8_t encoding; /*< Encoding of stream.*/
21 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).*/
22} mavlink_video_stream_information_t;
23
24#define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN 215
25#define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN 213
26#define MAVLINK_MSG_ID_269_LEN 215
27#define MAVLINK_MSG_ID_269_MIN_LEN 213
28
29#define MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC 109
30#define MAVLINK_MSG_ID_269_CRC 109
31
32#define MAVLINK_MSG_VIDEO_STREAM_INFORMATION_FIELD_NAME_LEN 32
33#define MAVLINK_MSG_VIDEO_STREAM_INFORMATION_FIELD_URI_LEN 160
34
35#if MAVLINK_COMMAND_24BIT
36#define MAVLINK_MESSAGE_INFO_VIDEO_STREAM_INFORMATION {
37 269,
38 "VIDEO_STREAM_INFORMATION",
39 14,
40 { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_video_stream_information_t, stream_id) },
41 { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_video_stream_information_t, count) },
42 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_video_stream_information_t, type) },
43 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_video_stream_information_t, flags) },
44 { "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_video_stream_information_t, framerate) },
45 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_video_stream_information_t, resolution_h) },
46 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_video_stream_information_t, resolution_v) },
47 { "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_video_stream_information_t, bitrate) },
48 { "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_video_stream_information_t, rotation) },
49 { "hfov", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_video_stream_information_t, hfov) },
50 { "name", NULL, MAVLINK_TYPE_CHAR, 32, 21, offsetof(mavlink_video_stream_information_t, name) },
51 { "uri", NULL, MAVLINK_TYPE_CHAR, 160, 53, offsetof(mavlink_video_stream_information_t, uri) },
52 { "encoding", NULL, MAVLINK_TYPE_UINT8_T, 0, 213, offsetof(mavlink_video_stream_information_t, encoding) },
53 { "camera_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 214, offsetof(mavlink_video_stream_information_t, camera_device_id) },
54 } \
55}
56#else
57#define MAVLINK_MESSAGE_INFO_VIDEO_STREAM_INFORMATION {
58 "VIDEO_STREAM_INFORMATION",
59 14,
60 { { "stream_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_video_stream_information_t, stream_id) },
61 { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_video_stream_information_t, count) },
62 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_video_stream_information_t, type) },
63 { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_video_stream_information_t, flags) },
64 { "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_video_stream_information_t, framerate) },
65 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_video_stream_information_t, resolution_h) },
66 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_video_stream_information_t, resolution_v) },
67 { "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_video_stream_information_t, bitrate) },
68 { "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_video_stream_information_t, rotation) },
69 { "hfov", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_video_stream_information_t, hfov) },
70 { "name", NULL, MAVLINK_TYPE_CHAR, 32, 21, offsetof(mavlink_video_stream_information_t, name) },
71 { "uri", NULL, MAVLINK_TYPE_CHAR, 160, 53, offsetof(mavlink_video_stream_information_t, uri) },
72 { "encoding", NULL, MAVLINK_TYPE_UINT8_T, 0, 213, offsetof(mavlink_video_stream_information_t, encoding) },
73 { "camera_device_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 214, offsetof(mavlink_video_stream_information_t, camera_device_id) },
74 } \
75}
76#endif
77
78/**
79 * @brief Pack a video_stream_information message
80 * @param system_id ID of this system
81 * @param component_id ID of this component (e.g. 200 for IMU)
82 * @param msg The MAVLink message to compress the data into
83 *
84 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
85 * @param count Number of streams available.
86 * @param type Type of stream.
87 * @param flags Bitmap of stream status flags.
88 * @param framerate [Hz] Frame rate.
89 * @param resolution_h [pix] Horizontal resolution.
90 * @param resolution_v [pix] Vertical resolution.
91 * @param bitrate [bits/s] Bit rate.
92 * @param rotation [deg] Video image rotation clockwise.
93 * @param hfov [deg] Horizontal Field of view.
94 * @param name Stream name.
95 * @param uri Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
96 * @param encoding Encoding of stream.
97 * @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).
98 * @return length of the message in bytes (excluding serial stream start sign)
99 */
100static inline uint16_t mavlink_msg_video_stream_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
101 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, uint8_t encoding, uint8_t camera_device_id)
102{
103#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
105 _mav_put_float(buf, 0, framerate);
106 _mav_put_uint32_t(buf, 4, bitrate);
107 _mav_put_uint16_t(buf, 8, flags);
108 _mav_put_uint16_t(buf, 10, resolution_h);
109 _mav_put_uint16_t(buf, 12, resolution_v);
110 _mav_put_uint16_t(buf, 14, rotation);
111 _mav_put_uint16_t(buf, 16, hfov);
112 _mav_put_uint8_t(buf, 18, stream_id);
113 _mav_put_uint8_t(buf, 19, count);
114 _mav_put_uint8_t(buf, 20, type);
115 _mav_put_uint8_t(buf, 213, encoding);
116 _mav_put_uint8_t(buf, 214, camera_device_id);
117 _mav_put_char_array(buf, 21, name, 32);
118 _mav_put_char_array(buf, 53, uri, 160);
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
120#else
121 mavlink_video_stream_information_t packet;
122 packet.framerate = framerate;
123 packet.bitrate = bitrate;
124 packet.flags = flags;
125 packet.resolution_h = resolution_h;
126 packet.resolution_v = resolution_v;
127 packet.rotation = rotation;
128 packet.hfov = hfov;
129 packet.stream_id = stream_id;
130 packet.count = count;
131 packet.type = type;
132 packet.encoding = encoding;
133 packet.camera_device_id = camera_device_id;
134 mav_array_memcpy(packet.name, name, sizeof(char)*32);
135 mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
136 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
137#endif
138
141}
142
143/**
144 * @brief Pack a video_stream_information message
145 * @param system_id ID of this system
146 * @param component_id ID of this component (e.g. 200 for IMU)
147 * @param status MAVLink status structure
148 * @param msg The MAVLink message to compress the data into
149 *
150 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
151 * @param count Number of streams available.
152 * @param type Type of stream.
153 * @param flags Bitmap of stream status flags.
154 * @param framerate [Hz] Frame rate.
155 * @param resolution_h [pix] Horizontal resolution.
156 * @param resolution_v [pix] Vertical resolution.
157 * @param bitrate [bits/s] Bit rate.
158 * @param rotation [deg] Video image rotation clockwise.
159 * @param hfov [deg] Horizontal Field of view.
160 * @param name Stream name.
161 * @param uri Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
162 * @param encoding Encoding of stream.
163 * @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).
164 * @return length of the message in bytes (excluding serial stream start sign)
165 */
166static inline uint16_t mavlink_msg_video_stream_information_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
167 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, uint8_t encoding, uint8_t camera_device_id)
168{
169#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 _mav_put_float(buf, 0, framerate);
172 _mav_put_uint32_t(buf, 4, bitrate);
173 _mav_put_uint16_t(buf, 8, flags);
174 _mav_put_uint16_t(buf, 10, resolution_h);
175 _mav_put_uint16_t(buf, 12, resolution_v);
176 _mav_put_uint16_t(buf, 14, rotation);
177 _mav_put_uint16_t(buf, 16, hfov);
178 _mav_put_uint8_t(buf, 18, stream_id);
179 _mav_put_uint8_t(buf, 19, count);
180 _mav_put_uint8_t(buf, 20, type);
181 _mav_put_uint8_t(buf, 213, encoding);
182 _mav_put_uint8_t(buf, 214, camera_device_id);
183 _mav_put_char_array(buf, 21, name, 32);
184 _mav_put_char_array(buf, 53, uri, 160);
185 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
186#else
187 mavlink_video_stream_information_t packet;
188 packet.framerate = framerate;
189 packet.bitrate = bitrate;
190 packet.flags = flags;
191 packet.resolution_h = resolution_h;
192 packet.resolution_v = resolution_v;
193 packet.rotation = rotation;
194 packet.hfov = hfov;
195 packet.stream_id = stream_id;
196 packet.count = count;
197 packet.type = type;
198 packet.encoding = encoding;
199 packet.camera_device_id = camera_device_id;
200 mav_array_memcpy(packet.name, name, sizeof(char)*32);
201 mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
202 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
203#endif
204
206#if MAVLINK_CRC_EXTRA
207 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_CRC);
208#else
209 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
210#endif
211}
212
213/**
214 * @brief Pack a video_stream_information message on a channel
215 * @param system_id ID of this system
216 * @param component_id ID of this component (e.g. 200 for IMU)
217 * @param chan The MAVLink channel this message will be sent over
218 * @param msg The MAVLink message to compress the data into
219 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
220 * @param count Number of streams available.
221 * @param type Type of stream.
222 * @param flags Bitmap of stream status flags.
223 * @param framerate [Hz] Frame rate.
224 * @param resolution_h [pix] Horizontal resolution.
225 * @param resolution_v [pix] Vertical resolution.
226 * @param bitrate [bits/s] Bit rate.
227 * @param rotation [deg] Video image rotation clockwise.
228 * @param hfov [deg] Horizontal Field of view.
229 * @param name Stream name.
230 * @param uri Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
231 * @param encoding Encoding of stream.
232 * @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).
233 * @return length of the message in bytes (excluding serial stream start sign)
234 */
235static inline uint16_t mavlink_msg_video_stream_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
236 mavlink_message_t* msg,
237 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,uint8_t encoding,uint8_t camera_device_id)
238{
239#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
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_uint8_t(buf, 213, encoding);
252 _mav_put_uint8_t(buf, 214, camera_device_id);
253 _mav_put_char_array(buf, 21, name, 32);
254 _mav_put_char_array(buf, 53, uri, 160);
255 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
256#else
257 mavlink_video_stream_information_t packet;
258 packet.framerate = framerate;
259 packet.bitrate = bitrate;
260 packet.flags = flags;
261 packet.resolution_h = resolution_h;
262 packet.resolution_v = resolution_v;
263 packet.rotation = rotation;
264 packet.hfov = hfov;
265 packet.stream_id = stream_id;
266 packet.count = count;
267 packet.type = type;
268 packet.encoding = encoding;
269 packet.camera_device_id = camera_device_id;
270 mav_array_memcpy(packet.name, name, sizeof(char)*32);
271 mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
272 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
273#endif
274
277}
278
279/**
280 * @brief Encode a video_stream_information struct
281 *
282 * @param system_id ID of this system
283 * @param component_id ID of this component (e.g. 200 for IMU)
284 * @param msg The MAVLink message to compress the data into
285 * @param video_stream_information C-struct to read the message contents from
286 */
287static 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)
288{
289 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, video_stream_information->encoding, video_stream_information->camera_device_id);
290}
291
292/**
293 * @brief Encode a video_stream_information struct on a channel
294 *
295 * @param system_id ID of this system
296 * @param component_id ID of this component (e.g. 200 for IMU)
297 * @param chan The MAVLink channel this message will be sent over
298 * @param msg The MAVLink message to compress the data into
299 * @param video_stream_information C-struct to read the message contents from
300 */
301static 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)
302{
303 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, video_stream_information->encoding, video_stream_information->camera_device_id);
304}
305
306/**
307 * @brief Encode a video_stream_information struct with provided status structure
308 *
309 * @param system_id ID of this system
310 * @param component_id ID of this component (e.g. 200 for IMU)
311 * @param status MAVLink status structure
312 * @param msg The MAVLink message to compress the data into
313 * @param video_stream_information C-struct to read the message contents from
314 */
315static inline uint16_t mavlink_msg_video_stream_information_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_video_stream_information_t* video_stream_information)
316{
317 return mavlink_msg_video_stream_information_pack_status(system_id, component_id, _status, 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, video_stream_information->encoding, video_stream_information->camera_device_id);
318}
319
320/**
321 * @brief Send a video_stream_information message
322 * @param chan MAVLink channel to send the message
323 *
324 * @param stream_id Video Stream ID (1 for first, 2 for second, etc.)
325 * @param count Number of streams available.
326 * @param type Type of stream.
327 * @param flags Bitmap of stream status flags.
328 * @param framerate [Hz] Frame rate.
329 * @param resolution_h [pix] Horizontal resolution.
330 * @param resolution_v [pix] Vertical resolution.
331 * @param bitrate [bits/s] Bit rate.
332 * @param rotation [deg] Video image rotation clockwise.
333 * @param hfov [deg] Horizontal Field of view.
334 * @param name Stream name.
335 * @param uri Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
336 * @param encoding Encoding of stream.
337 * @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).
338 */
339#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
340
341static 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, uint8_t encoding, uint8_t camera_device_id)
342{
343#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
344 char buf[MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN];
345 _mav_put_float(buf, 0, framerate);
346 _mav_put_uint32_t(buf, 4, bitrate);
347 _mav_put_uint16_t(buf, 8, flags);
348 _mav_put_uint16_t(buf, 10, resolution_h);
349 _mav_put_uint16_t(buf, 12, resolution_v);
350 _mav_put_uint16_t(buf, 14, rotation);
351 _mav_put_uint16_t(buf, 16, hfov);
352 _mav_put_uint8_t(buf, 18, stream_id);
353 _mav_put_uint8_t(buf, 19, count);
354 _mav_put_uint8_t(buf, 20, type);
355 _mav_put_uint8_t(buf, 213, encoding);
356 _mav_put_uint8_t(buf, 214, camera_device_id);
357 _mav_put_char_array(buf, 21, name, 32);
358 _mav_put_char_array(buf, 53, uri, 160);
359 _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);
360#else
361 mavlink_video_stream_information_t packet;
362 packet.framerate = framerate;
363 packet.bitrate = bitrate;
364 packet.flags = flags;
365 packet.resolution_h = resolution_h;
366 packet.resolution_v = resolution_v;
367 packet.rotation = rotation;
368 packet.hfov = hfov;
369 packet.stream_id = stream_id;
370 packet.count = count;
371 packet.type = type;
372 packet.encoding = encoding;
373 packet.camera_device_id = camera_device_id;
374 mav_array_memcpy(packet.name, name, sizeof(char)*32);
375 mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
376 _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);
377#endif
378}
379
380/**
381 * @brief Send a video_stream_information message
382 * @param chan MAVLink channel to send the message
383 * @param struct The MAVLink struct to serialize
384 */
385static inline void mavlink_msg_video_stream_information_send_struct(mavlink_channel_t chan, const mavlink_video_stream_information_t* video_stream_information)
386{
387#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
388 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, video_stream_information->encoding, video_stream_information->camera_device_id);
389#else
390 _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);
391#endif
392}
393
394#if MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
395/*
396 This variant of _send() can be used to save stack space by reusing
397 memory from the receive buffer. The caller provides a
398 mavlink_message_t which is the size of a full mavlink message. This
399 is usually the receive buffer for the channel, and allows a reply to an
400 incoming message with minimum stack space usage.
401 */
402static 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, uint8_t encoding, uint8_t camera_device_id)
403{
404#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
405 char *buf = (char *)msgbuf;
406 _mav_put_float(buf, 0, framerate);
407 _mav_put_uint32_t(buf, 4, bitrate);
408 _mav_put_uint16_t(buf, 8, flags);
409 _mav_put_uint16_t(buf, 10, resolution_h);
410 _mav_put_uint16_t(buf, 12, resolution_v);
411 _mav_put_uint16_t(buf, 14, rotation);
412 _mav_put_uint16_t(buf, 16, hfov);
413 _mav_put_uint8_t(buf, 18, stream_id);
414 _mav_put_uint8_t(buf, 19, count);
415 _mav_put_uint8_t(buf, 20, type);
416 _mav_put_uint8_t(buf, 213, encoding);
417 _mav_put_uint8_t(buf, 214, camera_device_id);
418 _mav_put_char_array(buf, 21, name, 32);
419 _mav_put_char_array(buf, 53, uri, 160);
420 _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);
421#else
422 mavlink_video_stream_information_t *packet = (mavlink_video_stream_information_t *)msgbuf;
423 packet->framerate = framerate;
424 packet->bitrate = bitrate;
425 packet->flags = flags;
426 packet->resolution_h = resolution_h;
427 packet->resolution_v = resolution_v;
428 packet->rotation = rotation;
429 packet->hfov = hfov;
430 packet->stream_id = stream_id;
431 packet->count = count;
432 packet->type = type;
433 packet->encoding = encoding;
434 packet->camera_device_id = camera_device_id;
435 mav_array_memcpy(packet->name, name, sizeof(char)*32);
436 mav_array_memcpy(packet->uri, uri, sizeof(char)*160);
437 _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);
438#endif
439}
440#endif
441
442#endif
443
444// MESSAGE VIDEO_STREAM_INFORMATION UNPACKING
445
446
447/**
448 * @brief Get field stream_id from video_stream_information message
449 *
450 * @return Video Stream ID (1 for first, 2 for second, etc.)
451 */
452static inline uint8_t mavlink_msg_video_stream_information_get_stream_id(const mavlink_message_t* msg)
453{
454 return _MAV_RETURN_uint8_t(msg, 18);
455}
456
457/**
458 * @brief Get field count from video_stream_information message
459 *
460 * @return Number of streams available.
461 */
462static inline uint8_t mavlink_msg_video_stream_information_get_count(const mavlink_message_t* msg)
463{
464 return _MAV_RETURN_uint8_t(msg, 19);
465}
466
467/**
468 * @brief Get field type from video_stream_information message
469 *
470 * @return Type of stream.
471 */
472static inline uint8_t mavlink_msg_video_stream_information_get_type(const mavlink_message_t* msg)
473{
474 return _MAV_RETURN_uint8_t(msg, 20);
475}
476
477/**
478 * @brief Get field flags from video_stream_information message
479 *
480 * @return Bitmap of stream status flags.
481 */
482static inline uint16_t mavlink_msg_video_stream_information_get_flags(const mavlink_message_t* msg)
483{
484 return _MAV_RETURN_uint16_t(msg, 8);
485}
486
487/**
488 * @brief Get field framerate from video_stream_information message
489 *
490 * @return [Hz] Frame rate.
491 */
492static inline float mavlink_msg_video_stream_information_get_framerate(const mavlink_message_t* msg)
493{
494 return _MAV_RETURN_float(msg, 0);
495}
496
497/**
498 * @brief Get field resolution_h from video_stream_information message
499 *
500 * @return [pix] Horizontal resolution.
501 */
502static inline uint16_t mavlink_msg_video_stream_information_get_resolution_h(const mavlink_message_t* msg)
503{
504 return _MAV_RETURN_uint16_t(msg, 10);
505}
506
507/**
508 * @brief Get field resolution_v from video_stream_information message
509 *
510 * @return [pix] Vertical resolution.
511 */
512static inline uint16_t mavlink_msg_video_stream_information_get_resolution_v(const mavlink_message_t* msg)
513{
514 return _MAV_RETURN_uint16_t(msg, 12);
515}
516
517/**
518 * @brief Get field bitrate from video_stream_information message
519 *
520 * @return [bits/s] Bit rate.
521 */
522static inline uint32_t mavlink_msg_video_stream_information_get_bitrate(const mavlink_message_t* msg)
523{
524 return _MAV_RETURN_uint32_t(msg, 4);
525}
526
527/**
528 * @brief Get field rotation from video_stream_information message
529 *
530 * @return [deg] Video image rotation clockwise.
531 */
532static inline uint16_t mavlink_msg_video_stream_information_get_rotation(const mavlink_message_t* msg)
533{
534 return _MAV_RETURN_uint16_t(msg, 14);
535}
536
537/**
538 * @brief Get field hfov from video_stream_information message
539 *
540 * @return [deg] Horizontal Field of view.
541 */
542static inline uint16_t mavlink_msg_video_stream_information_get_hfov(const mavlink_message_t* msg)
543{
544 return _MAV_RETURN_uint16_t(msg, 16);
545}
546
547/**
548 * @brief Get field name from video_stream_information message
549 *
550 * @return Stream name.
551 */
552static inline uint16_t mavlink_msg_video_stream_information_get_name(const mavlink_message_t* msg, char *name)
553{
554 return _MAV_RETURN_char_array(msg, name, 32, 21);
555}
556
557/**
558 * @brief Get field uri from video_stream_information message
559 *
560 * @return Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to).
561 */
562static inline uint16_t mavlink_msg_video_stream_information_get_uri(const mavlink_message_t* msg, char *uri)
563{
564 return _MAV_RETURN_char_array(msg, uri, 160, 53);
565}
566
567/**
568 * @brief Get field encoding from video_stream_information message
569 *
570 * @return Encoding of stream.
571 */
572static inline uint8_t mavlink_msg_video_stream_information_get_encoding(const mavlink_message_t* msg)
573{
574 return _MAV_RETURN_uint8_t(msg, 213);
575}
576
577/**
578 * @brief Get field camera_device_id from video_stream_information message
579 *
580 * @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).
581 */
582static inline uint8_t mavlink_msg_video_stream_information_get_camera_device_id(const mavlink_message_t* msg)
583{
584 return _MAV_RETURN_uint8_t(msg, 214);
585}
586
587/**
588 * @brief Decode a video_stream_information message into a struct
589 *
590 * @param msg The message to decode
591 * @param video_stream_information C-struct to decode the message contents into
592 */
593static inline void mavlink_msg_video_stream_information_decode(const mavlink_message_t* msg, mavlink_video_stream_information_t* video_stream_information)
594{
595#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
596 video_stream_information->framerate = mavlink_msg_video_stream_information_get_framerate(msg);
597 video_stream_information->bitrate = mavlink_msg_video_stream_information_get_bitrate(msg);
598 video_stream_information->flags = mavlink_msg_video_stream_information_get_flags(msg);
599 video_stream_information->resolution_h = mavlink_msg_video_stream_information_get_resolution_h(msg);
600 video_stream_information->resolution_v = mavlink_msg_video_stream_information_get_resolution_v(msg);
601 video_stream_information->rotation = mavlink_msg_video_stream_information_get_rotation(msg);
602 video_stream_information->hfov = mavlink_msg_video_stream_information_get_hfov(msg);
603 video_stream_information->stream_id = mavlink_msg_video_stream_information_get_stream_id(msg);
604 video_stream_information->count = mavlink_msg_video_stream_information_get_count(msg);
605 video_stream_information->type = mavlink_msg_video_stream_information_get_type(msg);
606 mavlink_msg_video_stream_information_get_name(msg, video_stream_information->name);
607 mavlink_msg_video_stream_information_get_uri(msg, video_stream_information->uri);
608 video_stream_information->encoding = mavlink_msg_video_stream_information_get_encoding(msg);
609 video_stream_information->camera_device_id = mavlink_msg_video_stream_information_get_camera_device_id(msg);
610#else
611 uint8_t len = msg->len < MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN;
612 memset(video_stream_information, 0, MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_LEN);
613 memcpy(video_stream_information, _MAV_PAYLOAD(msg), len);
614#endif
615}