Path: blob/master/dep/ffmpeg/include/libavcodec/qsv.h
4216 views
/*1* Intel MediaSDK QSV public API2*3* This file is part of FFmpeg.4*5* FFmpeg is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* FFmpeg is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with FFmpeg; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#ifndef AVCODEC_QSV_H21#define AVCODEC_QSV_H2223#include <mfxvideo.h>2425#include "libavutil/buffer.h"2627/**28* This struct is used for communicating QSV parameters between libavcodec and29* the caller. It is managed by the caller and must be assigned to30* AVCodecContext.hwaccel_context.31* - decoding: hwaccel_context must be set on return from the get_format()32* callback33* - encoding: hwaccel_context must be set before avcodec_open2()34*/35typedef struct AVQSVContext {36/**37* If non-NULL, the session to use for encoding or decoding.38* Otherwise, libavcodec will try to create an internal session.39*/40mfxSession session;4142/**43* The IO pattern to use.44*/45int iopattern;4647/**48* Extra buffers to pass to encoder or decoder initialization.49*/50mfxExtBuffer **ext_buffers;51int nb_ext_buffers;5253/**54* Encoding only. If this field is set to non-zero by the caller, libavcodec55* will create an mfxExtOpaqueSurfaceAlloc extended buffer and pass it to56* the encoder initialization. This only makes sense if iopattern is also57* set to MFX_IOPATTERN_IN_OPAQUE_MEMORY.58*59* The number of allocated opaque surfaces will be the sum of the number60* required by the encoder and the user-provided value nb_opaque_surfaces.61* The array of the opaque surfaces will be exported to the caller through62* the opaque_surfaces field.63*64* The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0)65*/66int opaque_alloc;6768/**69* Encoding only, and only if opaque_alloc is set to non-zero. Before70* calling avcodec_open2(), the caller should set this field to the number71* of extra opaque surfaces to allocate beyond what is required by the72* encoder.73*74* On return from avcodec_open2(), this field will be set by libavcodec to75* the total number of allocated opaque surfaces.76*/77int nb_opaque_surfaces;7879/**80* Encoding only, and only if opaque_alloc is set to non-zero. On return81* from avcodec_open2(), this field will be used by libavcodec to export the82* array of the allocated opaque surfaces to the caller, so they can be83* passed to other parts of the pipeline.84*85* The buffer reference exported here is owned and managed by libavcodec,86* the callers should make their own reference with av_buffer_ref() and free87* it with av_buffer_unref() when it is no longer needed.88*89* The buffer data is an nb_opaque_surfaces-sized array of mfxFrameSurface1.90*/91AVBufferRef *opaque_surfaces;9293/**94* Encoding only, and only if opaque_alloc is set to non-zero. On return95* from avcodec_open2(), this field will be set to the surface type used in96* the opaque allocation request.97*/98int opaque_alloc_type;99} AVQSVContext;100101/**102* Allocate a new context.103*104* It must be freed by the caller with av_free().105*/106AVQSVContext *av_qsv_alloc_context(void);107108#endif /* AVCODEC_QSV_H */109110111