summaryrefslogtreecommitdiffstats
path: root/libavcodec/v4l2_m2m.h
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2019-08-23 12:56:33 -0700
committerAman Gupta <aman@tmm1.net>2019-09-10 19:01:13 -0700
commitc0c7946196710d0579a9c85bf65289d5a123ab89 (patch)
tree35373c710bfb5d4930efe033bbcf9c61b29c7af1 /libavcodec/v4l2_m2m.h
parentd61cf1b1ebc2477749d7d7825a072400ed24af9f (diff)
downloadffmpeg-streaming-c0c7946196710d0579a9c85bf65289d5a123ab89.zip
ffmpeg-streaming-c0c7946196710d0579a9c85bf65289d5a123ab89.tar.gz
avcodec/v4l2_m2m: decouple v4l2_m2m helpers from AVCodecContext
This will allow re-use of the m2m backend with AVFilterContext Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/v4l2_m2m.h')
-rw-r--r--libavcodec/v4l2_m2m.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h
index 0d4671b..c860e96 100644
--- a/libavcodec/v4l2_m2m.h
+++ b/libavcodec/v4l2_m2m.h
@@ -59,10 +59,12 @@ typedef struct V4L2m2mContext {
/* Reference to self; only valid while codec is active. */
AVBufferRef *self_ref;
+
+ /* reference back to V4L2m2mPriv */
+ void *priv;
} V4L2m2mContext;
-typedef struct V4L2m2mPriv
-{
+typedef struct V4L2m2mPriv {
AVClass *class;
V4L2m2mContext *context;
@@ -75,33 +77,33 @@ typedef struct V4L2m2mPriv
/**
* Allocate a new context and references for a V4L2 M2M instance.
*
- * @param[in] ctx The AVCodecContext instantiated by the encoder/decoder.
+ * @param[in] ctx The V4L2m2mPriv instantiated by the encoder/decoder.
* @param[out] ctx The V4L2m2mContext.
*
* @returns 0 in success, a negative error code otherwise.
*/
-int ff_v4l2_m2m_create_context(AVCodecContext *avctx, V4L2m2mContext **s);
+int ff_v4l2_m2m_create_context(V4L2m2mPriv *priv, V4L2m2mContext **s);
/**
* Probes the video nodes looking for the required codec capabilities.
*
- * @param[in] ctx The AVCodecContext instantiated by the encoder/decoder.
+ * @param[in] ctx The V4L2m2mPriv instantiated by the encoder/decoder.
*
* @returns 0 if a driver is found, a negative number otherwise.
*/
-int ff_v4l2_m2m_codec_init(AVCodecContext *avctx);
+int ff_v4l2_m2m_codec_init(V4L2m2mPriv *priv);
/**
* Releases all the codec resources if all AVBufferRefs have been returned to the
* ctx. Otherwise keep the driver open.
*
- * @param[in] The AVCodecContext instantiated by the encoder/decoder.
+ * @param[in] The V4L2m2mPriv instantiated by the encoder/decoder.
*
* @returns 0
*
*/
-int ff_v4l2_m2m_codec_end(AVCodecContext *avctx);
+int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv);
/**
* Reinitializes the V4L2m2mContext when the driver cannot continue processing
OpenPOWER on IntegriCloud