1 // Copyright 2020 The ChromiumOS Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 //! This file was generated by the following commands and modified manually. 6 //! 7 //! ```shell 8 //! $ bindgen virtio_video.h \ 9 //! --allowlist-type "virtio_video.*" \ 10 //! --allowlist-var "VIRTIO_VIDEO_.*" \ 11 //! --with-derive-default \ 12 //! --no-layout-tests \ 13 //! --no-prepend-enum-name > protocol.rs 14 //! $ sed -i "s/__u/u/g" protocol.rs 15 //! $ sed -i "s/__le/Le/g" protocol.rs 16 //! ``` 17 //! 18 //! The main points of the manual modifications are as follows: 19 //! * Removed `hdr` from each command struct so that we can read the header and a command body 20 //! separately. (cf. [related discussion](https://markmail.org/message/tr5g6axqq2zzq64y)) 21 //! * Derive implementations of AsBytes and FromBytes for each struct as needed. 22 //! * Added GET_PARAMS_EXT and SET_PARAMS_EXT to allow querying and changing the resource type 23 //! dynamically. 24 //! * Moved some definitions such as virtio_video_config to device_constants to make them visible 25 //! to vhost-user modules, and also pub-use them. 26 27 #![allow(dead_code, non_snake_case, non_camel_case_types)] 28 29 use data_model::Le32; 30 use data_model::Le64; 31 use zerocopy::AsBytes; 32 use zerocopy::FromBytes; 33 34 pub use crate::virtio::device_constants::video::virtio_video_config; 35 pub use crate::virtio::device_constants::video::VIRTIO_VIDEO_F_RESOURCE_GUEST_PAGES; 36 pub use crate::virtio::device_constants::video::VIRTIO_VIDEO_F_RESOURCE_NON_CONTIG; 37 pub use crate::virtio::device_constants::video::VIRTIO_VIDEO_F_RESOURCE_VIRTIO_OBJECT; 38 39 pub const VIRTIO_VIDEO_MAX_PLANES: u32 = 8; 40 pub const VIRTIO_VIDEO_FORMAT_RAW_MIN: virtio_video_format = 1; 41 pub const VIRTIO_VIDEO_FORMAT_ARGB8888: virtio_video_format = 1; 42 pub const VIRTIO_VIDEO_FORMAT_BGRA8888: virtio_video_format = 2; 43 pub const VIRTIO_VIDEO_FORMAT_NV12: virtio_video_format = 3; 44 pub const VIRTIO_VIDEO_FORMAT_YUV420: virtio_video_format = 4; 45 pub const VIRTIO_VIDEO_FORMAT_YVU420: virtio_video_format = 5; 46 pub const VIRTIO_VIDEO_FORMAT_RAW_MAX: virtio_video_format = 5; 47 pub const VIRTIO_VIDEO_FORMAT_CODED_MIN: virtio_video_format = 4096; 48 pub const VIRTIO_VIDEO_FORMAT_MPEG2: virtio_video_format = 4096; 49 pub const VIRTIO_VIDEO_FORMAT_MPEG4: virtio_video_format = 4097; 50 pub const VIRTIO_VIDEO_FORMAT_H264: virtio_video_format = 4098; 51 pub const VIRTIO_VIDEO_FORMAT_HEVC: virtio_video_format = 4099; 52 pub const VIRTIO_VIDEO_FORMAT_VP8: virtio_video_format = 4100; 53 pub const VIRTIO_VIDEO_FORMAT_VP9: virtio_video_format = 4101; 54 pub const VIRTIO_VIDEO_FORMAT_CODED_MAX: virtio_video_format = 4101; 55 pub type virtio_video_format = u32; 56 pub const VIRTIO_VIDEO_PROFILE_H264_MIN: virtio_video_profile = 256; 57 pub const VIRTIO_VIDEO_PROFILE_H264_BASELINE: virtio_video_profile = 256; 58 pub const VIRTIO_VIDEO_PROFILE_H264_MAIN: virtio_video_profile = 257; 59 pub const VIRTIO_VIDEO_PROFILE_H264_EXTENDED: virtio_video_profile = 258; 60 pub const VIRTIO_VIDEO_PROFILE_H264_HIGH: virtio_video_profile = 259; 61 pub const VIRTIO_VIDEO_PROFILE_H264_HIGH10PROFILE: virtio_video_profile = 260; 62 pub const VIRTIO_VIDEO_PROFILE_H264_HIGH422PROFILE: virtio_video_profile = 261; 63 pub const VIRTIO_VIDEO_PROFILE_H264_HIGH444PREDICTIVEPROFILE: virtio_video_profile = 262; 64 pub const VIRTIO_VIDEO_PROFILE_H264_SCALABLEBASELINE: virtio_video_profile = 263; 65 pub const VIRTIO_VIDEO_PROFILE_H264_SCALABLEHIGH: virtio_video_profile = 264; 66 pub const VIRTIO_VIDEO_PROFILE_H264_STEREOHIGH: virtio_video_profile = 265; 67 pub const VIRTIO_VIDEO_PROFILE_H264_MULTIVIEWHIGH: virtio_video_profile = 266; 68 pub const VIRTIO_VIDEO_PROFILE_H264_MAX: virtio_video_profile = 266; 69 pub const VIRTIO_VIDEO_PROFILE_HEVC_MIN: virtio_video_profile = 512; 70 pub const VIRTIO_VIDEO_PROFILE_HEVC_MAIN: virtio_video_profile = 512; 71 pub const VIRTIO_VIDEO_PROFILE_HEVC_MAIN10: virtio_video_profile = 513; 72 pub const VIRTIO_VIDEO_PROFILE_HEVC_MAIN_STILL_PICTURE: virtio_video_profile = 514; 73 pub const VIRTIO_VIDEO_PROFILE_HEVC_MAX: virtio_video_profile = 514; 74 pub const VIRTIO_VIDEO_PROFILE_VP8_MIN: virtio_video_profile = 768; 75 pub const VIRTIO_VIDEO_PROFILE_VP8_PROFILE0: virtio_video_profile = 768; 76 pub const VIRTIO_VIDEO_PROFILE_VP8_PROFILE1: virtio_video_profile = 769; 77 pub const VIRTIO_VIDEO_PROFILE_VP8_PROFILE2: virtio_video_profile = 770; 78 pub const VIRTIO_VIDEO_PROFILE_VP8_PROFILE3: virtio_video_profile = 771; 79 pub const VIRTIO_VIDEO_PROFILE_VP8_MAX: virtio_video_profile = 771; 80 pub const VIRTIO_VIDEO_PROFILE_VP9_MIN: virtio_video_profile = 1024; 81 pub const VIRTIO_VIDEO_PROFILE_VP9_PROFILE0: virtio_video_profile = 1024; 82 pub const VIRTIO_VIDEO_PROFILE_VP9_PROFILE1: virtio_video_profile = 1025; 83 pub const VIRTIO_VIDEO_PROFILE_VP9_PROFILE2: virtio_video_profile = 1026; 84 pub const VIRTIO_VIDEO_PROFILE_VP9_PROFILE3: virtio_video_profile = 1027; 85 pub const VIRTIO_VIDEO_PROFILE_VP9_MAX: virtio_video_profile = 1027; 86 pub type virtio_video_profile = u32; 87 pub const VIRTIO_VIDEO_LEVEL_H264_MIN: virtio_video_level = 256; 88 pub const VIRTIO_VIDEO_LEVEL_H264_1_0: virtio_video_level = 256; 89 pub const VIRTIO_VIDEO_LEVEL_H264_1_1: virtio_video_level = 257; 90 pub const VIRTIO_VIDEO_LEVEL_H264_1_2: virtio_video_level = 258; 91 pub const VIRTIO_VIDEO_LEVEL_H264_1_3: virtio_video_level = 259; 92 pub const VIRTIO_VIDEO_LEVEL_H264_2_0: virtio_video_level = 260; 93 pub const VIRTIO_VIDEO_LEVEL_H264_2_1: virtio_video_level = 261; 94 pub const VIRTIO_VIDEO_LEVEL_H264_2_2: virtio_video_level = 262; 95 pub const VIRTIO_VIDEO_LEVEL_H264_3_0: virtio_video_level = 263; 96 pub const VIRTIO_VIDEO_LEVEL_H264_3_1: virtio_video_level = 264; 97 pub const VIRTIO_VIDEO_LEVEL_H264_3_2: virtio_video_level = 265; 98 pub const VIRTIO_VIDEO_LEVEL_H264_4_0: virtio_video_level = 266; 99 pub const VIRTIO_VIDEO_LEVEL_H264_4_1: virtio_video_level = 267; 100 pub const VIRTIO_VIDEO_LEVEL_H264_4_2: virtio_video_level = 268; 101 pub const VIRTIO_VIDEO_LEVEL_H264_5_0: virtio_video_level = 269; 102 pub const VIRTIO_VIDEO_LEVEL_H264_5_1: virtio_video_level = 270; 103 pub const VIRTIO_VIDEO_LEVEL_H264_MAX: virtio_video_level = 270; 104 pub type virtio_video_level = u32; 105 pub const VIRTIO_VIDEO_BITRATE_MODE_VBR: virtio_video_bitrate_mode = 0; 106 pub const VIRTIO_VIDEO_BITRATE_MODE_CBR: virtio_video_bitrate_mode = 1; 107 pub type virtio_video_bitrate_mode = u32; 108 109 pub const VIRTIO_VIDEO_CMD_QUERY_CAPABILITY: virtio_video_cmd_type = 256; 110 pub const VIRTIO_VIDEO_CMD_STREAM_CREATE: virtio_video_cmd_type = 257; 111 pub const VIRTIO_VIDEO_CMD_STREAM_DESTROY: virtio_video_cmd_type = 258; 112 pub const VIRTIO_VIDEO_CMD_STREAM_DRAIN: virtio_video_cmd_type = 259; 113 pub const VIRTIO_VIDEO_CMD_RESOURCE_CREATE: virtio_video_cmd_type = 260; 114 pub const VIRTIO_VIDEO_CMD_RESOURCE_QUEUE: virtio_video_cmd_type = 261; 115 pub const VIRTIO_VIDEO_CMD_RESOURCE_DESTROY_ALL: virtio_video_cmd_type = 262; 116 pub const VIRTIO_VIDEO_CMD_QUEUE_CLEAR: virtio_video_cmd_type = 263; 117 pub const VIRTIO_VIDEO_CMD_GET_PARAMS: virtio_video_cmd_type = 264; 118 pub const VIRTIO_VIDEO_CMD_SET_PARAMS: virtio_video_cmd_type = 265; 119 pub const VIRTIO_VIDEO_CMD_QUERY_CONTROL: virtio_video_cmd_type = 266; 120 pub const VIRTIO_VIDEO_CMD_GET_CONTROL: virtio_video_cmd_type = 267; 121 pub const VIRTIO_VIDEO_CMD_SET_CONTROL: virtio_video_cmd_type = 268; 122 pub const VIRTIO_VIDEO_CMD_GET_PARAMS_EXT: virtio_video_cmd_type = 269; 123 pub const VIRTIO_VIDEO_CMD_SET_PARAMS_EXT: virtio_video_cmd_type = 270; 124 pub const VIRTIO_VIDEO_RESP_OK_NODATA: virtio_video_cmd_type = 512; 125 pub const VIRTIO_VIDEO_RESP_OK_QUERY_CAPABILITY: virtio_video_cmd_type = 513; 126 pub const VIRTIO_VIDEO_RESP_OK_RESOURCE_QUEUE: virtio_video_cmd_type = 514; 127 pub const VIRTIO_VIDEO_RESP_OK_GET_PARAMS: virtio_video_cmd_type = 515; 128 pub const VIRTIO_VIDEO_RESP_OK_QUERY_CONTROL: virtio_video_cmd_type = 516; 129 pub const VIRTIO_VIDEO_RESP_OK_GET_CONTROL: virtio_video_cmd_type = 517; 130 pub const VIRTIO_VIDEO_RESP_ERR_INVALID_OPERATION: virtio_video_cmd_type = 768; 131 pub const VIRTIO_VIDEO_RESP_ERR_OUT_OF_MEMORY: virtio_video_cmd_type = 769; 132 pub const VIRTIO_VIDEO_RESP_ERR_INVALID_STREAM_ID: virtio_video_cmd_type = 770; 133 pub const VIRTIO_VIDEO_RESP_ERR_INVALID_RESOURCE_ID: virtio_video_cmd_type = 771; 134 pub const VIRTIO_VIDEO_RESP_ERR_INVALID_PARAMETER: virtio_video_cmd_type = 772; 135 pub const VIRTIO_VIDEO_RESP_ERR_UNSUPPORTED_CONTROL: virtio_video_cmd_type = 773; 136 pub type virtio_video_cmd_type = u32; 137 #[repr(C)] 138 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 139 pub struct virtio_video_cmd_hdr { 140 pub type_: Le32, 141 pub stream_id: Le32, 142 } 143 144 pub const VIRTIO_VIDEO_QUEUE_TYPE_INPUT: virtio_video_queue_type = 256; 145 pub const VIRTIO_VIDEO_QUEUE_TYPE_OUTPUT: virtio_video_queue_type = 257; 146 pub type virtio_video_queue_type = u32; 147 #[repr(C)] 148 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 149 pub struct virtio_video_query_capability { 150 pub queue_type: Le32, 151 pub padding: [u8; 4usize], 152 } 153 154 pub const VIRTIO_VIDEO_PLANES_LAYOUT_SINGLE_BUFFER: virtio_video_planes_layout_flag = 1; 155 pub const VIRTIO_VIDEO_PLANES_LAYOUT_PER_PLANE: virtio_video_planes_layout_flag = 2; 156 pub type virtio_video_planes_layout_flag = u32; 157 #[repr(C)] 158 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 159 pub struct virtio_video_format_range { 160 pub min: Le32, 161 pub max: Le32, 162 pub step: Le32, 163 pub padding: [u8; 4usize], 164 } 165 166 #[repr(C)] 167 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 168 pub struct virtio_video_format_frame { 169 pub width: virtio_video_format_range, 170 pub height: virtio_video_format_range, 171 pub num_rates: Le32, 172 pub padding: [u8; 4usize], 173 } 174 175 #[repr(C)] 176 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 177 pub struct virtio_video_format_desc { 178 pub mask: Le64, 179 pub format: Le32, 180 pub planes_layout: Le32, 181 pub plane_align: Le32, 182 pub num_frames: Le32, 183 } 184 185 #[repr(C)] 186 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 187 pub struct virtio_video_query_capability_resp { 188 pub hdr: virtio_video_cmd_hdr, 189 pub num_descs: Le32, 190 pub padding: [u8; 4usize], 191 } 192 193 pub const VIRTIO_VIDEO_MEM_TYPE_GUEST_PAGES: virtio_video_mem_type = 0; 194 pub const VIRTIO_VIDEO_MEM_TYPE_VIRTIO_OBJECT: virtio_video_mem_type = 1; 195 pub type virtio_video_mem_type = u32; 196 #[repr(C)] 197 #[derive(Copy, Clone, AsBytes, FromBytes)] 198 pub struct virtio_video_stream_create { 199 pub in_mem_type: Le32, 200 pub out_mem_type: Le32, 201 pub coded_format: Le32, 202 pub padding: [u8; 4usize], 203 pub tag: [u8; 64usize], 204 } 205 impl Default for virtio_video_stream_create { default() -> Self206 fn default() -> Self { 207 unsafe { ::std::mem::zeroed() } 208 } 209 } 210 211 #[repr(C)] 212 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 213 pub struct virtio_video_stream_destroy {} 214 215 #[repr(C)] 216 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 217 pub struct virtio_video_stream_drain {} 218 219 #[repr(C)] 220 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 221 pub struct virtio_video_mem_entry { 222 pub addr: Le64, 223 pub length: Le32, 224 pub padding: [u8; 4usize], 225 } 226 #[repr(C)] 227 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 228 pub struct virtio_video_object_entry { 229 pub uuid: [u8; 16usize], 230 } 231 232 #[repr(C)] 233 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 234 pub struct virtio_video_resource_create { 235 pub queue_type: Le32, 236 pub resource_id: Le32, 237 pub planes_layout: Le32, 238 pub num_planes: Le32, 239 pub plane_offsets: [Le32; 8usize], 240 pub num_entries: [Le32; 8usize], 241 } 242 243 #[repr(C)] 244 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 245 pub struct virtio_video_resource_queue { 246 pub queue_type: Le32, 247 pub resource_id: Le32, 248 pub timestamp: Le64, 249 pub num_data_sizes: Le32, 250 pub data_sizes: [Le32; 8usize], 251 pub padding: [u8; 4usize], 252 } 253 254 pub const VIRTIO_VIDEO_BUFFER_FLAG_ERR: virtio_video_buffer_flag = 1; 255 pub const VIRTIO_VIDEO_BUFFER_FLAG_EOS: virtio_video_buffer_flag = 2; 256 pub const VIRTIO_VIDEO_BUFFER_FLAG_IFRAME: virtio_video_buffer_flag = 4; 257 pub const VIRTIO_VIDEO_BUFFER_FLAG_PFRAME: virtio_video_buffer_flag = 8; 258 pub const VIRTIO_VIDEO_BUFFER_FLAG_BFRAME: virtio_video_buffer_flag = 16; 259 pub type virtio_video_buffer_flag = u32; 260 #[repr(C)] 261 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 262 pub struct virtio_video_resource_queue_resp { 263 pub hdr: virtio_video_cmd_hdr, 264 pub timestamp: Le64, 265 pub flags: Le32, 266 pub size: Le32, 267 } 268 269 #[repr(C)] 270 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 271 pub struct virtio_video_resource_destroy_all { 272 pub queue_type: Le32, 273 pub padding: [u8; 4usize], 274 } 275 276 #[repr(C)] 277 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 278 pub struct virtio_video_queue_clear { 279 pub queue_type: Le32, 280 pub padding: [u8; 4usize], 281 } 282 283 #[repr(C)] 284 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 285 pub struct virtio_video_plane_format { 286 pub plane_size: Le32, 287 pub stride: Le32, 288 } 289 #[repr(C)] 290 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 291 pub struct virtio_video_crop { 292 pub left: Le32, 293 pub top: Le32, 294 pub width: Le32, 295 pub height: Le32, 296 } 297 #[repr(C)] 298 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 299 pub struct virtio_video_params { 300 pub queue_type: Le32, 301 pub format: Le32, 302 pub frame_width: Le32, 303 pub frame_height: Le32, 304 pub min_buffers: Le32, 305 pub max_buffers: Le32, 306 pub crop: virtio_video_crop, 307 pub frame_rate: Le32, 308 pub num_planes: Le32, 309 pub plane_formats: [virtio_video_plane_format; 8usize], 310 } 311 #[repr(C)] 312 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 313 pub struct virtio_video_get_params { 314 pub queue_type: Le32, 315 pub padding: [u8; 4usize], 316 } 317 318 #[repr(C)] 319 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 320 pub struct virtio_video_get_params_resp { 321 pub hdr: virtio_video_cmd_hdr, 322 pub params: virtio_video_params, 323 } 324 325 #[repr(C)] 326 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 327 pub struct virtio_video_set_params { 328 pub params: virtio_video_params, 329 } 330 331 /// Extension of the {GET,SET}_PARAMS data to also include the resource type. Not including it 332 /// was an oversight and the {GET,SET}_PARAMS_EXT commands use this structure to fix it, while 333 /// the older {GET,SET}_PARAMS commands are kept for backward compatibility. 334 #[repr(C)] 335 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 336 pub struct virtio_video_params_ext { 337 pub base: virtio_video_params, 338 pub resource_type: Le32, 339 pub padding: [u8; 4usize], 340 } 341 #[repr(C)] 342 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 343 pub struct virtio_video_get_params_ext { 344 pub queue_type: Le32, 345 pub padding: [u8; 4usize], 346 } 347 348 #[repr(C)] 349 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 350 pub struct virtio_video_get_params_ext_resp { 351 pub hdr: virtio_video_cmd_hdr, 352 pub params: virtio_video_params_ext, 353 } 354 355 #[repr(C)] 356 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 357 pub struct virtio_video_set_params_ext { 358 pub params: virtio_video_params_ext, 359 } 360 361 pub const VIRTIO_VIDEO_CONTROL_BITRATE: virtio_video_control_type = 1; 362 pub const VIRTIO_VIDEO_CONTROL_PROFILE: virtio_video_control_type = 2; 363 pub const VIRTIO_VIDEO_CONTROL_LEVEL: virtio_video_control_type = 3; 364 pub const VIRTIO_VIDEO_CONTROL_FORCE_KEYFRAME: virtio_video_control_type = 4; 365 pub const VIRTIO_VIDEO_CONTROL_BITRATE_MODE: virtio_video_control_type = 5; 366 pub const VIRTIO_VIDEO_CONTROL_BITRATE_PEAK: virtio_video_control_type = 6; 367 pub const VIRTIO_VIDEO_CONTROL_PREPEND_SPSPPS_TO_IDR: virtio_video_control_type = 7; 368 pub type virtio_video_control_type = u32; 369 #[repr(C)] 370 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 371 pub struct virtio_video_query_control_profile { 372 pub format: Le32, 373 pub padding: [u8; 4usize], 374 } 375 376 #[repr(C)] 377 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 378 pub struct virtio_video_query_control_level { 379 pub format: Le32, 380 pub padding: [u8; 4usize], 381 } 382 383 #[repr(C)] 384 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 385 pub struct virtio_video_query_control { 386 pub control: Le32, 387 pub padding: [u8; 4usize], 388 } 389 390 #[repr(C)] 391 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 392 pub struct virtio_video_query_control_resp_profile { 393 pub num: Le32, 394 pub padding: [u8; 4usize], 395 } 396 397 #[repr(C)] 398 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 399 pub struct virtio_video_query_control_resp_level { 400 pub num: Le32, 401 pub padding: [u8; 4usize], 402 } 403 404 #[repr(C)] 405 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 406 pub struct virtio_video_query_control_resp { 407 pub hdr: virtio_video_cmd_hdr, 408 } 409 410 #[repr(C)] 411 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 412 pub struct virtio_video_get_control { 413 pub control: Le32, 414 pub padding: [u8; 4usize], 415 } 416 417 #[repr(C)] 418 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 419 pub struct virtio_video_control_val_bitrate { 420 pub bitrate: Le32, 421 pub padding: [u8; 4usize], 422 } 423 424 #[repr(C)] 425 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 426 pub struct virtio_video_control_val_bitrate_peak { 427 pub bitrate_peak: Le32, 428 pub padding: [u8; 4usize], 429 } 430 431 #[repr(C)] 432 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 433 pub struct virtio_video_control_val_bitrate_mode { 434 pub bitrate_mode: Le32, 435 pub padding: [u8; 4usize], 436 } 437 438 #[repr(C)] 439 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 440 pub struct virtio_video_control_val_profile { 441 pub profile: Le32, 442 pub padding: [u8; 4usize], 443 } 444 445 #[repr(C)] 446 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 447 pub struct virtio_video_control_val_level { 448 pub level: Le32, 449 pub padding: [u8; 4usize], 450 } 451 452 #[repr(C)] 453 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 454 pub struct virtio_video_control_val_prepend_spspps_to_idr { 455 pub prepend_spspps_to_idr: Le32, 456 pub padding: [u8; 4usize], 457 } 458 459 #[repr(C)] 460 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 461 pub struct virtio_video_get_control_resp { 462 pub hdr: virtio_video_cmd_hdr, 463 } 464 465 #[repr(C)] 466 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 467 pub struct virtio_video_set_control { 468 pub control: Le32, 469 pub padding: [u8; 4usize], 470 } 471 472 #[repr(C)] 473 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 474 pub struct virtio_video_set_control_resp { 475 pub hdr: virtio_video_cmd_hdr, 476 } 477 478 pub const VIRTIO_VIDEO_EVENT_ERROR: virtio_video_event_type = 256; 479 pub const VIRTIO_VIDEO_EVENT_DECODER_RESOLUTION_CHANGED: virtio_video_event_type = 512; 480 pub type virtio_video_event_type = u32; 481 #[repr(C)] 482 #[derive(Debug, Default, Copy, Clone, AsBytes, FromBytes)] 483 pub struct virtio_video_event { 484 pub event_type: Le32, 485 pub stream_id: Le32, 486 } 487