av_opt: add av_opt_ptr() to return a pointer to a field of a object based on

an AVClass

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2011-12-03 21:16:46 +01:00
parent 618fb9cc06
commit dff97be808
2 changed files with 19 additions and 0 deletions

View File

@@ -586,6 +586,17 @@ int av_opt_get_double(void *obj, const char *name, int search_flags, double
int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
/**
* @}
*/
/**
* Gets a pointer to the requested field in a struct.
* This function allows accessing a struct even when its fields are moved or
* renamed since the application making the access has been compiled,
*
* @returns a pointer to the field, it can be cast to the correct type and read
* or written to.
*/
void *av_opt_ptr(const AVClass *class, void *obj, const char *name);
/**
* @}
*/