ffmpeg: Use codec hardware config to configure hwaccels

Removes specific support for all hwaccels supported by the generic code
(DXVA2, D3D11VA, NVDEC, VAAPI and VDPAU).
This commit is contained in:
Mark Thompson
2017-10-26 00:18:47 +01:00
parent 3a71bcc213
commit b0cd14fb1d
4 changed files with 254 additions and 136 deletions

View File

@@ -61,14 +61,10 @@
enum HWAccelID {
HWACCEL_NONE = 0,
HWACCEL_AUTO,
HWACCEL_VDPAU,
HWACCEL_DXVA2,
HWACCEL_GENERIC,
HWACCEL_VIDEOTOOLBOX,
HWACCEL_QSV,
HWACCEL_VAAPI,
HWACCEL_CUVID,
HWACCEL_D3D11VA,
HWACCEL_NVDEC,
};
typedef struct HWAccel {
@@ -76,7 +72,6 @@ typedef struct HWAccel {
int (*init)(AVCodecContext *s);
enum HWAccelID id;
enum AVPixelFormat pix_fmt;
enum AVHWDeviceType device_type;
} HWAccel;
typedef struct HWDevice {
@@ -370,11 +365,11 @@ typedef struct InputStream {
/* hwaccel options */
enum HWAccelID hwaccel_id;
enum AVHWDeviceType hwaccel_device_type;
char *hwaccel_device;
enum AVPixelFormat hwaccel_output_format;
/* hwaccel context */
enum HWAccelID active_hwaccel_id;
void *hwaccel_ctx;
void (*hwaccel_uninit)(AVCodecContext *s);
int (*hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags);