From patchwork Wed Aug 3 22:33:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 85 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.67 with SMTP id o64csp921642vsd; Wed, 3 Aug 2016 15:55:22 -0700 (PDT) X-Received: by 10.194.96.205 with SMTP id du13mr66344687wjb.89.1470264921945; Wed, 03 Aug 2016 15:55:21 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ui6si10262483wjc.83.2016.08.03.15.55.21; Wed, 03 Aug 2016 15:55:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D338268A30A; Thu, 4 Aug 2016 01:55:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4543468A28A for ; Thu, 4 Aug 2016 01:34:36 +0300 (EEST) Received: by mail-oi0-f66.google.com with SMTP id d204so21237914oig.3 for ; Wed, 03 Aug 2016 15:34:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=7GaLLuBI3UmO/o7DzihhxhCf2Jdr5bX5t8JZEhVyt0I=; b=zZXUYCL0vFhNmRL1qMnWSac2e55zzzHfreRWOpTf6ei7FPGI3IF0keSl8fj4ZNmA9j 4NMiZBg0Fn0x9nUz+uH48G+yvik6D4RLvvtlXSRxWi1qtQMnzYD9xbCRsEUHJh0CXeFx Utx7O2lsZW1QyFre9DaNkJxfze0dSDgYyoWvE41Lmb0BhZWzu83qrA5mq26H03jCCrVC E24hzCCDU3b+tzk3fD8mYSKWE00cmO2kStmcmi+WksNDnuDJjNgwXsTHFzSbVmRM6UpA rcs4eCYq8UTIsUG2pCJNUBCg9F32WKFeTu2yn2U9rtYMA+tFdsN1F76woCJeIBEL9qN5 d5YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=7GaLLuBI3UmO/o7DzihhxhCf2Jdr5bX5t8JZEhVyt0I=; b=e5XwH9zKAsWprKvhQPrLYQNieGLPkRa9v0Ip66vffFOq1jQ5iLU69v0UXmfRTu4ayw LV15+AyQsHBVIO9G2PR1+UYaWRcfNjSuB7DgE+9LX4R9tAtKh5efRYRWRbkFya8mwsaX DA5X5Vn9MLAh281AY9vW5zfpBFWSrk6VbeX1pOqWlYmxvxuweiG7F3zowwnK84VhxK7X BNXIkDPy7L8uBXO+tlHert8N66e8/JluwrwWzBW9A4U5syWPQv56ZugX38mHVuyrJ953 fvJW1baip5dy88zSgbVC6POr0JRyKuRPWFr93aI/WVc2oNmkRISt1oWN2q74hOucpf5m QPEQ== X-Gm-Message-State: AEkoouv1DVRoL/K4E+nfyRrvoXkLjL+EmrA+PjQHsEZzb1i6hRGHc6/7WaBN1vGkLgSW1w== X-Received: by 10.202.219.69 with SMTP id s66mr42324231oig.149.1470263681234; Wed, 03 Aug 2016 15:34:41 -0700 (PDT) Received: from localhost.localdomain ([181.22.53.218]) by smtp.gmail.com with ESMTPSA id h2sm4835105otb.19.2016.08.03.15.34.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 15:34:40 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 3 Aug 2016 19:33:24 -0300 Message-Id: <20160803223324.5844-1-jamrial@gmail.com> X-Mailer: git-send-email 2.9.1 Subject: [FFmpeg-devel] [PATCH] avcodec: don't include vdpau_compat.h when vdpau is not enabled 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This removes unnecessary header dependencies. Signed-off-by: James Almer --- libavcodec/h263dec.c | 6 ++++-- libavcodec/h264_picture.c | 12 ++++++------ libavcodec/h264dec.c | 13 +++++++------ libavcodec/mpeg12dec.c | 7 ++++--- libavcodec/vc1dec.c | 7 ++++--- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index d0da1d3..953bbc5 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -41,7 +41,9 @@ #include "mpegvideo.h" #include "msmpeg4.h" #include "qpeldsp.h" +#if FF_API_CAP_VDPAU && CONFIG_MPEG4_VDPAU_DECODER #include "vdpau_compat.h" +#endif #include "thread.h" #include "wmv2.h" @@ -603,8 +605,8 @@ retry: if (!s->divx_packed && !avctx->hwaccel) ff_thread_finish_setup(avctx); -#if FF_API_CAP_VDPAU - if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)) { +#if FF_API_CAP_VDPAU && CONFIG_MPEG4_VDPAU_DECODER + if (s->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) { ff_vdpau_mpeg4_decode_picture(avctx->priv_data, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); goto frame_end; } diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index f634d2a..a721b8d 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -41,7 +41,9 @@ #include "mpegutils.h" #include "rectangle.h" #include "thread.h" +#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER #include "vdpau_compat.h" +#endif void ff_h264_unref_picture(H264Context *h, H264Picture *pic) { @@ -156,9 +158,8 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) int err = 0; h->mb_y = 0; -#if FF_API_CAP_VDPAU - if (CONFIG_H264_VDPAU_DECODER && - h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) +#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER + if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) ff_vdpau_h264_set_reference_frames(h); #endif @@ -179,9 +180,8 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) "hardware accelerator failed to decode picture\n"); } -#if FF_API_CAP_VDPAU - if (CONFIG_H264_VDPAU_DECODER && - h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) +#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER + if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) ff_vdpau_h264_picture_complete(h); #endif diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 323639d..35df360 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -50,10 +50,13 @@ #include "mathops.h" #include "me_cmp.h" #include "mpegutils.h" +#include "mpegvideo.h" #include "profiles.h" #include "rectangle.h" #include "thread.h" +#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER #include "vdpau_compat.h" +#endif static int h264_decode_end(AVCodecContext *avctx); @@ -844,9 +847,8 @@ again: if (h->avctx->hwaccel && (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0) goto end; -#if FF_API_CAP_VDPAU - if (CONFIG_H264_VDPAU_DECODER && - h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) +#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER + if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) ff_vdpau_h264_picture_start(h); #endif } @@ -858,9 +860,8 @@ again: nal->raw_size); if (ret < 0) goto end; -#if FF_API_CAP_VDPAU - } else if (CONFIG_H264_VDPAU_DECODER && - h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) { +#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER + } else if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) { ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0], start_code, sizeof(start_code)); diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 204a578..9f3daa3 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -47,7 +47,9 @@ #include "profiles.h" #include "thread.h" #include "version.h" +#if FF_API_VDPAU && (CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER) #include "vdpau_compat.h" +#endif #include "xvmc_internal.h" typedef struct Mpeg1Context { @@ -2433,9 +2435,8 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture, s2->er.error_count += s2->thread_context[i]->er.error_count; } -#if FF_API_VDPAU - if ((CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER) - && uses_vdpau(avctx)) +#if FF_API_VDPAU && (CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER) + if (uses_vdpau(avctx)) ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count); #endif diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 4f78aa8..dfe476a 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -37,7 +37,9 @@ #include "profiles.h" #include "vc1.h" #include "vc1data.h" +#if FF_API_CAP_VDPAU && CONFIG_VC1_VDPAU_DECODER #include "vdpau_compat.h" +#endif #include "libavutil/avassert.h" @@ -909,9 +911,8 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, s->me.qpel_put = s->qdsp.put_qpel_pixels_tab; s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab; -#if FF_API_CAP_VDPAU - if ((CONFIG_VC1_VDPAU_DECODER) - &&s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) { +#if FF_API_CAP_VDPAU && CONFIG_VC1_VDPAU_DECODER + if (s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) { if (v->field_mode && buf_start_second_field) { ff_vdpau_vc1_decode_picture(s, buf_start, buf_start_second_field - buf_start); ff_vdpau_vc1_decode_picture(s, buf_start_second_field, (buf + buf_size) - buf_start_second_field);