Lines Matching refs:ctx

182     VAAPIDeviceContext *ctx = hwdev->internal->priv;
185 for (i = 0; i < ctx->nb_formats; i++) {
186 if (ctx->formats[i].pix_fmt == pix_fmt) {
188 *image_format = &ctx->formats[i].image_format;
201 VAAPIDeviceContext *ctx = hwdev->internal->priv;
297 constraints->valid_sw_formats = av_malloc_array(ctx->nb_formats + 1,
303 for (i = j = 0; i < ctx->nb_formats; i++) {
307 if (constraints->valid_sw_formats[k] == ctx->formats[i].pix_fmt)
312 constraints->valid_sw_formats[j++] = ctx->formats[i].pix_fmt;
359 VAAPIDeviceContext *ctx = hwdev->internal->priv;
384 ctx->formats = av_malloc(image_count * sizeof(*ctx->formats));
385 if (!ctx->formats) {
389 ctx->nb_formats = 0;
399 ctx->formats[ctx->nb_formats].pix_fmt = pix_fmt;
400 ctx->formats[ctx->nb_formats].image_format = image_list[i];
401 ++ctx->nb_formats;
442 av_freep(&ctx->formats);
449 VAAPIDeviceContext *ctx = hwdev->internal->priv;
451 av_freep(&ctx->formats);
473 VAAPIFramesContext *ctx = hwfc->internal->priv;
484 vas = vaCreateSurfaces(hwctx->display, ctx->rt_format,
487 ctx->attributes, ctx->nb_attributes);
517 VAAPIFramesContext *ctx = hwfc->internal->priv;
544 ctx->nb_attributes =
547 ctx->attributes = av_malloc(ctx->nb_attributes *
548 sizeof(*ctx->attributes));
549 if (!ctx->attributes) {
555 ctx->attributes[i] = avfc->attributes[i];
557 ctx->attributes[i++] = (VASurfaceAttrib) {
565 ctx->attributes[i++] = (VASurfaceAttrib) {
572 av_assert0(i == ctx->nb_attributes);
574 ctx->attributes = NULL;
575 ctx->nb_attributes = 0;
578 ctx->rt_format = desc->rt_format;
629 ctx->derive_works = 0;
638 ctx->derive_works = 1;
662 av_freep(&ctx->attributes);
669 VAAPIFramesContext *ctx = hwfc->internal->priv;
672 av_freep(&ctx->attributes);
693 VAAPIDeviceContext *ctx = hwfc->device_ctx->internal->priv;
698 for (i = 0; i < ctx->nb_formats; i++) {
699 if (ctx->formats[i].pix_fmt == hwfc->sw_format)
703 pix_fmts = av_malloc((ctx->nb_formats + 1) * sizeof(*pix_fmts));
713 for (i = 0; i < ctx->nb_formats; i++) {
714 if (ctx->formats[i].pix_fmt == hwfc->sw_format)
716 av_assert0(k < ctx->nb_formats);
717 pix_fmts[k++] = ctx->formats[i].pix_fmt;
766 VAAPIFramesContext *ctx = hwfc->internal->priv;
778 if (!ctx->derive_works && (flags & AV_HWFRAME_MAP_DIRECT)) {
816 if (ctx->derive_works && dst->format == hwfc->sw_format &&
1559 static void vaapi_device_free(AVHWDeviceContext *ctx)
1561 AVVAAPIDeviceContext *hwctx = ctx->hwctx;
1562 VAAPIDevicePriv *priv = ctx->user_opaque;
1581 AVHWDeviceContext *ctx = context;
1583 av_log(ctx, AV_LOG_ERROR, "libva: %s", message);
1588 AVHWDeviceContext *ctx = context;
1590 av_log(ctx, AV_LOG_VERBOSE, "libva: %s", message);
1594 static int vaapi_device_connect(AVHWDeviceContext *ctx,
1597 AVVAAPIDeviceContext *hwctx = ctx->hwctx;
1602 vaSetErrorCallback(display, &vaapi_device_log_error, ctx);
1603 vaSetInfoCallback (display, &vaapi_device_log_info, ctx);
1610 av_log(ctx, AV_LOG_ERROR, "Failed to initialise VAAPI "
1614 av_log(ctx, AV_LOG_VERBOSE, "Initialised VAAPI connection: "
1620 static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
1634 ctx->user_opaque = priv;
1635 ctx->free = vaapi_device_free;
1645 av_log(ctx, AV_LOG_ERROR, "Invalid connection type %s.\n",
1664 av_log(ctx, loglevel, "Failed to open %s as "
1680 av_log(ctx, AV_LOG_VERBOSE, "Cannot open "
1689 av_log(ctx, AV_LOG_VERBOSE, "Ignoring device %d "
1697 av_log(ctx, AV_LOG_VERBOSE, "Trying to use "
1705 av_log(ctx, AV_LOG_VERBOSE, "Trying to use "
1716 av_log(ctx, AV_LOG_VERBOSE, "Cannot open a VA display "
1729 av_log(ctx, AV_LOG_VERBOSE, "Cannot open X11 display "
1734 av_log(ctx, AV_LOG_ERROR, "Cannot open a VA display "
1739 av_log(ctx, AV_LOG_VERBOSE, "Opened VA display via "
1747 av_log(ctx, AV_LOG_ERROR, "No VA display found for "
1750 av_log(ctx, AV_LOG_ERROR, "No VA display found for "
1761 av_log(ctx, AV_LOG_ERROR, "Failed to set driver name to "
1767 av_log(ctx, AV_LOG_WARNING, "Driver name setting is not "
1772 return vaapi_device_connect(ctx, display);
1775 static int vaapi_device_derive(AVHWDeviceContext *ctx,
1787 av_log(ctx, AV_LOG_ERROR, "DRM instance requires an associated "
1797 av_log(ctx, AV_LOG_ERROR, "DRM instance fd does not appear "
1806 av_log(ctx, AV_LOG_VERBOSE, "Using non-render node "
1813 av_log(ctx, AV_LOG_VERBOSE, "Using non-render node "
1818 av_log(ctx, AV_LOG_VERBOSE, "Using render node %s "
1847 ctx->user_opaque = priv;
1848 ctx->free = &vaapi_device_free;
1852 av_log(ctx, AV_LOG_ERROR, "Failed to open a VA display from "
1857 return vaapi_device_connect(ctx, display);