VAStatus vlVaQueryConfigProfiles(VADriverContextP ctx, VAProfile *profile_list, int *num_profiles) { struct pipe_screen *pscreen; enum pipe_video_profile p; VAProfile vap; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; *num_profiles = 0; pscreen = VL_VA_PSCREEN(ctx); for (p = PIPE_VIDEO_PROFILE_MPEG2_SIMPLE; p <= PIPE_VIDEO_PROFILE_HEVC_MAIN_444; ++p) { if (u_reduce_video_profile(p) == PIPE_VIDEO_FORMAT_MPEG4 && !debug_get_option_mpeg4()) continue; if (pscreen->get_video_param(pscreen, p, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_SUPPORTED)) { vap = PipeToProfile(p); if (vap != VAProfileNone) profile_list[(*num_profiles)++] = vap; } } /* Support postprocessing through vl_compositor */ profile_list[(*num_profiles)++] = VAProfileNone; return VA_STATUS_SUCCESS; }
/** * Retrieve the parameters used to create a VdpDecoder. */ VdpStatus vlVdpDecoderGetParameters(VdpDecoder decoder, VdpDecoderProfile *profile, uint32_t *width, uint32_t *height) { vlVdpDecoder *vldecoder; vldecoder = (vlVdpDecoder *)vlGetDataHTAB(decoder); if (!vldecoder) return VDP_STATUS_INVALID_HANDLE; *profile = PipeToProfile(vldecoder->decoder->profile); *width = vldecoder->decoder->width; *height = vldecoder->decoder->height; return VDP_STATUS_OK; }
VAStatus vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs) { vlVaDriver *drv; vlVaConfig *config; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; drv = VL_VA_DRIVER(ctx); if (!drv) return VA_STATUS_ERROR_INVALID_CONTEXT; pipe_mutex_lock(drv->mutex); config = handle_table_get(drv->htab, config_id); pipe_mutex_unlock(drv->mutex); if (!config) return VA_STATUS_ERROR_INVALID_CONFIG; *profile = PipeToProfile(config->profile); if (config->profile == PIPE_VIDEO_PROFILE_UNKNOWN) { *entrypoint = VAEntrypointVideoProc; *num_attribs = 0; return VA_STATUS_SUCCESS; } *entrypoint = config->entrypoint; *num_attribs = 1; attrib_list[0].type = VAConfigAttribRTFormat; attrib_list[0].value = config->rt_format; return VA_STATUS_SUCCESS; }
VAStatus vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs) { if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; *profile = PipeToProfile(config_id); if (config_id == PIPE_VIDEO_PROFILE_UNKNOWN) { *entrypoint = VAEntrypointVideoProc; *num_attribs = 0; return VA_STATUS_SUCCESS; } *entrypoint = VAEntrypointVLD; *num_attribs = 1; attrib_list[0].type = VAConfigAttribRTFormat; attrib_list[0].value = VA_RT_FORMAT_YUV420; return VA_STATUS_SUCCESS; }