Quoting wm4 (2015-12-27 14:33:26)
> On Sun, 20 Dec 2015 20:59:28 +0100
> Anton Khirnov <[email protected]> wrote:
>
> > ---
> > libavutil/Makefile | 1 +
> > libavutil/hwframe.c | 3 +
> > libavutil/hwframe_internal.h | 2 +
> > libavutil/hwframe_vdpau.c | 264
> > +++++++++++++++++++++++++++++++++++++++++++
> > libavutil/hwframe_vdpau.h | 30 +++++
> > 5 files changed, 300 insertions(+)
> > create mode 100644 libavutil/hwframe_vdpau.c
> > create mode 100644 libavutil/hwframe_vdpau.h
> >
> > diff --git a/libavutil/Makefile b/libavutil/Makefile
> > index 9dd6a78..7bb168e 100644
> > --- a/libavutil/Makefile
> > +++ b/libavutil/Makefile
> > @@ -105,6 +105,7 @@ OBJS = adler32.o
> > \
> > xtea.o \
> >
> > OBJS-$(CONFIG_LZO) += lzo.o
> > +OBJS-$(CONFIG_VDPAU) += hwframe_vdpau.o
> >
> > OBJS += $(COMPAT_OBJS:%=../compat/%)
> >
> > diff --git a/libavutil/hwframe.c b/libavutil/hwframe.c
> > index 15fb32c..7d57eb8 100644
> > --- a/libavutil/hwframe.c
> > +++ b/libavutil/hwframe.c
> > @@ -26,6 +26,9 @@
> > #include "mem.h"
> >
> > static const HWFrameType *hw_table[] = {
> > +#if CONFIG_VDPAU
> > + &ff_hwframe_type_vdpau,
> > +#endif
> > };
> >
> > static const AVClass hwframe_ctx_class = {
> > diff --git a/libavutil/hwframe_internal.h b/libavutil/hwframe_internal.h
> > index cae6ef9..93ac501 100644
> > --- a/libavutil/hwframe_internal.h
> > +++ b/libavutil/hwframe_internal.h
> > @@ -51,4 +51,6 @@ struct AVHWFramesInternal {
> > void *priv;
> > };
> >
> > +extern const HWFrameType ff_hwframe_type_vdpau;
> > +
> > #endif /* AVUTIL_HWFRAME_INTERNAL_H */
> > diff --git a/libavutil/hwframe_vdpau.c b/libavutil/hwframe_vdpau.c
> > new file mode 100644
> > index 0000000..3cbea4e3
> > --- /dev/null
> > +++ b/libavutil/hwframe_vdpau.c
> > @@ -0,0 +1,264 @@
> > +/*
> > + * This file is part of Libav.
> > + *
> > + * Libav is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2.1 of the License, or (at your option) any later version.
> > + *
> > + * Libav is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> > + * Lesser General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU Lesser General Public
> > + * License along with Libav; if not, write to the Free Software
> > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> > 02110-1301 USA
> > + */
> > +
> > +#include <stdint.h>
> > +#include <string.h>
> > +
> > +#include <vdpau/vdpau.h>
> > +
> > +#include "common.h"
> > +#include "hwframe.h"
> > +#include "hwframe_internal.h"
> > +#include "hwframe_vdpau.h"
> > +#include "mem.h"
> > +#include "pixfmt.h"
> > +#include "pixdesc.h"
> > +
> > +typedef struct VDPAUFramesContext {
> > + VdpVideoSurfaceGetParameters *get_surf_parameters;
> > + VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities *get_transfer_caps;
> > + VdpVideoSurfaceGetBitsYCbCr *get_data;
>
> Naming the fields much differently from the actual names is confusing.
>
andHavingLongJavaFunctionNamesIsPainful();
> > +typedef struct AVVDPAUFramesContext {
> > + VdpDevice device;
> > + VdpGetProcAddress *get_proc_address;
> > +} AVVDPAUFramesContext;
> > +
> > +#endif /* AVUTIL_HWFRAME_VDPAU_H */
>
> So how does this design work with preemption?
Why should it consider preemption at all? If you get preempted, it
returns an error and it's up the caller to decide what to do.
--
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel