diff options
author | wm4 <wm4@nowhere> | 2017-02-20 08:39:55 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-02-20 08:39:55 +0100 |
commit | 6aa4efd1e3205c9b1385865df1b5b09646d2160c (patch) | |
tree | 4a0f78718f21f7f644f9ca7de4fbcfb8a83aafa9 /video/decode/lavc.h | |
parent | 6e2d3d991912f230ee66448307e8e2657237ffd2 (diff) | |
download | mpv-6aa4efd1e3205c9b1385865df1b5b09646d2160c.tar.bz2 mpv-6aa4efd1e3205c9b1385865df1b5b09646d2160c.tar.xz |
vd_lavc, vaapi: move hw device creation to generic code
hw_vaapi.c didn't do much interesting anymore. Other than the function
to create a device for decoding with vaapi-copy, everything can be done
by generic code. Other libavcodec hwaccels are planned to provide the
same API as vaapi. It will be possible to drop the other hw_ files in
the future. They will use this generic code instead.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r-- | video/decode/lavc.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h index b41d56ce2f..dfce9c3bfd 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -19,6 +19,8 @@ // This value does not yet include HWDEC_DELAY_QUEUE_COUNT. #define HWDEC_EXTRA_SURFACES 4 +struct mpv_global; + typedef struct lavc_ctx { struct mp_log *log; struct MPOpts *opts; @@ -95,9 +97,11 @@ struct vd_lavc_hwdec { struct mp_image *(*allocate_image)(struct lavc_ctx *ctx, int w, int h); // Process the image returned by the libavcodec decoder. struct mp_image *(*process_image)(struct lavc_ctx *ctx, struct mp_image *img); - // Optional; if a special hardware decoder is needed (instead of "hwaccel"). - const char *(*get_codec)(struct lavc_ctx *ctx, const char *codec); - // Suffix for libavcodec decoder. If non-NULL, get_codec() is overridden + // For copy hwdecs. If probing is true, don't log errors if unavailable. + // The returned device must be freed with mp_hwdec_ctx->destroy. + struct mp_hwdec_ctx *(*create_dev)(struct mpv_global *global, + struct mp_log *log, bool probing); + // Suffix for libavcodec decoder. If non-NULL, the codec is overridden // with hwdec_find_decoder. // Intuitively, this will force the corresponding wrapper decoder. const char *lavc_suffix; |