[FFmpeg-devel] [PATCH] Add hwaccel_data infrastructure
Michael Niedermayer
michaelni
Thu Mar 5 19:31:33 CET 2009
On Wed, Mar 04, 2009 at 10:31:46AM +0100, Gwenole Beauchesne wrote:
> On Wed, 4 Mar 2009, Michael Niedermayer wrote:
>
> >> Because I suggested open/close and you said only when needed. :) So I
> >> assumed it was the wrong route since, currently, VA API only needs
> >> av_mallocz() at frame buffer creation and do extra work at frame
> >> buffer destruction.
> >
> > can you explain what this extra work is?
>
> For VA API:
>
> int ff_vaapi_destroy_picture(AVCodecContext *avctx, AVFrame *pic)
> {
> struct vaapi_render_state_private *rds = pic->hwaccel_data_private;
> assert(rds);
> if (rds->slice_data) {
> if (!rds->mapped_slice_data)
> av_free(rds->slice_data);
> rds->slice_data = NULL;
> }
> if (rds->slice_params) {
> if (!rds->mapped_slice_data)
> av_free(rds->slice_params);
> rds->slice_params = NULL;
> }
> av_free(rds);
> return 0;
> }
>
> I could do that at ::end_frame() time, once they are committed, though.
>
> However, for VDPAU, I am not sure there is another place than a ::close()
> to destroy the bitstreamBuffers, unless they are copied locally in
> vdp_decoder_render(). IIRC, this is asynchronous so if we delete them
> straight away, some weird things could happen when the function comes to
> actually need them later. ;-)
i suggest to rename close to hwaccel_priv_close
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> ... defining _GNU_SOURCE...
For the love of all that is holy, and some that is not, don't do that.
-- Luca & Mans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090305/bb5cd1d9/attachment.pgp>
More information about the ffmpeg-devel
mailing list