From patchwork Tue Apr 28 17:37:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 19343 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 E2A5444B549 for ; Tue, 28 Apr 2020 20:37:56 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CDAF068C61A; Tue, 28 Apr 2020 20:37:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 59DD768C5CF for ; Tue, 28 Apr 2020 20:37:52 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 3D2FAE3E28; Tue, 28 Apr 2020 19:37:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZKU579KPz703; Tue, 28 Apr 2020 19:37:50 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id C245FE40AC; Tue, 28 Apr 2020 19:37:48 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Apr 2020 19:37:25 +0200 Message-Id: <20200428173725.12482-8-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200428173725.12482-1-cus@passwd.hu> References: <20200428173725.12482-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH v4 8/8] avformat: remove retimeinterleave 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 Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It is not used by anything anymore. Signed-off-by: Marton Balint --- libavformat/retimeinterleave.c | 51 ------------------------------------------ libavformat/retimeinterleave.h | 51 ------------------------------------------ 2 files changed, 102 deletions(-) delete mode 100644 libavformat/retimeinterleave.c delete mode 100644 libavformat/retimeinterleave.h diff --git a/libavformat/retimeinterleave.c b/libavformat/retimeinterleave.c deleted file mode 100644 index 9f874e3626..0000000000 --- a/libavformat/retimeinterleave.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Retime Interleaving functions - * - * Copyright (c) 2009 Baptiste Coudurier - * - * 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 - */ - -#include "libavutil/mathematics.h" -#include "avformat.h" -#include "retimeinterleave.h" -#include "internal.h" - -void ff_retime_interleave_init(RetimeInterleaveContext *aic, AVRational time_base) -{ - aic->time_base = time_base; -} - -int ff_retime_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush, - int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int), - int (*compare_ts)(AVFormatContext *, const AVPacket *, const AVPacket *)) -{ - int ret; - - if (pkt) { - AVStream *st = s->streams[pkt->stream_index]; - RetimeInterleaveContext *aic = st->priv_data; - pkt->duration = av_rescale_q(pkt->duration, st->time_base, aic->time_base); - // rewrite pts and dts to be decoded time line position - pkt->pts = pkt->dts = aic->dts; - aic->dts += pkt->duration; - if ((ret = ff_interleave_add_packet(s, pkt, compare_ts)) < 0) - return ret; - } - - return get_packet(s, out, NULL, flush); -} diff --git a/libavformat/retimeinterleave.h b/libavformat/retimeinterleave.h deleted file mode 100644 index de0a7442b0..0000000000 --- a/libavformat/retimeinterleave.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * audio interleaving prototypes and declarations - * - * Copyright (c) 2009 Baptiste Coudurier - * - * 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_RETIMEINTERLEAVE_H -#define AVFORMAT_RETIMEINTERLEAVE_H - -#include "avformat.h" - -typedef struct RetimeInterleaveContext { - uint64_t dts; ///< current dts - AVRational time_base; ///< time base of output packets -} RetimeInterleaveContext; - -/** - * Init the retime interleave context - */ -void ff_retime_interleave_init(RetimeInterleaveContext *aic, AVRational time_base); - -/** - * Retime packets per RetimeInterleaveContext->time_base and interleave them - * correctly. - * The first element of AVStream->priv_data must be RetimeInterleaveContext - * when using this function. - * - * @param get_packet function will output a packet when streams are correctly interleaved. - * @param compare_ts function will compare AVPackets and decide interleaving order. - */ -int ff_retime_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush, - int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int), - int (*compare_ts)(AVFormatContext *, const AVPacket *, const AVPacket *)); - -#endif /* AVFORMAT_AUDIOINTERLEAVE_H */