From patchwork Sat Jan 6 13:38:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 7160 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.78.2 with SMTP id r2csp563245jaa; Sat, 6 Jan 2018 05:38:19 -0800 (PST) X-Google-Smtp-Source: ACJfBouY636pc+I40aEURVAAG0oVpfdAQg0cwjzZdN8+XTy9HwoGRwmhpuhKzzPfnWCOPwWw4+kp X-Received: by 10.223.129.6 with SMTP id 6mr773923wrm.221.1515245899816; Sat, 06 Jan 2018 05:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515245899; cv=none; d=google.com; s=arc-20160816; b=m3746zkI1Xv/hD0Grx87vKDvwPaVux+VOpYu51CywAHcwp92AjqGO7Fv1rCTWP6TY/ 0OhVwcG70Idt9Fn6ebaMAolZnSyofRjc+gNvPQOWj0u/VVrE0yK/kuTosxSzCrHKQ95o 4+LSIECZKtg9quBSeZjRI54bJFqmeQkLUu6fS49p3Hu6TsN77BkHJQiUjMzYSfWN1Ae1 0Jq6PpnqlSNKu779Nb7nwCJoq3/epn0v3ZJRHg3r8G4d/Vq7+8IhBAP8CEEEnMl5nfsA Ogqj1f6EN2zJrUQgCK8u6obfiwilYDtrpq1ycv95bMKRCPoQobnlNfe5o0bab4wVH9xu YP2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :in-reply-to:mime-version:references:message-id:to:from:date :delivered-to:arc-authentication-results; bh=sMnqEkuUKLuGcGlyoii7VP7pPlMw1H/xVznvGwD5ua4=; b=bRbeqU/KzArCUEzQNy445ff0AunmU9t0j+KvnHuOUpFwsQ3iMjds4dEklm0w60SuFW huuuI6HSaG92BMlPfStBNoKL0hdW1+3bNBGBgOE7QciTVxxN28UYivPuSel3xDVvCg1M nrXHHDSg/9muDtbXixduEDyn65yYiEYYUM+H9wBMm0wLJ3kTUDD0Mo+B6IwaMRwa3U3g l5QW4mSXKWVOAY62gvuw7hHl2UooFVS6vmdr7ZzyeDCUMgdddyZTuDJqrNbK3iTSiZG4 e8+g243n1kITrzxCaXmtyLdpk7uoZvT5XazAe9PNsP/wXnru2+kBT++AZb2AegFioKn6 1efw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d129si5030941wmf.137.2018.01.06.05.38.18; Sat, 06 Jan 2018 05:38:19 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B12D689A63; Sat, 6 Jan 2018 15:38:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D095D68974F for ; Sat, 6 Jan 2018 15:38:10 +0200 (EET) Received: from phare.normalesup.org (archicubes.ens.fr [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id w06DcA5L071028 for ; Sat, 6 Jan 2018 14:38:10 +0100 (CET) Received: by phare.normalesup.org (Postfix, from userid 1001) id 860BAEB5B6; Sat, 6 Jan 2018 14:38:10 +0100 (CET) Date: Sat, 6 Jan 2018 14:38:10 +0100 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: <20180106133810.GA3283318@phare.normalesup.org> References: <20180105205055.4120-1-jamrial@gmail.com> <20180105205055.4120-2-jamrial@gmail.com> <20180106132054.GA3277148@phare.normalesup.org> MIME-Version: 1.0 In-Reply-To: <20180106132054.GA3277148@phare.normalesup.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Sat, 06 Jan 2018 14:38:10 +0100 (CET) Subject: Re: [FFmpeg-devel] [PATCH 2/2] tools/uncoded_frame: remove usage of avfilter_link_get_channels() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" And while we're at it, let's fix a bunch of warnings. Note that I (or somebody else) need to check if this is still relevant with the "wrapped AVFrame" API from the fork, but that is another issue entirely. Regards, From 7a3a21108fca8e039ae4d5623ae18f828dc23f5e Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Sat, 6 Jan 2018 14:34:00 +0100 Subject: [PATCH] tools/uncoded_frame: remove use of AVStream.codec. Signed-off-by: Nicolas George --- tools/uncoded_frame.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/tools/uncoded_frame.c b/tools/uncoded_frame.c index f346b21916..606bdb746a 100644 --- a/tools/uncoded_frame.c +++ b/tools/uncoded_frame.c @@ -161,26 +161,24 @@ int main(int argc, char **argv) av_log(NULL, AV_LOG_ERROR, "Failed to create output stream\n"); goto fail; } - st->stream->codec->codec_type = av_buffersink_get_type(st->sink); - st->stream->time_base = st->stream->codec->time_base = - av_buffersink_get_time_base(st->sink); + st->stream->codecpar->codec_type = av_buffersink_get_type(st->sink); + st->stream->time_base = av_buffersink_get_time_base(st->sink); switch (av_buffersink_get_type(st->sink)) { case AVMEDIA_TYPE_VIDEO: - st->stream->codec->codec_id = AV_CODEC_ID_RAWVIDEO; + st->stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; st->stream->avg_frame_rate = st->stream-> r_frame_rate = av_buffersink_get_frame_rate(st->sink); - st->stream->codec->width = av_buffersink_get_w(st->sink); - st->stream->codec->height = av_buffersink_get_h(st->sink); - st->stream->codec->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(st->sink); - st->stream->codec->pix_fmt = av_buffersink_get_format(st->sink); + st->stream->codecpar->width = av_buffersink_get_w(st->sink); + st->stream->codecpar->height = av_buffersink_get_h(st->sink); + st->stream->codecpar->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(st->sink); + st->stream->codecpar->format = av_buffersink_get_format(st->sink); break; case AVMEDIA_TYPE_AUDIO: - st->stream->codec->channel_layout = av_buffersink_get_channel_layout(st->sink); - st->stream->codec->channels = av_buffersink_get_channels(st->sink); - st->stream->codec->sample_rate = av_buffersink_get_sample_rate(st->sink); - st->stream->codec->sample_fmt = av_buffersink_get_format(st->sink); - st->stream->codec->codec_id = - av_get_pcm_codec(st->stream->codec->sample_fmt, -1); + st->stream->codecpar->channel_layout = av_buffersink_get_channel_layout(st->sink); + st->stream->codecpar->channels = av_buffersink_get_channels(st->sink); + st->stream->codecpar->sample_rate = av_buffersink_get_sample_rate(st->sink); + st->stream->codecpar->format = av_buffersink_get_format(st->sink); + st->stream->codecpar->codec_id = av_get_pcm_codec(st->stream->codecpar->format, -1); break; default: av_assert0(!"reached"); @@ -245,7 +243,7 @@ int main(int argc, char **argv) frame); frame = NULL; if (ret < 0) { - av_log(st->stream->codec, AV_LOG_ERROR, + av_log(st->mux, AV_LOG_ERROR, "Error writing frame: %s\n", av_err2str(ret)); goto fail; } -- 2.15.1