From patchwork Tue Sep 26 00:36:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 5275 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp3230846jaa; Mon, 25 Sep 2017 17:44:14 -0700 (PDT) X-Received: by 10.28.19.10 with SMTP id 10mr1635910wmt.87.1506386654312; Mon, 25 Sep 2017 17:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506386654; cv=none; d=google.com; s=arc-20160816; b=nQLz49x0uxqhnsV/x9gZj+PMQaMuKEsxdHzv4nXzbF4TBHZRzMuvSJK30EPeJ/tNWl URK1NOYS6rUDVOH8ADG0kkRrlKT98hH6lWc1n7Z46HsKYWIKEX6F/8WD3PvFiyk2WGI9 CM5++sQNxuIc99awxGhvJb4MGyY58yBhA/D3uGCSB1ZsjBJEI7MmSIiIQVUt8cZonYG1 9bHxNt5o39thSulJSODg4YnrsgH+II4M8TZFetER9yo8xHNKmgyfynuaWSCsCMsydovk Tj93eAaefh2/5Jtg0Xz+n/ehT1KpSZiSM4CzNZVLNs72Wa/nsH7SwemXgZt4D5Hh+iLV MHyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=KrhttQK0awIpNODR3fe7/slup4Xpwxf+QCkQ6NuquAs=; b=GzeOlcr1sXo69kDPQ9tmD+VY3uinTyqvQgfpByiv7PA9fbFnaayBZ8OlVTzpNWD8dB 9B/7UL3aPm+DNAioyBS48iPEhE87OKtwVDTTdBfEwTEeHeQ+4xwIWZPkYPQ5rlWK8C6h qPF8I+NuDlXOaFrxakEj6Z99tj6Ndf8tHHtBTxiWalay/+6GGzOoct96k7jlf1j4sMFG DEflu7H+sDCvuEr0fvn+ZV8OyF3vU2XUJyJqNDTWX1ii8iZOIB0M69wuHi2TP6+HpH+j 1fBXoExy3zc1zKP/9DPI39uxABomkl+xha2rfXAy1rp+vxYtNw9BIqp2oJwKyfbQ+UrT SSug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@tmm1-net.20150623.gappssmtp.com header.s=20150623 header.b=fhK9yA7I; 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 a42si6195263wra.523.2017.09.25.17.44.13; Mon, 25 Sep 2017 17:44:14 -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=@tmm1-net.20150623.gappssmtp.com header.s=20150623 header.b=fhK9yA7I; 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 9CBFE689AFC; Tue, 26 Sep 2017 03:44:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0AA24689AF8 for ; Tue, 26 Sep 2017 03:43:55 +0300 (EEST) Received: by mail-pf0-f194.google.com with SMTP id f84so4301198pfj.3 for ; Mon, 25 Sep 2017 17:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tmm1-net.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=9e8wXIF1vNBQmeU/AcuEm3eBkTVBSUNtojlksc/rYws=; b=fhK9yA7ISO3HUM80XtgNKeqijxC/Du2nkTiw/pcnX6TUdDb+fs5yL1gZK6ue0kwWvn bD+64aOAP5Wf19k0/4HSgXFCWKRSmE+Gjh6mHQrUF2jiE3AL+LNIBkf6eVI1288wBc58 jMlEySqJPL5YdHw0Dv1OVX5UlfdkCNdz8FA3EB7uljoeYZcrEQqCeSArYTZ2bY6zWygI rJcRn0zMfq9NGG9sxyBUlYThblCi+/FUQzktCO17G84AvzVLJF28dmfdIheZ6YDW19km fxXoG8FqkOtgEeH443Ooa4g8zmirdKYQ+aaH7s5+y3lDtFjgqx9Mw6HTXCEOkzqGxwai /f7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=9e8wXIF1vNBQmeU/AcuEm3eBkTVBSUNtojlksc/rYws=; b=pzDHEvUxpAz5ChZP7ZD5ZwEn/8ypicocN+vXy4Ny2wyn82Bm0/IKz43Zi/PRancOxF ongutNGwHMpt0aOHpDnuNKjH2Z8+p2Z6SCBfluALxgi0AdiWUx7rGyujBGcb5mBG7r5f 1IvIMvRnw5V2Dr6MOoNJEqglWhmQFCEr7da8tezOht1XZUhtLGTIjVy3YejP2H6lh2Qq hOsdErGF0COkn34GD2KPaSI58GwDIu6iS+HkXvj/mlfrJyGy21opw3TDBcGjhYETqBO+ 7lcKqSsj6NMTgpaXUPDqetND2aVcbGsGHl9+UORW3lCG098SnrFV46Tz+5MjSMEKKC7I BjtQ== X-Gm-Message-State: AHPjjUjeG//EL89P84geArJB6Cmfyv7fiuhGTNkKSkUbkvlrAMt6Ayt8 /opf+xxHa0O/Qy7RtN7JamdUal6h X-Google-Smtp-Source: AOwi7QBZX88ggzDKbGNA0nahdndxGLqVpjPA6VjD3IcHrCaDGb/JKE9cwJlC4ozp/7NfzC6D+bE1kA== X-Received: by 10.84.129.193 with SMTP id b59mr9167253plb.52.1506386206656; Mon, 25 Sep 2017 17:36:46 -0700 (PDT) Received: from tmm1-macbook.local.net (c-73-252-174-83.hsd1.ca.comcast.net. [73.252.174.83]) by smtp.gmail.com with ESMTPSA id n18sm12483164pgd.69.2017.09.25.17.36.45 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 25 Sep 2017 17:36:46 -0700 (PDT) From: Aman Gupta To: ffmpeg-devel@ffmpeg.org Date: Mon, 25 Sep 2017 17:36:26 -0700 Message-Id: <20170926003631.55571-4-ffmpeg@tmm1.net> X-Mailer: git-send-email 2.13.5 (Apple Git-94) In-Reply-To: <20170926003631.55571-1-ffmpeg@tmm1.net> References: <20170926003631.55571-1-ffmpeg@tmm1.net> Subject: [FFmpeg-devel] [PATCH 4/9] avcodec/videotoolbox: reset bitstream_size in end_frame 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: Aman Gupta MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Aman Gupta This allows decode_slice to be invoked multiple times before end_frame, causing slices to accumulate before being fed into the VT decoder. An upcoming commit will re-use decode_slice for SPS and PPS nalus, so they can be propagated into the VT decoder session along with slide data. --- libavcodec/videotoolbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 8ed56392cc..1de556f3e8 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -141,8 +141,6 @@ int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx, VTContext *vtctx = avctx->internal->hwaccel_priv_data; H264Context *h = avctx->priv_data; - vtctx->bitstream_size = 0; - if (h->is_avc == 1) { return videotoolbox_buffer_copy(vtctx, buffer, size); } @@ -441,8 +439,10 @@ static int videotoolbox_h264_end_frame(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; AVFrame *frame = h->cur_pic_ptr->f; - - return videotoolbox_common_end_frame(avctx, frame); + VTContext *vtctx = avctx->internal->hwaccel_priv_data; + int ret = videotoolbox_common_end_frame(avctx, frame); + vtctx->bitstream_size = 0; + return ret; } static int videotoolbox_mpeg_start_frame(AVCodecContext *avctx,