summaryrefslogtreecommitdiff
path: root/libavcodec/vda.h
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2015-05-10 21:32:59 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-05-13 17:39:37 +0200
commite7c5e17d4fbd7c83fb331bf327e25ebd8e6a8623 (patch)
tree25b9fa293c02f0e10827a3649ed92ff55f571b36 /libavcodec/vda.h
parent3b5e5e6a29d62462d0505287042fa4c2b99c4f2b (diff)
vda: Make output CVPixelBuffer format configurable
This is useful for client programs to ask for nv12 surfaces instead of the current default (uyvy), since those are more efficient to decode to. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/vda.h')
-rw-r--r--libavcodec/vda.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/vda.h b/libavcodec/vda.h
index 9aa5d297fb..5e7228c94e 100644
--- a/libavcodec/vda.h
+++ b/libavcodec/vda.h
@@ -153,6 +153,12 @@ typedef struct AVVDAContext {
* Set by av_vda_alloc_context().
*/
VDADecoderOutputCallback output_callback;
+
+ /**
+ * CVPixelBuffer Format Type that VDA will use for decoded frames; set by
+ * the caller.
+ */
+ OSType cv_pix_fmt_type;
} AVVDAContext;
/**
@@ -181,6 +187,17 @@ AVVDAContext *av_vda_alloc_context(void);
int av_vda_default_init(AVCodecContext *avctx);
/**
+ * This is a convenience function that creates and sets up the VDA context using
+ * an internal implementation.
+ *
+ * @param avctx the corresponding codec context
+ * @param vdactx the VDA context to use
+ *
+ * @return >= 0 on success, a negative AVERROR code on failure
+ */
+int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx);
+
+/**
* This function must be called to free the VDA context initialized with
* av_vda_default_init().
*