X-Git-Url: https://git.libav.org/?p=libav.git;a=blobdiff_plain;f=libavutil%2Fhwcontext.h;h=040e010b308653aa9e952a6de094a36dbbce20e1;hp=49c7a21c1e748a0890a639316b9a6d0fb2fac06a;hb=b7487f4f3c39b4b202e1ea7bb2de13902f2dee45;hpb=b266ad56fe0e4ce5bb70118ba2e2b1dabfaf76ce diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h index 49c7a21c1e..040e010b30 100644 --- a/libavutil/hwcontext.h +++ b/libavutil/hwcontext.h @@ -30,6 +30,7 @@ enum AVHWDeviceType { AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_DXVA2, AV_HWDEVICE_TYPE_QSV, + AV_HWDEVICE_TYPE_NONE, }; typedef struct AVHWDeviceInternal AVHWDeviceInternal; @@ -223,6 +224,33 @@ typedef struct AVHWFramesContext { } AVHWFramesContext; /** + * Look up an AVHWDeviceType by name. + * + * @param name String name of the device type (case-insensitive). + * @return The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if + * not found. + */ +enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name); + +/** Get the string name of an AVHWDeviceType. + * + * @param type Type from enum AVHWDeviceType. + * @return Pointer to a static string containing the name, or NULL if the type + * is not valid. + */ +const char *av_hwdevice_get_type_name(enum AVHWDeviceType type); + +/** + * Iterate over supported device types. + * + * @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type + * returned by this function in subsequent iterations. + * @return The next usable device type from enum AVHWDeviceType, or + * AV_HWDEVICE_TYPE_NONE if there are no more. + */ +enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev); + +/** * Allocate an AVHWDeviceContext for a given pixel format. * * @return a reference to the newly created AVHWDeviceContext on success or NULL