From patchwork Tue Aug 13 06:11:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 14472 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 9A0EB44A0EE for ; Tue, 13 Aug 2019 09:11:05 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 84D2A68AB70; Tue, 13 Aug 2019 09:11:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92CF768AAAB for ; Tue, 13 Aug 2019 09:10:58 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 23:10:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,380,1559545200"; d="scan'208";a="194125621" Received: from media_ffmpeg_skl_e3.sh.intel.com ([10.239.159.38]) by fmsmga001.fm.intel.com with ESMTP; 12 Aug 2019 23:10:56 -0700 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Aug 2019 14:11:08 +0800 Message-Id: <1565676672-2755-2-git-send-email-zhong.li@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565676672-2755-1-git-send-email-zhong.li@intel.com> References: <1565676672-2755-1-git-send-email-zhong.li@intel.com> Subject: [FFmpeg-devel] [PATCH 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 437ef7c..533804a 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -207,7 +207,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; @@ -518,7 +518,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 f701cee..c50e9c7 100644 --- a/libavcodec/qsv_internal.h +++ b/libavcodec/qsv_internal.h @@ -92,6 +92,8 @@ 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_level_to_mfx(enum AVCodecID codec_id, int level); +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);