From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 49FEE4C433
	for <ffmpegdev@gitmailbox.com>; Fri,  4 Apr 2025 20:41:09 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4971768B206;
	Fri,  4 Apr 2025 23:41:06 +0300 (EEST)
Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net
 [217.70.183.199])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AD05E687D23
 for <ffmpeg-devel@ffmpeg.org>; Fri,  4 Apr 2025 23:40:58 +0300 (EEST)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 196A9443F6
 for <ffmpeg-devel@ffmpeg.org>; Fri,  4 Apr 2025 20:40:57 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc;
 s=gm1; t=1743799258;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=q7kL6LskGMZLrPQMsLhMYp/milHHjc46iuvbyXgd5tg=;
 b=Hca9u7NVAK1s92xLxir5EqgGttvteQlEaAZCX/cp2yuZPmX0th8cL0Jq21U4WlyTjrDxPs
 AwKpGNVnYwXP9W33qG70FThXdAC5IPWenr5kNH+EOMsGEKgJsed2Id9HebjRwc1jilOxRo
 wXbUH37vtmgsSSpuARt13n7YTX/h09QuPsCI2ea9qZBU4BochLW+sOCtvpeCT3Nq43JoV2
 sCw0Ti0179Rr1S+DyXqg9en+9w21aLTDcKs02tnoDM+FQ1H44Hbd0o402um8rhQjmvSx4r
 6QgDl6stn4RLiiaCJ6m9Yc8FPC7ORAEfBgrF0FhMgVNS0TcDy4ibQyQCeVdpJw==
Date: Fri, 4 Apr 2025 22:40:57 +0200
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <20250404204057.GV4991@pb2>
References: <20250402182940.29726-1-romain.beauxis@gmail.com>
 <20250402182940.29726-3-romain.beauxis@gmail.com>
MIME-Version: 1.0
In-Reply-To: <20250402182940.29726-3-romain.beauxis@gmail.com>
X-GND-State: clean
X-GND-Score: -70
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduledvgedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg
X-GND-Sasl: michael@niedermayer.cc
Subject: Re: [FFmpeg-devel] [PATCH v10 2/8] tests: Add stream dump test API
 util.
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: multipart/mixed; boundary="===============7918990272288469724=="
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250404204057.GV4991@pb2/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>


--===============7918990272288469724==
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="JeB5mQ3vMq+/7m82"
Content-Disposition: inline


--JeB5mQ3vMq+/7m82
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 02, 2025 at 01:29:34PM -0500, Romain Beauxis wrote:
> ---
>  tests/Makefile                        |   1 +
>  tests/api/Makefile                    |   2 +-
>  tests/api/api-dump-stream-meta-test.c | 175 ++++++++++++++++++++++++++
>  3 files changed, 177 insertions(+), 1 deletion(-)
>  create mode 100644 tests/api/api-dump-stream-meta-test.c
>=20
> diff --git a/tests/Makefile b/tests/Makefile
> index f9f5fc07f3..1f7e5003c2 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -277,6 +277,7 @@ $(FATE_FFPROBE) $(FATE_FFMPEG_FFPROBE) $(FATE_SAMPLES=
_FFPROBE) $(FATE_SAMPLES_FF
>  $(FATE_SAMPLES_FASTSTART): tools/qt-faststart$(EXESUF)
>  $(FATE_SAMPLES_DUMP_DATA) $(FATE_SAMPLES_DUMP_DATA-yes): tools/venc_data=
_dump$(EXESUF)
>  $(FATE_SAMPLES_SCALE_SLICE): tools/scale_slice_test$(EXESUF)
> +$(FATE_SAMPLES_DUMP_STREAM_META): tests/api/api-dump-stream-meta-test$(E=
XESUF)
> =20
>  ifdef SAMPLES
>  FATE +=3D $(FATE_EXTERN)
> diff --git a/tests/api/Makefile b/tests/api/Makefile
> index c96e636756..a2cb06a729 100644
> --- a/tests/api/Makefile
> +++ b/tests/api/Makefile
> @@ -1,7 +1,7 @@
>  APITESTPROGS-$(call ENCDEC, FLAC, FLAC) +=3D api-flac
>  APITESTPROGS-$(call DEMDEC, H264, H264) +=3D api-h264
>  APITESTPROGS-$(call DEMDEC, H264, H264) +=3D api-h264-slice
> -APITESTPROGS-yes +=3D api-seek
> +APITESTPROGS-yes +=3D api-seek api-dump-stream-meta
>  APITESTPROGS-$(call DEMDEC, H263, H263) +=3D api-band
>  APITESTPROGS-$(HAVE_THREADS) +=3D api-threadmessage
>  APITESTPROGS +=3D $(APITESTPROGS-yes)
> diff --git a/tests/api/api-dump-stream-meta-test.c b/tests/api/api-dump-s=
tream-meta-test.c
> new file mode 100644
> index 0000000000..906d355fe3
> --- /dev/null
> +++ b/tests/api/api-dump-stream-meta-test.c
> @@ -0,0 +1,175 @@
> +/*
> + * Copyright (c) 2025 Romain Beauxis
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining=
 a copy
> + * of this software and associated documentation files (the "Software"),=
 to deal
> + * in the Software without restriction, including without limitation the=
 rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or =
sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be includ=
ed in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE=
SS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI=
TY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHA=
LL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR =
OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI=
NG FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING=
S IN
> + * THE SOFTWARE.
> + */
> +
> +/**
> + * Dump stream metadata
> + */
> +
> +#include "libavcodec/avcodec.h"
> +#include "libavformat/avformat.h"
> +#include "libavutil/timestamp.h"
> +
> +static int dump_stream_meta(const char *input_filename) {
> +    const AVCodec *codec =3D NULL;
> +    AVPacket *pkt =3D NULL;
> +    AVFrame *fr =3D NULL;
> +    AVFormatContext *fmt_ctx =3D NULL;
> +    AVCodecContext *ctx =3D NULL;
> +    AVCodecParameters *origin_par =3D NULL;
> +    AVStream *st;
> +    int stream_idx =3D 0;
> +    int result;
> +    char *metadata;
> +
> +    result =3D avformat_open_input(&fmt_ctx, input_filename, NULL, NULL);
> +    if (result < 0) {
> +        av_log(NULL, AV_LOG_ERROR, "Can't open file\n");
> +        return result;
> +    }
> +
> +    result =3D avformat_find_stream_info(fmt_ctx, NULL);
> +    if (result < 0) {
> +        av_log(NULL, AV_LOG_ERROR, "Can't get stream info\n");
> +        goto end;
> +    }
> +

> +    if (fmt_ctx->nb_streams > 1) {
> +	av_log(NULL, AV_LOG_ERROR, "More than one stream found in input!\n");
> +	goto end;
> +    }

2 stray tab in indent


[...]

--=20
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt compla=
in"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"

--JeB5mQ3vMq+/7m82
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ/BD2QAKCRBhHseHBAsP
q79yAJ4vEl83/sZ4qXSZqW5OiNDM26OMIQCdGTaYtrucIiOPtMvixlk2YBzce5A=
=IKo5
-----END PGP SIGNATURE-----

--JeB5mQ3vMq+/7m82--

--===============7918990272288469724==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

--===============7918990272288469724==--