From patchwork Fri Mar 8 07:40:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 12259 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E2A06447EDF for ; Fri, 8 Mar 2019 16:56:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D1A5068A79A; Fri, 8 Mar 2019 16:56:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5E2368A770 for ; Fri, 8 Mar 2019 16:55:58 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2019 06:55:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,456,1544515200"; d="scan'208";a="149846418" Received: from blue-kbl.sh.intel.com ([10.239.13.16]) by fmsmga002.fm.intel.com with ESMTP; 08 Mar 2019 06:55:53 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Mar 2019 15:40:24 +0800 Message-Id: <20190308074028.13474-3-zhong.li@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190308074028.13474-1-zhong.li@intel.com> References: <20190308074028.13474-1-zhong.li@intel.com> Subject: [FFmpeg-devel] [PATCH v3 2/6] lavc/qsv: make function qsv_map_fourcc() can be called externally X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhong Li MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Zhong Li --- libavcodec/qsv.c | 4 ++-- libavcodec/qsv_internal.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 224bc00ce4..711fd3df1e 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -158,7 +158,7 @@ int ff_qsv_print_warning(void *log_ctx, mfxStatus err, return ret; } -static enum AVPixelFormat qsv_map_fourcc(uint32_t fourcc) +enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc) { switch (fourcc) { case MFX_FOURCC_NV12: return AV_PIX_FMT_NV12; @@ -469,7 +469,7 @@ static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, frames_hwctx = frames_ctx->hwctx; frames_ctx->format = AV_PIX_FMT_QSV; - frames_ctx->sw_format = qsv_map_fourcc(i->FourCC); + frames_ctx->sw_format = ff_qsv_map_fourcc(i->FourCC); frames_ctx->width = i->Width; frames_ctx->height = i->Height; frames_ctx->initial_pool_size = req->NumFrameSuggested; diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h index 51c23d5c7b..c432ac8a3f 100644 --- a/libavcodec/qsv_internal.h +++ b/libavcodec/qsv_internal.h @@ -91,6 +91,8 @@ int ff_qsv_print_warning(void *log_ctx, mfxStatus err, int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id); int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile); +enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc); + int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc); enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type);