diff options
author | Clément Bœsch <u@pkh.me> | 2017-03-20 16:02:43 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2017-03-20 16:05:51 +0100 |
commit | 2feef75cb5e62faecd66b3a16978fda372f66324 (patch) | |
tree | c817ae488e7a0e11089e4cf1dd3039906bc76b8f | |
parent | e07fa3008bcafc027e9aa654657bae1f1ac64f5d (diff) | |
parent | 09a145b3c837273b1379321e44386a3233156e75 (diff) | |
download | ffmpeg-2feef75cb5e62faecd66b3a16978fda372f66324.tar.gz |
Merge commit '09a145b3c837273b1379321e44386a3233156e75'
* commit '09a145b3c837273b1379321e44386a3233156e75':
hwcontext_vdpau: Remove duplicate definition of GET_CALLBACK
Merged-by: Clément Bœsch <u@pkh.me>
-rw-r--r-- | libavutil/hwcontext_vdpau.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/libavutil/hwcontext_vdpau.c b/libavutil/hwcontext_vdpau.c index cce5396043..9b8f839647 100644 --- a/libavutil/hwcontext_vdpau.c +++ b/libavutil/hwcontext_vdpau.c @@ -127,13 +127,6 @@ static int vdpau_init_pixmfts(AVHWDeviceContext *ctx) return 0; } -static int vdpau_device_init(AVHWDeviceContext *ctx) -{ - AVVDPAUDeviceContext *hwctx = ctx->hwctx; - VDPAUDeviceContext *priv = ctx->internal->priv; - VdpStatus err; - int ret; - #define GET_CALLBACK(id, result) \ do { \ void *tmp; \ @@ -142,15 +135,22 @@ do { av_log(ctx, AV_LOG_ERROR, "Error getting the " #id " callback.\n"); \ return AVERROR_UNKNOWN; \ } \ - priv->result = tmp; \ + result = tmp; \ } while (0) +static int vdpau_device_init(AVHWDeviceContext *ctx) +{ + AVVDPAUDeviceContext *hwctx = ctx->hwctx; + VDPAUDeviceContext *priv = ctx->internal->priv; + VdpStatus err; + int ret; + GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES, - get_transfer_caps); - GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, get_data); - GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR, put_data); - GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, surf_create); - GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, surf_destroy); + priv->get_transfer_caps); + GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, priv->get_data); + GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR, priv->put_data); + GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, priv->surf_create); + GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, priv->surf_destroy); ret = vdpau_init_pixmfts(ctx); if (ret < 0) { @@ -160,7 +160,6 @@ do { return 0; } -#undef GET_CALLBACK static void vdpau_device_uninit(AVHWDeviceContext *ctx) { @@ -445,17 +444,6 @@ static int vdpau_device_create(AVHWDeviceContext *ctx, const char *device, return AVERROR_UNKNOWN; } -#define GET_CALLBACK(id, result) \ -do { \ - void *tmp; \ - err = hwctx->get_proc_address(hwctx->device, id, &tmp); \ - if (err != VDP_STATUS_OK) { \ - av_log(ctx, AV_LOG_ERROR, "Error getting the " #id " callback.\n"); \ - return AVERROR_UNKNOWN; \ - } \ - result = tmp; \ -} while (0) - GET_CALLBACK(VDP_FUNC_ID_GET_INFORMATION_STRING, get_information_string); GET_CALLBACK(VDP_FUNC_ID_DEVICE_DESTROY, priv->device_destroy); |