[FFmpeg-devel] [RFC] Add AVFrame::hwaccel_data{, _private} (Was: [PATCH][VAAPI][2/6] Add common data structures and helpers)
Michael Niedermayer
michaelni
Mon Mar 2 15:48:08 CET 2009
On Mon, Mar 02, 2009 at 10:32:07AM +0100, Gwenole Beauchesne wrote:
> On Fri, 27 Feb 2009, Michael Niedermayer wrote:
>
> >> +/**
> >> + * Allocates HW acceleration private data
> >> + */
> >> +static void *alloc_hwaccel_data_private(AVCodecContext *avctx)
> >> +{
> >> + void *pdata = NULL;
> >> + assert(avctx->hwaccel);
> >> + switch (avctx->hwaccel->pix_fmt) {
> >> + case PIX_FMT_VAAPI_MOCO:
> >> + case PIX_FMT_VAAPI_IDCT:
> >> + case PIX_FMT_VAAPI_VLD:
> >> + pdata = ff_alloc_vaapi_render_state_private();
> >> + break;
> >> + default:
> >> + break;
> >> + }
> >> + return pdata;
> >> +}
> >
> > these probably should be done differently, but i first need to take a
> > look at ff_free_vaapi_render_state_private()
> > if its just a wraper around a avmalloc() then a priv_data_size field
> > in AVHWAccel should do otherwise i guess a open/close in AVHWAccel
> > would be better
>
> Yes, I also wondered about that once I shrank the function to
> return av_mallocz(sizeof(struct vaapi_render_state_private));
>
> That's true for VA API, but others probably would want to do anything
> special. open/close then?
can be once its needed ...
>
> I am also wondering about a means to differentiate encode/decode as I
> foresee encode acceleration soon.
encode() can be added once its needed
>
> > spliting code out belongs in a seperate patch that does only split code
> > out, also
> > i dont like the name get_buffer() it makes grepping hard as theres
> > AVCodecContext.get_buffer()
>
> alloc_frame_buffer() / free_frame_buffer()?
ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- 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/20090302/1a2d98d6/attachment.pgp>
More information about the ffmpeg-devel
mailing list