X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fv4l2_m2m.h;h=456281f48c545c3355c716c7c555a7a6902ef3f9;hb=5e546864b09379910721b35a14713982d933d9dd;hp=452bf0d9bc2581c0d7da794de6d71c2be03330e6;hpb=f3881c04e93ee70567bd3fe087f49b996b026d30;p=ffmpeg diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h index 452bf0d9bc2..456281f48c5 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -56,13 +56,16 @@ typedef struct V4L2m2mContext { /* null frame/packet received */ int draining; + AVPacket buf_pkt; /* 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,36 +78,36 @@ 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 cant continue processing + * Reinitializes the V4L2m2mContext when the driver cannot continue processing * with the capture parameters. * * @param[in] ctx The V4L2m2mContext instantiated by the encoder/decoder. @@ -114,7 +117,7 @@ int ff_v4l2_m2m_codec_end(AVCodecContext *avctx); int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *ctx); /** - * Reinitializes the V4L2m2mContext when the driver cant continue processing + * Reinitializes the V4L2m2mContext when the driver cannot continue processing * with the any of the current V4L2Contexts (ie, changes in output and capture). * * @param[in] ctx The V4L2m2mContext instantiated by the encoder/decoder.