[FFmpeg-devel] [PATCH] HWAccel infrastructure (take 5)
Michael Niedermayer
michaelni
Fri Feb 20 21:06:10 CET 2009
On Fri, Feb 20, 2009 at 09:49:59PM +0200, Ivan Kalvachev wrote:
> On 2/20/09, Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> > On Fri, Feb 20, 2009 at 06:06:08PM +0100, Gwenole Beauchesne wrote:
> >> static inline int is_hwaccel_format(int imgfmt)
> >> {
> >> switch (get_video_hwaccel()) {
> >> case HWACCEL_VAAPI: return IMGFMT_IS_VAAPI(imgfmt) != 0;
> >> case HWACCEL_VDPAU: return IMGFMT_IS_VDPAU(imgfmt) != 0;
> >> case HWACCEL_XVMC: return IMGFMT_IS_XVMC(imgfmt) != 0;
> >> }
> >> return 0;
> >> }
> >>
> >> static enum PixelFormat get_format(struct AVCodecContext *avctx,
> >> const enum PixelFormat *fmt){
> >> enum PixelFormat selected_format = PIX_FMT_NONE;
> >> int imgfmt;
> >> sh_video_t *sh = avctx->opaque;
> >> int i, try_hwaccel;
> >>
> >> for (try_hwaccel = 1; try_hwaccel >= 0; --try_hwaccel) {
> >> for (i = 0; fmt[i] != PIX_FMT_NONE; i++){
> >> imgfmt = pixfmt2imgfmt(fmt[i]);
> >> if ((try_hwaccel ^ is_hwaccel_format(imgfmt)) != 0)
> >> continue;
> >> mp_msg(MSGT_DECVIDEO, MSGL_INFO,
> >> MSGTR_MPCODECS_TryingPixfmt, i);
> >> if (query_format(sh, imgfmt)) {
> >> selected_format = fmt[i];
> >> break;
> >> }
> >
> > Well, it is still reimplementing the FFmpeg function, even though for
>
> My point exactly.
>
> > MPlayer it is not such an issue since IMGFMT_IS_.. is relatively easy
> > to do, it may be more effort for other applications.
>
> Precisely. What we don't see here is one huge table holding all
> possible pix_fmt->imgfmt conversion.
>
> What I want to say is that the above function is useful and outside
> libavcodec and could be put in good use.
id like to export the whole pix fmt descriptor table not just accessor
functions to it but for this the thing needs a cleanup first, please
be patient or suggest ways to make it less bloated.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- 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/20090220/83b0f851/attachment.pgp>
More information about the ffmpeg-devel
mailing list