From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1573F4600D for ; Sat, 29 Apr 2023 18:06:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5511A68BFEA; Sat, 29 Apr 2023 21:05:58 +0300 (EEST) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AB2E268BE39 for ; Sat, 29 Apr 2023 21:05:51 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id D67A2240008 for ; Sat, 29 Apr 2023 18:05:50 +0000 (UTC) Date: Sat, 29 Apr 2023 20:05:49 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230429180549.GJ275832@pb2> References: <20230429054950.6148-1-admin@superfashi.com> <20230429055306.7470-1-admin@superfashi.com> MIME-Version: 1.0 In-Reply-To: <20230429055306.7470-1-admin@superfashi.com> Subject: Re: [FFmpeg-devel] [PATCH v4] avformat: add MMTP parser and MMT/TLV demuxer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: multipart/mixed; boundary="===============1409942361584841439==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1409942361584841439== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7e8BFhNxqpjiNKz7" Content-Disposition: inline --7e8BFhNxqpjiNKz7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 29, 2023 at 02:53:06PM +0900, SuperFashi wrote: > v1 -> v2: Refactor using GetByteContext; Fix compile error. > v2 -> v3: Remove debug statement. > v3 -> v4: Squash commits (sorry, first time git patch user :( >=20 > This patch adds an MPEG Media Transport Protocol (MMTP) parser, as define= d in ISO/IEC 23008-1, and an MMT protocol over TLV packets (MMT/TLV) demuxe= r, as defined in ARIB STD-B32. Currently, it supports HEVC, AAC LATM, and A= RIB-TTML demuxing. >=20 > Since MMTP is designed to transmit over IP, there is no size information = within each MMTP packet, and there is no filesystem format defined alongsid= e the protocol. One industrial solution is a simple container format using = type=E2=80=93length=E2=80=93value packets, which is defined in ARIB STD-B32. >=20 > Another known container format for MMTP is using packet capture (pcap) fi= les which records network packets. This patch does not include the demuxer = for this container format. >=20 > Signed-off-by: SuperFashi > --- > Changelog | 1 + > doc/demuxers.texi | 4 + > libavformat/Makefile | 1 + > libavformat/allformats.c | 1 + > libavformat/mmtp.c | 1372 ++++++++++++++++++++++++++++++++++++++ > libavformat/mmtp.h | 61 ++ > libavformat/mmttlv.c | 324 +++++++++ > libavformat/version.h | 2 +- > 8 files changed, 1765 insertions(+), 1 deletion(-) > create mode 100644 libavformat/mmtp.c > create mode 100644 libavformat/mmtp.h > create mode 100644 libavformat/mmttlv.c >=20 > diff --git a/Changelog b/Changelog > index b6f6682904..2483fdd547 100644 > --- a/Changelog > +++ b/Changelog > @@ -6,6 +6,7 @@ version : > - Playdate video decoder and demuxer > - Extend VAAPI support for libva-win32 on Windows > - afireqsrc audio source filter > +- MMTP parser and MMT/TLV demuxer > =20 > version 6.0: > - Radiance HDR image support > diff --git a/doc/demuxers.texi b/doc/demuxers.texi > index 2d33b47a56..56aab251b2 100644 > --- a/doc/demuxers.texi > +++ b/doc/demuxers.texi > @@ -689,6 +689,10 @@ Set the sample rate for libopenmpt to output. > Range is from 1000 to INT_MAX. The value default is 48000. > @end table > =20 > +@section mmttlv > + > +Demuxer for MMT protocol over TLV packets (MMT/TLV), as defined in ARIB = STD-B32. > + > @section mov/mp4/3gp > =20 > Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/= IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12). > diff --git a/libavformat/Makefile b/libavformat/Makefile > index f8ad7c6a11..e32d6e71a3 100644 > --- a/libavformat/Makefile > +++ b/libavformat/Makefile > @@ -354,6 +354,7 @@ OBJS-$(CONFIG_MLV_DEMUXER) +=3D mlvdec.= o riffdec.o > OBJS-$(CONFIG_MM_DEMUXER) +=3D mm.o > OBJS-$(CONFIG_MMF_DEMUXER) +=3D mmf.o > OBJS-$(CONFIG_MMF_MUXER) +=3D mmf.o rawenc.o > +OBJS-$(CONFIG_MMTTLV_DEMUXER) +=3D mmtp.o mmttlv.o > OBJS-$(CONFIG_MODS_DEMUXER) +=3D mods.o > OBJS-$(CONFIG_MOFLEX_DEMUXER) +=3D moflex.o > OBJS-$(CONFIG_MOV_DEMUXER) +=3D mov.o mov_chan.o mov_esds.= o \ > diff --git a/libavformat/allformats.c b/libavformat/allformats.c > index efdb34e29d..d5f4f5680e 100644 > --- a/libavformat/allformats.c > +++ b/libavformat/allformats.c > @@ -270,6 +270,7 @@ extern const AVInputFormat ff_mlv_demuxer; > extern const AVInputFormat ff_mm_demuxer; > extern const AVInputFormat ff_mmf_demuxer; > extern const FFOutputFormat ff_mmf_muxer; > +extern const AVInputFormat ff_mmttlv_demuxer; > extern const AVInputFormat ff_mods_demuxer; > extern const AVInputFormat ff_moflex_demuxer; > extern const AVInputFormat ff_mov_demuxer; > diff --git a/libavformat/mmtp.c b/libavformat/mmtp.c > new file mode 100644 > index 0000000000..ba1fcab281 > --- /dev/null > +++ b/libavformat/mmtp.c > @@ -0,0 +1,1372 @@ > +/* > + * MPEG Media Transport Protocol (MMTP) parser, as defined in ISO/IEC 23= 008-1. > + * Copyright (c) 2023 SuperFashi > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1= 301 USA > + */ > +#include "libavutil/mem.h" > +#include "libavutil/avassert.h" > +#include "libavutil/intreadwrite.h" > +#include "libavcodec/bytestream.h" > +#include "network.h" > +#include "mmtp.h" > +#include "internal.h" > +#include "demux.h" > + > +#include > + > +#define ENSURE_BS_LEFT(bs, size) if (bytestream2_get_bytes_left(bs) < (s= ize)) return AVERROR_INVALIDDATA please dont wrap libavcodec API in another API if every file in libavformat did that, noone would be able to read code except their own files > + > +struct MMTGeneralLocationInfo { > + uint8_t location_type; > + union { > + struct { > + uint16_t packet_id; > + } type0; > + struct { > + struct in_addr ipv4_src_addr; > + struct in_addr ipv4_dst_addr; > + in_port_t dst_port; src/libavformat/mmtp.c:43:13: error: unknown type name =E2=80=98in_port_t= =E2=80=99 in_port_t dst_port; =20 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If the United States is serious about tackling the national security threat= s=20 related to an insecure 5G network, it needs to rethink the extent to which = it values corporate profits and government espionage over security.-Bruce Schn= eier --7e8BFhNxqpjiNKz7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZE1ceQAKCRBhHseHBAsP q4ucAJ9vpcSN/x+9GcSzDgGKhIYWhbYXDQCgkZjxN7+vUC4GsChLAh8w34XNMig= =dk4e -----END PGP SIGNATURE----- --7e8BFhNxqpjiNKz7-- --===============1409942361584841439== 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". --===============1409942361584841439==--