Files
c_library_v2/common/mavlink_msg_set_video_stream_settings.h
T

406 lines
21 KiB
C
Raw Normal View History

#pragma once
// MESSAGE SET_VIDEO_STREAM_SETTINGS PACKING
#define MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS 270
MAVPACKED(
typedef struct __mavlink_set_video_stream_settings_t {
2018-08-07 10:12:17 +08:00
float framerate; /*< [Hz] Frame rate (set to -1 for highest framerate possible)*/
uint32_t bitrate; /*< [bits/s] Bit rate (set to -1 for auto)*/
uint16_t resolution_h; /*< [pix] Horizontal resolution (set to -1 for highest resolution possible)*/
uint16_t resolution_v; /*< [pix] Vertical resolution (set to -1 for highest resolution possible)*/
2018-06-03 17:07:10 +08:00
uint16_t rotation; /*< [deg] Video image rotation clockwise (0-359 degrees)*/
uint8_t target_system; /*< system ID of the target*/
uint8_t target_component; /*< component ID of the target*/
2018-12-06 01:31:47 +08:00
uint8_t camera_id; /*< Stream ID (1 for first, 2 for second, etc.)*/
char uri[160]; /*< Video stream URI (mostly for UDP/RTP)*/
}) mavlink_set_video_stream_settings_t;
2018-12-06 01:31:47 +08:00
#define MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN 177
#define MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN 177
#define MAVLINK_MSG_ID_270_LEN 177
#define MAVLINK_MSG_ID_270_MIN_LEN 177
2018-12-06 01:31:47 +08:00
#define MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC 253
#define MAVLINK_MSG_ID_270_CRC 253
2018-12-06 01:31:47 +08:00
#define MAVLINK_MSG_SET_VIDEO_STREAM_SETTINGS_FIELD_URI_LEN 160
#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_SET_VIDEO_STREAM_SETTINGS { \
270, \
"SET_VIDEO_STREAM_SETTINGS", \
9, \
2017-09-11 17:32:44 +08:00
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_set_video_stream_settings_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_set_video_stream_settings_t, target_component) }, \
{ "camera_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_set_video_stream_settings_t, camera_id) }, \
{ "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_set_video_stream_settings_t, framerate) }, \
{ "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_set_video_stream_settings_t, resolution_h) }, \
{ "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_set_video_stream_settings_t, resolution_v) }, \
2017-09-11 17:32:44 +08:00
{ "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_set_video_stream_settings_t, bitrate) }, \
{ "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_set_video_stream_settings_t, rotation) }, \
2018-12-06 01:31:47 +08:00
{ "uri", NULL, MAVLINK_TYPE_CHAR, 160, 17, offsetof(mavlink_set_video_stream_settings_t, uri) }, \
} \
}
#else
#define MAVLINK_MESSAGE_INFO_SET_VIDEO_STREAM_SETTINGS { \
"SET_VIDEO_STREAM_SETTINGS", \
9, \
2017-09-11 17:32:44 +08:00
{ { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_set_video_stream_settings_t, target_system) }, \
{ "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_set_video_stream_settings_t, target_component) }, \
{ "camera_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_set_video_stream_settings_t, camera_id) }, \
{ "framerate", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_set_video_stream_settings_t, framerate) }, \
{ "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_set_video_stream_settings_t, resolution_h) }, \
{ "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_set_video_stream_settings_t, resolution_v) }, \
2017-09-11 17:32:44 +08:00
{ "bitrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_set_video_stream_settings_t, bitrate) }, \
{ "rotation", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_set_video_stream_settings_t, rotation) }, \
2018-12-06 01:31:47 +08:00
{ "uri", NULL, MAVLINK_TYPE_CHAR, 160, 17, offsetof(mavlink_set_video_stream_settings_t, uri) }, \
} \
}
#endif
/**
* @brief Pack a set_video_stream_settings message
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
*
2018-06-03 17:07:10 +08:00
* @param target_system system ID of the target
* @param target_component component ID of the target
2018-12-06 01:31:47 +08:00
* @param camera_id Stream ID (1 for first, 2 for second, etc.)
2018-08-07 10:12:17 +08:00
* @param framerate [Hz] Frame rate (set to -1 for highest framerate possible)
* @param resolution_h [pix] Horizontal resolution (set to -1 for highest resolution possible)
* @param resolution_v [pix] Vertical resolution (set to -1 for highest resolution possible)
* @param bitrate [bits/s] Bit rate (set to -1 for auto)
2018-06-03 17:07:10 +08:00
* @param rotation [deg] Video image rotation clockwise (0-359 degrees)
2018-12-06 01:31:47 +08:00
* @param uri Video stream URI (mostly for UDP/RTP)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint8_t target_system, uint8_t target_component, uint8_t camera_id, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, const char *uri)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN];
_mav_put_float(buf, 0, framerate);
_mav_put_uint32_t(buf, 4, bitrate);
_mav_put_uint16_t(buf, 8, resolution_h);
_mav_put_uint16_t(buf, 10, resolution_v);
_mav_put_uint16_t(buf, 12, rotation);
_mav_put_uint8_t(buf, 14, target_system);
_mav_put_uint8_t(buf, 15, target_component);
_mav_put_uint8_t(buf, 16, camera_id);
2018-12-06 01:31:47 +08:00
_mav_put_char_array(buf, 17, uri, 160);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN);
#else
mavlink_set_video_stream_settings_t packet;
packet.framerate = framerate;
packet.bitrate = bitrate;
packet.resolution_h = resolution_h;
packet.resolution_v = resolution_v;
packet.rotation = rotation;
packet.target_system = target_system;
packet.target_component = target_component;
packet.camera_id = camera_id;
2018-12-06 01:31:47 +08:00
mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS;
return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC);
}
/**
* @brief Pack a set_video_stream_settings message on a channel
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
2018-06-03 17:07:10 +08:00
* @param target_system system ID of the target
* @param target_component component ID of the target
2018-12-06 01:31:47 +08:00
* @param camera_id Stream ID (1 for first, 2 for second, etc.)
2018-08-07 10:12:17 +08:00
* @param framerate [Hz] Frame rate (set to -1 for highest framerate possible)
* @param resolution_h [pix] Horizontal resolution (set to -1 for highest resolution possible)
* @param resolution_v [pix] Vertical resolution (set to -1 for highest resolution possible)
* @param bitrate [bits/s] Bit rate (set to -1 for auto)
2018-06-03 17:07:10 +08:00
* @param rotation [deg] Video image rotation clockwise (0-359 degrees)
2018-12-06 01:31:47 +08:00
* @param uri Video stream URI (mostly for UDP/RTP)
* @return length of the message in bytes (excluding serial stream start sign)
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg,
uint8_t target_system,uint8_t target_component,uint8_t camera_id,float framerate,uint16_t resolution_h,uint16_t resolution_v,uint32_t bitrate,uint16_t rotation,const char *uri)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN];
_mav_put_float(buf, 0, framerate);
_mav_put_uint32_t(buf, 4, bitrate);
_mav_put_uint16_t(buf, 8, resolution_h);
_mav_put_uint16_t(buf, 10, resolution_v);
_mav_put_uint16_t(buf, 12, rotation);
_mav_put_uint8_t(buf, 14, target_system);
_mav_put_uint8_t(buf, 15, target_component);
_mav_put_uint8_t(buf, 16, camera_id);
2018-12-06 01:31:47 +08:00
_mav_put_char_array(buf, 17, uri, 160);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN);
#else
mavlink_set_video_stream_settings_t packet;
packet.framerate = framerate;
packet.bitrate = bitrate;
packet.resolution_h = resolution_h;
packet.resolution_v = resolution_v;
packet.rotation = rotation;
packet.target_system = target_system;
packet.target_component = target_component;
packet.camera_id = camera_id;
2018-12-06 01:31:47 +08:00
mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN);
#endif
msg->msgid = MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC);
}
/**
* @brief Encode a set_video_stream_settings struct
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into
* @param set_video_stream_settings C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_video_stream_settings_t* set_video_stream_settings)
{
return mavlink_msg_set_video_stream_settings_pack(system_id, component_id, msg, set_video_stream_settings->target_system, set_video_stream_settings->target_component, set_video_stream_settings->camera_id, set_video_stream_settings->framerate, set_video_stream_settings->resolution_h, set_video_stream_settings->resolution_v, set_video_stream_settings->bitrate, set_video_stream_settings->rotation, set_video_stream_settings->uri);
}
/**
* @brief Encode a set_video_stream_settings struct on a channel
*
* @param system_id ID of this system
* @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message will be sent over
* @param msg The MAVLink message to compress the data into
* @param set_video_stream_settings C-struct to read the message contents from
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_video_stream_settings_t* set_video_stream_settings)
{
return mavlink_msg_set_video_stream_settings_pack_chan(system_id, component_id, chan, msg, set_video_stream_settings->target_system, set_video_stream_settings->target_component, set_video_stream_settings->camera_id, set_video_stream_settings->framerate, set_video_stream_settings->resolution_h, set_video_stream_settings->resolution_v, set_video_stream_settings->bitrate, set_video_stream_settings->rotation, set_video_stream_settings->uri);
}
/**
* @brief Send a set_video_stream_settings message
* @param chan MAVLink channel to send the message
*
2018-06-03 17:07:10 +08:00
* @param target_system system ID of the target
* @param target_component component ID of the target
2018-12-06 01:31:47 +08:00
* @param camera_id Stream ID (1 for first, 2 for second, etc.)
2018-08-07 10:12:17 +08:00
* @param framerate [Hz] Frame rate (set to -1 for highest framerate possible)
* @param resolution_h [pix] Horizontal resolution (set to -1 for highest resolution possible)
* @param resolution_v [pix] Vertical resolution (set to -1 for highest resolution possible)
* @param bitrate [bits/s] Bit rate (set to -1 for auto)
2018-06-03 17:07:10 +08:00
* @param rotation [deg] Video image rotation clockwise (0-359 degrees)
2018-12-06 01:31:47 +08:00
* @param uri Video stream URI (mostly for UDP/RTP)
*/
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_set_video_stream_settings_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t camera_id, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, const char *uri)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN];
_mav_put_float(buf, 0, framerate);
_mav_put_uint32_t(buf, 4, bitrate);
_mav_put_uint16_t(buf, 8, resolution_h);
_mav_put_uint16_t(buf, 10, resolution_v);
_mav_put_uint16_t(buf, 12, rotation);
_mav_put_uint8_t(buf, 14, target_system);
_mav_put_uint8_t(buf, 15, target_component);
_mav_put_uint8_t(buf, 16, camera_id);
2018-12-06 01:31:47 +08:00
_mav_put_char_array(buf, 17, uri, 160);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS, buf, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC);
#else
mavlink_set_video_stream_settings_t packet;
packet.framerate = framerate;
packet.bitrate = bitrate;
packet.resolution_h = resolution_h;
packet.resolution_v = resolution_v;
packet.rotation = rotation;
packet.target_system = target_system;
packet.target_component = target_component;
packet.camera_id = camera_id;
2018-12-06 01:31:47 +08:00
mav_array_memcpy(packet.uri, uri, sizeof(char)*160);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS, (const char *)&packet, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC);
#endif
}
/**
* @brief Send a set_video_stream_settings message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_set_video_stream_settings_send_struct(mavlink_channel_t chan, const mavlink_set_video_stream_settings_t* set_video_stream_settings)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_set_video_stream_settings_send(chan, set_video_stream_settings->target_system, set_video_stream_settings->target_component, set_video_stream_settings->camera_id, set_video_stream_settings->framerate, set_video_stream_settings->resolution_h, set_video_stream_settings->resolution_v, set_video_stream_settings->bitrate, set_video_stream_settings->rotation, set_video_stream_settings->uri);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS, (const char *)set_video_stream_settings, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC);
#endif
}
#if MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
This varient of _send() can be used to save stack space by re-using
memory from the receive buffer. The caller provides a
mavlink_message_t which is the size of a full mavlink message. This
is usually the receive buffer for the channel, and allows a reply to an
incoming message with minimum stack space usage.
*/
static inline void mavlink_msg_set_video_stream_settings_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t camera_id, float framerate, uint16_t resolution_h, uint16_t resolution_v, uint32_t bitrate, uint16_t rotation, const char *uri)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char *buf = (char *)msgbuf;
_mav_put_float(buf, 0, framerate);
_mav_put_uint32_t(buf, 4, bitrate);
_mav_put_uint16_t(buf, 8, resolution_h);
_mav_put_uint16_t(buf, 10, resolution_v);
_mav_put_uint16_t(buf, 12, rotation);
_mav_put_uint8_t(buf, 14, target_system);
_mav_put_uint8_t(buf, 15, target_component);
_mav_put_uint8_t(buf, 16, camera_id);
2018-12-06 01:31:47 +08:00
_mav_put_char_array(buf, 17, uri, 160);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS, buf, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC);
#else
mavlink_set_video_stream_settings_t *packet = (mavlink_set_video_stream_settings_t *)msgbuf;
packet->framerate = framerate;
packet->bitrate = bitrate;
packet->resolution_h = resolution_h;
packet->resolution_v = resolution_v;
packet->rotation = rotation;
packet->target_system = target_system;
packet->target_component = target_component;
packet->camera_id = camera_id;
2018-12-06 01:31:47 +08:00
mav_array_memcpy(packet->uri, uri, sizeof(char)*160);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS, (const char *)packet, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_MIN_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_CRC);
#endif
}
#endif
#endif
// MESSAGE SET_VIDEO_STREAM_SETTINGS UNPACKING
/**
* @brief Get field target_system from set_video_stream_settings message
*
2018-06-03 17:07:10 +08:00
* @return system ID of the target
*/
static inline uint8_t mavlink_msg_set_video_stream_settings_get_target_system(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 14);
}
/**
* @brief Get field target_component from set_video_stream_settings message
*
2018-06-03 17:07:10 +08:00
* @return component ID of the target
*/
static inline uint8_t mavlink_msg_set_video_stream_settings_get_target_component(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 15);
}
/**
* @brief Get field camera_id from set_video_stream_settings message
*
2018-12-06 01:31:47 +08:00
* @return Stream ID (1 for first, 2 for second, etc.)
*/
static inline uint8_t mavlink_msg_set_video_stream_settings_get_camera_id(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint8_t(msg, 16);
}
/**
* @brief Get field framerate from set_video_stream_settings message
*
2018-08-07 10:12:17 +08:00
* @return [Hz] Frame rate (set to -1 for highest framerate possible)
*/
static inline float mavlink_msg_set_video_stream_settings_get_framerate(const mavlink_message_t* msg)
{
return _MAV_RETURN_float(msg, 0);
}
/**
* @brief Get field resolution_h from set_video_stream_settings message
*
2018-08-07 10:12:17 +08:00
* @return [pix] Horizontal resolution (set to -1 for highest resolution possible)
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_get_resolution_h(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 8);
}
/**
* @brief Get field resolution_v from set_video_stream_settings message
*
2018-08-07 10:12:17 +08:00
* @return [pix] Vertical resolution (set to -1 for highest resolution possible)
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_get_resolution_v(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 10);
}
/**
* @brief Get field bitrate from set_video_stream_settings message
*
2018-08-07 10:12:17 +08:00
* @return [bits/s] Bit rate (set to -1 for auto)
*/
static inline uint32_t mavlink_msg_set_video_stream_settings_get_bitrate(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint32_t(msg, 4);
}
/**
* @brief Get field rotation from set_video_stream_settings message
*
2018-06-03 17:07:10 +08:00
* @return [deg] Video image rotation clockwise (0-359 degrees)
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_get_rotation(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 12);
}
/**
* @brief Get field uri from set_video_stream_settings message
*
2018-12-06 01:31:47 +08:00
* @return Video stream URI (mostly for UDP/RTP)
*/
static inline uint16_t mavlink_msg_set_video_stream_settings_get_uri(const mavlink_message_t* msg, char *uri)
{
2018-12-06 01:31:47 +08:00
return _MAV_RETURN_char_array(msg, uri, 160, 17);
}
/**
* @brief Decode a set_video_stream_settings message into a struct
*
* @param msg The message to decode
* @param set_video_stream_settings C-struct to decode the message contents into
*/
static inline void mavlink_msg_set_video_stream_settings_decode(const mavlink_message_t* msg, mavlink_set_video_stream_settings_t* set_video_stream_settings)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
set_video_stream_settings->framerate = mavlink_msg_set_video_stream_settings_get_framerate(msg);
set_video_stream_settings->bitrate = mavlink_msg_set_video_stream_settings_get_bitrate(msg);
set_video_stream_settings->resolution_h = mavlink_msg_set_video_stream_settings_get_resolution_h(msg);
set_video_stream_settings->resolution_v = mavlink_msg_set_video_stream_settings_get_resolution_v(msg);
set_video_stream_settings->rotation = mavlink_msg_set_video_stream_settings_get_rotation(msg);
set_video_stream_settings->target_system = mavlink_msg_set_video_stream_settings_get_target_system(msg);
set_video_stream_settings->target_component = mavlink_msg_set_video_stream_settings_get_target_component(msg);
set_video_stream_settings->camera_id = mavlink_msg_set_video_stream_settings_get_camera_id(msg);
mavlink_msg_set_video_stream_settings_get_uri(msg, set_video_stream_settings->uri);
#else
uint8_t len = msg->len < MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN? msg->len : MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN;
memset(set_video_stream_settings, 0, MAVLINK_MSG_ID_SET_VIDEO_STREAM_SETTINGS_LEN);
memcpy(set_video_stream_settings, _MAV_PAYLOAD(msg), len);
#endif
}