diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2018-11-21 12:04:09 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2018-12-13 13:36:15 +0100 |
commit | 4662614de0872a620c2ec7c6daf956e45300f49b (patch) | |
tree | 2dc0ec8eb19163bbb55955b4f670b38e8ac4e7a6 /include/linux/media.h | |
parent | 56cd068e426c17d63457bbf772b7c8c475f254bc (diff) |
sync
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'include/linux/media.h')
-rw-r--r-- | include/linux/media.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/include/linux/media.h b/include/linux/media.h index 29cc82b8..1161a18b 100644 --- a/include/linux/media.h +++ b/include/linux/media.h @@ -323,6 +323,58 @@ struct media_v2_link { __u32 reserved[6]; } __attribute__ ((packed)); +#define MEDIA_PROP_TYPE_GROUP 1 +#define MEDIA_PROP_TYPE_U64 2 +#define MEDIA_PROP_TYPE_S64 3 +#define MEDIA_PROP_TYPE_STRING 4 + +#define MEDIA_OWNER_TYPE_ENTITY 0 +#define MEDIA_OWNER_TYPE_PAD 1 +#define MEDIA_OWNER_TYPE_LINK 2 +#define MEDIA_OWNER_TYPE_INTF 3 +#define MEDIA_OWNER_TYPE_PROP 4 + +/** + * struct media_v2_prop - A media property + * + * @id: The unique non-zero ID of this property + * @type: Property type + * @owner_id: The ID of the object this property belongs to + * @owner_type: The type of the object this property belongs to + * @flags: Property flags + * @name: Property name + * @payload_size: Property payload size, 0 for U64/S64 + * @payload_offset: Property payload starts at this offset from &prop.id. + * This is 0 for U64/S64. + * @reserved: Property reserved field, will be zeroed. + */ +struct media_v2_prop { + __u32 id; + __u32 type; + __u32 owner_id; + __u32 owner_type; + __u32 flags; + char name[32]; + __u32 payload_size; + __u32 payload_offset; + __u32 reserved[18]; +} __attribute__ ((packed)); + +static __inline__ const char *media_prop2string(const struct media_v2_prop *prop) +{ + return (const char *)prop + prop->payload_offset; +} + +static __inline__ __u64 media_prop2u64(const struct media_v2_prop *prop) +{ + return *(const __u64 *)((const char *)prop + prop->payload_offset); +} + +static __inline__ __s64 media_prop2s64(const struct media_v2_prop *prop) +{ + return *(const __s64 *)((const char *)prop + prop->payload_offset); +} + struct media_v2_topology { __u64 topology_version; @@ -341,6 +393,10 @@ struct media_v2_topology { __u32 num_links; __u32 reserved4; __u64 ptr_links; + + __u32 num_props; + __u32 props_payload_size; + __u64 ptr_props; } __attribute__ ((packed)); /* ioctls */ |