Lines Matching defs:ctx
116 static int vdpau_init_pixmfts(AVHWDeviceContext *ctx)
118 AVVDPAUDeviceContext *hwctx = ctx->hwctx;
119 VDPAUDeviceContext *priv = ctx->internal->priv;
152 av_log(ctx, AV_LOG_ERROR, "Error getting the " #id " callback.\n"); \
158 static int vdpau_device_init(AVHWDeviceContext *ctx)
160 AVVDPAUDeviceContext *hwctx = ctx->hwctx;
161 VDPAUDeviceContext *priv = ctx->internal->priv;
172 ret = vdpau_init_pixmfts(ctx);
174 av_log(ctx, AV_LOG_ERROR, "Error querying the supported pixel formats\n");
181 static void vdpau_device_uninit(AVHWDeviceContext *ctx)
183 VDPAUDeviceContext *priv = ctx->internal->priv;
190 static int vdpau_frames_get_constraints(AVHWDeviceContext *ctx,
194 VDPAUDeviceContext *priv = ctx->internal->priv;
221 AVHWFramesContext *ctx = opaque;
222 VDPAUDeviceContext *device_priv = ctx->device_ctx->internal->priv;
230 AVHWFramesContext *ctx = opaque;
231 VDPAUFramesContext *priv = ctx->internal->priv;
232 AVVDPAUDeviceContext *device_hwctx = ctx->device_ctx->hwctx;
233 VDPAUDeviceContext *device_priv = ctx->device_ctx->internal->priv;
240 ctx->width, ctx->height, &surf);
242 av_log(ctx, AV_LOG_ERROR, "Error allocating a VDPAU video surface\n");
247 vdpau_buffer_free, ctx, AV_BUFFER_FLAG_READONLY);
256 static int vdpau_frames_init(AVHWFramesContext *ctx)
258 VDPAUDeviceContext *device_priv = ctx->device_ctx->internal->priv;
259 VDPAUFramesContext *priv = ctx->internal->priv;
264 if (vdpau_pix_fmts[i].frames_sw_format == ctx->sw_format) {
273 av_log(ctx, AV_LOG_ERROR, "Unsupported sw format: %s\n",
274 av_get_pix_fmt_name(ctx->sw_format));
278 if (!ctx->pool) {
279 ctx->internal->pool_internal = av_buffer_pool_init2(sizeof(VdpVideoSurface), ctx,
281 if (!ctx->internal->pool_internal)
291 static int vdpau_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
293 frame->buf[0] = av_buffer_pool_get(ctx->pool);
299 frame->width = ctx->width;
300 frame->height = ctx->height;
305 static int vdpau_transfer_get_formats(AVHWFramesContext *ctx,
309 VDPAUFramesContext *priv = ctx->internal->priv;
314 av_log(ctx, AV_LOG_ERROR,
329 static int vdpau_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
332 VDPAUFramesContext *priv = ctx->internal->priv;
346 av_log(ctx, AV_LOG_ERROR,
362 av_log(ctx, AV_LOG_ERROR,
380 av_log(ctx, AV_LOG_ERROR, "Error retrieving the data from a VDPAU surface\n");
387 static int vdpau_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
390 VDPAUFramesContext *priv = ctx->internal->priv;
404 av_log(ctx, AV_LOG_ERROR,
420 av_log(ctx, AV_LOG_ERROR,
435 av_log(ctx, AV_LOG_ERROR, "Error uploading the data to a VDPAU surface\n");
451 static void vdpau_device_free(AVHWDeviceContext *ctx)
453 AVVDPAUDeviceContext *hwctx = ctx->hwctx;
454 VDPAUDevicePriv *priv = ctx->user_opaque;
463 static int vdpau_device_create(AVHWDeviceContext *ctx, const char *device,
466 AVVDPAUDeviceContext *hwctx = ctx->hwctx;
477 ctx->user_opaque = priv;
478 ctx->free = vdpau_device_free;
482 av_log(ctx, AV_LOG_ERROR, "Cannot open the X11 display %s.\n",
491 av_log(ctx, AV_LOG_ERROR, "VDPAU device creation on X11 display %s failed.\n",
500 av_log(ctx, AV_LOG_VERBOSE, "Successfully created a VDPAU device (%s) on "