]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qsv_internal.h
Merge commit '4ab61cd983b539749bd621ea271624ddb5196a8e'
[ffmpeg] / libavcodec / qsv_internal.h
index b1567fbef8341a3c0cf38037c5a07a80a7f33bda..814db08e6c9aa5fb2dccc1e5740e2b7db876c502 100644 (file)
     (MFX_VERSION_MAJOR > (MAJOR) ||         \
      MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
 
+typedef struct QSVMid {
+    AVBufferRef *hw_frames_ref;
+    mfxHDL handle;
+
+    AVFrame *locked_frame;
+    AVFrame *hw_frame;
+    mfxFrameSurface1 surf;
+} QSVMid;
+
 typedef struct QSVFrame {
     AVFrame *frame;
     mfxFrameSurface1 surface;
@@ -51,9 +60,15 @@ typedef struct QSVFrame {
 
 typedef struct QSVFramesContext {
     AVBufferRef *hw_frames_ctx;
-    mfxFrameInfo info;
-    mfxMemId *mids;
-    int    nb_mids;
+    void *logctx;
+
+    /* The memory ids for the external frames.
+     * Refcounted, since we need one reference owned by the QSVFramesContext
+     * (i.e. by the encoder/decoder) and another one given to the MFX session
+     * from the frame allocator. */
+    AVBufferRef *mids_buf;
+    QSVMid *mids;
+    int  nb_mids;
 } QSVFramesContext;
 
 /**
@@ -79,4 +94,6 @@ int ff_qsv_init_session_hwcontext(AVCodecContext *avctx, mfxSession *session,
                                   QSVFramesContext *qsv_frames_ctx,
                                   const char *load_plugins, int opaque);
 
+int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame);
+
 #endif /* AVCODEC_QSV_INTERNAL_H */