From patchwork Sat Feb 9 22:27:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 12013 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 134864484D3 for ; Sun, 10 Feb 2019 00:27:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F027768AA6F; Sun, 10 Feb 2019 00:27:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EE4F368AA37 for ; Sun, 10 Feb 2019 00:27:16 +0200 (EET) Received: by mail-it1-f195.google.com with SMTP id c9so17862683itj.1 for ; Sat, 09 Feb 2019 14:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=wcyqhFhWpsgl0sc8PTb9EIK1EhNaT3gtfdUP87scCfU=; b=LMHDAmpCqWNL8YPigl3lqi+xCP47DlMpXJKYVUoxSaUwTjXobGRzrsj4fGPiUyvByt iKNb+i0hrVWWtqcgaoNf2KIuaTlLxKlF6sABnlfOHTwf6xw321cepQna2wb8uX2NzZh+ +JMo4j0wR4jSw61B0Z14/vvTiwB70hXQkCBtDEgFfsFxiS8INX3jRC7LWK6WUnSdCuvC kyd/QPmI1/swHsRaJscAwHRFbME54DJI2VyCCibNuNiExHnk4rXK8ivWsx6/Gy3leVml IwelVZO085bCBDUcsf767gId3W5aUHtEJPnp2PE95FxUUFAAezbppEKqeVaOexjH4/Ro d0Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=wcyqhFhWpsgl0sc8PTb9EIK1EhNaT3gtfdUP87scCfU=; b=fsMps/N6mOWshgIXeT3X7qeDgvCLvBoC+Z879FV2VtZIQ4EHC21uWlC1uLdtA0/VDS bQxa6ACoQvZxgu0b4MAIhfbfmoaKp9e7BfL4Vfzfv5cmbxcK2BmsalZDQiQqSYhhb+D9 uMnzFE+HEK7haF/cRG3ZShe6K/6t+qBkVMjByAMxn4/z/FcBIF24my1CvFr9AiLdLs8i yly0yOJjvBMPoHOnQkNppHTlepIzBehtJpoeSFSI9ByoTlLVaZ+Qa3SumqeHQI4kOm3f Jwjcu5JR2KwRoSyajA1mcfw02r8Wbm6+q2ZyWjCGycM/PxGG8EKpaI3Ay9ZStPqM1baB Batg== X-Gm-Message-State: AHQUAuZTlb9gx4/cqMlLZ0N8JlYKeyamOVE31F9jf4I+rpROR2HsRLEi fAzrK2Y59F9FLqPtMY3XFFQItbhKvTikv5BIerH5ZA== X-Google-Smtp-Source: AHgI3IbkssHy1u+j34JDUo3PSTnicmLq6QXoYPZ7o/VDsvi+dRRjHv74yv2J7FZ7bXDpoNFEmIwG1PKtWhjzs8iV2O0= X-Received: by 2002:a24:6f51:: with SMTP id x78mr2188904itb.121.1549751235735; Sat, 09 Feb 2019 14:27:15 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a02:c890:0:0:0:0:0 with HTTP; Sat, 9 Feb 2019 14:27:15 -0800 (PST) In-Reply-To: References: From: Carl Eugen Hoyos Date: Sat, 9 Feb 2019 23:27:15 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH]lavf:Constify AVProbeData* in av_probe_input_format() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 2019-02-09 23:26 GMT+01:00, Carl Eugen Hoyos : > Hi! > > Attached patch constifies a few pointers at the next version bump. And the patch. Carl Eugen From cb2afc8b7e28b476d908daf1ae693bd007fb2abc Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 9 Feb 2019 23:22:59 +0100 Subject: [PATCH] lavf: Constify AVProbeData* in av_probe_input_format(). --- libavformat/avformat.h | 11 ++++++++--- libavformat/format.c | 6 +++--- libavformat/version.h | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index fdaffa5..c6e1e97 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -2231,7 +2231,12 @@ AVInputFormat *av_find_input_format(const char *short_name); * @param is_opened Whether the file is already opened; determines whether * demuxers with or without AVFMT_NOFILE are probed. */ -AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); +#if FF_API_AVIOFORMAT +#define av_const59 +#else +#define av_const59 const +#endif +AVInputFormat *av_probe_input_format(av_const59 AVProbeData *pd, int is_opened); /** * Guess the file format. @@ -2245,7 +2250,7 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended * to retry with a larger probe buffer. */ -AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max); +AVInputFormat *av_probe_input_format2(av_const59 AVProbeData *pd, int is_opened, int *score_max); /** * Guess the file format. @@ -2254,7 +2259,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score * demuxers with or without AVFMT_NOFILE are probed. * @param score_ret The score of the best detection. */ -AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret); +AVInputFormat *av_probe_input_format3(av_const59 AVProbeData *pd, int is_opened, int *score_ret); /** * Probe a bytestream to determine the input format. Each time a probe returns diff --git a/libavformat/format.c b/libavformat/format.c index 2c4c895..1ad8252 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -125,7 +125,7 @@ AVInputFormat *av_find_input_format(const char *short_name) return NULL; } -AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, +AVInputFormat *av_probe_input_format3(av_const59 AVProbeData *pd, int is_opened, int *score_ret) { AVProbeData lpd = *pd; @@ -202,7 +202,7 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, return fmt; } -AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) +AVInputFormat *av_probe_input_format2(av_const59 AVProbeData *pd, int is_opened, int *score_max) { int score_ret; AVInputFormat *fmt = av_probe_input_format3(pd, is_opened, &score_ret); @@ -213,7 +213,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score return NULL; } -AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened) +AVInputFormat *av_probe_input_format(av_const59 AVProbeData *pd, int is_opened) { int score = 0; return av_probe_input_format2(pd, is_opened, &score); diff --git a/libavformat/version.h b/libavformat/version.h index 4408eca..f189984 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -103,6 +103,9 @@ #ifndef FF_API_LAVF_MP4A_LATM #define FF_API_LAVF_MP4A_LATM (LIBAVFORMAT_VERSION_MAJOR < 59) #endif +#ifndef FF_API_AVIOFORMAT +#define FF_API_AVIOFORMAT (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif #ifndef FF_API_R_FRAME_RATE -- 1.7.10.4