From patchwork Sun Jul 28 18:23:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 14108 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 06009448019 for ; Sun, 28 Jul 2019 21:23:30 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E2B5068032A; Sun, 28 Jul 2019 21:23:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D8106800E4 for ; Sun, 28 Jul 2019 21:23:21 +0300 (EEST) Received: by mail-wm1-f67.google.com with SMTP id x15so51903173wmj.3 for ; Sun, 28 Jul 2019 11:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=FcDhrA05iFCaWP8LqorkLFVs6kD3GsGCMn62Clq4Th0=; b=hBAEEh38p8d5d3bmN1Q6lzgBm3uTsFywmOH9EbM7cS6ynD827Ai6ClMR8v6CdVN9UV I0pzWewlKE5VA90Eb5kbydz83at68kL2/OrOVLwGy2+7s/9044Hhst/bUn00xwnW52SB WdtdFXmHAcmLHwSBRT5ndkzV1CtOsKmgTtorAFYT+O0j+i7WOgYsuBqO7k41EkmyhjJC Yc6NMNJowodZNysINgGxpKRW+V77QNhxGoC7+H9MCQr8++bP21hmZXAqCObiKvSjIPdO DlCbbo4rJkjF4ZOEftXmPKUOSW5rFRgOACWwN5LCfp5XBAVZe+pYEhV51DjeKRNhU7kw MTkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FcDhrA05iFCaWP8LqorkLFVs6kD3GsGCMn62Clq4Th0=; b=KT+9aBJkW86ELXEzOsdR1fhF+pqOgbml4XNC1ZY5nL6WcASBqcytTfMhvdZukJkndH 4FYdlkFdNaS6cULrEbvEjMdJjOvIF/Mcb99mrRza0oCreg13h+5PN9G57wT77UPuRd7x TcAiHYR4Cyoa5TUorInrDOe6hFDXVkrY79tckUU7o4UKvr5/7kzfS+Sjb0o22xJve1N+ KAPB4eHfwqXPOvDSIYe+3/axMNbFAKXcLy8gk/8aYWOcSabD7gIaHeWIBxP6gAmk4ZDC qxDxc4LtXibDpRfL6bZDixsqQpShKh1bEOfwNzXMeGliFyZKkj3Za8Qm0/bNkx4YYGJ0 iDhQ== X-Gm-Message-State: APjAAAWNxovqxX3cXKTgidDDt3kjIXAp5dgRcHV/WwRYxSl9gilmnRRS I76HcDmkUbO0hjUGHQdGT910Ba+6 X-Google-Smtp-Source: APXvYqyPhf+01LEiOvcZQMGFXDaSeTYaTEVn3DDMwc7jmtLzxkh/1KyM9a3QUOb94cTwc+qzmoZmkw== X-Received: by 2002:a1c:630a:: with SMTP id x10mr100519050wmb.113.1564338200804; Sun, 28 Jul 2019 11:23:20 -0700 (PDT) Received: from rywe.jkqxz.net (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id i66sm99219312wmi.11.2019.07.28.11.23.20 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 28 Jul 2019 11:23:20 -0700 (PDT) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 Jul 2019 19:23:16 +0100 Message-Id: <20190728182316.8700-2-sw@jkqxz.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190728182316.8700-1-sw@jkqxz.net> References: <20190728182316.8700-1-sw@jkqxz.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] h264_metadata: Support overscan_appropriate_flag 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" Fixes #8041. --- Requested in . doc/bitstream_filters.texi | 4 ++++ libavcodec/h264_metadata_bsf.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi index 023945e9be..50a1679fc7 100644 --- a/doc/bitstream_filters.texi +++ b/doc/bitstream_filters.texi @@ -224,6 +224,10 @@ Insert or remove AUD NAL units in all access units of the stream. @item sample_aspect_ratio Set the sample aspect ratio of the stream in the VUI parameters. +@item overscan_appropriate_flag +Set whether the stream is suitable for display using overscan +or not (see H.264 section E.2.1). + @item video_format @item video_full_range_flag Set the video format in the stream (see H.264 section E.2.1 and diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c index 3684e6bf7f..5de74be9d6 100644 --- a/libavcodec/h264_metadata_bsf.c +++ b/libavcodec/h264_metadata_bsf.c @@ -57,6 +57,8 @@ typedef struct H264MetadataContext { AVRational sample_aspect_ratio; + int overscan_appropriate_flag; + int video_format; int video_full_range_flag; int colour_primaries; @@ -129,6 +131,11 @@ static int h264_metadata_update_sps(AVBSFContext *bsf, } \ } while (0) + if (ctx->overscan_appropriate_flag >= 0) { + SET_VUI_FIELD(overscan_appropriate_flag); + sps->vui.overscan_info_present_flag = 1; + } + if (ctx->video_format >= 0 || ctx->video_full_range_flag >= 0 || ctx->colour_primaries >= 0 || @@ -630,6 +637,10 @@ static const AVOption h264_metadata_options[] = { OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, { .dbl = 0.0 }, 0, 65535, FLAGS }, + { "overscan_appropriate_flag", "Set VUI overscan appropriate flag", + OFFSET(overscan_appropriate_flag), AV_OPT_TYPE_INT, + { .i64 = -1 }, -1, 1, FLAGS }, + { "video_format", "Set video format (table E-2)", OFFSET(video_format), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 7, FLAGS},