From 1f26a231bb065276cd80ce02957c759f3197edfa Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Fri, 21 Oct 2016 18:57:12 +0100 Subject: qsv: Merge libav implementation Merged as-at libav 398f015, and therefore includes outstanding skipped merges 04b17ff and 130e1f1. All features not in libav are preserved, and no options change. --- libavcodec/qsv_internal.h | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) (limited to 'libavcodec/qsv_internal.h') diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h index f289a2b2fa..82e1029a8b 100644 --- a/libavcodec/qsv_internal.h +++ b/libavcodec/qsv_internal.h @@ -21,21 +21,6 @@ #ifndef AVCODEC_QSV_INTERNAL_H #define AVCODEC_QSV_INTERNAL_H -#if CONFIG_VAAPI -#define AVCODEC_QSV_LINUX_SESSION_HANDLE -#endif //CONFIG_VAAPI - -#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE -#include -#include -#if HAVE_UNISTD_H -#include -#endif -#include -#include -#include -#endif - #include #include "libavutil/frame.h" @@ -43,7 +28,7 @@ #include "avcodec.h" #define QSV_VERSION_MAJOR 1 -#define QSV_VERSION_MINOR 9 +#define QSV_VERSION_MINOR 1 #define ASYNC_DEPTH_DEFAULT 4 // internal parallelism @@ -65,23 +50,26 @@ typedef struct QSVFrame { struct QSVFrame *next; } QSVFrame; -typedef struct QSVSession { - mfxSession session; -#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE - int fd_display; - VADisplay va_display; -#endif -} QSVSession; +typedef struct QSVFramesContext { + AVBufferRef *hw_frames_ctx; + mfxFrameInfo info; + mfxMemId *mids; + int nb_mids; +} QSVFramesContext; /** - * Convert a libmfx error code into a ffmpeg error code. + * Convert a libmfx error code into an ffmpeg error code. */ int ff_qsv_error(int mfx_err); int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id); +int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile); -int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, +int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session, const char *load_plugins); -int ff_qsv_close_internal_session(QSVSession *qs); + +int ff_qsv_init_session_hwcontext(AVCodecContext *avctx, mfxSession *session, + QSVFramesContext *qsv_frames_ctx, + const char *load_plugins, int opaque); #endif /* AVCODEC_QSV_INTERNAL_H */ -- cgit v1.2.3