Hi, 2014-08-31 21:24 GMT+02:00 Luca Barbato <lu_z...@gentoo.org>: > --- > Makefile | 1 + > avconv.h | 2 ++ > avconv_opt.c | 3 +++ > avconv_qsv.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 61 insertions(+) > create mode 100644 avconv_qsv.c > > diff --git a/Makefile b/Makefile > index cc016b3..2707b15 100644 > --- a/Makefile > +++ b/Makefile > @@ -76,6 +76,7 @@ OBJS-avconv += avconv_opt.o > avconv_filter.o > OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o > OBJS-avconv-$(HAVE_DXVA2_LIB) += avconv_dxva2.o > OBJS-avconv-$(CONFIG_VDA) += avconv_vda.o > +OBJS-avconv-$(CONFIG_QSV) += avconv_qsv.o > > TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64 > HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options > diff --git a/avconv.h b/avconv.h > index b932d7e..862f37c 100644 > --- a/avconv.h > +++ b/avconv.h > @@ -54,6 +54,7 @@ enum HWAccelID { > HWACCEL_VDPAU, > HWACCEL_DXVA2, > HWACCEL_VDA, > + HWACCEL_QSV, > }; > > typedef struct HWAccel { > @@ -427,5 +428,6 @@ int avconv_parse_options(int argc, char **argv); > int vdpau_init(AVCodecContext *s); > int dxva2_init(AVCodecContext *s); > int vda_init(AVCodecContext *s); > +int qsv_init(AVCodecContext *s); > > #endif /* AVCONV_H */ > diff --git a/avconv_opt.c b/avconv_opt.c > index 2d06912..f17c8d9 100644 > --- a/avconv_opt.c > +++ b/avconv_opt.c > @@ -63,6 +63,9 @@ const HWAccel hwaccels[] = { > #if CONFIG_VDA > { "vda", vda_init, HWACCEL_VDA, AV_PIX_FMT_VDA }, > #endif > +#if CONFIG_QSV > + { "qsv", qsv_init, HWACCEL_VDA, AV_PIX_FMT_NONE }, > +#endif > { 0 }, > };
Is this expected? i.e. shouldn't this be HWACCEL_QSV? > > diff --git a/avconv_qsv.c b/avconv_qsv.c > new file mode 100644 > index 0000000..fdbdb6f > --- /dev/null > +++ b/avconv_qsv.c > @@ -0,0 +1,55 @@ > +/* > + * 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 "libavcodec/avcodec.h" > +#include "libavcodec/qsv.h" > + > +#include "libavutil/imgutils.h" > + > +#include "avconv.h" > + > +static void qsv_uninit(AVCodecContext *s) > +{ > + InputStream *ist = s->opaque; > + > + ist->hwaccel_uninit = NULL; > + ist->hwaccel_retrieve_data = NULL; > + > + av_qsv_default_free(s); > + av_freep(&ist->hwaccel_ctx); > +} > + > +int qsv_init(AVCodecContext *s) > +{ > + InputStream *ist = s->opaque; > + int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : > AV_LOG_ERROR; > + int ret; > + > + ist->hwaccel_uninit = qsv_uninit; > + > + ret = av_qsv_default_init(s); > + if (ret < 0) { > + av_log(NULL, loglevel, "Error creating QSV decoder.\n"); > + goto fail; > + } > + > + return 0; > +fail: > + qsv_uninit(s); > + return ret; > +} > -- > 1.8.5.1 > > _______________________________________________ > libav-devel mailing list > libav-devel@libav.org > https://lists.libav.org/mailman/listinfo/libav-devel -- Gwenole Beauchesne Intel Corporation SAS / 2 rue de Paris, 92196 Meudon Cedex, France Registration Number (RCS): Nanterre B 302 456 199 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel