From patchwork Fri Sep 7 19:40:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 10269 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp1941219jap; Fri, 7 Sep 2018 12:40:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYRQLpLV2f+h+KISkZuZdJo96SG0LOSo+W9ogpeSdJktU6D0WYMewulpxsbWGvOCwIKzHeb X-Received: by 2002:a1c:888e:: with SMTP id k136-v6mr6563009wmd.6.1536349254170; Fri, 07 Sep 2018 12:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536349254; cv=none; d=google.com; s=arc-20160816; b=bMGK+Vi8HaOuQPsBh55gLQkJDYwwuYPLKVPxFOKXX2+VyyxfkeM43DLAmhgzU+/ZnL xchUUIV++E2vIeRS43A5K8Hj9f0c2gDQuTRwcmC5Ug2IBZSAZA4dhbhzrQ6gNL1adpgP OnvVTBZwAwvBKcC1PyTGHUDKznazWYtZEd1Ro/Skrg96swrFUYMcRa1snn/YD2lfEnz7 Mjt5Q71AHByIXrHj4LZtEu4ZFjtXHlqM1vmc+mQXLylHEoHk+dM9TZZNf3hllLUGkhNx f8v54Y8S2++/1zrDhAFTlv/SkpWRGPZROmGyCM0hyOdNwWcJjeFiuZx4bec3e2OjnmNQ VnEQ== 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:delivered-to; bh=rq3S+CRkc19q2bzdxEr+BnWL1gLi9VQXjsIJP6Dfq8I=; b=tekZphI2Msyr7Dg6lYx6NXLlwrCtLeUdiXzCaQLQtN+kH9HHQeXp+OgKK8ZDcAkzi4 yya1OxKfr8j+B9bHzJS8LjHPWF0aAYB7tOv+2qB5LFZUDWci5A52NFp9F4+F/pPdqqWN X5wFY+3Q4DRwj3/QTFcJI2Mig5x3WzoGtD92SPx5Fg7HFualje4uCbgnSBhpG3904LSI AMhMVcnh8Dk4ofc1Fp8hGr3yefgxsP45KnGc2ifaBxBvuo9Ov/mzVA4nIjGdqJ18phDT b451BCTFdNQAg7/yOkFXL36uainWCQCOFENnCZsmfuFcrkOhXh7gZKm83y1A4ccbu6VT zPgA== 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 a85-v6si6741031wme.181.2018.09.07.12.40.53; Fri, 07 Sep 2018 12:40:54 -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; 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 72A9F689F03; Fri, 7 Sep 2018 22:40:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from was-smtp1.livetimenet.net (50-206-97-56-was-smtp1.livetimenet.net [50.206.97.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 978CE6899E9 for ; Fri, 7 Sep 2018 22:40:30 +0300 (EEST) Received: by was-smtp1.livetimenet.net with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fyMcP-0006Sz-9m; Fri, 07 Sep 2018 15:40:38 -0400 From: Devin Heitmueller To: ffmpeg-devel@ffmpeg.org Date: Fri, 7 Sep 2018 15:40:24 -0400 Message-Id: <20180907194028.4629-2-dheitmueller@ltnglobal.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20180907194028.4629-1-dheitmueller@ltnglobal.com> References: <20180907194028.4629-1-dheitmueller@ltnglobal.com> X-Spam-Score: -1.9 (-) Subject: [FFmpeg-devel] [PATCH 1/5] v210enc: Pass through A53 CC data 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: jgreen@ltnglobal.com, Devin Heitmueller MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" When encoding to V210, make sure the CC side data makes it through in the resulting AVPacket. This is needed so the decklink output module can put out captions when in 10-bit mode. Signed-off-by: Devin Heitmueller --- libavcodec/v210enc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index a6afbbfc41..b9dcf9a672 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -123,6 +123,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, int aligned_width = ((avctx->width + 47) / 48) * 48; int stride = aligned_width * 8 / 3; int line_padding = stride - ((avctx->width * 8 + 11) / 12) * 4; + AVFrameSideData *side_data; int h, w, ret; uint8_t *dst; @@ -233,6 +234,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, } } + side_data = av_frame_get_side_data(pic, AV_FRAME_DATA_A53_CC); + if (side_data && side_data->size) { + uint8_t *buf = av_packet_new_side_data(pkt, AV_PKT_DATA_A53_CC, side_data->size); + if (!buf) + return AVERROR(ENOMEM); + memcpy(buf, side_data->data, side_data->size); + } + pkt->flags |= AV_PKT_FLAG_KEY; *got_packet = 1; return 0;