summaryrefslogtreecommitdiff
path: root/libavcodec/qsv.h
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-22 15:54:14 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-10-22 15:55:43 +0200
commit866a4174dba066780c7be1ebdaa0152161cdf3e0 (patch)
tree18965c935c72e99a74a56b54ef150bad9df4ebe5 /libavcodec/qsv.h
parenta440886a35e3329830d0c96311a80bd0f08ef6f3 (diff)
parentdc923bc23b3efd949d0bf67ff1abdb95059e5843 (diff)
Merge commit 'dc923bc23b3efd949d0bf67ff1abdb95059e5843'
* commit 'dc923bc23b3efd949d0bf67ff1abdb95059e5843': qsvenc: add an API for allocating opaque surfaces Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/qsv.h')
-rw-r--r--libavcodec/qsv.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/libavcodec/qsv.h b/libavcodec/qsv.h
index 6049629cc9..b77158ec26 100644
--- a/libavcodec/qsv.h
+++ b/libavcodec/qsv.h
@@ -23,6 +23,8 @@
#include <mfx/mfxvideo.h>
+#include "libavutil/buffer.h"
+
/**
* This struct is used for communicating QSV parameters between libavcodec and
* the caller. It is managed by the caller and must be assigned to
@@ -48,6 +50,51 @@ typedef struct AVQSVContext {
*/
mfxExtBuffer **ext_buffers;
int nb_ext_buffers;
+
+ /**
+ * Encoding only. If this field is set to non-zero by the caller, libavcodec
+ * will create an mfxExtOpaqueSurfaceAlloc extended buffer and pass it to
+ * the encoder initialization. This only makes sense if iopattern is also
+ * set to MFX_IOPATTERN_IN_OPAQUE_MEMORY.
+ *
+ * The number of allocated opaque surfaces will be the sum of the number
+ * required by the encoder and the user-provided value nb_opaque_surfaces.
+ * The array of the opaque surfaces will be exported to the caller through
+ * the opaque_surfaces field.
+ */
+ int opaque_alloc;
+
+ /**
+ * Encoding only, and only if opaque_alloc is set to non-zero. Before
+ * calling avcodec_open2(), the caller should set this field to the number
+ * of extra opaque surfaces to allocate beyond what is required by the
+ * encoder.
+ *
+ * On return from avcodec_open2(), this field will be set by libavcodec to
+ * the total number of allocated opaque surfaces.
+ */
+ int nb_opaque_surfaces;
+
+ /**
+ * Encoding only, and only if opaque_alloc is set to non-zero. On return
+ * from avcodec_open2(), this field will be used by libavcodec to export the
+ * array of the allocated opaque surfaces to the caller, so they can be
+ * passed to other parts of the pipeline.
+ *
+ * The buffer reference exported here is owned and managed by libavcodec,
+ * the callers should make their own reference with av_buffer_ref() and free
+ * it with av_buffer_unref() when it is no longer needed.
+ *
+ * The buffer data is an nb_opaque_surfaces-sized array of mfxFrameSurface1.
+ */
+ AVBufferRef *opaque_surfaces;
+
+ /**
+ * Encoding only, and only if opaque_alloc is set to non-zero. On return
+ * from avcodec_open2(), this field will be set to the surface type used in
+ * the opaque allocation request.
+ */
+ int opaque_alloc_type;
} AVQSVContext;
/**