From patchwork Tue Jun 30 04:29:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 20743 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 5B9A144A422 for ; Tue, 30 Jun 2020 07:29:34 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 30EEA6880DE; Tue, 30 Jun 2020 07:29:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A822C680D52 for ; Tue, 30 Jun 2020 07:29:27 +0300 (EEST) Received: by mail-pg1-f180.google.com with SMTP id z5so9335846pgb.6 for ; Mon, 29 Jun 2020 21:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BMCrtwcf2MtLvWCaX9ZSmLiPMN+GfuXB6S0tftRo0k8=; b=CvaH9Yx0TD9LDVNG71SjF5ZP31gM1DMQ4ExsfjKAG3fFnYVvuz1grWdFUXnMBmGGfi II4EvBbvuvo8/4js92VeduexWcmj9TVAcpOssCeWfYMMm9xIygFPFG5t2aca40c9ulOm 8D6wEdRWyS4DKQx6kNdVhAbbvjS+Ef7gXRaekTnW2euqlkGhfeWjNTDE0ISLpq19lbZU pwM9LSTgw6+gfy3RO5IRjYmHIlE+6U1iNcAoQxwN6SRedFrMF4ROAGGlokRhbSX0mtKL 8R4HTdMQoLlg11d5sDSKVnjh5PAMPqRgTGUn2E2C923zfFAjBMW4gxpDc0ECOHQuXGl5 aiQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BMCrtwcf2MtLvWCaX9ZSmLiPMN+GfuXB6S0tftRo0k8=; b=a/tfxTC30Iy8tz6trEFKhxuWdVmXzSXSyhpFd6O+F1j8Uae5eoYfqrHcdBz4hvjJ6i VXM1XsQ9GJ2HwoAjFrWs5MiC/3HgSKYLQWt+FFGZyq3aaSHCMVOnxC+/9QQAW8TK5+U3 H9lXYrMWFg8qd5PIW5ozgf+ojO/OrATS0c1SAeq0yvWbBr45vK+LukoQ7JnnpfLN43ns ajzOePML9uQ1BIDogo3U4FTYFvZL84AMHQRIm+pRe9t3ur/aVCjJ8cDaHYdjeyXBhcm9 0LmZ9Se7rv2kaDmOIeEGqc4eyRAJ0wOihZfbFHQdpSI9C53CdwbXsFdsDpocgf1DA+vK GLyA== X-Gm-Message-State: AOAM532H2qzw6FJfaEzgPubSOPu8mdZFJ910AvM0GxjQjY7IOFyXJTDE USB1JtSogcHUWzq6GLYL+ZKiHvFb X-Google-Smtp-Source: ABdhPJzzEf841a/Wzy6fd6X3DegVjMZl7O47mmAtoUX5TKgvnPzn2fX9jN5Bp9Yg5lUNhQsVfHYdfg== X-Received: by 2002:a65:620f:: with SMTP id d15mr12941301pgv.270.1593491365238; Mon, 29 Jun 2020 21:29:25 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id q92sm881510pjh.12.2020.06.29.21.29.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 21:29:24 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Jun 2020 12:29:17 +0800 Message-Id: <1593491358-20064-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1592663151-24180-1-git-send-email-lance.lmwang@gmail.com> References: <1592663151-24180-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v4 1/2] avutil/timecode: add description for SMPTE binary format 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang AV_FRAME_DATA_S12M_TIMECODE is public API, so user need to know its format by the API header instead of reading the code. Signed-off-by: Limin Wang --- libavutil/frame.h | 4 ++-- libavutil/timecode.h | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/libavutil/frame.h b/libavutil/frame.h index 3fb8c56..c694b12 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -162,8 +162,8 @@ enum AVFrameSideDataType { /** * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t * where the first uint32_t describes how many (1-3) of the other timecodes are used. - * The timecode format is described in the av_timecode_get_smpte_from_framenum() - * function in libavutil/timecode.c. + * The timecode format is described in the comments of av_timecode_get_smpte_from_framenum() + * function in libavutil/timecode.h. */ AV_FRAME_DATA_S12M_TIMECODE, diff --git a/libavutil/timecode.h b/libavutil/timecode.h index ab38e66..b1c1887 100644 --- a/libavutil/timecode.h +++ b/libavutil/timecode.h @@ -61,7 +61,21 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps); * @param tc timecode data correctly initialized * @param framenum frame number * @return the SMPTE binary representation - * + * the format description as follows, note it's in system byte order: + * 31b: color frame flag (0: unsync mode, 1: sync mode) + * 30b: drop frame flag (0: non drop, 1: drop) + * 28b,29b: tens of frames + * 24-27b: units of frames + * 23b: PC (NTSC) or BGF0 (PAL) + * 20b,22b: tens of seconds + * 16-19b: units of seconds + * 15b: BGF0 (NTSC) or BGF2 (PAL) + * 12b,13b: tens of minutes + * 8-11b: units of minutes + * 7b: BGF2 (NTSC) or PC (PAL) + * 6b: BGF1 + * 4b,5b: tens of hours + * 0b-3b: units of hours * @note Frame number adjustment is automatically done in case of drop timecode, * you do NOT have to call av_timecode_adjust_ntsc_framenum2(). * @note The frame number is relative to tc->start.