| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | use crate::bindings; |
| 8 | |
| 9 | |
| 10 | pub struct PicFlags(bindings::_VAEncPictureParameterBufferJPEG__bindgen_ty_1); |
| 11 | |
| 12 | impl PicFlags { |
| 13 | pub fn new( |
| 14 | profile: u32, |
| 15 | progressive: u32, |
| 16 | huffman: u32, |
| 17 | interleaved: u32, |
| 18 | differential: u32, |
| 19 | ) -> Self { |
| 20 | let _bitfield_1 = |
| 21 | bindings::_VAEncPictureParameterBufferJPEG__bindgen_ty_1__bindgen_ty_1::new_bitfield_1( |
| 22 | profile, |
| 23 | progressive, |
| 24 | huffman, |
| 25 | interleaved, |
| 26 | differential, |
| 27 | ); |
| 28 | Self(bindings::_VAEncPictureParameterBufferJPEG__bindgen_ty_1 { |
| 29 | bits: bindings::_VAEncPictureParameterBufferJPEG__bindgen_ty_1__bindgen_ty_1 { |
| 30 | _bitfield_align_1: Default::default(), |
| 31 | _bitfield_1, |
| 32 | __bindgen_padding_0: Default::default(), |
| 33 | }, |
| 34 | }) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | |
| 39 | pub struct EncPictureParameterBufferJPEG(Box<bindings::VAEncPictureParameterBufferJPEG>); |
| 40 | |
| 41 | impl EncPictureParameterBufferJPEG { |
| 42 | |
| 43 | pub fn new( |
| 44 | reconstructed_picture: bindings::VASurfaceID, |
| 45 | picture_width: u16, |
| 46 | picture_height: u16, |
| 47 | coded_buf: bindings::VABufferID, |
| 48 | pic_flags: PicFlags, |
| 49 | sample_bit_depth: u8, |
| 50 | num_scan: u8, |
| 51 | num_components: u16, |
| 52 | component_id: [u8; 4usize], |
| 53 | quantiser_table_selector: [u8; 4usize], |
| 54 | quality: u8, |
| 55 | ) -> Self { |
| 56 | Self(Box::new(bindings::VAEncPictureParameterBufferJPEG { |
| 57 | reconstructed_picture, |
| 58 | picture_width, |
| 59 | picture_height, |
| 60 | coded_buf, |
| 61 | pic_flags: pic_flags.0, |
| 62 | sample_bit_depth, |
| 63 | num_scan, |
| 64 | num_components, |
| 65 | component_id, |
| 66 | quantiser_table_selector, |
| 67 | quality, |
| 68 | va_reserved: Default::default(), |
| 69 | })) |
| 70 | } |
| 71 | |
| 72 | pub(crate) fn inner_mut(&mut self) -> &mut bindings::VAEncPictureParameterBufferJPEG { |
| 73 | self.0.as_mut() |
| 74 | } |
| 75 | |
| 76 | |
| 77 | pub fn inner(&self) -> &bindings::VAEncPictureParameterBufferJPEG { |
| 78 | self.0.as_ref() |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | |
| 83 | pub struct EncSliceParameterBufferJPEGComponent( |
| 84 | bindings::_VAEncSliceParameterBufferJPEG__bindgen_ty_1, |
| 85 | ); |
| 86 | |
| 87 | impl EncSliceParameterBufferJPEGComponent { |
| 88 | |
| 89 | pub fn new(component_selector: u8, dc_table_selector: u8, ac_table_selector: u8) -> Self { |
| 90 | Self(bindings::_VAEncSliceParameterBufferJPEG__bindgen_ty_1 { |
| 91 | component_selector, |
| 92 | dc_table_selector, |
| 93 | ac_table_selector, |
| 94 | }) |
| 95 | } |
| 96 | |
| 97 | |
| 98 | pub fn inner(&self) -> &bindings::_VAEncSliceParameterBufferJPEG__bindgen_ty_1 { |
| 99 | &self.0 |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | |
| 104 | pub struct EncSliceParameterBufferJPEG(Box<bindings::VAEncSliceParameterBufferJPEG>); |
| 105 | |
| 106 | impl EncSliceParameterBufferJPEG { |
| 107 | |
| 108 | pub fn new( |
| 109 | restart_interval: u16, |
| 110 | num_components: u16, |
| 111 | components: [EncSliceParameterBufferJPEGComponent; 4usize], |
| 112 | ) -> Self { |
| 113 | Self(Box::new(bindings::VAEncSliceParameterBufferJPEG { |
| 114 | restart_interval, |
| 115 | num_components, |
| 116 | components: components.map(|component| component.0), |
| 117 | va_reserved: Default::default(), |
| 118 | })) |
| 119 | } |
| 120 | |
| 121 | pub(crate) fn inner_mut(&mut self) -> &mut bindings::VAEncSliceParameterBufferJPEG { |
| 122 | self.0.as_mut() |
| 123 | } |
| 124 | |
| 125 | |
| 126 | pub fn inner(&self) -> &bindings::VAEncSliceParameterBufferJPEG { |
| 127 | self.0.as_ref() |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | |
| 132 | pub struct QMatrixBufferJPEG(Box<bindings::VAQMatrixBufferJPEG>); |
| 133 | |
| 134 | impl QMatrixBufferJPEG { |
| 135 | |
| 136 | pub fn new( |
| 137 | load_lum_quantiser_matrix: i32, |
| 138 | load_chroma_quantiser_matrix: i32, |
| 139 | lum_quantiser_matrix: [u8; 64usize], |
| 140 | chroma_quantiser_matrix: [u8; 64usize], |
| 141 | ) -> Self { |
| 142 | Self(Box::new(bindings::VAQMatrixBufferJPEG { |
| 143 | load_lum_quantiser_matrix, |
| 144 | load_chroma_quantiser_matrix, |
| 145 | lum_quantiser_matrix, |
| 146 | chroma_quantiser_matrix, |
| 147 | va_reserved: Default::default(), |
| 148 | })) |
| 149 | } |
| 150 | |
| 151 | pub(crate) fn inner_mut(&mut self) -> &mut bindings::VAQMatrixBufferJPEG { |
| 152 | self.0.as_mut() |
| 153 | } |
| 154 | |
| 155 | |
| 156 | pub fn inner(&self) -> &bindings::VAQMatrixBufferJPEG { |
| 157 | self.0.as_ref() |
| 158 | } |
| 159 | } |