static char *hw_device_default_name(enum AVHWDeviceType type)
{
    const char *type_name = av_hwdevice_get_type_name(type);
    char *name;
    size_t index_pos;
    int index, index_limit = 1000;
    index_pos = strlen(type_name);
    name = av_malloc(index_pos + 4);
    if (!name)
        return NULL;
    for (index = 0; index < index_limit; index++) {
        snprintf(name, index_pos + 4, "%s%d", type_name, index);
        if (!hw_device_get_by_name(name))
            break;
    }
    if (index >= index_limit) {
        av_freep(&name);
        return NULL;
    }
    return name;
}
['static char *hw_device_default_name(enum AVHWDeviceType type)\n{\n    const char *type_name = av_hwdevice_get_type_name(type);\n    char *name;\n    size_t index_pos;\n    int index, index_limit = 1000;\n    index_pos = strlen(type_name);\n    name = av_malloc(index_pos + 4);\n    if (!name)\n        return NULL;\n    for (index = 0; index < index_limit; index++) {\n        snprintf(name, index_pos + 4, "%s%d", type_name, index);\n        if (!hw_device_get_by_name(name))\n            break;\n    }\n    if (index >= index_limit) {\n        av_freep(&name);\n        return NULL;\n    }\n    return name;\n}', 'const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)\n{\n    if (type > AV_HWDEVICE_TYPE_NONE &&\n        type < FF_ARRAY_ELEMS(hw_type_names))\n        return hw_type_names[type];\n    else\n        return NULL;\n}']