const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len)

{

    const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);

    void *dst;

    uint8_t *bin;

    int len, i;

    if (!o || o->offset<=0)

        return NULL;

    if (o->type != FF_OPT_TYPE_STRING && (!buf || !buf_len))

        return NULL;



    dst= ((uint8_t*)obj) + o->offset;

    if (o_out) *o_out= o;



    switch (o->type) {

    case FF_OPT_TYPE_FLAGS:     snprintf(buf, buf_len, "0x%08X",*(int    *)dst);break;

    case FF_OPT_TYPE_INT:       snprintf(buf, buf_len, "%d" , *(int    *)dst);break;

    case FF_OPT_TYPE_INT64:     snprintf(buf, buf_len, "%"PRId64, *(int64_t*)dst);break;

    case FF_OPT_TYPE_FLOAT:     snprintf(buf, buf_len, "%f" , *(float  *)dst);break;

    case FF_OPT_TYPE_DOUBLE:    snprintf(buf, buf_len, "%f" , *(double *)dst);break;

    case FF_OPT_TYPE_RATIONAL:  snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;

    case FF_OPT_TYPE_STRING:    return *(void**)dst;

    case FF_OPT_TYPE_BINARY:

        len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));

        if (len >= (buf_len + 1)/2) return NULL;

        bin = *(uint8_t**)dst;

        for (i = 0; i < len; i++) snprintf(buf + i*2, 3, "%02X", bin[i]);

        break;

    default: return NULL;

    }

    return buf;

}

const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len)

{

    const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);

    void *dst;

    uint8_t *bin;

    int len, i;

    if (!o || o->offset<=0)

        return NULL;

    if (o->type != FF_OPT_TYPE_STRING && (!buf || !buf_len))

        return NULL;



    dst= ((uint8_t*)obj) + o->offset;

    if (o_out) *o_out= o;



    switch (o->type) {

    case FF_OPT_TYPE_FLAGS:     snprintf(buf, buf_len, "0x%08X",*(int    *)dst);break;

    case FF_OPT_TYPE_INT:       snprintf(buf, buf_len, "%d" , *(int    *)dst);break;

    case FF_OPT_TYPE_INT64:     snprintf(buf, buf_len, "%"PRId64, *(int64_t*)dst);break;

    case FF_OPT_TYPE_FLOAT:     snprintf(buf, buf_len, "%f" , *(float  *)dst);break;

    case FF_OPT_TYPE_DOUBLE:    snprintf(buf, buf_len, "%f" , *(double *)dst);break;

    case FF_OPT_TYPE_RATIONAL:  snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;

    case FF_OPT_TYPE_STRING:    return *(void**)dst;

    case FF_OPT_TYPE_BINARY:

        len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));

        if (len >= (buf_len + 1)/2) return NULL;

        bin = *(uint8_t**)dst;

        for (i = 0; i < len; i++) snprintf(buf + i*2, 3, "%02X", bin[i]);

        break;

    default: return NULL;

    }

    return buf;

}

const char *FUNC_0(void *VAR_0, const char *VAR_1, const AVOption **VAR_2, char *VAR_3, int VAR_4)

{

    const AVOption *VAR_5 = av_opt_find(VAR_0, VAR_1, NULL, 0, 0);

    void *VAR_6;

    uint8_t *bin;

    int VAR_7, VAR_8;

    if (!VAR_5 || VAR_5->offset<=0)

        return NULL;

    if (VAR_5->type != FF_OPT_TYPE_STRING && (!VAR_3 || !VAR_4))

        return NULL;



    VAR_6= ((uint8_t*)VAR_0) + VAR_5->offset;

    if (VAR_2) *VAR_2= VAR_5;



    switch (VAR_5->type) {

    case FF_OPT_TYPE_FLAGS:     snprintf(VAR_3, VAR_4, "0x%08X",*(int    *)VAR_6);break;

    case FF_OPT_TYPE_INT:       snprintf(VAR_3, VAR_4, "%d" , *(int    *)VAR_6);break;

    case FF_OPT_TYPE_INT64:     snprintf(VAR_3, VAR_4, "%"PRId64, *(int64_t*)VAR_6);break;

    case FF_OPT_TYPE_FLOAT:     snprintf(VAR_3, VAR_4, "%f" , *(float  *)VAR_6);break;

    case FF_OPT_TYPE_DOUBLE:    snprintf(VAR_3, VAR_4, "%f" , *(double *)VAR_6);break;

    case FF_OPT_TYPE_RATIONAL:  snprintf(VAR_3, VAR_4, "%d/%d", ((AVRational*)VAR_6)->num, ((AVRational*)VAR_6)->den);break;

    case FF_OPT_TYPE_STRING:    return *(void**)VAR_6;

    case FF_OPT_TYPE_BINARY:

        VAR_7 = *(int*)(((uint8_t *)VAR_6) + sizeof(uint8_t *));

        if (VAR_7 >= (VAR_4 + 1)/2) return NULL;

        bin = *(uint8_t**)VAR_6;

        for (VAR_8 = 0; VAR_8 < VAR_7; VAR_8++) snprintf(VAR_3 + VAR_8*2, 3, "%02X", bin[VAR_8]);

        break;

    default: return NULL;

    }

    return VAR_3;

}

const char *FUNC_0(void *VAR_0, const char *VAR_1, const AVOption **VAR_2, char *VAR_3, int VAR_4)
{ const AVOption *VAR_5 = av_opt_find(VAR_0, VAR_1, NULL, 0, 0); void *VAR_6; uint8_t *bin; int VAR_7, VAR_8; if (!VAR_5 || VAR_5->offset<=0)
return NULL; if (VAR_5->type != FF_OPT_TYPE_STRING && (!VAR_3 || !VAR_4))
return NULL; VAR_6= ((uint8_t*)VAR_0) + VAR_5->offset; if (VAR_2) *VAR_2= VAR_5; switch (VAR_5->type) { case FF_OPT_TYPE_FLAGS:     snprintf(VAR_3, VAR_4, "0x%08X",*(int    *)VAR_6);break; case FF_OPT_TYPE_INT:       snprintf(VAR_3, VAR_4, "%d" , *(int    *)VAR_6);break; case FF_OPT_TYPE_INT64:     snprintf(VAR_3, VAR_4, "%"PRId64, *(int64_t*)VAR_6);break; case FF_OPT_TYPE_FLOAT:     snprintf(VAR_3, VAR_4, "%f" , *(float  *)VAR_6);break; case FF_OPT_TYPE_DOUBLE:    snprintf(VAR_3, VAR_4, "%f" , *(double *)VAR_6);break; case FF_OPT_TYPE_RATIONAL:  snprintf(VAR_3, VAR_4, "%d/%d", ((AVRational*)VAR_6)->num, ((AVRational*)VAR_6)->den);break; case FF_OPT_TYPE_STRING:    return *(void**)VAR_6; case FF_OPT_TYPE_BINARY:
VAR_7 = *(int*)(((uint8_t *)VAR_6) + sizeof(uint8_t *)); if (VAR_7 >= (VAR_4 + 1)/2) return NULL; bin = *(uint8_t**)VAR_6; for (VAR_8 = 0; VAR_8 < VAR_7; VAR_8++) snprintf(VAR_3 + VAR_8*2, 3, "%02X", bin[VAR_8]); break; default: return NULL; } return VAR_3; }