On Mon, 27 Mar 2017 21:38:12 +0100 Mark Thompson <[email protected]> wrote:
> This also adds a new field to AVHWAccel to set supported hardware device > types, so that we can query the right hwaccel. > --- > Not entirely sure that the AVCodecContext should be the first argument of > probe_hw() - AVCodecParameters might be nicer, but we are likely to end up > needing an AVCodecContext anyway. (More generally, please bikeshed freely > over naming and structures used.) > > The probe_hw() function on the D*VA hwaccel would be where the extra > alignment gets set (when AVCodecContext.hw_device_ctx is not used). > /** > @@ -4927,6 +4947,37 @@ const AVCodecDescriptor > *avcodec_descriptor_get_by_name(const char *name); > AVCPBProperties *av_cpb_properties_alloc(size_t *size); > > /** > + * Probe hardware support for the given codec parameters. > + * > + * For decoders, it tests whether a stream with the given parameters can be > + * decoded on the given device. For encoders, it tests whether encoding with > + * the given parameters is possible on the device. > + * > + * On successful return, the fields of hw_frames_ref are set such that, once > + * initialised, it will be usable as AVCodecContext.hw_frames_ctx. If the > + * user has additional requirements to apply to the frames context (for > + * example, for a larger pool size or for frames created with some system- > + * specific attribute) then they should be applied after this call but before > + * calling av_hwframe_ctx_init(). > + * > + * The device to use is provided as the allocating context of hw_frames_ref. > + * (Even if set, the hw_frames_ctx and hw_device_ctx fields of avctx are > + * ignored.) > + * > + * @param avctx Codec context with relevant fields set. It need not have > been > + * opened. > + * @param hw_frames_ref A reference to a newly-allocated AVHWFramesContext, > + * which will be used to return the result. > + * @return 0 on success, otherwise negative error code: > + * AVERROR(ENOSYS): This function is not implemented (hardware support > + * may or may not be available). > + * AVERROR(ENODEV): The device is not usable. > + * AVERROR(EINVAL): The codec parameters are not supported. > + * Other errors: Probing failed for some other reason. > + */ > +int avcodec_probe_hw(AVCodecContext *avctx, AVBufferRef *hw_frames_ref); > + > +/** > * @} So I had concerns wrt. dxva2/d3d11va. Now I've actually written a patch that adds support for the new hwaccel API (essentially creating a new d3d11va hwaccel to make it match with the new common API). This patch adds a private dxva_adjust_hwframes() function. Would it be compatible with this function? _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
