|
1 | 1 | /*############################################################################ |
2 | | - # Copyright (C) 2020 Intel Corporation |
| 2 | + # Copyright Intel Corporation |
3 | 3 | # |
4 | 4 | # SPDX-License-Identifier: MIT |
5 | 5 | ############################################################################*/ |
@@ -147,6 +147,98 @@ mfxStatus MFX_CDECL MFXCreateSession(mfxLoader loader, mfxU32 i, mfxSession* ses |
147 | 147 | */ |
148 | 148 | mfxStatus MFX_CDECL MFXDispReleaseImplDescription(mfxLoader loader, mfxHDL hdl); |
149 | 149 |
|
| 150 | +/* Helper macro definitions to add config filter properties. */ |
| 151 | + |
| 152 | +/*! Adds single property of mfxU32 type. |
| 153 | + @param[in] loader Valid mfxLoader object |
| 154 | + @param[in] name Property name string |
| 155 | + @param[in] value Property value |
| 156 | +*/ |
| 157 | +#define MFX_ADD_PROPERTY_U32(loader, name, value) \ |
| 158 | +{ \ |
| 159 | + mfxVariant impl_value; \ |
| 160 | + mfxConfig cfg = MFXCreateConfig(loader); \ |
| 161 | + impl_value.Version.Version = MFX_VARIANT_VERSION; \ |
| 162 | + impl_value.Type = MFX_VARIANT_TYPE_U32; \ |
| 163 | + impl_value.Data.U32 = value; \ |
| 164 | + MFXSetConfigFilterProperty(cfg, (mfxU8 *)name, impl_value); \ |
| 165 | +} |
| 166 | + |
| 167 | +/*! Adds single property of mfxU16 type. |
| 168 | + @param[in] loader Valid mfxLoader object |
| 169 | + @param[in] name Property name string |
| 170 | + @param[in] value Property value |
| 171 | +*/ |
| 172 | +#define MFX_ADD_PROPERTY_U16(loader, name, value) \ |
| 173 | +{ \ |
| 174 | + mfxVariant impl_value = { 0 }; \ |
| 175 | + mfxConfig cfg = MFXCreateConfig(loader); \ |
| 176 | + impl_value.Version.Version = MFX_VARIANT_VERSION; \ |
| 177 | + impl_value.Type = MFX_VARIANT_TYPE_U16; \ |
| 178 | + impl_value.Data.U16 = value; \ |
| 179 | + MFXSetConfigFilterProperty(cfg, (mfxU8 *)name, impl_value); \ |
| 180 | +} |
| 181 | + |
| 182 | +/*! Adds single property of pointer type. |
| 183 | + @param[in] loader Valid mfxLoader object |
| 184 | + @param[in] name Property name string |
| 185 | + @param[in] value Property value |
| 186 | +*/ |
| 187 | +#define MFX_ADD_PROPERTY_PTR(loader, name, value) \ |
| 188 | +{ \ |
| 189 | + mfxVariant impl_value = { 0 }; \ |
| 190 | + mfxConfig cfg = MFXCreateConfig(loader); \ |
| 191 | + impl_value.Version.Version = MFX_VARIANT_VERSION; \ |
| 192 | + impl_value.Type = MFX_VARIANT_TYPE_PTR; \ |
| 193 | + impl_value.Data.Ptr = (mfxHDL)value; \ |
| 194 | + MFXSetConfigFilterProperty(cfg, (mfxU8 *)name, impl_value); \ |
| 195 | +} |
| 196 | + |
| 197 | +/*! Update existing property of mfxU32 type. |
| 198 | + @param[in] loader Valid mfxLoader object |
| 199 | + @param[in] config Valid mfxConfig object |
| 200 | + @param[in] name Property name string |
| 201 | + @param[in] value Property value |
| 202 | +*/ |
| 203 | +#define MFX_UPDATE_PROPERTY_U32(loader, config, name, value) \ |
| 204 | +{ \ |
| 205 | + mfxVariant impl_value; \ |
| 206 | + impl_value.Version.Version = MFX_VARIANT_VERSION; \ |
| 207 | + impl_value.Type = MFX_VARIANT_TYPE_U32; \ |
| 208 | + impl_value.Data.U32 = value; \ |
| 209 | + MFXSetConfigFilterProperty(config, (mfxU8 *)name, impl_value); \ |
| 210 | +} |
| 211 | + |
| 212 | +/*! Update existing property of mfxU16 type. |
| 213 | + @param[in] loader Valid mfxLoader object |
| 214 | + @param[in] config Valid mfxConfig object |
| 215 | + @param[in] name Property name string |
| 216 | + @param[in] value Property value |
| 217 | +*/ |
| 218 | +#define MFX_UPDATE_PROPERTY_U16(loader, config, name, value) \ |
| 219 | +{ \ |
| 220 | + mfxVariant impl_value; \ |
| 221 | + impl_value.Version.Version = MFX_VARIANT_VERSION; \ |
| 222 | + impl_value.Type = MFX_VARIANT_TYPE_U16; \ |
| 223 | + impl_value.Data.U16 = value; \ |
| 224 | + MFXSetConfigFilterProperty(config, (mfxU8 *)name, impl_value); \ |
| 225 | +} |
| 226 | + |
| 227 | +/*! Update existing property of pointer type. |
| 228 | + @param[in] loader Valid mfxLoader object |
| 229 | + @param[in] config Valid mfxConfig object |
| 230 | + @param[in] name Property name string |
| 231 | + @param[in] value Property value |
| 232 | +*/ |
| 233 | +#define MFX_UPDATE_PROPERTY_PTR(loader, config, name, value) \ |
| 234 | +{ \ |
| 235 | + mfxVariant impl_value; \ |
| 236 | + impl_value.Version.Version = MFX_VARIANT_VERSION; \ |
| 237 | + impl_value.Type = MFX_VARIANT_TYPE_PTR; \ |
| 238 | + impl_value.Data.Ptr = (mfxHDL)value; \ |
| 239 | + MFXSetConfigFilterProperty(config, (mfxU8 *)name, impl_value); \ |
| 240 | +} |
| 241 | + |
150 | 242 | #ifdef __cplusplus |
151 | 243 | } |
152 | 244 | #endif |
|
0 commit comments