From patchwork Mon Sep 26 17:39:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 730 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp2038546vsd; Mon, 26 Sep 2016 10:42:31 -0700 (PDT) X-Received: by 10.194.30.97 with SMTP id r1mr19002897wjh.8.1474911751821; Mon, 26 Sep 2016 10:42:31 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f135si9477001wmd.94.2016.09.26.10.42.31; Mon, 26 Sep 2016 10:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A7C51689B71; Mon, 26 Sep 2016 20:42:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0FBB9689B3F for ; Mon, 26 Sep 2016 20:42:05 +0300 (EEST) Received: by mail-oi0-f68.google.com with SMTP id a62so14037658oib.1 for ; Mon, 26 Sep 2016 10:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=pvMHE8d7iYLOYAN4ZE/uzhqg7N32YpRIRYErgoi9EtU=; b=BtfBEUgnKJLMglPpL9hQ7vDUYu9rGOZRt3v0blOCh9eGFRDXcuKFjZ45XQV2ZDx7+G c4/gQsP1pbk8UBt/pAZ13wc2gwt70tuTsP394vEaYTKBJqvi0XkRAF39FqWs7usN63oZ +EVqXSy+/ZuuGqO9FugozFB3hMCbi2jg8e+cxEzgA1zt2mitafB8vr6K4Le3j7ZuKvCZ WyCU6/XR4mOPSLbqJSijWpde4pETX3UFXdJTn4gLjWLRYlfX08IclFbKRVTBGPlxaE3m jodhEr4wSP8yccQyVNZNN+qTCUwfd+8v35cLRy2UUCDdu33vX0mQHADuPaWtGQZNwMxm 49VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=pvMHE8d7iYLOYAN4ZE/uzhqg7N32YpRIRYErgoi9EtU=; b=QIkR8yxJ8feaL42eU++acX52+GP9kFnkHuygMUh5sbMEcPLsLazSonfhby+H1dpLVJ 26hQ5ovVZQV5AWtDaDtmKFX/LaXifPZNLmIrw+f39c6UfJCzcOKQsL78vYWFmKRH/on6 jKYD0Rq2xGWr97Va6FAcAk2DOItsO17VoPhKZUpONSb6j3KId8P1Dd0u9qV/W6EGm4ZE fWepFqbZDaOs6CzAywUrqQkQ3IfQyhz5lvvdnvQXd9arhopQyuGf8UPHBEcBReZDRu/Y BrZglTHW1LI+iJ3vWugpXxJGouJJ1TNQIUgEx5sxn31aSSCoX1X9tYvZMywn85yeq6Aw AFHA== X-Gm-Message-State: AE9vXwOqxywRNH7znn5qpZAbDb93W15XPU/KdM6KhRCvBEimsjOkykmOMRz4/8DvhbXgAg== X-Received: by 10.202.252.22 with SMTP id a22mr25846080oii.124.1474911740905; Mon, 26 Sep 2016 10:42:20 -0700 (PDT) Received: from localhost.localdomain ([181.22.11.145]) by smtp.gmail.com with ESMTPSA id 92sm2127662otg.41.2016.09.26.10.42.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Sep 2016 10:42:20 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Sep 2016 14:39:12 -0300 Message-Id: <20160926173913.976-1-jamrial@gmail.com> X-Mailer: git-send-email 2.9.1 Subject: [FFmpeg-devel] [PATCH 1/2] avformat: add av_stream_get_codec_timebase() 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This will allow ffmpeg.c to stop using AVStream.codec in some cases Signed-off-by: James Almer --- TODO: Version bump, APIChanges entry. libavformat/avformat.h | 7 +++++++ libavformat/utils.c | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ae70cc8..057f8c5 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -2922,6 +2922,13 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, enum AVTimebaseSource copy_tb); /** + * Get the internal codec timebase from a stream. + * + * @param st input stream to extract the timebase from + */ +AVRational av_stream_get_codec_timebase(const AVStream *st); + +/** * @} */ diff --git a/libavformat/utils.c b/libavformat/utils.c index 3e0f57d..abb5fb9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -5383,3 +5383,13 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, return 0; } + +AVRational av_stream_get_codec_timebase(const AVStream *st) +{ + // See avformat_transfer_internal_stream_timing_info() TODO. +#if FF_API_LAVF_AVCTX +FF_DISABLE_DEPRECATION_WARNINGS + return st->codec->time_base; +FF_ENABLE_DEPRECATION_WARNINGS +#endif +}