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 B455748CFF for ; Wed, 24 Jan 2024 18:45:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3209568D0EE; Wed, 24 Jan 2024 20:45:36 +0200 (EET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C032268D014 for ; Wed, 24 Jan 2024 20:45:29 +0200 (EET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6ddc6f5eaccso12218b3a.3 for ; Wed, 24 Jan 2024 10:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706121927; x=1706726727; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=+aEF8wN/Oy2fRWTMIc5qt04y+CGxM9d7V10x5dID0RU=; b=dhut1Y3IsIGPoZakfGO1nC7XjGV4Jz41b9FrG9fE//uZnxIEivQ+vj3NlM149D47Zz OhzE3kM0x5pNoOK9GWjvlCE0Al0abHaDCwHtk6immBbdv16LuZAp1N98c8+vYfBL8YbS 2hwuN3eplmIgIo09aJ9IUJpuzhebVzNIcMCeBTfrIH4vZ8c3spcZUWN4xQ6tnCIuMwpy w9euA1s7wBNkUKtzLhg5EDTdu+4gRCKmClaAL9dYvazDbOWqRdVCVjceKhQV+afXkG+F IlJw1lHMfacNCVFMD5jc7ftwI4JARicMuIe+gtosJMBMceQKDQiWcEN/NKcdXnXmM2a3 +4Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706121927; x=1706726727; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+aEF8wN/Oy2fRWTMIc5qt04y+CGxM9d7V10x5dID0RU=; b=t+KIIDVEcWGpb/w8vgLCNmVq8f7HyVmI64ujGdjlWOTKQic+rjxZlVunoP0UmNjXHm ossjl9G5Bd2tCyJZaPYPNXxAIU37/oLIa7Ddzo/LQ29G0BmrNVHLq7OeIdu7crfI9qXW wd+UUlcm/8ItggnCEDH6LpOQrscar0gy3HDgzPhPjoOef85/SbtzS7WmxdolhM3uYvxM jp6uhl1H071Txtzp4eistcew34/wF8FTdNAkN6TNczmw8St5s5NOh/yB/T6WuUW6vhjP TN2G/vjmE7Qd5bMgIHMSbnScfs/293BA1fQDeftcAblvAvdB0h+B43OmUMAB8tARdDZY /aaA== X-Gm-Message-State: AOJu0YwHXSE9NJ5KeDeRt+hbKVLF+RO+BqwlKmsiPL23t1aXFNb7PY1L hJPcIF6hOJmIPARAO0pfzgdbRJHV8mAVj0ejfZOz7Rhc97lWZIBzXEVZIZ1k X-Google-Smtp-Source: AGHT+IEB2pFKvwDUT2aTOgKLBAUZnXcyeSW2aJaXh6DQZ+hm6JawHMKEwNrA1iTGO9+FwUe2d5xaNA== X-Received: by 2002:a05:6a00:10c5:b0:6db:e113:9f9a with SMTP id d5-20020a056a0010c500b006dbe1139f9amr5018420pfu.59.1706121926667; Wed, 24 Jan 2024 10:45:26 -0800 (PST) Received: from [192.168.0.18] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id f11-20020a63f74b000000b005cd821a01d4sm12179952pgk.28.2024.01.24.10.45.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jan 2024 10:45:26 -0800 (PST) Message-ID: <1c5d5e2b-1be1-4d93-b989-2d3d4224980b@gmail.com> Date: Wed, 24 Jan 2024 15:45:37 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240116005031.30423-1-jamrial@gmail.com> Content-Language: en-US From: James Almer Autocrypt: addr=jamrial@gmail.com; keydata= xsBNBFjZtqABCADLW+vdEoZaJZDsIO6geYFTOcn1unsEHefj9zn+3oTHlDFFzO47mzHsSfbK 9JE2xpOJEVnC8FAF5Sayi/pVwV+mtQUV3n5dgVeVBYF9GUQwOGFCpK8X54RRqhkgknbunOEE 0CtgAJgmpFmmmHgq02GvEspx1h/rh4apqwQR6QX4Favb+x9+i9ytVpwVcBX94vo2toyP7h/K BWfadQmb8ltgE1kshfg+SQs/H5bTV5Z1DuEASf02ZL/1qYB/sdTgWPLv9XMUHHsRFmMY8TMx wJSkP+Af3AiYQPJYz1B1D4tt98T/NoiVdin10zATakPjV8hXaobuRmxgakkUASXudydDABEB AAHNH0phbWVzIEFsbWVyIDxqYW1yaWFsQGdtYWlsLmNvbT7CwJIEEwEIADwCGwMGCwkIBwMC BhUIAgkKCwQWAgMBAh4BAheAFiEEd1EujP2UoWlX5pp6FGMBrXN2WeAFAmJoLUUCGQEACgkQ FGMBrXN2WeAFVQf9GtGhniRs1PzNUOgJktCnv6j4BbLieaIPYPEFXKDHOgjqQE2zVMYXnoXl Jam928ii902a8OY06r9ywn/R8ApD1/3NY/v64O71CY9scz5XyH2au8wIZ6HwFy3/f7sqjdGD uctY8Qs7rjT7NkoC5lmgMu2v2k03dGtM9AAf5AK5gU+H0EUw7vmKKiXzUqt5kvBuf4CEwXvH AQT1SMJ52rIlDWB7FQFyZeUbOAK2IgY/KNedfK6nsgd/eQVnlofPd2XoddE7kP6iys7jJefw DD3g3rZyDTq7in5dyk5glaNpWZpbHGBs+9SCYLnfQ8XvWqPFOD+gj0plamKANgOvavKTxM7A TQRY2bagAQgA69YtILj8kYxmqPr/M8+MXT7wVoOWVW9lvSmPquCELaDy/NIS7D06VC5EuE/6 JlJXZMTn37NLlyWhzwOgXuXw5w2tyoQQBuvqGiXJijuXwXH7HKdzrc6rpYtAqt5w05hzNrFS KrS0izG64VpWrfproy3BsL+8TBm9brLhhNPynVRqVukbbGzlATTzNQGZ14TTi2/dL6DkMQnM qn4jX9UEe4GdGQBP50bUJSSmeiIkyNLWA+znuN2PZEz930ZwNrF9GtDVw7mzcmpCZ7spldE2 tutbpy9D1bIqxyqBrYDSezyzL2adR1qgHyOTMCHg2AYNkrIQHrSyJxKTpZ1/hqOp8wARAQAB wsBfBBgBAgAJBQJY2bagAhsMAAoJEBRjAa1zdlnghekH/0Yb0iYJ74oID2f/Fj+AJKS2ekQF P2xOr8lpGzgp/+yWUvPtqbX0A33anBJdYwxaAC0NataX3tfZ+oJkzXqfmqhIHMPYHdZesJA2 Bk9hU/33mDl5s5U66/z0uelWzwKVHoQ2O6or4+qF3HJFSJLCe9uvWJ3zXf9F342Ftj73sfx+ 3xkw/IXsN1RqbYqDlzpoEQ99SIEfY/8Jjwnd3sIPfqkuyeaYfe6GJDqKawdCEP1oRRlbXEAp TJgYz8r3nPhGv9cdHNDCk44ISbsqVuxIEnLqi4fTPZaGupiQhT+srl268TTAp2TQW7+6Ce/b NPQorMquzS/LZoyALpmsYi/miMc= In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avformat: move internal stream related functions and structs to a separate header 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 1/24/2024 12:14 PM, Andreas Rheinhardt wrote: > James Almer: >> Signed-off-by: James Almer >> --- >> libavformat/Makefile | 1 + >> libavformat/avformat.c | 171 ---------------- >> libavformat/demux.h | 29 --- >> libavformat/internal.h | 319 +--------------------------- >> libavformat/stream.c | 196 ++++++++++++++++++ >> libavformat/stream_internal.h | 376 ++++++++++++++++++++++++++++++++++ >> 6 files changed, 574 insertions(+), 518 deletions(-) >> create mode 100644 libavformat/stream.c >> create mode 100644 libavformat/stream_internal.h >> >> diff --git a/libavformat/internal.h b/libavformat/internal.h >> index f93832b3c4..f97ebc818f 100644 >> --- a/libavformat/internal.h >> +++ b/libavformat/internal.h >> @@ -26,6 +26,7 @@ >> #include "libavcodec/packet_internal.h" >> >> #include "avformat.h" >> +#include "stream_internal.h" > > You seem to have included the new header in order to avoid checking > which of the internal.h inclusions should be replaced by > stream_internal.h. This basically defeats the point of adding a new > header (honestly, I don't really get the point of splitting this off > anyway: avformat.c is not that big). Anton suggested to split the stream related functions into their own file. But agree there's not a lot to gain. > >> >> #define MAX_URL_SIZE 4096 >> > > ... > >> diff --git a/libavformat/stream_internal.h b/libavformat/stream_internal.h >> new file mode 100644 >> index 0000000000..9759f30e3f >> --- /dev/null >> +++ b/libavformat/stream_internal.h >> @@ -0,0 +1,376 @@ >> +/* >> + * Stream related functions and structs >> + * >> + * 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-1301 USA >> + */ >> + >> +#ifndef AVFORMAT_STREAM_INTERNAL_H >> +#define AVFORMAT_STREAM_INTERNAL_H >> + >> +#include >> + >> +#include "libavcodec/bsf.h" >> +#include "libavcodec/packet_internal.h" >> +#include "libavcodec/parser.h" > > Including bsf.h and parser.h is unnecessary (the structs here don't need > the complete types and almost no file including this needs them either). > >> +#include "avformat.h" >> + >> +/** >> + * Fractional numbers for exact pts handling >> + * >> + * The exact value of the fractional number is: 'val + num / den'. >> + * num is assumed to be 0 <= num < den. >> + */ >> +typedef struct FFFrac { >> + int64_t val, num, den; >> +} FFFrac; >> + >> +#define MAX_STD_TIMEBASES (30*12+30+3+6) >> +typedef struct FFStreamInfo { >> + int64_t last_dts; >> + int64_t duration_gcd; >> + int duration_count; >> + int64_t rfps_duration_sum; >> + double (*duration_error)[2][MAX_STD_TIMEBASES]; >> + int64_t codec_info_duration; >> + int64_t codec_info_duration_fields; >> + int frame_delay_evidence; >> + >> + /** >> + * 0 -> decoder has not been searched for yet. >> + * >0 -> decoder found >> + * <0 -> decoder with codec_id == -found_decoder has not been found >> + */ >> + int found_decoder; >> + >> + int64_t last_duration; >> + >> + /** >> + * Those are used for average framerate estimation. >> + */ >> + int64_t fps_first_dts; >> + int fps_first_dts_idx; >> + int64_t fps_last_dts; >> + int fps_last_dts_idx; >> +} FFStreamInfo; > > Moving FFStreamInfo to this header makes it accessible to muxers, > although this is supposed to be a demuxer-only struct. > (Didn't you send this patch once before?) Ah, guess i did. I did get a sense of deja vu when i wrote this. I couldn't find anything like this in my local repo, so i might have lost the commit after sending the patch and ended up writing it again. _______________________________________________ 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".