diff options
author | wm4 <wm4@nowhere> | 2014-03-10 22:36:23 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-10 22:56:26 +0100 |
commit | ccce58d6d63538911fa7bdd216a32e8444ea36b8 (patch) | |
tree | 2a59a762d1242ea796655c42531de0d64765d55c /video/decode/lavc.h | |
parent | fbddbce01dec878c072cd9dd00da9ff035f3350f (diff) | |
download | mpv-ccce58d6d63538911fa7bdd216a32e8444ea36b8.tar.bz2 mpv-ccce58d6d63538911fa7bdd216a32e8444ea36b8.tar.xz |
video: initialize hw decoder in get_format
Apparently the "right" place to initialize the hardware decoder is in
the libavcodec get_format callback.
This doesn't change vda.c and vdpau_old.c, because I don't have OSX, and
vdpau_old.c is probably going to be removed soon (if Libav ever manages
to release Libav 10). So for now the init_decoder callback added with
this commit is optional.
This also means vdpau.c and vaapi.c don't have to manage and check the
image parameters anymore.
This change is probably needed for when libavcodec VDA supports gets a
new iteration of its API.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r-- | video/decode/lavc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h index 867488de95..71d568aa8a 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -38,6 +38,10 @@ typedef struct lavc_ctx { // For free use by hwdec implementation void *hwdec_priv; + int hwdec_fmt; + int hwdec_w; + int hwdec_h; + // Legacy bool do_dr1; struct FramePool *dr1_buffer_pool; @@ -59,7 +63,10 @@ struct vd_lavc_hwdec { int (*probe)(struct vd_lavc_hwdec *hwdec, struct mp_hwdec_info *info, const char *decoder); int (*init)(struct lavc_ctx *ctx); + int (*init_decoder)(struct lavc_ctx *ctx, int fmt, int w, int h); void (*uninit)(struct lavc_ctx *ctx); + // Note: if init_decoder is set, this will always use the values from the + // last successful init_decoder call. Otherwise, it's up to you. struct mp_image *(*allocate_image)(struct lavc_ctx *ctx, int fmt, int w, int h); // Process the image returned by the libavcodec decoder. |