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 0EF8B444B0 for ; Thu, 13 Oct 2022 13:50:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C85EB68BD83; Thu, 13 Oct 2022 16:49:28 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7754068BD5F for ; Thu, 13 Oct 2022 16:49:19 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 210D1240591 for ; Thu, 13 Oct 2022 15:49:16 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id OibgCzmM9NWy for ; Thu, 13 Oct 2022 15:49:15 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 5877A2405F9 for ; Thu, 13 Oct 2022 15:49:13 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 20C013A1767 for ; Thu, 13 Oct 2022 15:49:08 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 Oct 2022 15:48:58 +0200 Message-Id: <20221013134904.10104-7-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013134904.10104-1-anton@khirnov.net> References: <20221013134904.10104-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/13] fftools/ffmpeg_mux: move Muxer and MuxStream to a new 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This will allow ffmpeg_mux_init.c to see work with these structs. --- fftools/ffmpeg_mux.c | 36 +--------------------- fftools/ffmpeg_mux.h | 72 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 35 deletions(-) create mode 100644 fftools/ffmpeg_mux.h diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 7bc25c6175..09213472a6 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -21,6 +21,7 @@ #include #include "ffmpeg.h" +#include "ffmpeg_mux.h" #include "objpool.h" #include "sync_queue.h" #include "thread_queue.h" @@ -37,41 +38,6 @@ #include "libavformat/avformat.h" #include "libavformat/avio.h" -typedef struct MuxStream { - /* the packets are buffered here until the muxer is ready to be initialized */ - AVFifo *muxing_queue; - - /* - * The size of the AVPackets' buffers in queue. - * Updated when a packet is either pushed or pulled from the queue. - */ - size_t muxing_queue_data_size; - - /* dts of the last packet sent to the muxer, in the stream timebase - * used for making up missing dts values */ - int64_t last_mux_dts; -} MuxStream; - -struct Muxer { - AVFormatContext *fc; - - pthread_t thread; - ThreadQueue *tq; - - MuxStream *streams; - - AVDictionary *opts; - - int thread_queue_size; - - /* filesize limit expressed in bytes */ - int64_t limit_filesize; - atomic_int_least64_t last_filesize; - int header_written; - - AVPacket *sq_pkt; -}; - static int want_sdp = 1; static int64_t filesize(AVIOContext *pb) diff --git a/fftools/ffmpeg_mux.h b/fftools/ffmpeg_mux.h new file mode 100644 index 0000000000..920e4ff7ab --- /dev/null +++ b/fftools/ffmpeg_mux.h @@ -0,0 +1,72 @@ +/* + * Muxer internal APIs - should not be included outside of ffmpeg_mux* + * + * 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 FFTOOLS_FFMPEG_MUX_H +#define FFTOOLS_FFMPEG_MUX_H + +#include +#include + +#include "thread_queue.h" + +#include "libavformat/avformat.h" + +#include "libavcodec/packet.h" + +#include "libavutil/dict.h" +#include "libavutil/fifo.h" +#include "libavutil/thread.h" + +typedef struct MuxStream { + /* the packets are buffered here until the muxer is ready to be initialized */ + AVFifo *muxing_queue; + + /* + * The size of the AVPackets' buffers in queue. + * Updated when a packet is either pushed or pulled from the queue. + */ + size_t muxing_queue_data_size; + + /* dts of the last packet sent to the muxer, in the stream timebase + * used for making up missing dts values */ + int64_t last_mux_dts; +} MuxStream; + +struct Muxer { + AVFormatContext *fc; + + pthread_t thread; + ThreadQueue *tq; + + MuxStream *streams; + + AVDictionary *opts; + + int thread_queue_size; + + /* filesize limit expressed in bytes */ + int64_t limit_filesize; + atomic_int_least64_t last_filesize; + int header_written; + + AVPacket *sq_pkt; +}; + +#endif /* FFTOOLS_FFMPEG_MUX_H */ -- 2.35.1 _______________________________________________ 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".