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; \
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) {
for (i = 0; i< FF_ARRAY_ELEMS(data) && dst->data[i]; i++) {
data[i] = dst->data[i];
- if (dst->linesize[i] < 0 || (uint64_t)dst->linesize > UINT32_MAX) {
+ if (dst->linesize[i] < 0 || dst->linesize[i] > UINT32_MAX) {
av_log(ctx, AV_LOG_ERROR,
"The linesize %d cannot be represented as uint32\n",
dst->linesize[i]);
for (i = 0; i< FF_ARRAY_ELEMS(data) && src->data[i]; i++) {
data[i] = src->data[i];
- if (src->linesize[i] < 0 || (uint64_t)src->linesize > UINT32_MAX) {
+ if (src->linesize[i] < 0 || src->linesize[i] > UINT32_MAX) {
av_log(ctx, AV_LOG_ERROR,
"The linesize %d cannot be represented as uint32\n",
src->linesize[i]);
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);