From patchwork Sun Mar 22 08:59:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18340 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 C18B4448B66 for ; Sun, 22 Mar 2020 11:00:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A69E868B530; Sun, 22 Mar 2020 11:00:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 653EE68B4AB for ; Sun, 22 Mar 2020 11:00:22 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 48lWgT1DkLzKmWH; Sun, 22 Mar 2020 10:00:21 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id AOWEgj3eWzkw; Sun, 22 Mar 2020 10:00:18 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:20 +0100 Message-Id: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 01/14] avformat/matroska: add missing Buttons track type 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme --- libavformat/matroska.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 86968a8de1..9e33e51c94 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -271,6 +271,7 @@ typedef enum { MATROSKA_TRACK_TYPE_COMPLEX = 0x3, MATROSKA_TRACK_TYPE_LOGO = 0x10, MATROSKA_TRACK_TYPE_SUBTITLE = 0x11, + MATROSKA_TRACK_TYPE_BUTTONS = 0x12, MATROSKA_TRACK_TYPE_CONTROL = 0x20, MATROSKA_TRACK_TYPE_METADATA = 0x21, } MatroskaTrackType; From patchwork Sun Mar 22 08:59:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18342 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 BF2B0448B66 for ; Sun, 22 Mar 2020 11:00:32 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A1CA468B5C9; Sun, 22 Mar 2020 11:00:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 69B5568B4DF for ; Sun, 22 Mar 2020 11:00:22 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 48lWgT50VfzKmf9; Sun, 22 Mar 2020 10:00:21 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id kkiR6nXGzeMF; Sun, 22 Mar 2020 10:00:18 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:21 +0100 Message-Id: <20200322085933.7532-2-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 02/14] avformat/matroska: clean the structure formatting 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme Always use a comma at the end, order elements by value. --- libavformat/matroska.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 9e33e51c94..e177cd027f 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -286,13 +286,13 @@ typedef enum { typedef enum { MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED = 0, MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED = 1, - MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE = 2 + MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE = 2, } MatroskaVideoInterlaceFlag; typedef enum { MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE = 0, - MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2, MATROSKA_VIDEO_FIELDORDER_TT = 1, + MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2, MATROSKA_VIDEO_FIELDORDER_BB = 6, MATROSKA_VIDEO_FIELDORDER_TB = 9, MATROSKA_VIDEO_FIELDORDER_BT = 14, From patchwork Sun Mar 22 08:59:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18339 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 B31B1448B66 for ; Sun, 22 Mar 2020 11:00:29 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7EF4968B539; Sun, 22 Mar 2020 11:00:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 60C5868B4A2 for ; Sun, 22 Mar 2020 11:00:22 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 48lWgT4x7mzKmds; Sun, 22 Mar 2020 10:00:21 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id 3tHeXqzIOGJR; Sun, 22 Mar 2020 10:00:19 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:22 +0100 Message-Id: <20200322085933.7532-3-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 03/14] avformat/matroska: use more consistent spacing in enums 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme --- libavformat/matroska.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libavformat/matroska.h b/libavformat/matroska.h index e177cd027f..5520e9ce8f 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -284,18 +284,18 @@ typedef enum { } MatroskaTrackEncodingCompAlgo; typedef enum { - MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED = 0, - MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED = 1, - MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE = 2, + MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED = 0, + MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED = 1, + MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE = 2, } MatroskaVideoInterlaceFlag; typedef enum { - MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE = 0, - MATROSKA_VIDEO_FIELDORDER_TT = 1, - MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2, - MATROSKA_VIDEO_FIELDORDER_BB = 6, - MATROSKA_VIDEO_FIELDORDER_TB = 9, - MATROSKA_VIDEO_FIELDORDER_BT = 14, + MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE = 0, + MATROSKA_VIDEO_FIELDORDER_TT = 1, + MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2, + MATROSKA_VIDEO_FIELDORDER_BB = 6, + MATROSKA_VIDEO_FIELDORDER_TB = 9, + MATROSKA_VIDEO_FIELDORDER_BT = 14, } MatroskaVideoFieldOrder; typedef enum { From patchwork Sun Mar 22 08:59:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18343 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 26344448B66 for ; Sun, 22 Mar 2020 11:00:34 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 16A1068B5E6; Sun, 22 Mar 2020 11:00:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 62F0368B4A3 for ; Sun, 22 Mar 2020 11:00:23 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 48lWgV65rXzQlCW; Sun, 22 Mar 2020 10:00:22 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id en5SHuSW1FG5; Sun, 22 Mar 2020 10:00:19 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:23 +0100 Message-Id: <20200322085933.7532-4-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 04/14] avformat/matroska: move Matroska IDs and enums in a separate header 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme So the file can be generated from the EBML Schema. No functional change. --- libavformat/matroska.h | 302 +--------------------------------- libavformat/matroska_ids.h | 327 +++++++++++++++++++++++++++++++++++++ 2 files changed, 328 insertions(+), 301 deletions(-) create mode 100644 libavformat/matroska_ids.h diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 5520e9ce8f..10140dea48 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -23,6 +23,7 @@ #define AVFORMAT_MATROSKA_H #include "libavcodec/avcodec.h" +#include "matroska_ids.h" #include "metadata.h" #include "internal.h" @@ -45,307 +46,6 @@ #define EBML_ID_VOID 0xEC #define EBML_ID_CRC32 0xBF -/* - * Matroska element IDs, max. 32 bits - */ - -/* toplevel segment */ -#define MATROSKA_ID_SEGMENT 0x18538067 - -/* Matroska top-level master IDs */ -#define MATROSKA_ID_INFO 0x1549A966 -#define MATROSKA_ID_TRACKS 0x1654AE6B -#define MATROSKA_ID_CUES 0x1C53BB6B -#define MATROSKA_ID_TAGS 0x1254C367 -#define MATROSKA_ID_SEEKHEAD 0x114D9B74 -#define MATROSKA_ID_ATTACHMENTS 0x1941A469 -#define MATROSKA_ID_CLUSTER 0x1F43B675 -#define MATROSKA_ID_CHAPTERS 0x1043A770 - -/* IDs in the info master */ -#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1 -#define MATROSKA_ID_DURATION 0x4489 -#define MATROSKA_ID_TITLE 0x7BA9 -#define MATROSKA_ID_WRITINGAPP 0x5741 -#define MATROSKA_ID_MUXINGAPP 0x4D80 -#define MATROSKA_ID_DATEUTC 0x4461 -#define MATROSKA_ID_SEGMENTUID 0x73A4 - -/* ID in the tracks master */ -#define MATROSKA_ID_TRACKENTRY 0xAE - -/* IDs in the trackentry master */ -#define MATROSKA_ID_TRACKNUMBER 0xD7 -#define MATROSKA_ID_TRACKUID 0x73C5 -#define MATROSKA_ID_TRACKTYPE 0x83 -#define MATROSKA_ID_TRACKVIDEO 0xE0 -#define MATROSKA_ID_TRACKAUDIO 0xE1 -#define MATROSKA_ID_TRACKOPERATION 0xE2 -#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 -#define MATROSKA_ID_TRACKPLANE 0xE4 -#define MATROSKA_ID_TRACKPLANEUID 0xE5 -#define MATROSKA_ID_TRACKPLANETYPE 0xE6 -#define MATROSKA_ID_CODECID 0x86 -#define MATROSKA_ID_CODECPRIVATE 0x63A2 -#define MATROSKA_ID_CODECNAME 0x258688 -#define MATROSKA_ID_CODECINFOURL 0x3B4040 -#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240 -#define MATROSKA_ID_CODECDECODEALL 0xAA -#define MATROSKA_ID_CODECDELAY 0x56AA -#define MATROSKA_ID_SEEKPREROLL 0x56BB -#define MATROSKA_ID_TRACKNAME 0x536E -#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C -#define MATROSKA_ID_TRACKFLAGENABLED 0xB9 -#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 -#define MATROSKA_ID_TRACKFLAGFORCED 0x55AA -#define MATROSKA_ID_TRACKFLAGLACING 0x9C -#define MATROSKA_ID_TRACKMINCACHE 0x6DE7 -#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 -#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 -#define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80 -#define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 -#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F -#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE - -/* IDs in the trackvideo master */ -#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 -#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0 -#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA -#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0 -#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA -#define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA -#define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB -#define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC -#define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD -#define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2 -#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A -#define MATROSKA_ID_VIDEOFIELDORDER 0x9D -#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8 -#define MATROSKA_ID_VIDEOALPHAMODE 0x53C0 -#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 -#define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524 -#define MATROSKA_ID_VIDEOCOLOR 0x55B0 - -#define MATROSKA_ID_VIDEOCOLORMATRIXCOEFF 0x55B1 -#define MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL 0x55B2 -#define MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ 0x55B3 -#define MATROSKA_ID_VIDEOCOLORCHROMASUBVERT 0x55B4 -#define MATROSKA_ID_VIDEOCOLORCBSUBHORZ 0x55B5 -#define MATROSKA_ID_VIDEOCOLORCBSUBVERT 0x55B6 -#define MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ 0x55B7 -#define MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT 0x55B8 -#define MATROSKA_ID_VIDEOCOLORRANGE 0x55B9 -#define MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS 0x55BA - -#define MATROSKA_ID_VIDEOCOLORPRIMARIES 0x55BB -#define MATROSKA_ID_VIDEOCOLORMAXCLL 0x55BC -#define MATROSKA_ID_VIDEOCOLORMAXFALL 0x55BD - -#define MATROSKA_ID_VIDEOCOLORMASTERINGMETA 0x55D0 -#define MATROSKA_ID_VIDEOCOLOR_RX 0x55D1 -#define MATROSKA_ID_VIDEOCOLOR_RY 0x55D2 -#define MATROSKA_ID_VIDEOCOLOR_GX 0x55D3 -#define MATROSKA_ID_VIDEOCOLOR_GY 0x55D4 -#define MATROSKA_ID_VIDEOCOLOR_BX 0x55D5 -#define MATROSKA_ID_VIDEOCOLOR_BY 0x55D6 -#define MATROSKA_ID_VIDEOCOLOR_WHITEX 0x55D7 -#define MATROSKA_ID_VIDEOCOLOR_WHITEY 0x55D8 -#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX 0x55D9 -#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN 0x55DA - -#define MATROSKA_ID_VIDEOPROJECTION 0x7670 -#define MATROSKA_ID_VIDEOPROJECTIONTYPE 0x7671 -#define MATROSKA_ID_VIDEOPROJECTIONPRIVATE 0x7672 -#define MATROSKA_ID_VIDEOPROJECTIONPOSEYAW 0x7673 -#define MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH 0x7674 -#define MATROSKA_ID_VIDEOPROJECTIONPOSEROLL 0x7675 - -/* IDs in the trackaudio master */ -#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 -#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 - -#define MATROSKA_ID_AUDIOBITDEPTH 0x6264 -#define MATROSKA_ID_AUDIOCHANNELS 0x9F - -/* IDs in the content encoding master */ -#define MATROSKA_ID_ENCODINGORDER 0x5031 -#define MATROSKA_ID_ENCODINGSCOPE 0x5032 -#define MATROSKA_ID_ENCODINGTYPE 0x5033 -#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 -#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 -#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 - -#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 -#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 -#define MATROSKA_ID_ENCODINGENCALGO 0x47E1 -#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 -#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5 -#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6 -#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 -#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 - -/* ID in the cues master */ -#define MATROSKA_ID_POINTENTRY 0xBB - -/* IDs in the pointentry master */ -#define MATROSKA_ID_CUETIME 0xB3 -#define MATROSKA_ID_CUETRACKPOSITION 0xB7 - -/* IDs in the cuetrackposition master */ -#define MATROSKA_ID_CUETRACK 0xF7 -#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1 -#define MATROSKA_ID_CUERELATIVEPOSITION 0xF0 -#define MATROSKA_ID_CUEDURATION 0xB2 -#define MATROSKA_ID_CUEBLOCKNUMBER 0x5378 - -/* IDs in the tags master */ -#define MATROSKA_ID_TAG 0x7373 -#define MATROSKA_ID_SIMPLETAG 0x67C8 -#define MATROSKA_ID_TAGNAME 0x45A3 -#define MATROSKA_ID_TAGSTRING 0x4487 -#define MATROSKA_ID_TAGLANG 0x447A -#define MATROSKA_ID_TAGDEFAULT 0x4484 -#define MATROSKA_ID_TAGDEFAULT_BUG 0x44B4 -#define MATROSKA_ID_TAGTARGETS 0x63C0 -#define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA -#define MATROSKA_ID_TAGTARGETS_TYPEVALUE 0x68CA -#define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5 -#define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4 -#define MATROSKA_ID_TAGTARGETS_ATTACHUID 0x63C6 - -/* IDs in the seekhead master */ -#define MATROSKA_ID_SEEKENTRY 0x4DBB - -/* IDs in the seekpoint master */ -#define MATROSKA_ID_SEEKID 0x53AB -#define MATROSKA_ID_SEEKPOSITION 0x53AC - -/* IDs in the cluster master */ -#define MATROSKA_ID_CLUSTERTIMECODE 0xE7 -#define MATROSKA_ID_CLUSTERPOSITION 0xA7 -#define MATROSKA_ID_CLUSTERPREVSIZE 0xAB -#define MATROSKA_ID_BLOCKGROUP 0xA0 -#define MATROSKA_ID_BLOCKADDITIONS 0x75A1 -#define MATROSKA_ID_BLOCKMORE 0xA6 -#define MATROSKA_ID_BLOCKADDID 0xEE -#define MATROSKA_ID_BLOCKADDITIONAL 0xA5 -#define MATROSKA_ID_SIMPLEBLOCK 0xA3 - -/* IDs in the blockgroup master */ -#define MATROSKA_ID_BLOCK 0xA1 -#define MATROSKA_ID_BLOCKDURATION 0x9B -#define MATROSKA_ID_BLOCKREFERENCE 0xFB -#define MATROSKA_ID_CODECSTATE 0xA4 -#define MATROSKA_ID_DISCARDPADDING 0x75A2 - -/* IDs in the attachments master */ -#define MATROSKA_ID_ATTACHEDFILE 0x61A7 -#define MATROSKA_ID_FILEDESC 0x467E -#define MATROSKA_ID_FILENAME 0x466E -#define MATROSKA_ID_FILEMIMETYPE 0x4660 -#define MATROSKA_ID_FILEDATA 0x465C -#define MATROSKA_ID_FILEUID 0x46AE - -/* IDs in the chapters master */ -#define MATROSKA_ID_EDITIONENTRY 0x45B9 -#define MATROSKA_ID_CHAPTERATOM 0xB6 -#define MATROSKA_ID_CHAPTERTIMESTART 0x91 -#define MATROSKA_ID_CHAPTERTIMEEND 0x92 -#define MATROSKA_ID_CHAPTERDISPLAY 0x80 -#define MATROSKA_ID_CHAPSTRING 0x85 -#define MATROSKA_ID_CHAPLANG 0x437C -#define MATROSKA_ID_CHAPCOUNTRY 0x437E -#define MATROSKA_ID_EDITIONUID 0x45BC -#define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45BD -#define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45DB -#define MATROSKA_ID_EDITIONFLAGORDERED 0x45DD -#define MATROSKA_ID_CHAPTERUID 0x73C4 -#define MATROSKA_ID_CHAPTERFLAGHIDDEN 0x98 -#define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598 -#define MATROSKA_ID_CHAPTERPHYSEQUIV 0x63C3 - -typedef enum { - MATROSKA_TRACK_TYPE_NONE = 0x0, - MATROSKA_TRACK_TYPE_VIDEO = 0x1, - MATROSKA_TRACK_TYPE_AUDIO = 0x2, - MATROSKA_TRACK_TYPE_COMPLEX = 0x3, - MATROSKA_TRACK_TYPE_LOGO = 0x10, - MATROSKA_TRACK_TYPE_SUBTITLE = 0x11, - MATROSKA_TRACK_TYPE_BUTTONS = 0x12, - MATROSKA_TRACK_TYPE_CONTROL = 0x20, - MATROSKA_TRACK_TYPE_METADATA = 0x21, -} MatroskaTrackType; - -typedef enum { - MATROSKA_TRACK_ENCODING_COMP_ZLIB = 0, - MATROSKA_TRACK_ENCODING_COMP_BZLIB = 1, - MATROSKA_TRACK_ENCODING_COMP_LZO = 2, - MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3, -} MatroskaTrackEncodingCompAlgo; - -typedef enum { - MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED = 0, - MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED = 1, - MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE = 2, -} MatroskaVideoInterlaceFlag; - -typedef enum { - MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE = 0, - MATROSKA_VIDEO_FIELDORDER_TT = 1, - MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2, - MATROSKA_VIDEO_FIELDORDER_BB = 6, - MATROSKA_VIDEO_FIELDORDER_TB = 9, - MATROSKA_VIDEO_FIELDORDER_BT = 14, -} MatroskaVideoFieldOrder; - -typedef enum { - MATROSKA_VIDEO_STEREOMODE_TYPE_MONO = 0, - MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT = 1, - MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP = 2, - MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM = 3, - MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL = 4, - MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR = 5, - MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL = 6, - MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR = 7, - MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL = 8, - MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR = 9, - MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED = 10, - MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT = 11, - MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG = 12, - MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR = 13, - MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL = 14, - MATROSKA_VIDEO_STEREOMODE_TYPE_NB, -} MatroskaVideoStereoModeType; - -typedef enum { - MATROSKA_VIDEO_DISPLAYUNIT_PIXELS = 0, - MATROSKA_VIDEO_DISPLAYUNIT_CENTIMETERS = 1, - MATROSKA_VIDEO_DISPLAYUNIT_INCHES = 2, - MATROSKA_VIDEO_DISPLAYUNIT_DAR = 3, - MATROSKA_VIDEO_DISPLAYUNIT_UNKNOWN = 4, -} MatroskaVideoDisplayUnit; - -typedef enum { - MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED = 0, - MATROSKA_COLOUR_CHROMASITINGHORZ_LEFT = 1, - MATROSKA_COLOUR_CHROMASITINGHORZ_HALF = 2, - MATROSKA_COLOUR_CHROMASITINGHORZ_NB -} MatroskaColourChromaSitingHorz; - -typedef enum { - MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED = 0, - MATROSKA_COLOUR_CHROMASITINGVERT_TOP = 1, - MATROSKA_COLOUR_CHROMASITINGVERT_HALF = 2, - MATROSKA_COLOUR_CHROMASITINGVERT_NB -} MatroskaColourChromaSitingVert; - -typedef enum { - MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR = 0, - MATROSKA_VIDEO_PROJECTION_TYPE_EQUIRECTANGULAR = 1, - MATROSKA_VIDEO_PROJECTION_TYPE_CUBEMAP = 2, - MATROSKA_VIDEO_PROJECTION_TYPE_MESH = 3, -} MatroskaVideoProjectionType; - /* * Matroska Codec IDs, strings */ diff --git a/libavformat/matroska_ids.h b/libavformat/matroska_ids.h new file mode 100644 index 0000000000..063dae5f94 --- /dev/null +++ b/libavformat/matroska_ids.h @@ -0,0 +1,327 @@ +/* + * Matroska Semantic constants + * Copyright (c) 2003-2020 The FFmpeg Project + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_MATROSKA_IDS_H +#define AVFORMAT_MATROSKA_IDS_H + +/* + * Matroska element IDs, max. 32 bits + */ + +/* toplevel segment */ +#define MATROSKA_ID_SEGMENT 0x18538067 + +/* Matroska top-level master IDs */ +#define MATROSKA_ID_INFO 0x1549A966 +#define MATROSKA_ID_TRACKS 0x1654AE6B +#define MATROSKA_ID_CUES 0x1C53BB6B +#define MATROSKA_ID_TAGS 0x1254C367 +#define MATROSKA_ID_SEEKHEAD 0x114D9B74 +#define MATROSKA_ID_ATTACHMENTS 0x1941A469 +#define MATROSKA_ID_CLUSTER 0x1F43B675 +#define MATROSKA_ID_CHAPTERS 0x1043A770 + +/* IDs in the info master */ +#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1 +#define MATROSKA_ID_DURATION 0x4489 +#define MATROSKA_ID_TITLE 0x7BA9 +#define MATROSKA_ID_WRITINGAPP 0x5741 +#define MATROSKA_ID_MUXINGAPP 0x4D80 +#define MATROSKA_ID_DATEUTC 0x4461 +#define MATROSKA_ID_SEGMENTUID 0x73A4 + +/* ID in the tracks master */ +#define MATROSKA_ID_TRACKENTRY 0xAE + +/* IDs in the trackentry master */ +#define MATROSKA_ID_TRACKNUMBER 0xD7 +#define MATROSKA_ID_TRACKUID 0x73C5 +#define MATROSKA_ID_TRACKTYPE 0x83 +#define MATROSKA_ID_TRACKVIDEO 0xE0 +#define MATROSKA_ID_TRACKAUDIO 0xE1 +#define MATROSKA_ID_TRACKOPERATION 0xE2 +#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 +#define MATROSKA_ID_TRACKPLANE 0xE4 +#define MATROSKA_ID_TRACKPLANEUID 0xE5 +#define MATROSKA_ID_TRACKPLANETYPE 0xE6 +#define MATROSKA_ID_CODECID 0x86 +#define MATROSKA_ID_CODECPRIVATE 0x63A2 +#define MATROSKA_ID_CODECNAME 0x258688 +#define MATROSKA_ID_CODECINFOURL 0x3B4040 +#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240 +#define MATROSKA_ID_CODECDECODEALL 0xAA +#define MATROSKA_ID_CODECDELAY 0x56AA +#define MATROSKA_ID_SEEKPREROLL 0x56BB +#define MATROSKA_ID_TRACKNAME 0x536E +#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C +#define MATROSKA_ID_TRACKFLAGENABLED 0xB9 +#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 +#define MATROSKA_ID_TRACKFLAGFORCED 0x55AA +#define MATROSKA_ID_TRACKFLAGLACING 0x9C +#define MATROSKA_ID_TRACKMINCACHE 0x6DE7 +#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 +#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 +#define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80 +#define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 +#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F +#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE + +/* IDs in the trackvideo master */ +#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 +#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0 +#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA +#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0 +#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA +#define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA +#define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB +#define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC +#define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD +#define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2 +#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A +#define MATROSKA_ID_VIDEOFIELDORDER 0x9D +#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8 +#define MATROSKA_ID_VIDEOALPHAMODE 0x53C0 +#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 +#define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524 +#define MATROSKA_ID_VIDEOCOLOR 0x55B0 + +#define MATROSKA_ID_VIDEOCOLORMATRIXCOEFF 0x55B1 +#define MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL 0x55B2 +#define MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ 0x55B3 +#define MATROSKA_ID_VIDEOCOLORCHROMASUBVERT 0x55B4 +#define MATROSKA_ID_VIDEOCOLORCBSUBHORZ 0x55B5 +#define MATROSKA_ID_VIDEOCOLORCBSUBVERT 0x55B6 +#define MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ 0x55B7 +#define MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT 0x55B8 +#define MATROSKA_ID_VIDEOCOLORRANGE 0x55B9 +#define MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS 0x55BA + +#define MATROSKA_ID_VIDEOCOLORPRIMARIES 0x55BB +#define MATROSKA_ID_VIDEOCOLORMAXCLL 0x55BC +#define MATROSKA_ID_VIDEOCOLORMAXFALL 0x55BD + +#define MATROSKA_ID_VIDEOCOLORMASTERINGMETA 0x55D0 +#define MATROSKA_ID_VIDEOCOLOR_RX 0x55D1 +#define MATROSKA_ID_VIDEOCOLOR_RY 0x55D2 +#define MATROSKA_ID_VIDEOCOLOR_GX 0x55D3 +#define MATROSKA_ID_VIDEOCOLOR_GY 0x55D4 +#define MATROSKA_ID_VIDEOCOLOR_BX 0x55D5 +#define MATROSKA_ID_VIDEOCOLOR_BY 0x55D6 +#define MATROSKA_ID_VIDEOCOLOR_WHITEX 0x55D7 +#define MATROSKA_ID_VIDEOCOLOR_WHITEY 0x55D8 +#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX 0x55D9 +#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN 0x55DA + +#define MATROSKA_ID_VIDEOPROJECTION 0x7670 +#define MATROSKA_ID_VIDEOPROJECTIONTYPE 0x7671 +#define MATROSKA_ID_VIDEOPROJECTIONPRIVATE 0x7672 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEYAW 0x7673 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH 0x7674 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEROLL 0x7675 + +/* IDs in the trackaudio master */ +#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 +#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 + +#define MATROSKA_ID_AUDIOBITDEPTH 0x6264 +#define MATROSKA_ID_AUDIOCHANNELS 0x9F + +/* IDs in the content encoding master */ +#define MATROSKA_ID_ENCODINGORDER 0x5031 +#define MATROSKA_ID_ENCODINGSCOPE 0x5032 +#define MATROSKA_ID_ENCODINGTYPE 0x5033 +#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 +#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 +#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 + +#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 +#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 +#define MATROSKA_ID_ENCODINGENCALGO 0x47E1 +#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 +#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5 +#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6 +#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 +#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 + +/* ID in the cues master */ +#define MATROSKA_ID_POINTENTRY 0xBB + +/* IDs in the pointentry master */ +#define MATROSKA_ID_CUETIME 0xB3 +#define MATROSKA_ID_CUETRACKPOSITION 0xB7 + +/* IDs in the cuetrackposition master */ +#define MATROSKA_ID_CUETRACK 0xF7 +#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1 +#define MATROSKA_ID_CUERELATIVEPOSITION 0xF0 +#define MATROSKA_ID_CUEDURATION 0xB2 +#define MATROSKA_ID_CUEBLOCKNUMBER 0x5378 + +/* IDs in the tags master */ +#define MATROSKA_ID_TAG 0x7373 +#define MATROSKA_ID_SIMPLETAG 0x67C8 +#define MATROSKA_ID_TAGNAME 0x45A3 +#define MATROSKA_ID_TAGSTRING 0x4487 +#define MATROSKA_ID_TAGLANG 0x447A +#define MATROSKA_ID_TAGDEFAULT 0x4484 +#define MATROSKA_ID_TAGDEFAULT_BUG 0x44B4 +#define MATROSKA_ID_TAGTARGETS 0x63C0 +#define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA +#define MATROSKA_ID_TAGTARGETS_TYPEVALUE 0x68CA +#define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5 +#define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4 +#define MATROSKA_ID_TAGTARGETS_ATTACHUID 0x63C6 + +/* IDs in the seekhead master */ +#define MATROSKA_ID_SEEKENTRY 0x4DBB + +/* IDs in the seekpoint master */ +#define MATROSKA_ID_SEEKID 0x53AB +#define MATROSKA_ID_SEEKPOSITION 0x53AC + +/* IDs in the cluster master */ +#define MATROSKA_ID_CLUSTERTIMECODE 0xE7 +#define MATROSKA_ID_CLUSTERPOSITION 0xA7 +#define MATROSKA_ID_CLUSTERPREVSIZE 0xAB +#define MATROSKA_ID_BLOCKGROUP 0xA0 +#define MATROSKA_ID_BLOCKADDITIONS 0x75A1 +#define MATROSKA_ID_BLOCKMORE 0xA6 +#define MATROSKA_ID_BLOCKADDID 0xEE +#define MATROSKA_ID_BLOCKADDITIONAL 0xA5 +#define MATROSKA_ID_SIMPLEBLOCK 0xA3 + +/* IDs in the blockgroup master */ +#define MATROSKA_ID_BLOCK 0xA1 +#define MATROSKA_ID_BLOCKDURATION 0x9B +#define MATROSKA_ID_BLOCKREFERENCE 0xFB +#define MATROSKA_ID_CODECSTATE 0xA4 +#define MATROSKA_ID_DISCARDPADDING 0x75A2 + +/* IDs in the attachments master */ +#define MATROSKA_ID_ATTACHEDFILE 0x61A7 +#define MATROSKA_ID_FILEDESC 0x467E +#define MATROSKA_ID_FILENAME 0x466E +#define MATROSKA_ID_FILEMIMETYPE 0x4660 +#define MATROSKA_ID_FILEDATA 0x465C +#define MATROSKA_ID_FILEUID 0x46AE + +/* IDs in the chapters master */ +#define MATROSKA_ID_EDITIONENTRY 0x45B9 +#define MATROSKA_ID_CHAPTERATOM 0xB6 +#define MATROSKA_ID_CHAPTERTIMESTART 0x91 +#define MATROSKA_ID_CHAPTERTIMEEND 0x92 +#define MATROSKA_ID_CHAPTERDISPLAY 0x80 +#define MATROSKA_ID_CHAPSTRING 0x85 +#define MATROSKA_ID_CHAPLANG 0x437C +#define MATROSKA_ID_CHAPCOUNTRY 0x437E +#define MATROSKA_ID_EDITIONUID 0x45BC +#define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45BD +#define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45DB +#define MATROSKA_ID_EDITIONFLAGORDERED 0x45DD +#define MATROSKA_ID_CHAPTERUID 0x73C4 +#define MATROSKA_ID_CHAPTERFLAGHIDDEN 0x98 +#define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598 +#define MATROSKA_ID_CHAPTERPHYSEQUIV 0x63C3 + +typedef enum { + MATROSKA_TRACK_TYPE_NONE = 0x0, + MATROSKA_TRACK_TYPE_VIDEO = 0x1, + MATROSKA_TRACK_TYPE_AUDIO = 0x2, + MATROSKA_TRACK_TYPE_COMPLEX = 0x3, + MATROSKA_TRACK_TYPE_LOGO = 0x10, + MATROSKA_TRACK_TYPE_SUBTITLE = 0x11, + MATROSKA_TRACK_TYPE_BUTTONS = 0x12, + MATROSKA_TRACK_TYPE_CONTROL = 0x20, + MATROSKA_TRACK_TYPE_METADATA = 0x21, +} MatroskaTrackType; + +typedef enum { + MATROSKA_TRACK_ENCODING_COMP_ZLIB = 0, + MATROSKA_TRACK_ENCODING_COMP_BZLIB = 1, + MATROSKA_TRACK_ENCODING_COMP_LZO = 2, + MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3, +} MatroskaTrackEncodingCompAlgo; + +typedef enum { + MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED = 0, + MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED = 1, + MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE = 2, +} MatroskaVideoInterlaceFlag; + +typedef enum { + MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE = 0, + MATROSKA_VIDEO_FIELDORDER_TT = 1, + MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2, + MATROSKA_VIDEO_FIELDORDER_BB = 6, + MATROSKA_VIDEO_FIELDORDER_TB = 9, + MATROSKA_VIDEO_FIELDORDER_BT = 14, +} MatroskaVideoFieldOrder; + +typedef enum { + MATROSKA_VIDEO_STEREOMODE_TYPE_MONO = 0, + MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT = 1, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP = 2, + MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM = 3, + MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL = 4, + MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR = 5, + MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL = 6, + MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR = 7, + MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL = 8, + MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR = 9, + MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED = 10, + MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT = 11, + MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG = 12, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR = 13, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL = 14, + MATROSKA_VIDEO_STEREOMODE_TYPE_NB, +} MatroskaVideoStereoModeType; + +typedef enum { + MATROSKA_VIDEO_DISPLAYUNIT_PIXELS = 0, + MATROSKA_VIDEO_DISPLAYUNIT_CENTIMETERS = 1, + MATROSKA_VIDEO_DISPLAYUNIT_INCHES = 2, + MATROSKA_VIDEO_DISPLAYUNIT_DAR = 3, + MATROSKA_VIDEO_DISPLAYUNIT_UNKNOWN = 4, +} MatroskaVideoDisplayUnit; + +typedef enum { + MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED = 0, + MATROSKA_COLOUR_CHROMASITINGHORZ_LEFT = 1, + MATROSKA_COLOUR_CHROMASITINGHORZ_HALF = 2, + MATROSKA_COLOUR_CHROMASITINGHORZ_NB +} MatroskaColourChromaSitingHorz; + +typedef enum { + MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED = 0, + MATROSKA_COLOUR_CHROMASITINGVERT_TOP = 1, + MATROSKA_COLOUR_CHROMASITINGVERT_HALF = 2, + MATROSKA_COLOUR_CHROMASITINGVERT_NB +} MatroskaColourChromaSitingVert; + +typedef enum { + MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR = 0, + MATROSKA_VIDEO_PROJECTION_TYPE_EQUIRECTANGULAR = 1, + MATROSKA_VIDEO_PROJECTION_TYPE_CUBEMAP = 2, + MATROSKA_VIDEO_PROJECTION_TYPE_MESH = 3, +} MatroskaVideoProjectionType; + + +#endif /* AVFORMAT_MATROSKA_IDS_H */ From patchwork Sun Mar 22 08:59:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18344 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 C7DC0448B66 for ; Sun, 22 Mar 2020 11:00:34 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B931868B6AE; Sun, 22 Mar 2020 11:00:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E24068B4E8 for ; Sun, 22 Mar 2020 11:00:22 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 48lWgV4T1hzKmb5; Sun, 22 Mar 2020 10:00:22 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id hIc720KCMssF; Sun, 22 Mar 2020 10:00:19 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:24 +0100 Message-Id: <20200322085933.7532-5-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 05/14] avformat:matroska_ids: move some IDs in separate sections 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme According grouped with their parent's elements. No value added/removed. --- libavformat/matroska_ids.h | 78 ++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/libavformat/matroska_ids.h b/libavformat/matroska_ids.h index 063dae5f94..ab77228da5 100644 --- a/libavformat/matroska_ids.h +++ b/libavformat/matroska_ids.h @@ -58,10 +58,8 @@ #define MATROSKA_ID_TRACKVIDEO 0xE0 #define MATROSKA_ID_TRACKAUDIO 0xE1 #define MATROSKA_ID_TRACKOPERATION 0xE2 -#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 -#define MATROSKA_ID_TRACKPLANE 0xE4 -#define MATROSKA_ID_TRACKPLANEUID 0xE5 -#define MATROSKA_ID_TRACKPLANETYPE 0xE6 +#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F +#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE #define MATROSKA_ID_CODECID 0x86 #define MATROSKA_ID_CODECPRIVATE 0x63A2 #define MATROSKA_ID_CODECNAME 0x258688 @@ -80,9 +78,19 @@ #define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 #define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 #define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80 + +/* IDs in the contentencodings master */ #define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 -#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F -#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE + +/* IDs in the trackoperation master */ +#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 + +/* IDs in the trackcombineplanes master */ +#define MATROSKA_ID_TRACKPLANE 0xE4 + +/* IDs in the trackplane master */ +#define MATROSKA_ID_TRACKPLANEUID 0xE5 +#define MATROSKA_ID_TRACKPLANETYPE 0xE6 /* IDs in the trackvideo master */ #define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 @@ -102,7 +110,9 @@ #define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 #define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524 #define MATROSKA_ID_VIDEOCOLOR 0x55B0 +#define MATROSKA_ID_VIDEOPROJECTION 0x7670 +/* IDs in the colour master */ #define MATROSKA_ID_VIDEOCOLORMATRIXCOEFF 0x55B1 #define MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL 0x55B2 #define MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ 0x55B3 @@ -113,12 +123,12 @@ #define MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT 0x55B8 #define MATROSKA_ID_VIDEOCOLORRANGE 0x55B9 #define MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS 0x55BA - #define MATROSKA_ID_VIDEOCOLORPRIMARIES 0x55BB #define MATROSKA_ID_VIDEOCOLORMAXCLL 0x55BC #define MATROSKA_ID_VIDEOCOLORMAXFALL 0x55BD - #define MATROSKA_ID_VIDEOCOLORMASTERINGMETA 0x55D0 + +/* IDs in the masteringmetadata master */ #define MATROSKA_ID_VIDEOCOLOR_RX 0x55D1 #define MATROSKA_ID_VIDEOCOLOR_RY 0x55D2 #define MATROSKA_ID_VIDEOCOLOR_GX 0x55D3 @@ -130,7 +140,7 @@ #define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX 0x55D9 #define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN 0x55DA -#define MATROSKA_ID_VIDEOPROJECTION 0x7670 +/* IDs in the projection master */ #define MATROSKA_ID_VIDEOPROJECTIONTYPE 0x7671 #define MATROSKA_ID_VIDEOPROJECTIONPRIVATE 0x7672 #define MATROSKA_ID_VIDEOPROJECTIONPOSEYAW 0x7673 @@ -140,7 +150,6 @@ /* IDs in the trackaudio master */ #define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 #define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 - #define MATROSKA_ID_AUDIOBITDEPTH 0x6264 #define MATROSKA_ID_AUDIOCHANNELS 0x9F @@ -149,10 +158,13 @@ #define MATROSKA_ID_ENCODINGSCOPE 0x5032 #define MATROSKA_ID_ENCODINGTYPE 0x5033 #define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 +#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 + +/* IDs in the contentcompression master */ #define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 #define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 -#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 +/* IDs in the contentencryption master */ #define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 #define MATROSKA_ID_ENCODINGENCALGO 0x47E1 #define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 @@ -177,13 +189,19 @@ /* IDs in the tags master */ #define MATROSKA_ID_TAG 0x7373 + +/* IDs in the tag master */ #define MATROSKA_ID_SIMPLETAG 0x67C8 -#define MATROSKA_ID_TAGNAME 0x45A3 -#define MATROSKA_ID_TAGSTRING 0x4487 +#define MATROSKA_ID_TAGTARGETS 0x63C0 + +/* IDs in the simpletag master */ #define MATROSKA_ID_TAGLANG 0x447A #define MATROSKA_ID_TAGDEFAULT 0x4484 +#define MATROSKA_ID_TAGSTRING 0x4487 #define MATROSKA_ID_TAGDEFAULT_BUG 0x44B4 -#define MATROSKA_ID_TAGTARGETS 0x63C0 +#define MATROSKA_ID_TAGNAME 0x45A3 + +/* IDs in the targets master */ #define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA #define MATROSKA_ID_TAGTARGETS_TYPEVALUE 0x68CA #define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5 @@ -202,21 +220,27 @@ #define MATROSKA_ID_CLUSTERPOSITION 0xA7 #define MATROSKA_ID_CLUSTERPREVSIZE 0xAB #define MATROSKA_ID_BLOCKGROUP 0xA0 -#define MATROSKA_ID_BLOCKADDITIONS 0x75A1 -#define MATROSKA_ID_BLOCKMORE 0xA6 -#define MATROSKA_ID_BLOCKADDID 0xEE -#define MATROSKA_ID_BLOCKADDITIONAL 0xA5 #define MATROSKA_ID_SIMPLEBLOCK 0xA3 /* IDs in the blockgroup master */ #define MATROSKA_ID_BLOCK 0xA1 +#define MATROSKA_ID_BLOCKADDITIONS 0x75A1 #define MATROSKA_ID_BLOCKDURATION 0x9B #define MATROSKA_ID_BLOCKREFERENCE 0xFB #define MATROSKA_ID_CODECSTATE 0xA4 #define MATROSKA_ID_DISCARDPADDING 0x75A2 +/* IDs in the blockadditions master */ +#define MATROSKA_ID_BLOCKMORE 0xA6 + +/* IDs in the blockmore master */ +#define MATROSKA_ID_BLOCKADDID 0xEE +#define MATROSKA_ID_BLOCKADDITIONAL 0xA5 + /* IDs in the attachments master */ #define MATROSKA_ID_ATTACHEDFILE 0x61A7 + +/* IDs in the attachedfile master */ #define MATROSKA_ID_FILEDESC 0x467E #define MATROSKA_ID_FILENAME 0x466E #define MATROSKA_ID_FILEMIMETYPE 0x4660 @@ -225,21 +249,27 @@ /* IDs in the chapters master */ #define MATROSKA_ID_EDITIONENTRY 0x45B9 + +/* IDs in the editionentry master */ #define MATROSKA_ID_CHAPTERATOM 0xB6 -#define MATROSKA_ID_CHAPTERTIMESTART 0x91 -#define MATROSKA_ID_CHAPTERTIMEEND 0x92 -#define MATROSKA_ID_CHAPTERDISPLAY 0x80 -#define MATROSKA_ID_CHAPSTRING 0x85 -#define MATROSKA_ID_CHAPLANG 0x437C -#define MATROSKA_ID_CHAPCOUNTRY 0x437E #define MATROSKA_ID_EDITIONUID 0x45BC #define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45BD #define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45DB #define MATROSKA_ID_EDITIONFLAGORDERED 0x45DD + +/* IDs in the chapteratom master */ #define MATROSKA_ID_CHAPTERUID 0x73C4 +#define MATROSKA_ID_CHAPTERTIMESTART 0x91 +#define MATROSKA_ID_CHAPTERTIMEEND 0x92 #define MATROSKA_ID_CHAPTERFLAGHIDDEN 0x98 #define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598 #define MATROSKA_ID_CHAPTERPHYSEQUIV 0x63C3 +#define MATROSKA_ID_CHAPTERDISPLAY 0x80 + +/* IDs in the chapterdisplay master */ +#define MATROSKA_ID_CHAPSTRING 0x85 +#define MATROSKA_ID_CHAPLANG 0x437C +#define MATROSKA_ID_CHAPCOUNTRY 0x437E typedef enum { MATROSKA_TRACK_TYPE_NONE = 0x0, From patchwork Sun Mar 22 08:59:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18345 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 C6F8E448B66 for ; Sun, 22 Mar 2020 11:00:35 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B722968B6FF; Sun, 22 Mar 2020 11:00:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B796868B2C6 for ; Sun, 22 Mar 2020 11:00:23 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 48lWgW2c6qzQlJJ; Sun, 22 Mar 2020 10:00:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id 6jWyMA-o2oJM; Sun, 22 Mar 2020 10:00:20 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:25 +0100 Message-Id: <20200322085933.7532-6-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 06/14] avformat:matroska_ids: reorder some IDs to match the generated order 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme The XSLT scripts produces a similar file to this one, minus some spacing differences. No value added/removed. --- libavformat/matroska_ids.h | 70 +++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/libavformat/matroska_ids.h b/libavformat/matroska_ids.h index ab77228da5..321e555bec 100644 --- a/libavformat/matroska_ids.h +++ b/libavformat/matroska_ids.h @@ -60,6 +60,8 @@ #define MATROSKA_ID_TRACKOPERATION 0xE2 #define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F #define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE +#define MATROSKA_ID_TRACKNAME 0x536E +#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C #define MATROSKA_ID_CODECID 0x86 #define MATROSKA_ID_CODECPRIVATE 0x63A2 #define MATROSKA_ID_CODECNAME 0x258688 @@ -68,8 +70,6 @@ #define MATROSKA_ID_CODECDECODEALL 0xAA #define MATROSKA_ID_CODECDELAY 0x56AA #define MATROSKA_ID_SEEKPREROLL 0x56BB -#define MATROSKA_ID_TRACKNAME 0x536E -#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C #define MATROSKA_ID_TRACKFLAGENABLED 0xB9 #define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 #define MATROSKA_ID_TRACKFLAGFORCED 0x55AA @@ -82,6 +82,26 @@ /* IDs in the contentencodings master */ #define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 +/* IDs in the content encoding master */ +#define MATROSKA_ID_ENCODINGORDER 0x5031 +#define MATROSKA_ID_ENCODINGSCOPE 0x5032 +#define MATROSKA_ID_ENCODINGTYPE 0x5033 +#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 +#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 + +/* IDs in the contentcompression master */ +#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 +#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 + +/* IDs in the contentencryption master */ +#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 +#define MATROSKA_ID_ENCODINGENCALGO 0x47E1 +#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 +#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5 +#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6 +#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 +#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 + /* IDs in the trackoperation master */ #define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 @@ -153,26 +173,6 @@ #define MATROSKA_ID_AUDIOBITDEPTH 0x6264 #define MATROSKA_ID_AUDIOCHANNELS 0x9F -/* IDs in the content encoding master */ -#define MATROSKA_ID_ENCODINGORDER 0x5031 -#define MATROSKA_ID_ENCODINGSCOPE 0x5032 -#define MATROSKA_ID_ENCODINGTYPE 0x5033 -#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 -#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 - -/* IDs in the contentcompression master */ -#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 -#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 - -/* IDs in the contentencryption master */ -#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 -#define MATROSKA_ID_ENCODINGENCALGO 0x47E1 -#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 -#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5 -#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6 -#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 -#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 - /* ID in the cues master */ #define MATROSKA_ID_POINTENTRY 0xBB @@ -208,12 +208,15 @@ #define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4 #define MATROSKA_ID_TAGTARGETS_ATTACHUID 0x63C6 -/* IDs in the seekhead master */ -#define MATROSKA_ID_SEEKENTRY 0x4DBB +/* IDs in the attachments master */ +#define MATROSKA_ID_ATTACHEDFILE 0x61A7 -/* IDs in the seekpoint master */ -#define MATROSKA_ID_SEEKID 0x53AB -#define MATROSKA_ID_SEEKPOSITION 0x53AC +/* IDs in the attachedfile master */ +#define MATROSKA_ID_FILEDESC 0x467E +#define MATROSKA_ID_FILENAME 0x466E +#define MATROSKA_ID_FILEMIMETYPE 0x4660 +#define MATROSKA_ID_FILEDATA 0x465C +#define MATROSKA_ID_FILEUID 0x46AE /* IDs in the cluster master */ #define MATROSKA_ID_CLUSTERTIMECODE 0xE7 @@ -237,15 +240,12 @@ #define MATROSKA_ID_BLOCKADDID 0xEE #define MATROSKA_ID_BLOCKADDITIONAL 0xA5 -/* IDs in the attachments master */ -#define MATROSKA_ID_ATTACHEDFILE 0x61A7 +/* IDs in the seekhead master */ +#define MATROSKA_ID_SEEKENTRY 0x4DBB -/* IDs in the attachedfile master */ -#define MATROSKA_ID_FILEDESC 0x467E -#define MATROSKA_ID_FILENAME 0x466E -#define MATROSKA_ID_FILEMIMETYPE 0x4660 -#define MATROSKA_ID_FILEDATA 0x465C -#define MATROSKA_ID_FILEUID 0x46AE +/* IDs in the seekpoint master */ +#define MATROSKA_ID_SEEKID 0x53AB +#define MATROSKA_ID_SEEKPOSITION 0x53AC /* IDs in the chapters master */ #define MATROSKA_ID_EDITIONENTRY 0x45B9 From patchwork Sun Mar 22 08:59:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18341 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 A115C448B66 for ; Sun, 22 Mar 2020 11:00:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 88CEB68B5BC; Sun, 22 Mar 2020 11:00:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6759568B4B5 for ; Sun, 22 Mar 2020 11:00:23 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 48lWgW00vQzKmbT; Sun, 22 Mar 2020 10:00:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id rnJihsG4clrt; Sun, 22 Mar 2020 10:00:20 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:26 +0100 Message-Id: <20200322085933.7532-7-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 07/14] avformat/matroskadec: fix the type of the TrackLanguage 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme It's an ASCII string, not a UTF-8 string. --- libavformat/matroskadec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 4d7fdab99f..383869bced 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -554,7 +554,7 @@ static EbmlSyntax matroska_track[] = { { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack, codec_id) }, { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack, codec_priv) }, { MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack, codec_delay) }, - { MATROSKA_ID_TRACKLANGUAGE, EBML_UTF8, 0, offsetof(MatroskaTrack, language), { .s = "eng" } }, + { MATROSKA_ID_TRACKLANGUAGE, EBML_STR, 0, offsetof(MatroskaTrack, language), { .s = "eng" } }, { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack, default_duration) }, { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT, 0, offsetof(MatroskaTrack, time_scale), { .f = 1.0 } }, { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack, flag_default), { .u = 1 } }, From patchwork Sun Mar 22 08:59:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18346 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 9F003448B66 for ; Sun, 22 Mar 2020 11:00:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8E3FC68B6AB; Sun, 22 Mar 2020 11:00:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 70D0468B4A3 for ; Sun, 22 Mar 2020 11:00:24 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 48lWgX0DYHzQjjH; Sun, 22 Mar 2020 10:00:24 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id oa56sl3okBRh; Sun, 22 Mar 2020 10:00:20 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:27 +0100 Message-Id: <20200322085933.7532-8-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 08/14] avformat/matroskadec: fix the default of the TagDefault element 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme By default a tag is the default one. --- libavformat/matroskadec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 383869bced..3640dd76d9 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -652,8 +652,8 @@ static EbmlSyntax matroska_simpletag[] = { { MATROSKA_ID_TAGNAME, EBML_UTF8, 0, offsetof(MatroskaTag, name) }, { MATROSKA_ID_TAGSTRING, EBML_UTF8, 0, offsetof(MatroskaTag, string) }, { MATROSKA_ID_TAGLANG, EBML_STR, 0, offsetof(MatroskaTag, lang), { .s = "und" } }, - { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag, def) }, - { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag, def) }, + { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, + { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag, sub), { .n = matroska_simpletag } }, CHILD_OF(matroska_tag) }; From patchwork Sun Mar 22 08:59:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18347 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 7F2C9448B66 for ; Sun, 22 Mar 2020 11:00:37 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6D08468B773; Sun, 22 Mar 2020 11:00:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E91968B54C for ; Sun, 22 Mar 2020 11:00:24 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 48lWgX25SqzQlJK; Sun, 22 Mar 2020 10:00:24 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id OFW8FmBW_1Zh; Sun, 22 Mar 2020 10:00:21 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:28 +0100 Message-Id: <20200322085933.7532-9-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 09/14] avformat/matroskadec: remove some implicit default value 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme All integers should be initialized to 0. Make the tables more consistent by only setting non zero values. --- libavformat/matroskadec.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 3640dd76d9..b021a4cce0 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -445,18 +445,18 @@ static EbmlSyntax matroska_mastering_meta[] = { static EbmlSyntax matroska_track_video_color[] = { { MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, matrix_coefficients), { .u = AVCOL_SPC_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, bits_per_channel), { .u=0 } }, - { MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_horz), { .u=0 } }, - { MATROSKA_ID_VIDEOCOLORCHROMASUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_vert), { .u=0 } }, - { MATROSKA_ID_VIDEOCOLORCBSUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_horz), { .u=0 } }, - { MATROSKA_ID_VIDEOCOLORCBSUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_vert), { .u=0 } }, + { MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, bits_per_channel) }, + { MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_horz) }, + { MATROSKA_ID_VIDEOCOLORCHROMASUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_vert) }, + { MATROSKA_ID_VIDEOCOLORCBSUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_horz) }, + { MATROSKA_ID_VIDEOCOLORCBSUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_vert) }, { MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_horz), { .u = MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED } }, { MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_vert), { .u = MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED } }, { MATROSKA_ID_VIDEOCOLORRANGE, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, range), { .u = AVCOL_RANGE_UNSPECIFIED } }, { MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, transfer_characteristics), { .u = AVCOL_TRC_UNSPECIFIED } }, { MATROSKA_ID_VIDEOCOLORPRIMARIES, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, primaries), { .u = AVCOL_PRI_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORMAXCLL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_cll), { .u=0 } }, - { MATROSKA_ID_VIDEOCOLORMAXFALL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_fall), { .u=0 } }, + { MATROSKA_ID_VIDEOCOLORMAXCLL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_cll) }, + { MATROSKA_ID_VIDEOCOLORMAXFALL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_fall) }, { MATROSKA_ID_VIDEOCOLORMASTERINGMETA, EBML_NEST, 0, offsetof(MatroskaTrackVideoColor, mastering_meta), { .n = matroska_mastering_meta } }, CHILD_OF(matroska_track_video) }; @@ -501,13 +501,13 @@ static EbmlSyntax matroska_track_audio[] = { }; static EbmlSyntax matroska_track_encoding_compression[] = { - { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo), { .u = 0 } }, + { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo) }, { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) }, CHILD_OF(matroska_track_encoding) }; static EbmlSyntax matroska_track_encoding_encryption[] = { - { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption,algo), {.u = 0} }, + { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption,algo) }, { MATROSKA_ID_ENCODINGENCKEYID, EBML_BIN, 0, offsetof(MatroskaTrackEncryption,key_id) }, { MATROSKA_ID_ENCODINGENCAESSETTINGS, EBML_NONE }, { MATROSKA_ID_ENCODINGSIGALGO, EBML_NONE }, @@ -518,7 +518,7 @@ static EbmlSyntax matroska_track_encoding_encryption[] = { }; static EbmlSyntax matroska_track_encoding[] = { { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } }, - { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type), { .u = 0 } }, + { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type) }, { MATROSKA_ID_ENCODINGCOMPRESSION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, compression), { .n = matroska_track_encoding_compression } }, { MATROSKA_ID_ENCODINGENCRYPTION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, encryption), { .n = matroska_track_encoding_encryption } }, { MATROSKA_ID_ENCODINGORDER, EBML_NONE }, @@ -558,7 +558,7 @@ static EbmlSyntax matroska_track[] = { { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack, default_duration) }, { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT, 0, offsetof(MatroskaTrack, time_scale), { .f = 1.0 } }, { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack, flag_default), { .u = 1 } }, - { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced), { .u = 0 } }, + { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced) }, { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack, video), { .n = matroska_track_video } }, { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack, audio), { .n = matroska_track_audio } }, { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } }, From patchwork Sun Mar 22 08:59:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18351 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 DFA95448B66 for ; Sun, 22 Mar 2020 11:00:41 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BD6FC68B7CD; Sun, 22 Mar 2020 11:00:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3A41D68B5C9 for ; Sun, 22 Mar 2020 11:00:27 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 48lWgZ67SXzKmg2; Sun, 22 Mar 2020 10:00:26 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id uUFfRGDAKQP5; Sun, 22 Mar 2020 10:00:21 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:29 +0100 Message-Id: <20200322085933.7532-10-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 10/14] avformat/matroskadec: move the elements semantic in a separate file 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme So the file can be generated from the Matroska Schema. The EbmlSyntax structures are not shared between files. matroska_segments and matroska_cluster_enter also have their size predefined. No functional changes. --- libavformat/Makefile | 2 +- libavformat/matroskadec.c | 668 +------------------------------------- libavformat/matroskasem.c | 384 ++++++++++++++++++++++ libavformat/matroskasem.h | 362 +++++++++++++++++++++ 4 files changed, 748 insertions(+), 668 deletions(-) create mode 100644 libavformat/matroskasem.c create mode 100644 libavformat/matroskasem.h diff --git a/libavformat/Makefile b/libavformat/Makefile index 8fd0d43721..09cd0d49ce 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -294,7 +294,7 @@ OBJS-$(CONFIG_LVF_DEMUXER) += lvfdec.o OBJS-$(CONFIG_LXF_DEMUXER) += lxfdec.o OBJS-$(CONFIG_M4V_DEMUXER) += m4vdec.o rawdec.o OBJS-$(CONFIG_M4V_MUXER) += rawenc.o -OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \ +OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroskasem.o matroska.o \ rmsipr.o flac_picture.o \ oggparsevorbis.o vorbiscomment.o \ flac_picture.o replaygain.o diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index b021a4cce0..8aa2cbda61 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -54,6 +54,7 @@ #include "internal.h" #include "isom.h" #include "matroska.h" +#include "matroskasem.h" #include "oggdec.h" /* For ff_codec_get_id(). */ #include "riff.h" @@ -80,673 +81,6 @@ * to this many bytes of unknown data for the * SKIP_THRESHOLD check. */ -typedef enum { - EBML_NONE, - EBML_UINT, - EBML_SINT, - EBML_FLOAT, - EBML_STR, - EBML_UTF8, - EBML_BIN, - EBML_NEST, - EBML_LEVEL1, - EBML_STOP, - EBML_TYPE_COUNT -} EbmlType; - -typedef const struct EbmlSyntax { - uint32_t id; - EbmlType type; - size_t list_elem_size; - size_t data_offset; - union { - int64_t i; - uint64_t u; - double f; - const char *s; - const struct EbmlSyntax *n; - } def; -} EbmlSyntax; - -typedef struct EbmlList { - int nb_elem; - unsigned int alloc_elem_size; - void *elem; -} EbmlList; - -typedef struct EbmlBin { - int size; - AVBufferRef *buf; - uint8_t *data; - int64_t pos; -} EbmlBin; - -typedef struct Ebml { - uint64_t version; - uint64_t max_size; - uint64_t id_length; - char *doctype; - uint64_t doctype_version; -} Ebml; - -typedef struct MatroskaTrackCompression { - uint64_t algo; - EbmlBin settings; -} MatroskaTrackCompression; - -typedef struct MatroskaTrackEncryption { - uint64_t algo; - EbmlBin key_id; -} MatroskaTrackEncryption; - -typedef struct MatroskaTrackEncoding { - uint64_t scope; - uint64_t type; - MatroskaTrackCompression compression; - MatroskaTrackEncryption encryption; -} MatroskaTrackEncoding; - -typedef struct MatroskaMasteringMeta { - double r_x; - double r_y; - double g_x; - double g_y; - double b_x; - double b_y; - double white_x; - double white_y; - double max_luminance; - double min_luminance; -} MatroskaMasteringMeta; - -typedef struct MatroskaTrackVideoColor { - uint64_t matrix_coefficients; - uint64_t bits_per_channel; - uint64_t chroma_sub_horz; - uint64_t chroma_sub_vert; - uint64_t cb_sub_horz; - uint64_t cb_sub_vert; - uint64_t chroma_siting_horz; - uint64_t chroma_siting_vert; - uint64_t range; - uint64_t transfer_characteristics; - uint64_t primaries; - uint64_t max_cll; - uint64_t max_fall; - MatroskaMasteringMeta mastering_meta; -} MatroskaTrackVideoColor; - -typedef struct MatroskaTrackVideoProjection { - uint64_t type; - EbmlBin private; - double yaw; - double pitch; - double roll; -} MatroskaTrackVideoProjection; - -typedef struct MatroskaTrackVideo { - double frame_rate; - uint64_t display_width; - uint64_t display_height; - uint64_t pixel_width; - uint64_t pixel_height; - EbmlBin color_space; - uint64_t display_unit; - uint64_t interlaced; - uint64_t field_order; - uint64_t stereo_mode; - uint64_t alpha_mode; - EbmlList color; - MatroskaTrackVideoProjection projection; -} MatroskaTrackVideo; - -typedef struct MatroskaTrackAudio { - double samplerate; - double out_samplerate; - uint64_t bitdepth; - uint64_t channels; - - /* real audio header (extracted from extradata) */ - int coded_framesize; - int sub_packet_h; - int frame_size; - int sub_packet_size; - int sub_packet_cnt; - int pkt_cnt; - uint64_t buf_timecode; - uint8_t *buf; -} MatroskaTrackAudio; - -typedef struct MatroskaTrackPlane { - uint64_t uid; - uint64_t type; -} MatroskaTrackPlane; - -typedef struct MatroskaTrackOperation { - EbmlList combine_planes; -} MatroskaTrackOperation; - -typedef struct MatroskaTrack { - uint64_t num; - uint64_t uid; - uint64_t type; - char *name; - char *codec_id; - EbmlBin codec_priv; - char *language; - double time_scale; - uint64_t default_duration; - uint64_t flag_default; - uint64_t flag_forced; - uint64_t seek_preroll; - MatroskaTrackVideo video; - MatroskaTrackAudio audio; - MatroskaTrackOperation operation; - EbmlList encodings; - uint64_t codec_delay; - uint64_t codec_delay_in_track_tb; - - AVStream *stream; - int64_t end_timecode; - int ms_compat; - uint64_t max_block_additional_id; - - uint32_t palette[AVPALETTE_COUNT]; - int has_palette; -} MatroskaTrack; - -typedef struct MatroskaAttachment { - uint64_t uid; - char *filename; - char *mime; - EbmlBin bin; - - AVStream *stream; -} MatroskaAttachment; - -typedef struct MatroskaChapter { - uint64_t start; - uint64_t end; - uint64_t uid; - char *title; - - AVChapter *chapter; -} MatroskaChapter; - -typedef struct MatroskaIndexPos { - uint64_t track; - uint64_t pos; -} MatroskaIndexPos; - -typedef struct MatroskaIndex { - uint64_t time; - EbmlList pos; -} MatroskaIndex; - -typedef struct MatroskaTag { - char *name; - char *string; - char *lang; - uint64_t def; - EbmlList sub; -} MatroskaTag; - -typedef struct MatroskaTagTarget { - char *type; - uint64_t typevalue; - uint64_t trackuid; - uint64_t chapteruid; - uint64_t attachuid; -} MatroskaTagTarget; - -typedef struct MatroskaTags { - MatroskaTagTarget target; - EbmlList tag; -} MatroskaTags; - -typedef struct MatroskaSeekhead { - uint64_t id; - uint64_t pos; -} MatroskaSeekhead; - -typedef struct MatroskaLevel { - uint64_t start; - uint64_t length; -} MatroskaLevel; - -typedef struct MatroskaBlock { - uint64_t duration; - int64_t reference; - uint64_t non_simple; - EbmlBin bin; - uint64_t additional_id; - EbmlBin additional; - int64_t discard_padding; -} MatroskaBlock; - -typedef struct MatroskaCluster { - MatroskaBlock block; - uint64_t timecode; - int64_t pos; -} MatroskaCluster; - -typedef struct MatroskaLevel1Element { - int64_t pos; - uint32_t id; - int parsed; -} MatroskaLevel1Element; - -typedef struct MatroskaDemuxContext { - const AVClass *class; - AVFormatContext *ctx; - - /* EBML stuff */ - MatroskaLevel levels[EBML_MAX_DEPTH]; - int num_levels; - uint32_t current_id; - int64_t resync_pos; - int unknown_count; - - uint64_t time_scale; - double duration; - char *title; - char *muxingapp; - EbmlBin date_utc; - EbmlList tracks; - EbmlList attachments; - EbmlList chapters; - EbmlList index; - EbmlList tags; - EbmlList seekhead; - - /* byte position of the segment inside the stream */ - int64_t segment_start; - - /* the packet queue */ - AVPacketList *queue; - AVPacketList *queue_end; - - int done; - - /* What to skip before effectively reading a packet. */ - int skip_to_keyframe; - uint64_t skip_to_timecode; - - /* File has a CUES element, but we defer parsing until it is needed. */ - int cues_parsing_deferred; - - /* Level1 elements and whether they were read yet */ - MatroskaLevel1Element level1_elems[64]; - int num_level1_elems; - - MatroskaCluster current_cluster; - - /* WebM DASH Manifest live flag */ - int is_live; - - /* Bandwidth value for WebM DASH Manifest */ - int bandwidth; -} MatroskaDemuxContext; - -#define CHILD_OF(parent) { .def = { .n = parent } } - -// The following forward declarations need their size because -// a tentative definition with internal linkage must not be an -// incomplete type (6.7.2 in C90, 6.9.2 in C99). -// Removing the sizes breaks MSVC. -static EbmlSyntax ebml_syntax[3], matroska_segment[9], matroska_track_video_color[15], matroska_track_video[19], - matroska_track[27], matroska_track_encoding[6], matroska_track_encodings[2], - matroska_track_combine_planes[2], matroska_track_operation[2], matroska_tracks[2], - matroska_attachments[2], matroska_chapter_entry[9], matroska_chapter[6], matroska_chapters[2], - matroska_index_entry[3], matroska_index[2], matroska_tag[3], matroska_tags[2], matroska_seekhead[2], - matroska_blockadditions[2], matroska_blockgroup[8], matroska_cluster_parsing[8]; - -static EbmlSyntax ebml_header[] = { - { EBML_ID_EBMLREADVERSION, EBML_UINT, 0, offsetof(Ebml, version), { .u = EBML_VERSION } }, - { EBML_ID_EBMLMAXSIZELENGTH, EBML_UINT, 0, offsetof(Ebml, max_size), { .u = 8 } }, - { EBML_ID_EBMLMAXIDLENGTH, EBML_UINT, 0, offsetof(Ebml, id_length), { .u = 4 } }, - { EBML_ID_DOCTYPE, EBML_STR, 0, offsetof(Ebml, doctype), { .s = "(none)" } }, - { EBML_ID_DOCTYPEREADVERSION, EBML_UINT, 0, offsetof(Ebml, doctype_version), { .u = 1 } }, - { EBML_ID_EBMLVERSION, EBML_NONE }, - { EBML_ID_DOCTYPEVERSION, EBML_NONE }, - CHILD_OF(ebml_syntax) -}; - -static EbmlSyntax ebml_syntax[] = { - { EBML_ID_HEADER, EBML_NEST, 0, 0, { .n = ebml_header } }, - { MATROSKA_ID_SEGMENT, EBML_STOP }, - { 0 } -}; - -static EbmlSyntax matroska_info[] = { - { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext, time_scale), { .u = 1000000 } }, - { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext, duration) }, - { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, title) }, - { MATROSKA_ID_WRITINGAPP, EBML_NONE }, - { MATROSKA_ID_MUXINGAPP, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, muxingapp) }, - { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext, date_utc) }, - { MATROSKA_ID_SEGMENTUID, EBML_NONE }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_mastering_meta[] = { - { MATROSKA_ID_VIDEOCOLOR_RX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_RY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_GX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_GY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_BX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_BY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_WHITEX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_WHITEY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, min_luminance), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, max_luminance), { .f=-1 } }, - CHILD_OF(matroska_track_video_color) -}; - -static EbmlSyntax matroska_track_video_color[] = { - { MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, matrix_coefficients), { .u = AVCOL_SPC_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, bits_per_channel) }, - { MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_horz) }, - { MATROSKA_ID_VIDEOCOLORCHROMASUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_vert) }, - { MATROSKA_ID_VIDEOCOLORCBSUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_horz) }, - { MATROSKA_ID_VIDEOCOLORCBSUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_vert) }, - { MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_horz), { .u = MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED } }, - { MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_vert), { .u = MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED } }, - { MATROSKA_ID_VIDEOCOLORRANGE, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, range), { .u = AVCOL_RANGE_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, transfer_characteristics), { .u = AVCOL_TRC_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORPRIMARIES, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, primaries), { .u = AVCOL_PRI_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORMAXCLL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_cll) }, - { MATROSKA_ID_VIDEOCOLORMAXFALL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_fall) }, - { MATROSKA_ID_VIDEOCOLORMASTERINGMETA, EBML_NEST, 0, offsetof(MatroskaTrackVideoColor, mastering_meta), { .n = matroska_mastering_meta } }, - CHILD_OF(matroska_track_video) -}; - -static EbmlSyntax matroska_track_video_projection[] = { - { MATROSKA_ID_VIDEOPROJECTIONTYPE, EBML_UINT, 0, offsetof(MatroskaTrackVideoProjection, type), { .u = MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR } }, - { MATROSKA_ID_VIDEOPROJECTIONPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrackVideoProjection, private) }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEYAW, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, yaw), { .f=0.0 } }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, pitch), { .f=0.0 } }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEROLL, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, roll), { .f=0.0 } }, - CHILD_OF(matroska_track_video) -}; - -static EbmlSyntax matroska_track_video[] = { - { MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT, 0, offsetof(MatroskaTrackVideo, frame_rate) }, - { MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_width), { .u=-1 } }, - { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_height), { .u=-1 } }, - { MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_width) }, - { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_height) }, - { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo, color_space) }, - { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, alpha_mode) }, - { MATROSKA_ID_VIDEOCOLOR, EBML_NEST, sizeof(MatroskaTrackVideoColor), offsetof(MatroskaTrackVideo, color), { .n = matroska_track_video_color } }, - { MATROSKA_ID_VIDEOPROJECTION, EBML_NEST, 0, offsetof(MatroskaTrackVideo, projection), { .n = matroska_track_video_projection } }, - { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE }, - { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE }, - { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE }, - { MATROSKA_ID_VIDEOPIXELCROPR, EBML_NONE }, - { MATROSKA_ID_VIDEODISPLAYUNIT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_unit), { .u= MATROSKA_VIDEO_DISPLAYUNIT_PIXELS } }, - { MATROSKA_ID_VIDEOFLAGINTERLACED, EBML_UINT, 0, offsetof(MatroskaTrackVideo, interlaced), { .u = MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED } }, - { MATROSKA_ID_VIDEOFIELDORDER, EBML_UINT, 0, offsetof(MatroskaTrackVideo, field_order), { .u = MATROSKA_VIDEO_FIELDORDER_UNDETERMINED } }, - { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, stereo_mode), { .u = MATROSKA_VIDEO_STEREOMODE_TYPE_NB } }, - { MATROSKA_ID_VIDEOASPECTRATIO, EBML_NONE }, - CHILD_OF(matroska_track) -}; - -static EbmlSyntax matroska_track_audio[] = { - { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, samplerate), { .f = 8000.0 } }, - { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, out_samplerate) }, - { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio, bitdepth) }, - { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio, channels), { .u = 1 } }, - CHILD_OF(matroska_track) -}; - -static EbmlSyntax matroska_track_encoding_compression[] = { - { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo) }, - { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) }, - CHILD_OF(matroska_track_encoding) -}; - -static EbmlSyntax matroska_track_encoding_encryption[] = { - { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption,algo) }, - { MATROSKA_ID_ENCODINGENCKEYID, EBML_BIN, 0, offsetof(MatroskaTrackEncryption,key_id) }, - { MATROSKA_ID_ENCODINGENCAESSETTINGS, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGALGO, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGHASHALGO, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGKEYID, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGNATURE, EBML_NONE }, - CHILD_OF(matroska_track_encoding) -}; -static EbmlSyntax matroska_track_encoding[] = { - { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } }, - { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type) }, - { MATROSKA_ID_ENCODINGCOMPRESSION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, compression), { .n = matroska_track_encoding_compression } }, - { MATROSKA_ID_ENCODINGENCRYPTION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, encryption), { .n = matroska_track_encoding_encryption } }, - { MATROSKA_ID_ENCODINGORDER, EBML_NONE }, - CHILD_OF(matroska_track_encodings) -}; - -static EbmlSyntax matroska_track_encodings[] = { - { MATROSKA_ID_TRACKCONTENTENCODING, EBML_NEST, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack, encodings), { .n = matroska_track_encoding } }, - CHILD_OF(matroska_track) -}; - -static EbmlSyntax matroska_track_plane[] = { - { MATROSKA_ID_TRACKPLANEUID, EBML_UINT, 0, offsetof(MatroskaTrackPlane,uid) }, - { MATROSKA_ID_TRACKPLANETYPE, EBML_UINT, 0, offsetof(MatroskaTrackPlane,type) }, - CHILD_OF(matroska_track_combine_planes) -}; - -static EbmlSyntax matroska_track_combine_planes[] = { - { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation,combine_planes), {.n = matroska_track_plane} }, - CHILD_OF(matroska_track_operation) -}; - -static EbmlSyntax matroska_track_operation[] = { - { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, {.n = matroska_track_combine_planes} }, - CHILD_OF(matroska_track) -}; - -static EbmlSyntax matroska_track[] = { - { MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack, num) }, - { MATROSKA_ID_TRACKNAME, EBML_UTF8, 0, offsetof(MatroskaTrack, name) }, - { MATROSKA_ID_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTrack, uid) }, - { MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack, type) }, - { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack, codec_id) }, - { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack, codec_priv) }, - { MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack, codec_delay) }, - { MATROSKA_ID_TRACKLANGUAGE, EBML_STR, 0, offsetof(MatroskaTrack, language), { .s = "eng" } }, - { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack, default_duration) }, - { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT, 0, offsetof(MatroskaTrack, time_scale), { .f = 1.0 } }, - { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack, flag_default), { .u = 1 } }, - { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced) }, - { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack, video), { .n = matroska_track_video } }, - { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack, audio), { .n = matroska_track_audio } }, - { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } }, - { MATROSKA_ID_TRACKCONTENTENCODINGS, EBML_NEST, 0, 0, { .n = matroska_track_encodings } }, - { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack, max_block_additional_id) }, - { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack, seek_preroll) }, - { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE }, - { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE }, - { MATROSKA_ID_CODECNAME, EBML_NONE }, - { MATROSKA_ID_CODECDECODEALL, EBML_NONE }, - { MATROSKA_ID_CODECINFOURL, EBML_NONE }, - { MATROSKA_ID_CODECDOWNLOADURL, EBML_NONE }, - { MATROSKA_ID_TRACKMINCACHE, EBML_NONE }, - { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE }, - CHILD_OF(matroska_tracks) -}; - -static EbmlSyntax matroska_tracks[] = { - { MATROSKA_ID_TRACKENTRY, EBML_NEST, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext, tracks), { .n = matroska_track } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_attachment[] = { - { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachment, uid) }, - { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) }, - { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) }, - { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) }, - { MATROSKA_ID_FILEDESC, EBML_NONE }, - CHILD_OF(matroska_attachments) -}; - -static EbmlSyntax matroska_attachments[] = { - { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_chapter_display[] = { - { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) }, - { MATROSKA_ID_CHAPLANG, EBML_NONE }, - { MATROSKA_ID_CHAPCOUNTRY, EBML_NONE }, - CHILD_OF(matroska_chapter_entry) -}; - -static EbmlSyntax matroska_chapter_entry[] = { - { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } }, - { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } }, - { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter, uid) }, - { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, { .n = matroska_chapter_display } }, - { MATROSKA_ID_CHAPTERFLAGHIDDEN, EBML_NONE }, - { MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE }, - { MATROSKA_ID_CHAPTERPHYSEQUIV, EBML_NONE }, - { MATROSKA_ID_CHAPTERATOM, EBML_NONE }, - CHILD_OF(matroska_chapter) -}; - -static EbmlSyntax matroska_chapter[] = { - { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } }, - { MATROSKA_ID_EDITIONUID, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGHIDDEN, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGORDERED, EBML_NONE }, - CHILD_OF(matroska_chapters) -}; - -static EbmlSyntax matroska_chapters[] = { - { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, { .n = matroska_chapter } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_index_pos[] = { - { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos, track) }, - { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos, pos) }, - { MATROSKA_ID_CUERELATIVEPOSITION,EBML_NONE }, - { MATROSKA_ID_CUEDURATION, EBML_NONE }, - { MATROSKA_ID_CUEBLOCKNUMBER, EBML_NONE }, - CHILD_OF(matroska_index_entry) -}; - -static EbmlSyntax matroska_index_entry[] = { - { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex, time) }, - { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } }, - CHILD_OF(matroska_index) -}; - -static EbmlSyntax matroska_index[] = { - { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_simpletag[] = { - { MATROSKA_ID_TAGNAME, EBML_UTF8, 0, offsetof(MatroskaTag, name) }, - { MATROSKA_ID_TAGSTRING, EBML_UTF8, 0, offsetof(MatroskaTag, string) }, - { MATROSKA_ID_TAGLANG, EBML_STR, 0, offsetof(MatroskaTag, lang), { .s = "und" } }, - { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, - { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, - { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag, sub), { .n = matroska_simpletag } }, - CHILD_OF(matroska_tag) -}; - -static EbmlSyntax matroska_tagtargets[] = { - { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget, type) }, - { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget, typevalue), { .u = 50 } }, - { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, trackuid) }, - { MATROSKA_ID_TAGTARGETS_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, chapteruid) }, - { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, attachuid) }, - CHILD_OF(matroska_tag) -}; - -static EbmlSyntax matroska_tag[] = { - { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags, tag), { .n = matroska_simpletag } }, - { MATROSKA_ID_TAGTARGETS, EBML_NEST, 0, offsetof(MatroskaTags, target), { .n = matroska_tagtargets } }, - CHILD_OF(matroska_tags) -}; - -static EbmlSyntax matroska_tags[] = { - { MATROSKA_ID_TAG, EBML_NEST, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext, tags), { .n = matroska_tag } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_seekhead_entry[] = { - { MATROSKA_ID_SEEKID, EBML_UINT, 0, offsetof(MatroskaSeekhead, id) }, - { MATROSKA_ID_SEEKPOSITION, EBML_UINT, 0, offsetof(MatroskaSeekhead, pos), { .u = -1 } }, - CHILD_OF(matroska_seekhead) -}; - -static EbmlSyntax matroska_seekhead[] = { - { MATROSKA_ID_SEEKENTRY, EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext, seekhead), { .n = matroska_seekhead_entry } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_segment[] = { - { MATROSKA_ID_CLUSTER, EBML_STOP }, - { MATROSKA_ID_INFO, EBML_LEVEL1, 0, 0, { .n = matroska_info } }, - { MATROSKA_ID_TRACKS, EBML_LEVEL1, 0, 0, { .n = matroska_tracks } }, - { MATROSKA_ID_ATTACHMENTS, EBML_LEVEL1, 0, 0, { .n = matroska_attachments } }, - { MATROSKA_ID_CHAPTERS, EBML_LEVEL1, 0, 0, { .n = matroska_chapters } }, - { MATROSKA_ID_CUES, EBML_LEVEL1, 0, 0, { .n = matroska_index } }, - { MATROSKA_ID_TAGS, EBML_LEVEL1, 0, 0, { .n = matroska_tags } }, - { MATROSKA_ID_SEEKHEAD, EBML_LEVEL1, 0, 0, { .n = matroska_seekhead } }, - { 0 } /* We don't want to go back to level 0, so don't add the parent. */ -}; - -static EbmlSyntax matroska_segments[] = { - { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, { .n = matroska_segment } }, - { 0 } -}; - -static EbmlSyntax matroska_blockmore[] = { - { MATROSKA_ID_BLOCKADDID, EBML_UINT, 0, offsetof(MatroskaBlock,additional_id), { .u = 1 } }, - { MATROSKA_ID_BLOCKADDITIONAL, EBML_BIN, 0, offsetof(MatroskaBlock,additional) }, - CHILD_OF(matroska_blockadditions) -}; - -static EbmlSyntax matroska_blockadditions[] = { - { MATROSKA_ID_BLOCKMORE, EBML_NEST, 0, 0, {.n = matroska_blockmore} }, - CHILD_OF(matroska_blockgroup) -}; - -static EbmlSyntax matroska_blockgroup[] = { - { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, - { MATROSKA_ID_BLOCKADDITIONS, EBML_NEST, 0, 0, { .n = matroska_blockadditions} }, - { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock, duration) }, - { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock, discard_padding) }, - { MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, reference), { .i = INT64_MIN } }, - { MATROSKA_ID_CODECSTATE, EBML_NONE }, - { 1, EBML_UINT, 0, offsetof(MatroskaBlock, non_simple), { .u = 1 } }, - CHILD_OF(matroska_cluster_parsing) -}; - -// The following array contains SimpleBlock and BlockGroup twice -// in order to reuse the other values for matroska_cluster_enter. -static EbmlSyntax matroska_cluster_parsing[] = { - { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, - { MATROSKA_ID_BLOCKGROUP, EBML_NEST, 0, 0, { .n = matroska_blockgroup } }, - { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) }, - { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP }, - { MATROSKA_ID_BLOCKGROUP, EBML_STOP }, - { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE }, - { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_cluster_enter[] = { - { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, { .n = &matroska_cluster_parsing[2] } }, - { 0 } -}; -#undef CHILD_OF - static const char *const matroska_doctypes[] = { "matroska", "webm" }; static int matroska_read_close(AVFormatContext *s); diff --git a/libavformat/matroskasem.c b/libavformat/matroskasem.c new file mode 100644 index 0000000000..ce9331e044 --- /dev/null +++ b/libavformat/matroskasem.c @@ -0,0 +1,384 @@ +/* + * Matroska file semantic definition + * Copyright (c) 2003-2020 The FFmpeg Project + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Matroska file semantic element definitions + * @author Ronald Bultje + * @author with a little help from Moritz Bunkus + * @author totally reworked by Aurelien Jacobs + * @author Split from decoder by Steve Lhomme + * @see specs available on the Matroska project page: http://www.matroska.org/ + */ + +#include "config.h" + +#include + +#include "matroskasem.h" + +#define CHILD_OF(parent) { .def = { .n = parent } } + +static EbmlSyntax ebml_header[] = { + { EBML_ID_EBMLREADVERSION, EBML_UINT, 0, offsetof(Ebml, version), { .u = EBML_VERSION } }, + { EBML_ID_EBMLMAXSIZELENGTH, EBML_UINT, 0, offsetof(Ebml, max_size), { .u = 8 } }, + { EBML_ID_EBMLMAXIDLENGTH, EBML_UINT, 0, offsetof(Ebml, id_length), { .u = 4 } }, + { EBML_ID_DOCTYPE, EBML_STR, 0, offsetof(Ebml, doctype), { .s = "(none)" } }, + { EBML_ID_DOCTYPEREADVERSION, EBML_UINT, 0, offsetof(Ebml, doctype_version), { .u = 1 } }, + { EBML_ID_EBMLVERSION, EBML_NONE }, + { EBML_ID_DOCTYPEVERSION, EBML_NONE }, + CHILD_OF(ebml_syntax) +}; + +EbmlSyntax ebml_syntax[] = { + { EBML_ID_HEADER, EBML_NEST, 0, 0, { .n = ebml_header } }, + { MATROSKA_ID_SEGMENT, EBML_STOP }, + { 0 } +}; + +static EbmlSyntax matroska_info[] = { + { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext, time_scale), { .u = 1000000 } }, + { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext, duration) }, + { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, title) }, + { MATROSKA_ID_WRITINGAPP, EBML_NONE }, + { MATROSKA_ID_MUXINGAPP, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, muxingapp) }, + { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext, date_utc) }, + { MATROSKA_ID_SEGMENTUID, EBML_NONE }, + CHILD_OF(matroska_segment) +}; + +static EbmlSyntax matroska_mastering_meta[] = { + { MATROSKA_ID_VIDEOCOLOR_RX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_x), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_RY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_y), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_GX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_x), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_GY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_y), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_BX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_x), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_BY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_y), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_WHITEX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_x), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_WHITEY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_y), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, min_luminance), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, max_luminance), { .f=-1 } }, + CHILD_OF(matroska_track_video_color) +}; + +EbmlSyntax matroska_track_video_color[] = { + { MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, matrix_coefficients), { .u = AVCOL_SPC_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, bits_per_channel) }, + { MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_horz) }, + { MATROSKA_ID_VIDEOCOLORCHROMASUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_vert) }, + { MATROSKA_ID_VIDEOCOLORCBSUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_horz) }, + { MATROSKA_ID_VIDEOCOLORCBSUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_vert) }, + { MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_horz), { .u = MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED } }, + { MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_vert), { .u = MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED } }, + { MATROSKA_ID_VIDEOCOLORRANGE, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, range), { .u = AVCOL_RANGE_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, transfer_characteristics), { .u = AVCOL_TRC_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORPRIMARIES, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, primaries), { .u = AVCOL_PRI_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORMAXCLL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_cll) }, + { MATROSKA_ID_VIDEOCOLORMAXFALL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_fall) }, + { MATROSKA_ID_VIDEOCOLORMASTERINGMETA, EBML_NEST, 0, offsetof(MatroskaTrackVideoColor, mastering_meta), { .n = matroska_mastering_meta } }, + CHILD_OF(matroska_track_video) +}; + +static EbmlSyntax matroska_track_video_projection[] = { + { MATROSKA_ID_VIDEOPROJECTIONTYPE, EBML_UINT, 0, offsetof(MatroskaTrackVideoProjection, type), { .u = MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR } }, + { MATROSKA_ID_VIDEOPROJECTIONPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrackVideoProjection, private) }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEYAW, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, yaw), { .f=0.0 } }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, pitch), { .f=0.0 } }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEROLL, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, roll), { .f=0.0 } }, + CHILD_OF(matroska_track_video) +}; + +EbmlSyntax matroska_track_video[] = { + { MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT, 0, offsetof(MatroskaTrackVideo, frame_rate) }, + { MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_width), { .u=-1 } }, + { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_height), { .u=-1 } }, + { MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_width) }, + { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_height) }, + { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo, color_space) }, + { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, alpha_mode) }, + { MATROSKA_ID_VIDEOCOLOR, EBML_NEST, sizeof(MatroskaTrackVideoColor), offsetof(MatroskaTrackVideo, color), { .n = matroska_track_video_color } }, + { MATROSKA_ID_VIDEOPROJECTION, EBML_NEST, 0, offsetof(MatroskaTrackVideo, projection), { .n = matroska_track_video_projection } }, + { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE }, + { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE }, + { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE }, + { MATROSKA_ID_VIDEOPIXELCROPR, EBML_NONE }, + { MATROSKA_ID_VIDEODISPLAYUNIT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_unit), { .u= MATROSKA_VIDEO_DISPLAYUNIT_PIXELS } }, + { MATROSKA_ID_VIDEOFLAGINTERLACED, EBML_UINT, 0, offsetof(MatroskaTrackVideo, interlaced), { .u = MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED } }, + { MATROSKA_ID_VIDEOFIELDORDER, EBML_UINT, 0, offsetof(MatroskaTrackVideo, field_order), { .u = MATROSKA_VIDEO_FIELDORDER_UNDETERMINED } }, + { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, stereo_mode), { .u = MATROSKA_VIDEO_STEREOMODE_TYPE_NB } }, + { MATROSKA_ID_VIDEOASPECTRATIO, EBML_NONE }, + CHILD_OF(matroska_track) +}; + +static EbmlSyntax matroska_track_audio[] = { + { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, samplerate), { .f = 8000.0 } }, + { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, out_samplerate) }, + { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio, bitdepth) }, + { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio, channels), { .u = 1 } }, + CHILD_OF(matroska_track) +}; + +static EbmlSyntax matroska_track_encoding_compression[] = { + { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo) }, + { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) }, + CHILD_OF(matroska_track_encoding) +}; + +static EbmlSyntax matroska_track_encoding_encryption[] = { + { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption,algo) }, + { MATROSKA_ID_ENCODINGENCKEYID, EBML_BIN, 0, offsetof(MatroskaTrackEncryption,key_id) }, + { MATROSKA_ID_ENCODINGENCAESSETTINGS, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGALGO, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGHASHALGO, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGKEYID, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGNATURE, EBML_NONE }, + CHILD_OF(matroska_track_encoding) +}; + +EbmlSyntax matroska_track_encoding[] = { + { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } }, + { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type) }, + { MATROSKA_ID_ENCODINGCOMPRESSION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, compression), { .n = matroska_track_encoding_compression } }, + { MATROSKA_ID_ENCODINGENCRYPTION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, encryption), { .n = matroska_track_encoding_encryption } }, + { MATROSKA_ID_ENCODINGORDER, EBML_NONE }, + CHILD_OF(matroska_track_encodings) +}; + +EbmlSyntax matroska_track_encodings[] = { + { MATROSKA_ID_TRACKCONTENTENCODING, EBML_NEST, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack, encodings), { .n = matroska_track_encoding } }, + CHILD_OF(matroska_track) +}; + +EbmlSyntax matroska_track_plane[] = { + { MATROSKA_ID_TRACKPLANEUID, EBML_UINT, 0, offsetof(MatroskaTrackPlane,uid) }, + { MATROSKA_ID_TRACKPLANETYPE, EBML_UINT, 0, offsetof(MatroskaTrackPlane,type) }, + CHILD_OF(matroska_track_combine_planes) +}; + +EbmlSyntax matroska_track_combine_planes[] = { + { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation,combine_planes), {.n = matroska_track_plane} }, + CHILD_OF(matroska_track_operation) +}; + +EbmlSyntax matroska_track_operation[] = { + { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, {.n = matroska_track_combine_planes} }, + CHILD_OF(matroska_track) +}; + +EbmlSyntax matroska_track[] = { + { MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack, num) }, + { MATROSKA_ID_TRACKNAME, EBML_UTF8, 0, offsetof(MatroskaTrack, name) }, + { MATROSKA_ID_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTrack, uid) }, + { MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack, type) }, + { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack, codec_id) }, + { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack, codec_priv) }, + { MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack, codec_delay) }, + { MATROSKA_ID_TRACKLANGUAGE, EBML_STR, 0, offsetof(MatroskaTrack, language), { .s = "eng" } }, + { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack, default_duration) }, + { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT, 0, offsetof(MatroskaTrack, time_scale), { .f = 1.0 } }, + { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack, flag_default), { .u = 1 } }, + { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced) }, + { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack, video), { .n = matroska_track_video } }, + { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack, audio), { .n = matroska_track_audio } }, + { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } }, + { MATROSKA_ID_TRACKCONTENTENCODINGS, EBML_NEST, 0, 0, { .n = matroska_track_encodings } }, + { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack, max_block_additional_id) }, + { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack, seek_preroll) }, + { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE }, + { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE }, + { MATROSKA_ID_CODECNAME, EBML_NONE }, + { MATROSKA_ID_CODECDECODEALL, EBML_NONE }, + { MATROSKA_ID_CODECINFOURL, EBML_NONE }, + { MATROSKA_ID_CODECDOWNLOADURL, EBML_NONE }, + { MATROSKA_ID_TRACKMINCACHE, EBML_NONE }, + { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE }, + CHILD_OF(matroska_tracks) +}; + +EbmlSyntax matroska_tracks[] = { + { MATROSKA_ID_TRACKENTRY, EBML_NEST, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext, tracks), { .n = matroska_track } }, + CHILD_OF(matroska_segment) +}; + +static EbmlSyntax matroska_attachment[] = { + { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachment, uid) }, + { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) }, + { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) }, + { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) }, + { MATROSKA_ID_FILEDESC, EBML_NONE }, + CHILD_OF(matroska_attachments) +}; + +EbmlSyntax matroska_attachments[] = { + { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } }, + CHILD_OF(matroska_segment) +}; + +static EbmlSyntax matroska_chapter_display[] = { + { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) }, + { MATROSKA_ID_CHAPLANG, EBML_NONE }, + { MATROSKA_ID_CHAPCOUNTRY, EBML_NONE }, + CHILD_OF(matroska_chapter_entry) +}; + +EbmlSyntax matroska_chapter_entry[] = { + { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } }, + { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } }, + { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter, uid) }, + { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, { .n = matroska_chapter_display } }, + { MATROSKA_ID_CHAPTERFLAGHIDDEN, EBML_NONE }, + { MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE }, + { MATROSKA_ID_CHAPTERPHYSEQUIV, EBML_NONE }, + { MATROSKA_ID_CHAPTERATOM, EBML_NONE }, + CHILD_OF(matroska_chapter) +}; + +EbmlSyntax matroska_chapter[] = { + { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } }, + { MATROSKA_ID_EDITIONUID, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGHIDDEN, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGORDERED, EBML_NONE }, + CHILD_OF(matroska_chapters) +}; + +EbmlSyntax matroska_chapters[] = { + { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, { .n = matroska_chapter } }, + CHILD_OF(matroska_segment) +}; + +static EbmlSyntax matroska_index_pos[] = { + { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos, track) }, + { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos, pos) }, + { MATROSKA_ID_CUERELATIVEPOSITION,EBML_NONE }, + { MATROSKA_ID_CUEDURATION, EBML_NONE }, + { MATROSKA_ID_CUEBLOCKNUMBER, EBML_NONE }, + CHILD_OF(matroska_index_entry) +}; + +EbmlSyntax matroska_index_entry[] = { + { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex, time) }, + { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } }, + CHILD_OF(matroska_index) +}; + +EbmlSyntax matroska_index[] = { + { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } }, + CHILD_OF(matroska_segment) +}; + +static EbmlSyntax matroska_simpletag[] = { + { MATROSKA_ID_TAGNAME, EBML_UTF8, 0, offsetof(MatroskaTag, name) }, + { MATROSKA_ID_TAGSTRING, EBML_UTF8, 0, offsetof(MatroskaTag, string) }, + { MATROSKA_ID_TAGLANG, EBML_STR, 0, offsetof(MatroskaTag, lang), { .s = "und" } }, + { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, + { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, + { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag, sub), { .n = matroska_simpletag } }, + CHILD_OF(matroska_tag) +}; + +static EbmlSyntax matroska_tagtargets[] = { + { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget, type) }, + { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget, typevalue), { .u = 50 } }, + { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, trackuid) }, + { MATROSKA_ID_TAGTARGETS_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, chapteruid) }, + { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, attachuid) }, + CHILD_OF(matroska_tag) +}; + +EbmlSyntax matroska_tag[] = { + { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags, tag), { .n = matroska_simpletag } }, + { MATROSKA_ID_TAGTARGETS, EBML_NEST, 0, offsetof(MatroskaTags, target), { .n = matroska_tagtargets } }, + CHILD_OF(matroska_tags) +}; + +EbmlSyntax matroska_tags[] = { + { MATROSKA_ID_TAG, EBML_NEST, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext, tags), { .n = matroska_tag } }, + CHILD_OF(matroska_segment) +}; + +static EbmlSyntax matroska_seekhead_entry[] = { + { MATROSKA_ID_SEEKID, EBML_UINT, 0, offsetof(MatroskaSeekhead, id) }, + { MATROSKA_ID_SEEKPOSITION, EBML_UINT, 0, offsetof(MatroskaSeekhead, pos), { .u = -1 } }, + CHILD_OF(matroska_seekhead) +}; + +EbmlSyntax matroska_seekhead[] = { + { MATROSKA_ID_SEEKENTRY, EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext, seekhead), { .n = matroska_seekhead_entry } }, + CHILD_OF(matroska_segment) +}; + +EbmlSyntax matroska_segment[] = { + { MATROSKA_ID_CLUSTER, EBML_STOP }, + { MATROSKA_ID_INFO, EBML_LEVEL1, 0, 0, { .n = matroska_info } }, + { MATROSKA_ID_TRACKS, EBML_LEVEL1, 0, 0, { .n = matroska_tracks } }, + { MATROSKA_ID_ATTACHMENTS, EBML_LEVEL1, 0, 0, { .n = matroska_attachments } }, + { MATROSKA_ID_CHAPTERS, EBML_LEVEL1, 0, 0, { .n = matroska_chapters } }, + { MATROSKA_ID_CUES, EBML_LEVEL1, 0, 0, { .n = matroska_index } }, + { MATROSKA_ID_TAGS, EBML_LEVEL1, 0, 0, { .n = matroska_tags } }, + { MATROSKA_ID_SEEKHEAD, EBML_LEVEL1, 0, 0, { .n = matroska_seekhead } }, + { 0 } /* We don't want to go back to level 0, so don't add the parent. */ +}; + +EbmlSyntax matroska_segments[] = { + { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, { .n = matroska_segment } }, + { 0 } +}; + +static EbmlSyntax matroska_blockmore[] = { + { MATROSKA_ID_BLOCKADDID, EBML_UINT, 0, offsetof(MatroskaBlock,additional_id), { .u = 1 } }, + { MATROSKA_ID_BLOCKADDITIONAL, EBML_BIN, 0, offsetof(MatroskaBlock,additional) }, + CHILD_OF(matroska_blockadditions) +}; + +EbmlSyntax matroska_blockadditions[] = { + { MATROSKA_ID_BLOCKMORE, EBML_NEST, 0, 0, {.n = matroska_blockmore} }, + CHILD_OF(matroska_blockgroup) +}; + +EbmlSyntax matroska_blockgroup[] = { + { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, + { MATROSKA_ID_BLOCKADDITIONS, EBML_NEST, 0, 0, { .n = matroska_blockadditions} }, + { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock, duration) }, + { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock, discard_padding) }, + { MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, reference), { .i = INT64_MIN } }, + { MATROSKA_ID_CODECSTATE, EBML_NONE }, + { 1, EBML_UINT, 0, offsetof(MatroskaBlock, non_simple), { .u = 1 } }, + CHILD_OF(matroska_cluster_parsing) +}; + +// The following array contains SimpleBlock and BlockGroup twice +// in order to reuse the other values for matroska_cluster_enter. +EbmlSyntax matroska_cluster_parsing[] = { + { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, + { MATROSKA_ID_BLOCKGROUP, EBML_NEST, 0, 0, { .n = matroska_blockgroup } }, + { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) }, + { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP }, + { MATROSKA_ID_BLOCKGROUP, EBML_STOP }, + { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE }, + { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE }, + CHILD_OF(matroska_segment) +}; + +EbmlSyntax matroska_cluster_enter[] = { + { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, { .n = &matroska_cluster_parsing[2] } }, + { 0 } +}; diff --git a/libavformat/matroskasem.h b/libavformat/matroskasem.h new file mode 100644 index 0000000000..8171982abf --- /dev/null +++ b/libavformat/matroskasem.h @@ -0,0 +1,362 @@ +/* + * Matroska file semantic definition + * Copyright (c) 2003-2020 The FFmpeg project + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Matroska file demuxer + * @author Ronald Bultje + * @author with a little help from Moritz Bunkus + * @author totally reworked by Aurelien Jacobs + * @see specs available on the Matroska project page: http://www.matroska.org/ + */ + +#ifndef AVFORMAT_MATROSKASEM_H +#define AVFORMAT_MATROSKASEM_H + +#include + +#include "matroska.h" +#include "avformat.h" +#include "libavutil/frame.h" + +typedef enum { + EBML_NONE, + EBML_UINT, + EBML_SINT, + EBML_FLOAT, + EBML_STR, + EBML_UTF8, + EBML_BIN, + EBML_NEST, + EBML_LEVEL1, + EBML_STOP, + EBML_TYPE_COUNT +} EbmlType; + +typedef const struct EbmlSyntax { + uint32_t id; + EbmlType type; + size_t list_elem_size; + size_t data_offset; + union { + int64_t i; + uint64_t u; + double f; + const char *s; + const struct EbmlSyntax *n; + } def; +} EbmlSyntax; + +typedef struct EbmlList { + int nb_elem; + unsigned int alloc_elem_size; + void *elem; +} EbmlList; + +typedef struct EbmlBin { + int size; + AVBufferRef *buf; + uint8_t *data; + int64_t pos; +} EbmlBin; + +typedef struct Ebml { + uint64_t version; + uint64_t max_size; + uint64_t id_length; + char *doctype; + uint64_t doctype_version; +} Ebml; + +typedef struct MatroskaTrackCompression { + uint64_t algo; + EbmlBin settings; +} MatroskaTrackCompression; + +typedef struct MatroskaTrackEncryption { + uint64_t algo; + EbmlBin key_id; +} MatroskaTrackEncryption; + +typedef struct MatroskaTrackEncoding { + uint64_t scope; + uint64_t type; + MatroskaTrackCompression compression; + MatroskaTrackEncryption encryption; +} MatroskaTrackEncoding; + +typedef struct MatroskaMasteringMeta { + double r_x; + double r_y; + double g_x; + double g_y; + double b_x; + double b_y; + double white_x; + double white_y; + double max_luminance; + double min_luminance; +} MatroskaMasteringMeta; + +typedef struct MatroskaTrackVideoColor { + uint64_t matrix_coefficients; + uint64_t bits_per_channel; + uint64_t chroma_sub_horz; + uint64_t chroma_sub_vert; + uint64_t cb_sub_horz; + uint64_t cb_sub_vert; + uint64_t chroma_siting_horz; + uint64_t chroma_siting_vert; + uint64_t range; + uint64_t transfer_characteristics; + uint64_t primaries; + uint64_t max_cll; + uint64_t max_fall; + MatroskaMasteringMeta mastering_meta; +} MatroskaTrackVideoColor; + +typedef struct MatroskaTrackVideoProjection { + uint64_t type; + EbmlBin private; + double yaw; + double pitch; + double roll; +} MatroskaTrackVideoProjection; + +typedef struct MatroskaTrackVideo { + double frame_rate; + uint64_t display_width; + uint64_t display_height; + uint64_t pixel_width; + uint64_t pixel_height; + EbmlBin color_space; + uint64_t display_unit; + uint64_t interlaced; + uint64_t field_order; + uint64_t stereo_mode; + uint64_t alpha_mode; + EbmlList color; + MatroskaTrackVideoProjection projection; +} MatroskaTrackVideo; + +typedef struct MatroskaTrackAudio { + double samplerate; + double out_samplerate; + uint64_t bitdepth; + uint64_t channels; + + /* real audio header (extracted from extradata) */ + int coded_framesize; + int sub_packet_h; + int frame_size; + int sub_packet_size; + int sub_packet_cnt; + int pkt_cnt; + uint64_t buf_timecode; + uint8_t *buf; +} MatroskaTrackAudio; + +typedef struct MatroskaTrackPlane { + uint64_t uid; + uint64_t type; +} MatroskaTrackPlane; + +typedef struct MatroskaTrackOperation { + EbmlList combine_planes; +} MatroskaTrackOperation; + +typedef struct MatroskaTrack { + uint64_t num; + uint64_t uid; + uint64_t type; + char *name; + char *codec_id; + EbmlBin codec_priv; + char *language; + double time_scale; + uint64_t default_duration; + uint64_t flag_default; + uint64_t flag_forced; + uint64_t seek_preroll; + MatroskaTrackVideo video; + MatroskaTrackAudio audio; + MatroskaTrackOperation operation; + EbmlList encodings; + uint64_t codec_delay; + uint64_t codec_delay_in_track_tb; + + AVStream *stream; + int64_t end_timecode; + int ms_compat; + uint64_t max_block_additional_id; + + uint32_t palette[AVPALETTE_COUNT]; + int has_palette; +} MatroskaTrack; + +typedef struct MatroskaAttachment { + uint64_t uid; + char *filename; + char *mime; + EbmlBin bin; + + AVStream *stream; +} MatroskaAttachment; + +typedef struct MatroskaChapter { + uint64_t start; + uint64_t end; + uint64_t uid; + char *title; + + AVChapter *chapter; +} MatroskaChapter; + +typedef struct MatroskaIndexPos { + uint64_t track; + uint64_t pos; +} MatroskaIndexPos; + +typedef struct MatroskaIndex { + uint64_t time; + EbmlList pos; +} MatroskaIndex; + +typedef struct MatroskaTag { + char *name; + char *string; + char *lang; + uint64_t def; + EbmlList sub; +} MatroskaTag; + +typedef struct MatroskaTagTarget { + char *type; + uint64_t typevalue; + uint64_t trackuid; + uint64_t chapteruid; + uint64_t attachuid; +} MatroskaTagTarget; + +typedef struct MatroskaTags { + MatroskaTagTarget target; + EbmlList tag; +} MatroskaTags; + +typedef struct MatroskaSeekhead { + uint64_t id; + uint64_t pos; +} MatroskaSeekhead; + +typedef struct MatroskaLevel { + uint64_t start; + uint64_t length; +} MatroskaLevel; + +typedef struct MatroskaBlock { + uint64_t duration; + int64_t reference; + uint64_t non_simple; + EbmlBin bin; + uint64_t additional_id; + EbmlBin additional; + int64_t discard_padding; +} MatroskaBlock; + +typedef struct MatroskaCluster { + MatroskaBlock block; + uint64_t timecode; + int64_t pos; +} MatroskaCluster; + +typedef struct MatroskaLevel1Element { + int64_t pos; + uint32_t id; + int parsed; +} MatroskaLevel1Element; + +typedef struct MatroskaDemuxContext { + const AVClass *class; + AVFormatContext *ctx; + + /* EBML stuff */ + MatroskaLevel levels[EBML_MAX_DEPTH]; + int num_levels; + uint32_t current_id; + int64_t resync_pos; + int unknown_count; + + uint64_t time_scale; + double duration; + char *title; + char *muxingapp; + EbmlBin date_utc; + EbmlList tracks; + EbmlList attachments; + EbmlList chapters; + EbmlList index; + EbmlList tags; + EbmlList seekhead; + + /* byte position of the segment inside the stream */ + int64_t segment_start; + + /* the packet queue */ + AVPacketList *queue; + AVPacketList *queue_end; + + int done; + + /* What to skip before effectively reading a packet. */ + int skip_to_keyframe; + uint64_t skip_to_timecode; + + /* File has a CUES element, but we defer parsing until it is needed. */ + int cues_parsing_deferred; + + /* Level1 elements and whether they were read yet */ + MatroskaLevel1Element level1_elems[64]; + int num_level1_elems; + + MatroskaCluster current_cluster; + + /* WebM DASH Manifest live flag */ + int is_live; + + /* Bandwidth value for WebM DASH Manifest */ + int bandwidth; +} MatroskaDemuxContext; + +// The following forward declarations need their size because +// a tentative definition with internal linkage must not be an +// incomplete type (6.7.2 in C90, 6.9.2 in C99). +// Removing the sizes breaks MSVC. +EbmlSyntax ebml_syntax[3], matroska_segment[9], matroska_track_video_color[15], matroska_track_video[19], + matroska_track[27], matroska_track_encoding[6], matroska_track_encodings[2], + matroska_track_combine_planes[2], matroska_track_operation[2], matroska_tracks[2], + matroska_attachments[2], matroska_chapter_entry[9], matroska_chapter[6], matroska_chapters[2], + matroska_index_entry[3], matroska_index[2], matroska_tag[3], matroska_tags[2], matroska_seekhead[2], + matroska_blockadditions[2], matroska_blockgroup[8], matroska_cluster_parsing[8]; + +EbmlSyntax matroska_segments[1]; +EbmlSyntax matroska_cluster_enter[1]; + +#endif /* AVFORMAT_MATROSKASEM_H */ From patchwork Sun Mar 22 08:59:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18348 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 5917C448B66 for ; Sun, 22 Mar 2020 11:00:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4158868B79D; Sun, 22 Mar 2020 11:00:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B26E468B58F for ; Sun, 22 Mar 2020 11:00:25 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 48lWgY2mxZzKmcH; Sun, 22 Mar 2020 10:00:25 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id yGUQwCDemOsi; Sun, 22 Mar 2020 10:00:22 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:30 +0100 Message-Id: <20200322085933.7532-11-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 11/14] avformat/matroskasem: reorder EbmlSyntax tables 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme So they are sorted by their EBML path, in reverse order so we don't extra declarations. No functional changes. --- libavformat/matroskasem.c | 256 +++++++++++++++++++------------------- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/libavformat/matroskasem.c b/libavformat/matroskasem.c index ce9331e044..27aa6d9c4e 100644 --- a/libavformat/matroskasem.c +++ b/libavformat/matroskasem.c @@ -54,15 +54,13 @@ EbmlSyntax ebml_syntax[] = { { 0 } }; -static EbmlSyntax matroska_info[] = { - { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext, time_scale), { .u = 1000000 } }, - { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext, duration) }, - { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, title) }, - { MATROSKA_ID_WRITINGAPP, EBML_NONE }, - { MATROSKA_ID_MUXINGAPP, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, muxingapp) }, - { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext, date_utc) }, - { MATROSKA_ID_SEGMENTUID, EBML_NONE }, - CHILD_OF(matroska_segment) +static EbmlSyntax matroska_track_video_projection[] = { + { MATROSKA_ID_VIDEOPROJECTIONTYPE, EBML_UINT, 0, offsetof(MatroskaTrackVideoProjection, type), { .u = MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR } }, + { MATROSKA_ID_VIDEOPROJECTIONPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrackVideoProjection, private) }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEYAW, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, yaw), { .f=0.0 } }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, pitch), { .f=0.0 } }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEROLL, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, roll), { .f=0.0 } }, + CHILD_OF(matroska_track_video) }; static EbmlSyntax matroska_mastering_meta[] = { @@ -97,15 +95,6 @@ EbmlSyntax matroska_track_video_color[] = { CHILD_OF(matroska_track_video) }; -static EbmlSyntax matroska_track_video_projection[] = { - { MATROSKA_ID_VIDEOPROJECTIONTYPE, EBML_UINT, 0, offsetof(MatroskaTrackVideoProjection, type), { .u = MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR } }, - { MATROSKA_ID_VIDEOPROJECTIONPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrackVideoProjection, private) }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEYAW, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, yaw), { .f=0.0 } }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, pitch), { .f=0.0 } }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEROLL, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, roll), { .f=0.0 } }, - CHILD_OF(matroska_track_video) -}; - EbmlSyntax matroska_track_video[] = { { MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT, 0, offsetof(MatroskaTrackVideo, frame_rate) }, { MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_width), { .u=-1 } }, @@ -128,18 +117,20 @@ EbmlSyntax matroska_track_video[] = { CHILD_OF(matroska_track) }; -static EbmlSyntax matroska_track_audio[] = { - { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, samplerate), { .f = 8000.0 } }, - { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, out_samplerate) }, - { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio, bitdepth) }, - { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio, channels), { .u = 1 } }, - CHILD_OF(matroska_track) +EbmlSyntax matroska_track_plane[] = { + { MATROSKA_ID_TRACKPLANEUID, EBML_UINT, 0, offsetof(MatroskaTrackPlane,uid) }, + { MATROSKA_ID_TRACKPLANETYPE, EBML_UINT, 0, offsetof(MatroskaTrackPlane,type) }, + CHILD_OF(matroska_track_combine_planes) }; -static EbmlSyntax matroska_track_encoding_compression[] = { - { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo) }, - { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) }, - CHILD_OF(matroska_track_encoding) +EbmlSyntax matroska_track_combine_planes[] = { + { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation,combine_planes), {.n = matroska_track_plane} }, + CHILD_OF(matroska_track_operation) +}; + +EbmlSyntax matroska_track_operation[] = { + { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, {.n = matroska_track_combine_planes} }, + CHILD_OF(matroska_track) }; static EbmlSyntax matroska_track_encoding_encryption[] = { @@ -153,6 +144,12 @@ static EbmlSyntax matroska_track_encoding_encryption[] = { CHILD_OF(matroska_track_encoding) }; +static EbmlSyntax matroska_track_encoding_compression[] = { + { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo) }, + { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) }, + CHILD_OF(matroska_track_encoding) +}; + EbmlSyntax matroska_track_encoding[] = { { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } }, { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type) }, @@ -167,19 +164,11 @@ EbmlSyntax matroska_track_encodings[] = { CHILD_OF(matroska_track) }; -EbmlSyntax matroska_track_plane[] = { - { MATROSKA_ID_TRACKPLANEUID, EBML_UINT, 0, offsetof(MatroskaTrackPlane,uid) }, - { MATROSKA_ID_TRACKPLANETYPE, EBML_UINT, 0, offsetof(MatroskaTrackPlane,type) }, - CHILD_OF(matroska_track_combine_planes) -}; - -EbmlSyntax matroska_track_combine_planes[] = { - { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation,combine_planes), {.n = matroska_track_plane} }, - CHILD_OF(matroska_track_operation) -}; - -EbmlSyntax matroska_track_operation[] = { - { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, {.n = matroska_track_combine_planes} }, +static EbmlSyntax matroska_track_audio[] = { + { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, samplerate), { .f = 8000.0 } }, + { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, out_samplerate) }, + { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio, bitdepth) }, + { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio, channels), { .u = 1 } }, CHILD_OF(matroska_track) }; @@ -218,71 +207,13 @@ EbmlSyntax matroska_tracks[] = { CHILD_OF(matroska_segment) }; -static EbmlSyntax matroska_attachment[] = { - { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachment, uid) }, - { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) }, - { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) }, - { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) }, - { MATROSKA_ID_FILEDESC, EBML_NONE }, - CHILD_OF(matroska_attachments) -}; - -EbmlSyntax matroska_attachments[] = { - { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_chapter_display[] = { - { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) }, - { MATROSKA_ID_CHAPLANG, EBML_NONE }, - { MATROSKA_ID_CHAPCOUNTRY, EBML_NONE }, - CHILD_OF(matroska_chapter_entry) -}; - -EbmlSyntax matroska_chapter_entry[] = { - { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } }, - { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } }, - { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter, uid) }, - { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, { .n = matroska_chapter_display } }, - { MATROSKA_ID_CHAPTERFLAGHIDDEN, EBML_NONE }, - { MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE }, - { MATROSKA_ID_CHAPTERPHYSEQUIV, EBML_NONE }, - { MATROSKA_ID_CHAPTERATOM, EBML_NONE }, - CHILD_OF(matroska_chapter) -}; - -EbmlSyntax matroska_chapter[] = { - { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } }, - { MATROSKA_ID_EDITIONUID, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGHIDDEN, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGORDERED, EBML_NONE }, - CHILD_OF(matroska_chapters) -}; - -EbmlSyntax matroska_chapters[] = { - { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, { .n = matroska_chapter } }, - CHILD_OF(matroska_segment) -}; - -static EbmlSyntax matroska_index_pos[] = { - { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos, track) }, - { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos, pos) }, - { MATROSKA_ID_CUERELATIVEPOSITION,EBML_NONE }, - { MATROSKA_ID_CUEDURATION, EBML_NONE }, - { MATROSKA_ID_CUEBLOCKNUMBER, EBML_NONE }, - CHILD_OF(matroska_index_entry) -}; - -EbmlSyntax matroska_index_entry[] = { - { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex, time) }, - { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } }, - CHILD_OF(matroska_index) -}; - -EbmlSyntax matroska_index[] = { - { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } }, - CHILD_OF(matroska_segment) +static EbmlSyntax matroska_tagtargets[] = { + { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget, type) }, + { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget, typevalue), { .u = 50 } }, + { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, trackuid) }, + { MATROSKA_ID_TAGTARGETS_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, chapteruid) }, + { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, attachuid) }, + CHILD_OF(matroska_tag) }; static EbmlSyntax matroska_simpletag[] = { @@ -295,15 +226,6 @@ static EbmlSyntax matroska_simpletag[] = { CHILD_OF(matroska_tag) }; -static EbmlSyntax matroska_tagtargets[] = { - { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget, type) }, - { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget, typevalue), { .u = 50 } }, - { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, trackuid) }, - { MATROSKA_ID_TAGTARGETS_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, chapteruid) }, - { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, attachuid) }, - CHILD_OF(matroska_tag) -}; - EbmlSyntax matroska_tag[] = { { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags, tag), { .n = matroska_simpletag } }, { MATROSKA_ID_TAGTARGETS, EBML_NEST, 0, offsetof(MatroskaTags, target), { .n = matroska_tagtargets } }, @@ -326,21 +248,35 @@ EbmlSyntax matroska_seekhead[] = { CHILD_OF(matroska_segment) }; -EbmlSyntax matroska_segment[] = { - { MATROSKA_ID_CLUSTER, EBML_STOP }, - { MATROSKA_ID_INFO, EBML_LEVEL1, 0, 0, { .n = matroska_info } }, - { MATROSKA_ID_TRACKS, EBML_LEVEL1, 0, 0, { .n = matroska_tracks } }, - { MATROSKA_ID_ATTACHMENTS, EBML_LEVEL1, 0, 0, { .n = matroska_attachments } }, - { MATROSKA_ID_CHAPTERS, EBML_LEVEL1, 0, 0, { .n = matroska_chapters } }, - { MATROSKA_ID_CUES, EBML_LEVEL1, 0, 0, { .n = matroska_index } }, - { MATROSKA_ID_TAGS, EBML_LEVEL1, 0, 0, { .n = matroska_tags } }, - { MATROSKA_ID_SEEKHEAD, EBML_LEVEL1, 0, 0, { .n = matroska_seekhead } }, - { 0 } /* We don't want to go back to level 0, so don't add the parent. */ +static EbmlSyntax matroska_info[] = { + { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext, time_scale), { .u = 1000000 } }, + { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext, duration) }, + { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, title) }, + { MATROSKA_ID_WRITINGAPP, EBML_NONE }, + { MATROSKA_ID_MUXINGAPP, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, muxingapp) }, + { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext, date_utc) }, + { MATROSKA_ID_SEGMENTUID, EBML_NONE }, + CHILD_OF(matroska_segment) }; -EbmlSyntax matroska_segments[] = { - { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, { .n = matroska_segment } }, - { 0 } +static EbmlSyntax matroska_index_pos[] = { + { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos, track) }, + { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos, pos) }, + { MATROSKA_ID_CUERELATIVEPOSITION,EBML_NONE }, + { MATROSKA_ID_CUEDURATION, EBML_NONE }, + { MATROSKA_ID_CUEBLOCKNUMBER, EBML_NONE }, + CHILD_OF(matroska_index_entry) +}; + +EbmlSyntax matroska_index_entry[] = { + { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex, time) }, + { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } }, + CHILD_OF(matroska_index) +}; + +EbmlSyntax matroska_index[] = { + { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } }, + CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_blockmore[] = { @@ -378,6 +314,70 @@ EbmlSyntax matroska_cluster_parsing[] = { CHILD_OF(matroska_segment) }; +static EbmlSyntax matroska_chapter_display[] = { + { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) }, + { MATROSKA_ID_CHAPLANG, EBML_NONE }, + { MATROSKA_ID_CHAPCOUNTRY, EBML_NONE }, + CHILD_OF(matroska_chapter_entry) +}; + +EbmlSyntax matroska_chapter_entry[] = { + { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } }, + { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } }, + { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter, uid) }, + { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, { .n = matroska_chapter_display } }, + { MATROSKA_ID_CHAPTERFLAGHIDDEN, EBML_NONE }, + { MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE }, + { MATROSKA_ID_CHAPTERPHYSEQUIV, EBML_NONE }, + { MATROSKA_ID_CHAPTERATOM, EBML_NONE }, + CHILD_OF(matroska_chapter) +}; + +EbmlSyntax matroska_chapter[] = { + { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } }, + { MATROSKA_ID_EDITIONUID, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGHIDDEN, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGORDERED, EBML_NONE }, + CHILD_OF(matroska_chapters) +}; + +EbmlSyntax matroska_chapters[] = { + { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, { .n = matroska_chapter } }, + CHILD_OF(matroska_segment) +}; + +static EbmlSyntax matroska_attachment[] = { + { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachment, uid) }, + { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) }, + { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) }, + { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) }, + { MATROSKA_ID_FILEDESC, EBML_NONE }, + CHILD_OF(matroska_attachments) +}; + +EbmlSyntax matroska_attachments[] = { + { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } }, + CHILD_OF(matroska_segment) +}; + +EbmlSyntax matroska_segment[] = { + { MATROSKA_ID_CLUSTER, EBML_STOP }, + { MATROSKA_ID_INFO, EBML_LEVEL1, 0, 0, { .n = matroska_info } }, + { MATROSKA_ID_TRACKS, EBML_LEVEL1, 0, 0, { .n = matroska_tracks } }, + { MATROSKA_ID_ATTACHMENTS, EBML_LEVEL1, 0, 0, { .n = matroska_attachments } }, + { MATROSKA_ID_CHAPTERS, EBML_LEVEL1, 0, 0, { .n = matroska_chapters } }, + { MATROSKA_ID_CUES, EBML_LEVEL1, 0, 0, { .n = matroska_index } }, + { MATROSKA_ID_TAGS, EBML_LEVEL1, 0, 0, { .n = matroska_tags } }, + { MATROSKA_ID_SEEKHEAD, EBML_LEVEL1, 0, 0, { .n = matroska_seekhead } }, + { 0 } /* We don't want to go back to level 0, so don't add the parent. */ +}; + +EbmlSyntax matroska_segments[] = { + { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, { .n = matroska_segment } }, + { 0 } +}; + EbmlSyntax matroska_cluster_enter[] = { { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, { .n = &matroska_cluster_parsing[2] } }, { 0 } From patchwork Sun Mar 22 08:59:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18349 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 5C39C448B66 for ; Sun, 22 Mar 2020 11:00:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3EF1868B787; Sun, 22 Mar 2020 11:00:39 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C432A68B5C9 for ; Sun, 22 Mar 2020 11:00:26 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 48lWgZ3FL4zQlJL; Sun, 22 Mar 2020 10:00:26 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id ggm174SorMib; Sun, 22 Mar 2020 10:00:22 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:31 +0100 Message-Id: <20200322085933.7532-12-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 12/14] avformat/matroskasem: reorder some EbmlSyntax elements 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme So it's easier to match with the XSLT ordering which has limited possibilities (15 max criteria for all the syntax tables). No functional changes. --- libavformat/matroskasem.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libavformat/matroskasem.c b/libavformat/matroskasem.c index 27aa6d9c4e..aca506b943 100644 --- a/libavformat/matroskasem.c +++ b/libavformat/matroskasem.c @@ -101,10 +101,6 @@ EbmlSyntax matroska_track_video[] = { { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_height), { .u=-1 } }, { MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_width) }, { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_height) }, - { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo, color_space) }, - { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, alpha_mode) }, - { MATROSKA_ID_VIDEOCOLOR, EBML_NEST, sizeof(MatroskaTrackVideoColor), offsetof(MatroskaTrackVideo, color), { .n = matroska_track_video_color } }, - { MATROSKA_ID_VIDEOPROJECTION, EBML_NEST, 0, offsetof(MatroskaTrackVideo, projection), { .n = matroska_track_video_projection } }, { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE }, { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE }, { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE }, @@ -112,6 +108,10 @@ EbmlSyntax matroska_track_video[] = { { MATROSKA_ID_VIDEODISPLAYUNIT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_unit), { .u= MATROSKA_VIDEO_DISPLAYUNIT_PIXELS } }, { MATROSKA_ID_VIDEOFLAGINTERLACED, EBML_UINT, 0, offsetof(MatroskaTrackVideo, interlaced), { .u = MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED } }, { MATROSKA_ID_VIDEOFIELDORDER, EBML_UINT, 0, offsetof(MatroskaTrackVideo, field_order), { .u = MATROSKA_VIDEO_FIELDORDER_UNDETERMINED } }, + { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, alpha_mode) }, + { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo, color_space) }, + { MATROSKA_ID_VIDEOCOLOR, EBML_NEST, sizeof(MatroskaTrackVideoColor), offsetof(MatroskaTrackVideo, color), { .n = matroska_track_video_color } }, + { MATROSKA_ID_VIDEOPROJECTION, EBML_NEST, 0, offsetof(MatroskaTrackVideo, projection), { .n = matroska_track_video_projection } }, { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, stereo_mode), { .u = MATROSKA_VIDEO_STEREOMODE_TYPE_NB } }, { MATROSKA_ID_VIDEOASPECTRATIO, EBML_NONE }, CHILD_OF(matroska_track) @@ -187,18 +187,18 @@ EbmlSyntax matroska_track[] = { { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced) }, { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack, video), { .n = matroska_track_video } }, { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack, audio), { .n = matroska_track_audio } }, - { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } }, - { MATROSKA_ID_TRACKCONTENTENCODINGS, EBML_NEST, 0, 0, { .n = matroska_track_encodings } }, - { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack, max_block_additional_id) }, - { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack, seek_preroll) }, { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE }, { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE }, + { MATROSKA_ID_TRACKMINCACHE, EBML_NONE }, + { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE }, + { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack, max_block_additional_id) }, { MATROSKA_ID_CODECNAME, EBML_NONE }, - { MATROSKA_ID_CODECDECODEALL, EBML_NONE }, { MATROSKA_ID_CODECINFOURL, EBML_NONE }, { MATROSKA_ID_CODECDOWNLOADURL, EBML_NONE }, - { MATROSKA_ID_TRACKMINCACHE, EBML_NONE }, - { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE }, + { MATROSKA_ID_CODECDECODEALL, EBML_NONE }, + { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack, seek_preroll) }, + { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } }, + { MATROSKA_ID_TRACKCONTENTENCODINGS, EBML_NEST, 0, 0, { .n = matroska_track_encodings } }, CHILD_OF(matroska_tracks) }; @@ -307,10 +307,10 @@ EbmlSyntax matroska_cluster_parsing[] = { { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, { MATROSKA_ID_BLOCKGROUP, EBML_NEST, 0, 0, { .n = matroska_blockgroup } }, { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) }, - { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP }, - { MATROSKA_ID_BLOCKGROUP, EBML_STOP }, { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE }, { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE }, + { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP }, + { MATROSKA_ID_BLOCKGROUP, EBML_STOP }, CHILD_OF(matroska_segment) }; From patchwork Sun Mar 22 08:59:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18352 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 C5646448B66 for ; Sun, 22 Mar 2020 11:00:42 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AD46668B7E0; Sun, 22 Mar 2020 11:00:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6EE6168B4B5 for ; Sun, 22 Mar 2020 11:00:33 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 48lWgj0YCczKmb5; Sun, 22 Mar 2020 10:00:33 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id jlmT3f7AQujd; Sun, 22 Mar 2020 10:00:23 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:32 +0100 Message-Id: <20200322085933.7532-13-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/14] tools: add XLSTs script to generate matroska semantic files 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: Steve Lhomme Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme Usage: xsltproc -o matroska_ids.h schema_2_lavf_h.xsl ebml_matroska.xml xsltproc -o matroskasem.c schema_2_lavf_sem_c.xsl ebml_matroska.xml The ebml_matroska.xml file comes from https://github.com/cellar-wg/matroska-specification/blob/master/ebml_matroska.xml With an extra TagDefault_Bug element to parse an old invalid tag ID. --- tools/ebml_matroska.xml | 1344 +++++++++++++++++++++++++++++++++ tools/schema_2_lavf_h.xsl | 741 ++++++++++++++++++ tools/schema_2_lavf_sem_c.xsl | 1163 ++++++++++++++++++++++++++++ 3 files changed, 3248 insertions(+) create mode 100644 tools/ebml_matroska.xml create mode 100644 tools/schema_2_lavf_h.xsl create mode 100644 tools/schema_2_lavf_sem_c.xsl diff --git a/tools/ebml_matroska.xml b/tools/ebml_matroska.xml new file mode 100644 index 0000000000..6e03325682 --- /dev/null +++ b/tools/ebml_matroska.xml @@ -0,0 +1,1344 @@ + + + + + + + + + + + + The Root Element that contains all other Top-Level Elements (Elements defined only at Level 1). A Matroska file is composed of 1 Segment. + + + Contains the Segment Position of other Top-Level Elements. + + + Contains a single seek entry to an EBML Element. + + + The binary ID corresponding to the Element name. + + + The Segment Position of the Element. + + + Contains general information about the Segment. + + + A randomly generated unique ID to identify the Segment amongst many others (128 bits). + If the Segment is a part of a Linked Segment then this Element is REQUIRED. + + + + A filename corresponding to this Segment. + + + + A unique ID to identify the previous Segment of a Linked Segment (128 bits). + If the Segment is a part of a Linked Segment that uses Hard Linking then either the PrevUID or the NextUID Element is REQUIRED. If a Segment contains a PrevUID but not a NextUID then it MAY be considered as the last Segment of the Linked Segment. The PrevUID MUST NOT be equal to the SegmentUID. + + + + A filename corresponding to the file of the previous Linked Segment. + Provision of the previous filename is for display convenience, but PrevUID SHOULD be considered authoritative for identifying the previous Segment in a Linked Segment. + + + + A unique ID to identify the next Segment of a Linked Segment (128 bits). + If the Segment is a part of a Linked Segment that uses Hard Linking then either the PrevUID or the NextUID Element is REQUIRED. If a Segment contains a NextUID but not a PrevUID then it MAY be considered as the first Segment of the Linked Segment. The NextUID MUST NOT be equal to the SegmentUID. + + + + A filename corresponding to the file of the next Linked Segment. + Provision of the next filename is for display convenience, but NextUID SHOULD be considered authoritative for identifying the Next Segment. + + + + A randomly generated unique ID that all Segments of a Linked Segment MUST share (128 bits). + If the Segment is a part of a Linked Segment that uses Soft Linking then this Element is REQUIRED. + + + + A tuple of corresponding ID used by chapter codecs to represent this Segment. + + + + Specify an edition UID on which this correspondence applies. When not specified, it means for all editions found in the Segment. + + + + The chapter codec + + + + + + + + The binary value used to represent this Segment in the chapter codec data. The format depends on the ChapProcessCodecID used. + + + + Timestamp scale in nanoseconds (1.000.000 means all timestamps in the Segment are expressed in milliseconds). + + + + + Duration of the Segment in nanoseconds based on TimestampScale. + + + The date and time that the Segment was created by the muxing application or library. + + + General name of the Segment. + + + + Muxing application or library (example: "libmatroska-0.4.3"). + Include the full name of the application or library followed by the version number. + + + Writing application (example: "mkvmerge-0.3.3"). + Include the full name of the application followed by the version number. + + + The Top-Level Element containing the (monolithic) Block structure. + + + Absolute timestamp of the cluster (based on TimestampScale). + + + + The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking or to decide what track to use. + + + + + One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster. + + + + + The Segment Position of the Cluster in the Segment (0 in live streams). It might help to resynchronise offset on damaged streams. + + + + + Size of the previous Cluster, in octets. Can be useful for backward playing. + + + + Similar to Block but without all the extra information, mostly used to reduced overhead when no extra feature is needed. (see SimpleBlock Structure) + + + + + Basic container of information containing a single Block and information specific to that Block. + + + Block containing the actual data to be rendered and a timestamp relative to the Cluster Timestamp. (see Block Structure) + + + A Block with no data. It MUST be stored in the stream at the place the real Block would be in display order. (see Block Virtual) + + + + Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data. + + + + Contain the BlockAdditional and some parameters. + + + + An ID to identify the BlockAdditional level. A value of 1 means the BlockAdditional data is interpreted as additional data passed to the codec with the Block data. + + + + Interpreted by the codec as it wishes (using the BlockAddID). + + + + The duration of the Block (based on TimestampScale). The BlockDuration Element can be useful at the end of a Track to define the duration of the last frame (as there is no subsequent Block available), or when there is a break in a track like for subtitle tracks. + BlockDuration MUST be set (minOccurs=1) if the associated TrackEntry stores a DefaultDuration value. + When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). + + + This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced. + + + + Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to. + + + The Segment Position of the data that would otherwise be in position of the virtual block. + + + + The new codec state to use. Data interpretation is private to the codec. This information SHOULD always be referenced by a seek entry. + + + + Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and SHOULD be discarded during playback. + + + + Contains slices description. + + + + + Contains extra time information about the data contained in the Block. Being able to interpret this Element is not REQUIRED for playback. + + + + + The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). Being able to interpret this Element is not REQUIRED for playback. + + + + + + The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame). + + + + + The ID of the BlockAdditional Element (0 is the main Block). + + + + + The (scaled) delay to apply to the Element. + + + + + The (scaled) duration to apply to the Element. + + + + + DivX trick track extensions + + + + + + + DivX trick track extensions + + + + + + + DivX trick track extensions + + + + + + + Similar to SimpleBlock but the data inside the Block are Transformed (encrypt and/or signed). (see EncryptedBlock Structure) + + + + A Top-Level Element of information with many tracks described. + + + Describes a track with all Elements. + + + The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number). + + + A unique ID to identify the Track. This SHOULD be kept the same when making a direct stream copy of the Track to another file. + + + A set of track types coded on 8 bits. + + + + + + + + + + + + + Set if the track is usable. (1 bit) + + + + + Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit) + + + + Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player SHOULD select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit) + + + + Set if the track MAY contain blocks using lacing. (1 bit) + + + + The minimum number of frames a player SHOULD be able to cache during playback. If set to 0, the reference pseudo-cache system is not used. + + + + + The maximum cache size necessary to store referenced frames in and the current frame. 0 means no cache is needed. + + + + + Number of nanoseconds (not scaled via TimestampScale) per frame ('frame' in the Matroska sense -- one Element put into a (Simple)Block). + + + + The period in nanoseconds (not scaled by TimestampScale) between two successive fields at the output of the decoding process (see the notes) + + + + + DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs). + + + + + A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track. + + + + The maximum value of BlockAddID. A value 0 means there is no BlockAdditions for this track. + + + + Contains elements that describe each value of BlockAddID found in the Track. + + + + The BlockAddID value being described. To keep MaxBlockAdditionID as low as possible, small values SHOULD be used. + + + + A human-friendly name describing the type of BlockAdditional data as defined by the associated Block Additional Mapping. + + + + Stores the registered identifer of the Block Additional Mapping to define how the BlockAdditional data should be handled. + + + + Extra binary data that the BlockAddIDType can use to interpret the BlockAdditional data. The intepretation of the binary data depends on the BlockAddIDType value and the corresponding Block Additional Mapping. + + + + A human-readable track name. + + + + Specifies the language of the track in the Matroska languages form. This Element MUST be ignored if the LanguageIETF Element is used in the same TrackEntry. + + + + Specifies the language of the track according to BCP 47 and using the IANA Language Subtag Registry. If this Element is used, then any Language Elements used in the same TrackEntry MUST be ignored. + + + An ID corresponding to the codec, see the codec page for more info. + + + Private data only known to the codec. + + + A human-readable string specifying the codec. + + + The UID of an attachment that is used by this codec. + + + + + A string describing the encoding setting used. + + + + A URL to find information about the codec used. + + + + A URL to download about the codec used. + + + + The codec can decode potentially damaged data (1 bit). + + + + Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track SHOULD be used instead. The order of multiple TrackOverlay matters, the first one is the one that SHOULD be used. If not found it SHOULD be the second, etc. + + + + CodecDelay is The codec-built-in delay in nanoseconds. This value MUST be subtracted from each block timestamp in order to get the actual timestamp. The value SHOULD be small so the muxing of tracks with the same actual timestamp are in the same Cluster. + + + + After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder MUST decode before the decoded data is valid. + + + + The track identification for the given Chapter Codec. + + + + Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the Segment. + + + + The chapter codec. + + + + + + + + The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used. + + + + Video settings. + + + + A flag to declare if the video is known to be progressive or interlaced and if applicable to declare details about the interlacement. + + + + + + + + + + Declare the field ordering of the video. If FlagInterlaced is not set to 1, this Element MUST be ignored. + + + + Top field displayed first. Top field stored first. + + + + Bottom field displayed first. Bottom field stored first. + + + Top field displayed first. Fields are interleaved in storage with the top line of the top field stored first. + + + Bottom field displayed first. Fields are interleaved in storage with the top line of the top field stored first. + + + + + + + Stereo-3D video mode. There are some more details on 3D support in the Specification Notes. + + + + + + + + + + + + + + + + + + + + + + Alpha Video Mode. Presence of this Element indicates that the BlockAdditional Element could contain Alpha data. + + + + + DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. + + + + + + + + + + + Width of the encoded video frames in pixels. + + + + Height of the encoded video frames in pixels. + + + + The number of video pixels to remove at the bottom of the image. + + + + The number of video pixels to remove at the top of the image. + + + + The number of video pixels to remove on the left of the image. + + + + The number of video pixels to remove on the right of the image. + + + + Width of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements). + If the DisplayUnit of the same TrackEntry is 0, then the default value for DisplayWidth is equal to PixelWidth - PixelCropLeft - PixelCropRight, else there is no default value. + + + + Height of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements). + If the DisplayUnit of the same TrackEntry is 0, then the default value for DisplayHeight is equal to PixelHeight - PixelCropTop - PixelCropBottom, else there is no default value. + + + + How DisplayWidth & DisplayHeight are interpreted. + + + + + + + + + + + Specify the possible modifications to the aspect ratio. + + + + + + + + + Specify the pixel format used for the Track's data as a FourCC. This value is similar in scope to the biCompression value of AVI's BITMAPINFOHEADER. + ColourSpace MUST be set (minOccurs=1) in TrackEntry when the CodecID Element of the TrackEntry is set to "V_UNCOMPRESSED". + + + + + Gamma Value. + + + + + Number of frames per second. Informational only. + + + + + Settings describing the colour format. + + + + + The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273. + + + + + + + + + + + + + + + + + + + + + + Number of decoded bits per channel. A value of 0 indicates that the BitsPerChannel is unspecified. + + + + + The amount of pixels to remove in the Cr and Cb channels for every pixel not removed horizontally. Example: For video with 4:2:0 chroma subsampling, the ChromaSubsamplingHorz SHOULD be set to 1. + + + + + The amount of pixels to remove in the Cr and Cb channels for every pixel not removed vertically. Example: For video with 4:2:0 chroma subsampling, the ChromaSubsamplingVert SHOULD be set to 1. + + + + + The amount of pixels to remove in the Cb channel for every pixel not removed horizontally. This is additive with ChromaSubsamplingHorz. Example: For video with 4:2:1 chroma subsampling, the ChromaSubsamplingHorz SHOULD be set to 1 and CbSubsamplingHorz SHOULD be set to 1. + + + + + The amount of pixels to remove in the Cb channel for every pixel not removed vertically. This is additive with ChromaSubsamplingVert. + + + + + How chroma is subsampled horizontally. + + + + + + + + + + How chroma is subsampled vertically. + + + + + + + + + + Clipping of the color ranges. + + + + + + + + + + + The transfer characteristics of the video. For clarity, the value and meanings for TransferCharacteristics are adopted from Table 3 of ISO/IEC 23091-4 or ITU-T H.273. + + + + + + + + + + + + + + + + + + + + + + + + + + The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273. + + + + + + + + + + + + + + + + + + + + + Maximum brightness of a single pixel (Maximum Content Light Level) in candelas per square meter (cd/m²). + + + + + Maximum brightness of a single full frame (Maximum Frame-Average Light Level) in candelas per square meter (cd/m²). + + + + + SMPTE 2086 mastering data. + + + + + Red X chromaticity coordinate as defined by CIE 1931. + + + + + Red Y chromaticity coordinate as defined by CIE 1931. + + + + + Green X chromaticity coordinate as defined by CIE 1931. + + + + + Green Y chromaticity coordinate as defined by CIE 1931. + + + + + Blue X chromaticity coordinate as defined by CIE 1931. + + + + + Blue Y chromaticity coordinate as defined by CIE 1931. + + + + + White X chromaticity coordinate as defined by CIE 1931. + + + + + White Y chromaticity coordinate as defined by CIE 1931. + + + + + Maximum luminance. Represented in candelas per square meter (cd/m²). + + + + + Minimum luminance. Represented in candelas per square meter (cd/m²). + + + + + Describes the video projection details. Used to render spherical and VR videos. + + + + + Describes the projection used for this video track. + + + + + + + + + + + Private data that only applies to a specific projection.
Semantics
If ProjectionType equals 0 (Rectangular), + then this element must not be present.
If ProjectionType equals 1 (Equirectangular), then this element must be present and contain the same binary data that would be stored inside + an ISOBMFF Equirectangular Projection Box ('equi').
If ProjectionType equals 2 (Cubemap), then this element must be present and contain the same binary data that would be stored + inside an ISOBMFF Cubemap Projection Box ('cbmp').
If ProjectionType equals 3 (Mesh), then this element must be present and contain the same binary data that would be stored inside + an ISOBMFF Mesh Projection Box ('mshp').
Note: ISOBMFF box size and fourcc fields are not included in the binary data, but the FullBox version and flag fields are. This is to avoid + redundant framing information while preserving versioning and semantics between the two container formats.
+ + +
+ + Specifies a yaw rotation to the projection.
Semantics
Value represents a clockwise rotation, in degrees, around the up vector. This rotation must be applied before any ProjectionPosePitch or ProjectionPoseRoll rotations. The value of this field should be in the -180 to 180 degree range.
+ + +
+ + Specifies a pitch rotation to the projection.
Semantics
Value represents a counter-clockwise rotation, in degrees, around the right vector. This rotation must be applied after the ProjectionPoseYaw rotation and before the ProjectionPoseRoll rotation. The value of this field should be in the -90 to 90 degree range.
+ + +
+ + Specifies a roll rotation to the projection.
Semantics
Value represents a counter-clockwise rotation, in degrees, around the forward vector. This rotation must be applied after the ProjectionPoseYaw and ProjectionPosePitch rotations. The value of this field should be in the -180 to 180 degree range.
+ + +
+ + Audio settings. + + + + Sampling frequency in Hz. + + + + Real output sampling frequency in Hz (used for SBR techniques). + The default value for OutputSamplingFrequency of the same TrackEntry is equal to the SamplingFrequency. + + + + Numbers of channels in the track. + + + + Table of horizontal angles for each successive channel, see appendix. + + + + + Bits per sample, mostly used for PCM. + + + + Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject. + + + + Contains the list of all video plane tracks that need to be combined to create this 3D track + + + + Contains a video plane track that need to be combined to create this 3D track + + + + The trackUID number of the track representing the plane. + + + + The kind of plane this track corresponds to. + + + + + + + + + Contains the list of all tracks whose Blocks need to be combined to create this virtual track + + + + The trackUID number of a track whose blocks are used to create this virtual track. + + + + + DivX trick track extensions + + + + + + + DivX trick track extensions + + + + + + + DivX trick track extensions + + + + + + + DivX trick track extensions + + + + + + + DivX trick track extensions + + + + + + Settings for several content encoding mechanisms like compression or encryption. + + + + Settings for one content encoding like compression or encryption. + + + + Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder Elements in the TrackEntry that contains this ContentEncodingOrder element. + + + + A bit field that describes which Elements have been modified in this way. Values (big endian) can be OR'ed. + + + + + + + + + A value describing what kind of transformation is applied. + + + + + + + + Settings describing the compression used. This Element MUST be present if the value of ContentEncodingType is 0 and absent otherwise. Each block MUST be decompressable even if no previous block is available in order not to prevent seeking. + + + + The compression algorithm used. + + + + + + + + + + Settings that might be needed by the decompressor. For Header Stripping (`ContentCompAlgo`=3), the bytes that were removed from the beginning of each frames of the track. + + + + Settings describing the encryption used. This Element MUST be present if the value of `ContentEncodingType` is 1 (encryption) and MUST be ignored otherwise. + + + + The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. + + + + + + + + + + + + For public key algorithms this is the ID of the public key the the data was encrypted with. + + + + Settings describing the encryption algorithm used. If `ContentEncAlgo` != 5 this MUST be ignored. + + + + The AES cipher mode used in the encryption. + + + + + + + + A cryptographic signature of the contents. + + + + This is the ID of the private key the data was signed with. + + + + The algorithm used for the signature. + + + + + + + + The hash algorithm used for the signature. + + + + + + + + + A Top-Level Element to speed seeking access. All entries are local to the Segment. + This Element SHOULD be set when the Segment is not transmitted as a live stream (see #livestreaming). + + + Contains all information relative to a seek point in the Segment. + + + Absolute timestamp according to the Segment time base. + + + Contain positions for different tracks corresponding to the timestamp. + + + The track for which a position is given. + + + The Segment Position of the Cluster containing the associated Block. + + + The relative position inside the Cluster of the referenced SimpleBlock or BlockGroup with 0 being the first possible position for an Element inside that Cluster. + + + + The duration of the block according to the Segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues. + + + + Number of the Block in the specified Cluster. + + + The Segment Position of the Codec State corresponding to this Cue Element. 0 means that the data is taken from the initial Track Entry. + + + + The Clusters containing the referenced Blocks. + + + + Timestamp of the referenced Block. + + + + The Segment Position of the Cluster containing the referenced Block. + + + + Number of the referenced Block of Track X in the specified Cluster. + + + + The Segment Position of the Codec State corresponding to this referenced Element. 0 means that the data is taken from the initial Track Entry. + + + + Contain attached files. + + + + An attached file. + + + + + A human-friendly name for the attached file. + + + + Filename of the attached file. + + + + MIME type of the file. + + + + + The data of the file. + + + + Unique ID representing the file, as random as possible. + + + + A binary value that a track/codec can refer to when the attachment is needed. + + + + + DivX font extension + + + + + + + DivX font extension + + + + + + A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation. + + + + Contains all information about a Segment edition. + + + + A unique ID to identify the edition. It's useful for tagging an edition. + + + + If an edition is hidden (1), it SHOULD NOT be available to the user interface (but still to Control Tracks; see flag notes). (1 bit) + + + + If a flag is set (1) the edition SHOULD be used as the default one. (1 bit) + + + + Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit) + + + + Contains the atom information to use as the chapter atom (apply to all tracks). + + + + A unique ID to identify the Chapter. + + + + A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage. + + + + Timestamp of the start of Chapter (not scaled). + + + + Timestamp of the end of Chapter (timestamp excluded, not scaled). + + + + If a chapter is hidden (1), it SHOULD NOT be available to the user interface (but still to Control Tracks; see flag notes). (1 bit) + + + + Specify whether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie SHOULD skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit) + + + + The SegmentUID of another Segment to play during this chapter. + ChapterSegmentUID MUST be set (minOccurs=1) if ChapterSegmentEditionUID is used. + + + + The EditionUID to play from the Segment linked in ChapterSegmentUID. If ChapterSegmentEditionUID is undeclared then no Edition of the linked Segment is used. + + + + Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values. + + + + List of tracks on which the chapter applies. If this Element is not present, all tracks apply + + + + UID of the Track to apply this chapter too. In the absence of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absence of this Element indicates that the Chapter SHOULD be applied to any currently used Tracks. + + + + + Contains all possible strings to use for the chapter display. + + + + Contains the string to use as the chapter atom. + + + + + The languages corresponding to the string, in the bibliographic ISO-639-2 form. This Element MUST be ignored if the ChapLanguageIETF Element is used within the same ChapterDisplay Element. + + + + + Specifies the language used in the ChapString according to BCP 47 and using the IANA Language Subtag Registry. If this Element is used, then any ChapLanguage Elements used in the same ChapterDisplay MUST be ignored. + + + + The countries corresponding to the string, same 2 octets as in Internet domains. This Element MUST be ignored if the ChapLanguageIETF Element is used within the same ChapterDisplay Element. + + + + + Contains all the commands associated to the Atom. + + + + + Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later. + + + + + Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent. + + + + + Contains all the commands associated to the Atom. + + + + + Defines when the process command SHOULD be handled + + + + + + + + + + Contains the command information. The data SHOULD be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands. + + + + + Element containing metadata describing Tracks, Editions, Chapters, Attachments, or the Segment as a whole. A list of valid tags can be found here. + + + + A single metadata descriptor. + + + + Specifies which other elements the metadata represented by the Tag applies to. If empty or not present, then the Tag describes everything in the Segment. + + + + + A number to indicate the logical level of the target. + + + The highest hierarchical level that tags can describe. + + + A list of lower levels grouped together. + + + The most common grouping level of music and video (equals to an episode for TV series). + + + When an album or episode has different logical parts. + + + The common parts of an album or movie. + + + Corresponds to parts of a track for audio (like a movement). + + + The lowest hierarchy found in music or movies. + + + + + + + An informational string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment. + + + + A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment. + + + + A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment. + + + + A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment. + + + + Contains general information about the target. + + + + + The name of the Tag that is going to be stored. + + + + Specifies the language of the tag specified, in the Matroska languages form. This Element MUST be ignored if the TagLanguageIETF Element is used within the same SimpleTag Element. + + + + + Specifies the language used in the TagString according to BCP 47 and using the IANA Language Subtag Registry. If this Element is used, then any TagLanguage Elements used in the same SimpleTag MUST be ignored. + + + + A boolean value to indicate if this is the default/original language to use for the given tag. + + + + The value of the Tag. + + + + The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString. + + +
diff --git a/tools/schema_2_lavf_h.xsl b/tools/schema_2_lavf_h.xsl new file mode 100644 index 0000000000..d2acf0bf23 --- /dev/null +++ b/tools/schema_2_lavf_h.xsl @@ -0,0 +1,741 @@ + + + + + + +/* + * Matroska Semantic constants + * DO NOT EDIT, GENERATED WITH schema_2_lavf_h.xsl + * + * Copyright (c) 2003-2020 The FFmpeg Project + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_MATROSKA_IDS_H +#define AVFORMAT_MATROSKA_IDS_H + +/* + * Matroska element IDs, max. 32 bits + */ + + + + + + + + + + + + + + + + + + + + + + + +#endif /* AVFORMAT_MATROSKA_IDS_H */ + + + + + + + + Missing TagDefault_Bug! + + + + + + + + + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + + + + + + + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + + + + + + + + + + + + + + + + + +/* toplevel segment */ +#define MATROSKA_ID_SEGMENT 0x18538067 + +/* Matroska top-level master IDs */ + + + + /* IDs in the + + + PointEntry + TrackAudio + TrackVideo + SeekPoint + Content Encoding + + + + + + master */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FileDesc + ChapLang + BlockReference + ClusterPosition + ClusterPrevSize + ClusterTimecode + PointEntry + CueTrackPosition + TimecodeScale + SeekEntry + TagLang + TagTargets + TagTargets_AttachUID + TagTargets_ChapterUID + TagTargets_TrackUID + TagTargets_Type + TagTargets_TypeValue + ChapterPhysEquiv + AudioOutSamplingFreq + AudioSamplingFreq + TrackContentEncodings + TrackContentEncoding + EncodingCompression + EncodingCompAlgo + EncodingCompSettings + EncodingOrder + EncodingScope + EncodingType + EncodingEncryption + EncodingEncAESSettings + EncodingEncAlgo + EncodingEncKeyId + EncodingSigAlgo + EncodingSignature + EncodingSigKeyId + EncodingSigHashAlgo + TrackMaxBlkAddID + SeekPreRoll + TrackTimecodeScale + VideoAspectRatio + VideoColor + VideoColorSpace + VideoColorChromaSubHorz + VideoColorChromaSubVert + VideoColorCbSubHorz + VideoColorCbSubVert + VideoColorMasteringMeta + VideoColorMatrixCoeff + Audio + VideoPixelCrop + + VideoColor_ + + + VideoColor_WHITE + + VideoColor_ + VideoColor + Video + Track + + + + + + + + #define MATROSKA_ID_ + + + + + + + + + + + + + + + + + + + + + + + + + + + A + B + C + D + E + F + A + + + + + + + + + 0x + + + + + + + + + + + + + + + + + + + TRACK_ENCODING_COMP + TRACK_TYPE + VIDEO_PROJECTION_TYPE + VIDEO_INTERLACE_FLAG + VIDEO_STEREOMODE_TYPE + COLOUR_ + VIDEO_ + + + + + + + 12 + 9 + 19 + 13 + 19 + 12 + 13 + 17 + + + typedef enum { + + + MATROSKA_TRACK_TYPE_NONE = 0x0, + + + + MATROSKA_ + + _ + + + + + + = + + + + + + + + + , + + + + + MATROSKA_COLOUR_CHROMASITINGHORZ_NB + MATROSKA_COLOUR_CHROMASITINGVERT_NB + MATROSKA_VIDEO_STEREOMODE_TYPE_NB, + + + } Matroska + + TrackEncodingCompAlgo + ColourChromaSitingHorz + ColourChromaSitingVert + VideoInterlaceFlag + VideoStereoModeType + Video + + + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/schema_2_lavf_sem_c.xsl b/tools/schema_2_lavf_sem_c.xsl new file mode 100644 index 0000000000..a06a67fed1 --- /dev/null +++ b/tools/schema_2_lavf_sem_c.xsl @@ -0,0 +1,1163 @@ + + + + + + +/* + * Matroska file semantic definition + * DO NOT EDIT, GENERATED WITH schema_2_lavf_sem_c.xsl + * + * Copyright (c) 2003-2020 The FFmpeg Project + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Matroska file semantic element definitions + * @author Ronald Bultje <rbultje@ronald.bitfreak.net> + * @author with a little help from Moritz Bunkus <moritz@bunkus.org> + * @author totally reworked by Aurelien Jacobs <aurel@gnuage.org> + * @author Split from decoder by Steve Lhomme <slhomme@matroska.org> + * @see specs available on the Matroska project page: http://www.matroska.org/ + */ + +#include "config.h" + +#include <inttypes.h> + +#include "matroskasem.h" + +#define CHILD_OF(parent) { .def = { .n = parent } } + +static EbmlSyntax ebml_header[] = { + { EBML_ID_EBMLREADVERSION, EBML_UINT, 0, offsetof(Ebml, version), { .u = EBML_VERSION } }, + { EBML_ID_EBMLMAXSIZELENGTH, EBML_UINT, 0, offsetof(Ebml, max_size), { .u = 8 } }, + { EBML_ID_EBMLMAXIDLENGTH, EBML_UINT, 0, offsetof(Ebml, id_length), { .u = 4 } }, + { EBML_ID_DOCTYPE, EBML_STR, 0, offsetof(Ebml, doctype), { .s = "(none)" } }, + { EBML_ID_DOCTYPEREADVERSION, EBML_UINT, 0, offsetof(Ebml, doctype_version), { .u = 1 } }, + { EBML_ID_EBMLVERSION, EBML_NONE }, + { EBML_ID_DOCTYPEVERSION, EBML_NONE }, + CHILD_OF(ebml_syntax) +}; + +EbmlSyntax ebml_syntax[] = { + { EBML_ID_HEADER, EBML_NEST, 0, 0, { .n = ebml_header } }, + { MATROSKA_ID_SEGMENT, EBML_STOP }, + { 0 } +}; + + + + + + + + + + + + + + + + + + + + + + + + + + +EbmlSyntax matroska_segments[] = { + { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, { .n = matroska_segment } }, + { 0 } +}; + +EbmlSyntax matroska_cluster_enter[] = { + { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, { .n = &matroska_cluster_parsing[2] } }, + { 0 } +}; + + + + + + + + Missing TagDefault_Bug! + + + + + + + + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + + + + + + + + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + y + + + + + + + + + + + // The following array contains SimpleBlock and BlockGroup twice + // in order to reuse the other values for matroska_cluster_enter. + + + + + + + + + + + + + static + + EbmlSyntax matroska_ + + + + [] = { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP }, + { MATROSKA_ID_BLOCKGROUP, EBML_STOP }, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { 1, EBML_UINT, 0, offsetof(MatroskaBlock, non_simple), { .u = 1 } }, + + + + + { 0 } /* We don't want to go back to level 0, so don't add the parent. */ + + + CHILD_OF(matroska_ + + + + + + + + + ) + + + }; + + + + + + + + + + + + + + + + + \ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + date_utc + duration + muxingapp + title + STOP + time_scale + tracks + num + name + uid + type + codec_id + flag_default + flag_forced + codec_delay + codec_priv + seek_preroll + video + audio + operation + name + max_block_additional_id + language + time_scale + default_duration + encodings + scope + type + compression + encryption + algo + settings + algo + key_id + combine_planes + uid + type + interlaced + field_order + pixel_width + pixel_height + stereo_mode + alpha_mode + display_width + display_height + display_unit + color + projection + frame_rate + color_space + matrix_coefficients + bits_per_channel + chroma_sub_horz + chroma_sub_vert + cb_sub_horz + cb_sub_vert + chroma_siting_horz + chroma_siting_vert + range + transfer_characteristics + primaries + max_cll + max_fall + mastering_meta + r_x + r_y + g_x + g_y + b_x + b_y + white_x + white_y + max_luminance + min_luminance + type + private + yaw + pitch + roll + channels + samplerate + out_samplerate + bitdepth + index + time + pos + time + pos + track + target + + + sub + tag + + + attachments + bin + mime + filename + uid + bin + timecode + duration + bin + reference + discard_padding + tags + chapteruid + trackuid + attachuid + type + typevalue + seekhead + id + pos + + + + chapters + + + additional + additional_id + start + end + uid + title + lang + def + def + string + name + + + + + + + + + + + + + + + MatroskaTrack + MatroskaTrackEncoding + MatroskaTrackPlane + MatroskaTrackVideoColor + MatroskaIndex + MatroskaIndexPos + MatroskaAttachment + MatroskaSeekhead + MatroskaTags + MatroskaTag + MatroskaChapter + + + + + + + + + + + + + MatroskaDemuxContext + MatroskaDemuxContext + MatroskaDemuxContext + MatroskaDemuxContext + MatroskaDemuxContext + MatroskaDemuxContext + MatroskaTrackOperation + MatroskaTrackEncryption + MatroskaTrackCompression + MatroskaTrack + MatroskaTrackVideo + MatroskaTrackAudio + MatroskaMasteringMeta + MatroskaTrackVideoProjection + MatroskaCluster + MatroskaBlock + MatroskaTagTarget + MatroskaBlock + MatroskaDemuxContext + MatroskaChapter + + + + + + + + + + track + index + index_entry + track_audio + track_video + track_operation + seekhead_entry + track_encodings + track_encoding + track_encoding_compression + track_encoding_encryption + track_combine_planes + track_plane + track_video_color + track_video_projection + mastering_meta + index_pos + tagtargets + attachment + chapter + cluster_parsing + chapter_entry + chapter_display + + + + + + + + + + + + + + + + + + + + + FileDesc + ChapLang + BlockReference + ClusterPosition + ClusterPrevSize + ClusterTimecode + PointEntry + CueTrackPosition + TimecodeScale + SeekEntry + TagLang + TagTargets + TagTargets_AttachUID + TagTargets_ChapterUID + TagTargets_TrackUID + TagTargets_Type + TagTargets_TypeValue + ChapterPhysEquiv + AudioOutSamplingFreq + AudioSamplingFreq + TrackContentEncodings + TrackContentEncoding + EncodingCompression + EncodingCompAlgo + EncodingCompSettings + EncodingOrder + EncodingScope + EncodingType + EncodingEncryption + EncodingEncAESSettings + EncodingEncAlgo + EncodingEncKeyId + EncodingSigAlgo + EncodingSignature + EncodingSigKeyId + EncodingSigHashAlgo + TrackMaxBlkAddID + SeekPreRoll + TrackTimecodeScale + VideoAspectRatio + VideoColor + VideoColorSpace + VideoColorChromaSubHorz + VideoColorChromaSubVert + VideoColorCbSubHorz + VideoColorCbSubVert + VideoColorMasteringMeta + VideoColorMatrixCoeff + Audio + VideoPixelCrop + + VideoColor_ + + + VideoColor_WHITE + + VideoColor_ + VideoColor + Video + Track + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + matroska_ + + + + + + + -1 + MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED + MATROSKA_VIDEO_FIELDORDER_UNDETERMINED + MATROSKA_VIDEO_STEREOMODE_TYPE_NB + MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR + AVCOL_SPC_UNSPECIFIED + AVCOL_PRI_UNSPECIFIED + AVCOL_TRC_UNSPECIFIED + AVCOL_RANGE_UNSPECIFIED + MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED + MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED + -1 + -1 + MATROSKA_VIDEO_DISPLAYUNIT_PIXELS + INT64_MIN + AV_NOPTS_VALUE + AV_NOPTS_VALUE + -1 + 1.0 + 0.0 + 8000.0 + + + + + + + + + + + + + + { MATROSKA_ID_ + + + + + + , + + + + + + + + + EBML_STOP + + + + EBML_UINT + + + + + EBML_LEVEL1 + + + EBML_NONE + + + + + + + + + + EBML_NONE + EBML_NEST + + + + + + EBML_NONE + + + EBML_UINT + + + EBML_SINT + + + EBML_UTF8 + + + EBML_STR + + + EBML_BIN + + + EBML_BIN + + + EBML_FLOAT + + + + + + + + + + + + + + + + + + + + + + + 0, + + + + + 0, + + + + + sizeof( + + ), + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + MatroskaBlock + + + + + + + + + + + offsetof( + + , + + ) + + + + + + + + + + + + + + + , { + + + .u = + + + .i = + + + .f = + + + .s = " + + + .s = " + + + .n = + + + + + + " + + + " + + + } + + + + }, + + + + From patchwork Sun Mar 22 08:59:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 18350 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 89E81448B66 for ; Sun, 22 Mar 2020 11:00:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6BFCE68B7B3; Sun, 22 Mar 2020 11:00:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C0D368B559 for ; Sun, 22 Mar 2020 11:00:32 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 48lWgg5xtHzQlCW; Sun, 22 Mar 2020 10:00:31 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id ZfCXOV9gfAoF; Sun, 22 Mar 2020 10:00:23 +0100 (CET) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Sun, 22 Mar 2020 09:59:33 +0100 Message-Id: <20200322085933.7532-14-robUx4@ycbcr.xyz> In-Reply-To: <20200322085933.7532-1-robUx4@ycbcr.xyz> References: <20200322085933.7532-1-robUx4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH 14/14] avformat/matroska: use the generated semantic files 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Steve Lhomme No functional value/added removed, only more regular spacing. --- libavformat/matroska_ids.h | 290 +++++++++++++++--------------- libavformat/matroskasem.c | 356 +++++++++++++++++++------------------ 2 files changed, 326 insertions(+), 320 deletions(-) diff --git a/libavformat/matroska_ids.h b/libavformat/matroska_ids.h index 321e555bec..f8e7cc927e 100644 --- a/libavformat/matroska_ids.h +++ b/libavformat/matroska_ids.h @@ -1,5 +1,7 @@ /* * Matroska Semantic constants + * DO NOT EDIT, GENERATED WITH schema_2_lavf_h.xsl + * * Copyright (c) 2003-2020 The FFmpeg Project * * This file is part of FFmpeg. @@ -30,162 +32,164 @@ #define MATROSKA_ID_SEGMENT 0x18538067 /* Matroska top-level master IDs */ -#define MATROSKA_ID_INFO 0x1549A966 -#define MATROSKA_ID_TRACKS 0x1654AE6B -#define MATROSKA_ID_CUES 0x1C53BB6B -#define MATROSKA_ID_TAGS 0x1254C367 -#define MATROSKA_ID_SEEKHEAD 0x114D9B74 -#define MATROSKA_ID_ATTACHMENTS 0x1941A469 -#define MATROSKA_ID_CLUSTER 0x1F43B675 -#define MATROSKA_ID_CHAPTERS 0x1043A770 +#define MATROSKA_ID_INFO 0x1549A966 +#define MATROSKA_ID_TRACKS 0x1654AE6B +#define MATROSKA_ID_CUES 0x1C53BB6B +#define MATROSKA_ID_TAGS 0x1254C367 +#define MATROSKA_ID_SEEKHEAD 0x114D9B74 +#define MATROSKA_ID_ATTACHMENTS 0x1941A469 +#define MATROSKA_ID_CLUSTER 0x1F43B675 +#define MATROSKA_ID_CHAPTERS 0x1043A770 /* IDs in the info master */ -#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1 -#define MATROSKA_ID_DURATION 0x4489 -#define MATROSKA_ID_TITLE 0x7BA9 -#define MATROSKA_ID_WRITINGAPP 0x5741 -#define MATROSKA_ID_MUXINGAPP 0x4D80 -#define MATROSKA_ID_DATEUTC 0x4461 -#define MATROSKA_ID_SEGMENTUID 0x73A4 +#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1 +#define MATROSKA_ID_DURATION 0x4489 +#define MATROSKA_ID_TITLE 0x7BA9 +#define MATROSKA_ID_WRITINGAPP 0x5741 +#define MATROSKA_ID_MUXINGAPP 0x4D80 +#define MATROSKA_ID_DATEUTC 0x4461 +#define MATROSKA_ID_SEGMENTUID 0x73A4 -/* ID in the tracks master */ -#define MATROSKA_ID_TRACKENTRY 0xAE +/* IDs in the tracks master */ +#define MATROSKA_ID_TRACKENTRY 0xAE /* IDs in the trackentry master */ -#define MATROSKA_ID_TRACKNUMBER 0xD7 -#define MATROSKA_ID_TRACKUID 0x73C5 -#define MATROSKA_ID_TRACKTYPE 0x83 -#define MATROSKA_ID_TRACKVIDEO 0xE0 -#define MATROSKA_ID_TRACKAUDIO 0xE1 -#define MATROSKA_ID_TRACKOPERATION 0xE2 -#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F -#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE -#define MATROSKA_ID_TRACKNAME 0x536E -#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C -#define MATROSKA_ID_CODECID 0x86 -#define MATROSKA_ID_CODECPRIVATE 0x63A2 -#define MATROSKA_ID_CODECNAME 0x258688 -#define MATROSKA_ID_CODECINFOURL 0x3B4040 -#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240 -#define MATROSKA_ID_CODECDECODEALL 0xAA -#define MATROSKA_ID_CODECDELAY 0x56AA -#define MATROSKA_ID_SEEKPREROLL 0x56BB -#define MATROSKA_ID_TRACKFLAGENABLED 0xB9 -#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 -#define MATROSKA_ID_TRACKFLAGFORCED 0x55AA -#define MATROSKA_ID_TRACKFLAGLACING 0x9C -#define MATROSKA_ID_TRACKMINCACHE 0x6DE7 -#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 -#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 -#define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80 +#define MATROSKA_ID_TRACKNUMBER 0xD7 +#define MATROSKA_ID_TRACKUID 0x73C5 +#define MATROSKA_ID_TRACKTYPE 0x83 +#define MATROSKA_ID_TRACKVIDEO 0xE0 +#define MATROSKA_ID_TRACKAUDIO 0xE1 +#define MATROSKA_ID_TRACKOPERATION 0xE2 +#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F +#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE +#define MATROSKA_ID_TRACKNAME 0x536E +#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C +#define MATROSKA_ID_CODECID 0x86 +#define MATROSKA_ID_CODECPRIVATE 0x63A2 +#define MATROSKA_ID_CODECNAME 0x258688 +#define MATROSKA_ID_CODECINFOURL 0x3B4040 +#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240 +#define MATROSKA_ID_CODECDECODEALL 0xAA +#define MATROSKA_ID_CODECDELAY 0x56AA +#define MATROSKA_ID_SEEKPREROLL 0x56BB +#define MATROSKA_ID_TRACKFLAGENABLED 0xB9 +#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 +#define MATROSKA_ID_TRACKFLAGFORCED 0x55AA +#define MATROSKA_ID_TRACKFLAGLACING 0x9C +#define MATROSKA_ID_TRACKMINCACHE 0x6DE7 +#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 +#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 +#define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80 /* IDs in the contentencodings master */ -#define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 +#define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 /* IDs in the content encoding master */ -#define MATROSKA_ID_ENCODINGORDER 0x5031 -#define MATROSKA_ID_ENCODINGSCOPE 0x5032 -#define MATROSKA_ID_ENCODINGTYPE 0x5033 -#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 -#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 +#define MATROSKA_ID_ENCODINGORDER 0x5031 +#define MATROSKA_ID_ENCODINGSCOPE 0x5032 +#define MATROSKA_ID_ENCODINGTYPE 0x5033 +#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 +#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 /* IDs in the contentcompression master */ -#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 -#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 +#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 +#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 /* IDs in the contentencryption master */ -#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 -#define MATROSKA_ID_ENCODINGENCALGO 0x47E1 -#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 -#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5 -#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6 -#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 -#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 +#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 +#define MATROSKA_ID_ENCODINGENCALGO 0x47E1 +#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 +#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5 +#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6 +#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 +#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 + +/* IDs in the contentencaessettings master */ /* IDs in the trackoperation master */ -#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 +#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 /* IDs in the trackcombineplanes master */ -#define MATROSKA_ID_TRACKPLANE 0xE4 +#define MATROSKA_ID_TRACKPLANE 0xE4 /* IDs in the trackplane master */ -#define MATROSKA_ID_TRACKPLANEUID 0xE5 -#define MATROSKA_ID_TRACKPLANETYPE 0xE6 +#define MATROSKA_ID_TRACKPLANEUID 0xE5 +#define MATROSKA_ID_TRACKPLANETYPE 0xE6 /* IDs in the trackvideo master */ -#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 -#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0 -#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA -#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0 -#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA -#define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA -#define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB -#define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC -#define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD -#define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2 -#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A -#define MATROSKA_ID_VIDEOFIELDORDER 0x9D -#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8 -#define MATROSKA_ID_VIDEOALPHAMODE 0x53C0 -#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 -#define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524 -#define MATROSKA_ID_VIDEOCOLOR 0x55B0 -#define MATROSKA_ID_VIDEOPROJECTION 0x7670 +#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 +#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0 +#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA +#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0 +#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA +#define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA +#define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB +#define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC +#define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD +#define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2 +#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A +#define MATROSKA_ID_VIDEOFIELDORDER 0x9D +#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8 +#define MATROSKA_ID_VIDEOALPHAMODE 0x53C0 +#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 +#define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524 +#define MATROSKA_ID_VIDEOCOLOR 0x55B0 +#define MATROSKA_ID_VIDEOPROJECTION 0x7670 /* IDs in the colour master */ -#define MATROSKA_ID_VIDEOCOLORMATRIXCOEFF 0x55B1 -#define MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL 0x55B2 -#define MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ 0x55B3 -#define MATROSKA_ID_VIDEOCOLORCHROMASUBVERT 0x55B4 -#define MATROSKA_ID_VIDEOCOLORCBSUBHORZ 0x55B5 -#define MATROSKA_ID_VIDEOCOLORCBSUBVERT 0x55B6 -#define MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ 0x55B7 -#define MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT 0x55B8 -#define MATROSKA_ID_VIDEOCOLORRANGE 0x55B9 -#define MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS 0x55BA -#define MATROSKA_ID_VIDEOCOLORPRIMARIES 0x55BB -#define MATROSKA_ID_VIDEOCOLORMAXCLL 0x55BC -#define MATROSKA_ID_VIDEOCOLORMAXFALL 0x55BD -#define MATROSKA_ID_VIDEOCOLORMASTERINGMETA 0x55D0 +#define MATROSKA_ID_VIDEOCOLORMATRIXCOEFF 0x55B1 +#define MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL 0x55B2 +#define MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ 0x55B3 +#define MATROSKA_ID_VIDEOCOLORCHROMASUBVERT 0x55B4 +#define MATROSKA_ID_VIDEOCOLORCBSUBHORZ 0x55B5 +#define MATROSKA_ID_VIDEOCOLORCBSUBVERT 0x55B6 +#define MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ 0x55B7 +#define MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT 0x55B8 +#define MATROSKA_ID_VIDEOCOLORRANGE 0x55B9 +#define MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS 0x55BA +#define MATROSKA_ID_VIDEOCOLORPRIMARIES 0x55BB +#define MATROSKA_ID_VIDEOCOLORMAXCLL 0x55BC +#define MATROSKA_ID_VIDEOCOLORMAXFALL 0x55BD +#define MATROSKA_ID_VIDEOCOLORMASTERINGMETA 0x55D0 /* IDs in the masteringmetadata master */ -#define MATROSKA_ID_VIDEOCOLOR_RX 0x55D1 -#define MATROSKA_ID_VIDEOCOLOR_RY 0x55D2 -#define MATROSKA_ID_VIDEOCOLOR_GX 0x55D3 -#define MATROSKA_ID_VIDEOCOLOR_GY 0x55D4 -#define MATROSKA_ID_VIDEOCOLOR_BX 0x55D5 -#define MATROSKA_ID_VIDEOCOLOR_BY 0x55D6 -#define MATROSKA_ID_VIDEOCOLOR_WHITEX 0x55D7 -#define MATROSKA_ID_VIDEOCOLOR_WHITEY 0x55D8 -#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX 0x55D9 -#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN 0x55DA +#define MATROSKA_ID_VIDEOCOLOR_RX 0x55D1 +#define MATROSKA_ID_VIDEOCOLOR_RY 0x55D2 +#define MATROSKA_ID_VIDEOCOLOR_GX 0x55D3 +#define MATROSKA_ID_VIDEOCOLOR_GY 0x55D4 +#define MATROSKA_ID_VIDEOCOLOR_BX 0x55D5 +#define MATROSKA_ID_VIDEOCOLOR_BY 0x55D6 +#define MATROSKA_ID_VIDEOCOLOR_WHITEX 0x55D7 +#define MATROSKA_ID_VIDEOCOLOR_WHITEY 0x55D8 +#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX 0x55D9 +#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN 0x55DA /* IDs in the projection master */ -#define MATROSKA_ID_VIDEOPROJECTIONTYPE 0x7671 -#define MATROSKA_ID_VIDEOPROJECTIONPRIVATE 0x7672 -#define MATROSKA_ID_VIDEOPROJECTIONPOSEYAW 0x7673 -#define MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH 0x7674 -#define MATROSKA_ID_VIDEOPROJECTIONPOSEROLL 0x7675 +#define MATROSKA_ID_VIDEOPROJECTIONTYPE 0x7671 +#define MATROSKA_ID_VIDEOPROJECTIONPRIVATE 0x7672 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEYAW 0x7673 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH 0x7674 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEROLL 0x7675 /* IDs in the trackaudio master */ -#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 -#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 -#define MATROSKA_ID_AUDIOBITDEPTH 0x6264 -#define MATROSKA_ID_AUDIOCHANNELS 0x9F +#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 +#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 +#define MATROSKA_ID_AUDIOBITDEPTH 0x6264 +#define MATROSKA_ID_AUDIOCHANNELS 0x9F -/* ID in the cues master */ -#define MATROSKA_ID_POINTENTRY 0xBB +/* IDs in the cues master */ +#define MATROSKA_ID_POINTENTRY 0xBB /* IDs in the pointentry master */ -#define MATROSKA_ID_CUETIME 0xB3 -#define MATROSKA_ID_CUETRACKPOSITION 0xB7 +#define MATROSKA_ID_CUETIME 0xB3 +#define MATROSKA_ID_CUETRACKPOSITION 0xB7 -/* IDs in the cuetrackposition master */ -#define MATROSKA_ID_CUETRACK 0xF7 -#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1 -#define MATROSKA_ID_CUERELATIVEPOSITION 0xF0 -#define MATROSKA_ID_CUEDURATION 0xB2 -#define MATROSKA_ID_CUEBLOCKNUMBER 0x5378 +/* IDs in the cuetrackpositions master */ +#define MATROSKA_ID_CUETRACK 0xF7 +#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1 +#define MATROSKA_ID_CUERELATIVEPOSITION 0xF0 +#define MATROSKA_ID_CUEDURATION 0xB2 +#define MATROSKA_ID_CUEBLOCKNUMBER 0x5378 /* IDs in the tags master */ #define MATROSKA_ID_TAG 0x7373 @@ -202,10 +206,10 @@ #define MATROSKA_ID_TAGNAME 0x45A3 /* IDs in the targets master */ -#define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA +#define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA #define MATROSKA_ID_TAGTARGETS_TYPEVALUE 0x68CA -#define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5 -#define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4 +#define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5 +#define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4 #define MATROSKA_ID_TAGTARGETS_ATTACHUID 0x63C6 /* IDs in the attachments master */ @@ -219,33 +223,33 @@ #define MATROSKA_ID_FILEUID 0x46AE /* IDs in the cluster master */ -#define MATROSKA_ID_CLUSTERTIMECODE 0xE7 -#define MATROSKA_ID_CLUSTERPOSITION 0xA7 -#define MATROSKA_ID_CLUSTERPREVSIZE 0xAB -#define MATROSKA_ID_BLOCKGROUP 0xA0 -#define MATROSKA_ID_SIMPLEBLOCK 0xA3 +#define MATROSKA_ID_CLUSTERTIMECODE 0xE7 +#define MATROSKA_ID_CLUSTERPOSITION 0xA7 +#define MATROSKA_ID_CLUSTERPREVSIZE 0xAB +#define MATROSKA_ID_BLOCKGROUP 0xA0 +#define MATROSKA_ID_SIMPLEBLOCK 0xA3 /* IDs in the blockgroup master */ -#define MATROSKA_ID_BLOCK 0xA1 -#define MATROSKA_ID_BLOCKADDITIONS 0x75A1 -#define MATROSKA_ID_BLOCKDURATION 0x9B -#define MATROSKA_ID_BLOCKREFERENCE 0xFB -#define MATROSKA_ID_CODECSTATE 0xA4 -#define MATROSKA_ID_DISCARDPADDING 0x75A2 +#define MATROSKA_ID_BLOCK 0xA1 +#define MATROSKA_ID_BLOCKADDITIONS 0x75A1 +#define MATROSKA_ID_BLOCKDURATION 0x9B +#define MATROSKA_ID_BLOCKREFERENCE 0xFB +#define MATROSKA_ID_CODECSTATE 0xA4 +#define MATROSKA_ID_DISCARDPADDING 0x75A2 /* IDs in the blockadditions master */ -#define MATROSKA_ID_BLOCKMORE 0xA6 +#define MATROSKA_ID_BLOCKMORE 0xA6 /* IDs in the blockmore master */ -#define MATROSKA_ID_BLOCKADDID 0xEE -#define MATROSKA_ID_BLOCKADDITIONAL 0xA5 +#define MATROSKA_ID_BLOCKADDID 0xEE +#define MATROSKA_ID_BLOCKADDITIONAL 0xA5 /* IDs in the seekhead master */ -#define MATROSKA_ID_SEEKENTRY 0x4DBB +#define MATROSKA_ID_SEEKENTRY 0x4DBB /* IDs in the seekpoint master */ -#define MATROSKA_ID_SEEKID 0x53AB -#define MATROSKA_ID_SEEKPOSITION 0x53AC +#define MATROSKA_ID_SEEKID 0x53AB +#define MATROSKA_ID_SEEKPOSITION 0x53AC /* IDs in the chapters master */ #define MATROSKA_ID_EDITIONENTRY 0x45B9 diff --git a/libavformat/matroskasem.c b/libavformat/matroskasem.c index aca506b943..2027e6a195 100644 --- a/libavformat/matroskasem.c +++ b/libavformat/matroskasem.c @@ -1,5 +1,7 @@ /* * Matroska file semantic definition + * DO NOT EDIT, GENERATED WITH schema_2_lavf_sem_c.xsl + * * Copyright (c) 2003-2020 The FFmpeg Project * * This file is part of FFmpeg. @@ -55,321 +57,321 @@ EbmlSyntax ebml_syntax[] = { }; static EbmlSyntax matroska_track_video_projection[] = { - { MATROSKA_ID_VIDEOPROJECTIONTYPE, EBML_UINT, 0, offsetof(MatroskaTrackVideoProjection, type), { .u = MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR } }, - { MATROSKA_ID_VIDEOPROJECTIONPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrackVideoProjection, private) }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEYAW, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, yaw), { .f=0.0 } }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, pitch), { .f=0.0 } }, - { MATROSKA_ID_VIDEOPROJECTIONPOSEROLL, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, roll), { .f=0.0 } }, + { MATROSKA_ID_VIDEOPROJECTIONTYPE, EBML_UINT, 0, offsetof(MatroskaTrackVideoProjection, type), { .u = MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR } }, + { MATROSKA_ID_VIDEOPROJECTIONPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrackVideoProjection, private) }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEYAW, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, yaw), { .f = 0.0 } }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, pitch), { .f = 0.0 } }, + { MATROSKA_ID_VIDEOPROJECTIONPOSEROLL, EBML_FLOAT, 0, offsetof(MatroskaTrackVideoProjection, roll), { .f = 0.0 } }, CHILD_OF(matroska_track_video) }; static EbmlSyntax matroska_mastering_meta[] = { - { MATROSKA_ID_VIDEOCOLOR_RX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_RY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_GX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_GY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_BX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_BY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_WHITEX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_x), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_WHITEY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_y), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, min_luminance), { .f=-1 } }, - { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, max_luminance), { .f=-1 } }, + { MATROSKA_ID_VIDEOCOLOR_RX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_x), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_RY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, r_y), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_GX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_x), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_GY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, g_y), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_BX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_x), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_BY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, b_y), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_WHITEX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_x), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_WHITEY, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, white_y), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, min_luminance), { .f = -1 } }, + { MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX, EBML_FLOAT, 0, offsetof(MatroskaMasteringMeta, max_luminance), { .f = -1 } }, CHILD_OF(matroska_track_video_color) }; EbmlSyntax matroska_track_video_color[] = { - { MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, matrix_coefficients), { .u = AVCOL_SPC_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, bits_per_channel) }, - { MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_horz) }, - { MATROSKA_ID_VIDEOCOLORCHROMASUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_vert) }, - { MATROSKA_ID_VIDEOCOLORCBSUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_horz) }, - { MATROSKA_ID_VIDEOCOLORCBSUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_vert) }, - { MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_horz), { .u = MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED } }, - { MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_vert), { .u = MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED } }, - { MATROSKA_ID_VIDEOCOLORRANGE, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, range), { .u = AVCOL_RANGE_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, transfer_characteristics), { .u = AVCOL_TRC_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORPRIMARIES, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, primaries), { .u = AVCOL_PRI_UNSPECIFIED } }, - { MATROSKA_ID_VIDEOCOLORMAXCLL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_cll) }, - { MATROSKA_ID_VIDEOCOLORMAXFALL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_fall) }, - { MATROSKA_ID_VIDEOCOLORMASTERINGMETA, EBML_NEST, 0, offsetof(MatroskaTrackVideoColor, mastering_meta), { .n = matroska_mastering_meta } }, + { MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, matrix_coefficients), { .u = AVCOL_SPC_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, bits_per_channel) }, + { MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_horz) }, + { MATROSKA_ID_VIDEOCOLORCHROMASUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_vert) }, + { MATROSKA_ID_VIDEOCOLORCBSUBHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_horz) }, + { MATROSKA_ID_VIDEOCOLORCBSUBVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, cb_sub_vert) }, + { MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_horz), { .u = MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED } }, + { MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, chroma_siting_vert), { .u = MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED } }, + { MATROSKA_ID_VIDEOCOLORRANGE, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, range), { .u = AVCOL_RANGE_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, transfer_characteristics), { .u = AVCOL_TRC_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORPRIMARIES, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, primaries), { .u = AVCOL_PRI_UNSPECIFIED } }, + { MATROSKA_ID_VIDEOCOLORMAXCLL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_cll) }, + { MATROSKA_ID_VIDEOCOLORMAXFALL, EBML_UINT, 0, offsetof(MatroskaTrackVideoColor, max_fall) }, + { MATROSKA_ID_VIDEOCOLORMASTERINGMETA, EBML_NEST, 0, offsetof(MatroskaTrackVideoColor, mastering_meta), { .n = matroska_mastering_meta } }, CHILD_OF(matroska_track_video) }; EbmlSyntax matroska_track_video[] = { - { MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT, 0, offsetof(MatroskaTrackVideo, frame_rate) }, - { MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_width), { .u=-1 } }, - { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_height), { .u=-1 } }, - { MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_width) }, - { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_height) }, - { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE }, - { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE }, - { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE }, - { MATROSKA_ID_VIDEOPIXELCROPR, EBML_NONE }, - { MATROSKA_ID_VIDEODISPLAYUNIT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_unit), { .u= MATROSKA_VIDEO_DISPLAYUNIT_PIXELS } }, - { MATROSKA_ID_VIDEOFLAGINTERLACED, EBML_UINT, 0, offsetof(MatroskaTrackVideo, interlaced), { .u = MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED } }, - { MATROSKA_ID_VIDEOFIELDORDER, EBML_UINT, 0, offsetof(MatroskaTrackVideo, field_order), { .u = MATROSKA_VIDEO_FIELDORDER_UNDETERMINED } }, - { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, alpha_mode) }, - { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo, color_space) }, - { MATROSKA_ID_VIDEOCOLOR, EBML_NEST, sizeof(MatroskaTrackVideoColor), offsetof(MatroskaTrackVideo, color), { .n = matroska_track_video_color } }, - { MATROSKA_ID_VIDEOPROJECTION, EBML_NEST, 0, offsetof(MatroskaTrackVideo, projection), { .n = matroska_track_video_projection } }, - { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, stereo_mode), { .u = MATROSKA_VIDEO_STEREOMODE_TYPE_NB } }, - { MATROSKA_ID_VIDEOASPECTRATIO, EBML_NONE }, + { MATROSKA_ID_VIDEOFRAMERATE, EBML_FLOAT, 0, offsetof(MatroskaTrackVideo, frame_rate) }, + { MATROSKA_ID_VIDEODISPLAYWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_width), { .u = -1 } }, + { MATROSKA_ID_VIDEODISPLAYHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_height), { .u = -1 } }, + { MATROSKA_ID_VIDEOPIXELWIDTH, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_width) }, + { MATROSKA_ID_VIDEOPIXELHEIGHT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, pixel_height) }, + { MATROSKA_ID_VIDEOPIXELCROPB, EBML_NONE }, + { MATROSKA_ID_VIDEOPIXELCROPT, EBML_NONE }, + { MATROSKA_ID_VIDEOPIXELCROPL, EBML_NONE }, + { MATROSKA_ID_VIDEOPIXELCROPR, EBML_NONE }, + { MATROSKA_ID_VIDEODISPLAYUNIT, EBML_UINT, 0, offsetof(MatroskaTrackVideo, display_unit), { .u = MATROSKA_VIDEO_DISPLAYUNIT_PIXELS } }, + { MATROSKA_ID_VIDEOFLAGINTERLACED, EBML_UINT, 0, offsetof(MatroskaTrackVideo, interlaced), { .u = MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED } }, + { MATROSKA_ID_VIDEOFIELDORDER, EBML_UINT, 0, offsetof(MatroskaTrackVideo, field_order), { .u = MATROSKA_VIDEO_FIELDORDER_UNDETERMINED } }, + { MATROSKA_ID_VIDEOALPHAMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, alpha_mode) }, + { MATROSKA_ID_VIDEOCOLORSPACE, EBML_BIN, 0, offsetof(MatroskaTrackVideo, color_space) }, + { MATROSKA_ID_VIDEOCOLOR, EBML_NEST, sizeof(MatroskaTrackVideoColor), offsetof(MatroskaTrackVideo, color), { .n = matroska_track_video_color } }, + { MATROSKA_ID_VIDEOPROJECTION, EBML_NEST, 0, offsetof(MatroskaTrackVideo, projection), { .n = matroska_track_video_projection } }, + { MATROSKA_ID_VIDEOSTEREOMODE, EBML_UINT, 0, offsetof(MatroskaTrackVideo, stereo_mode), { .u = MATROSKA_VIDEO_STEREOMODE_TYPE_NB } }, + { MATROSKA_ID_VIDEOASPECTRATIO, EBML_NONE }, CHILD_OF(matroska_track) }; EbmlSyntax matroska_track_plane[] = { - { MATROSKA_ID_TRACKPLANEUID, EBML_UINT, 0, offsetof(MatroskaTrackPlane,uid) }, - { MATROSKA_ID_TRACKPLANETYPE, EBML_UINT, 0, offsetof(MatroskaTrackPlane,type) }, + { MATROSKA_ID_TRACKPLANEUID, EBML_UINT, 0, offsetof(MatroskaTrackPlane, uid) }, + { MATROSKA_ID_TRACKPLANETYPE, EBML_UINT, 0, offsetof(MatroskaTrackPlane, type) }, CHILD_OF(matroska_track_combine_planes) }; EbmlSyntax matroska_track_combine_planes[] = { - { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation,combine_planes), {.n = matroska_track_plane} }, + { MATROSKA_ID_TRACKPLANE, EBML_NEST, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation, combine_planes), { .n = matroska_track_plane } }, CHILD_OF(matroska_track_operation) }; EbmlSyntax matroska_track_operation[] = { - { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, {.n = matroska_track_combine_planes} }, + { MATROSKA_ID_TRACKCOMBINEPLANES, EBML_NEST, 0, 0, { .n = matroska_track_combine_planes } }, CHILD_OF(matroska_track) }; static EbmlSyntax matroska_track_encoding_encryption[] = { - { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption,algo) }, - { MATROSKA_ID_ENCODINGENCKEYID, EBML_BIN, 0, offsetof(MatroskaTrackEncryption,key_id) }, - { MATROSKA_ID_ENCODINGENCAESSETTINGS, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGALGO, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGHASHALGO, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGKEYID, EBML_NONE }, - { MATROSKA_ID_ENCODINGSIGNATURE, EBML_NONE }, + { MATROSKA_ID_ENCODINGENCALGO, EBML_UINT, 0, offsetof(MatroskaTrackEncryption, algo) }, + { MATROSKA_ID_ENCODINGENCKEYID, EBML_BIN, 0, offsetof(MatroskaTrackEncryption, key_id) }, + { MATROSKA_ID_ENCODINGENCAESSETTINGS, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGALGO, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGHASHALGO, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGKEYID, EBML_NONE }, + { MATROSKA_ID_ENCODINGSIGNATURE, EBML_NONE }, CHILD_OF(matroska_track_encoding) }; static EbmlSyntax matroska_track_encoding_compression[] = { - { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo) }, - { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) }, + { MATROSKA_ID_ENCODINGCOMPALGO, EBML_UINT, 0, offsetof(MatroskaTrackCompression, algo) }, + { MATROSKA_ID_ENCODINGCOMPSETTINGS, EBML_BIN, 0, offsetof(MatroskaTrackCompression, settings) }, CHILD_OF(matroska_track_encoding) }; EbmlSyntax matroska_track_encoding[] = { - { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } }, - { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type) }, - { MATROSKA_ID_ENCODINGCOMPRESSION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, compression), { .n = matroska_track_encoding_compression } }, - { MATROSKA_ID_ENCODINGENCRYPTION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, encryption), { .n = matroska_track_encoding_encryption } }, - { MATROSKA_ID_ENCODINGORDER, EBML_NONE }, + { MATROSKA_ID_ENCODINGSCOPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } }, + { MATROSKA_ID_ENCODINGTYPE, EBML_UINT, 0, offsetof(MatroskaTrackEncoding, type) }, + { MATROSKA_ID_ENCODINGCOMPRESSION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, compression), { .n = matroska_track_encoding_compression } }, + { MATROSKA_ID_ENCODINGENCRYPTION, EBML_NEST, 0, offsetof(MatroskaTrackEncoding, encryption), { .n = matroska_track_encoding_encryption } }, + { MATROSKA_ID_ENCODINGORDER, EBML_NONE }, CHILD_OF(matroska_track_encodings) }; EbmlSyntax matroska_track_encodings[] = { - { MATROSKA_ID_TRACKCONTENTENCODING, EBML_NEST, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack, encodings), { .n = matroska_track_encoding } }, + { MATROSKA_ID_TRACKCONTENTENCODING, EBML_NEST, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack, encodings), { .n = matroska_track_encoding } }, CHILD_OF(matroska_track) }; static EbmlSyntax matroska_track_audio[] = { - { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, samplerate), { .f = 8000.0 } }, - { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, out_samplerate) }, - { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio, bitdepth) }, - { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio, channels), { .u = 1 } }, + { MATROSKA_ID_AUDIOSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, samplerate), { .f = 8000.0 } }, + { MATROSKA_ID_AUDIOOUTSAMPLINGFREQ, EBML_FLOAT, 0, offsetof(MatroskaTrackAudio, out_samplerate) }, + { MATROSKA_ID_AUDIOBITDEPTH, EBML_UINT, 0, offsetof(MatroskaTrackAudio, bitdepth) }, + { MATROSKA_ID_AUDIOCHANNELS, EBML_UINT, 0, offsetof(MatroskaTrackAudio, channels), { .u = 1 } }, CHILD_OF(matroska_track) }; EbmlSyntax matroska_track[] = { - { MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack, num) }, - { MATROSKA_ID_TRACKNAME, EBML_UTF8, 0, offsetof(MatroskaTrack, name) }, - { MATROSKA_ID_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTrack, uid) }, - { MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack, type) }, - { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack, codec_id) }, - { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack, codec_priv) }, - { MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack, codec_delay) }, - { MATROSKA_ID_TRACKLANGUAGE, EBML_STR, 0, offsetof(MatroskaTrack, language), { .s = "eng" } }, - { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack, default_duration) }, - { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT, 0, offsetof(MatroskaTrack, time_scale), { .f = 1.0 } }, - { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack, flag_default), { .u = 1 } }, - { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced) }, - { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack, video), { .n = matroska_track_video } }, - { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack, audio), { .n = matroska_track_audio } }, - { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE }, - { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE }, - { MATROSKA_ID_TRACKMINCACHE, EBML_NONE }, - { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE }, - { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack, max_block_additional_id) }, - { MATROSKA_ID_CODECNAME, EBML_NONE }, - { MATROSKA_ID_CODECINFOURL, EBML_NONE }, - { MATROSKA_ID_CODECDOWNLOADURL, EBML_NONE }, - { MATROSKA_ID_CODECDECODEALL, EBML_NONE }, - { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack, seek_preroll) }, - { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } }, - { MATROSKA_ID_TRACKCONTENTENCODINGS, EBML_NEST, 0, 0, { .n = matroska_track_encodings } }, + { MATROSKA_ID_TRACKNUMBER, EBML_UINT, 0, offsetof(MatroskaTrack, num) }, + { MATROSKA_ID_TRACKNAME, EBML_UTF8, 0, offsetof(MatroskaTrack, name) }, + { MATROSKA_ID_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTrack, uid) }, + { MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack, type) }, + { MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack, codec_id) }, + { MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack, codec_priv) }, + { MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack, codec_delay) }, + { MATROSKA_ID_TRACKLANGUAGE, EBML_STR, 0, offsetof(MatroskaTrack, language), { .s = "eng" } }, + { MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack, default_duration) }, + { MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT, 0, offsetof(MatroskaTrack, time_scale), { .f = 1.0 } }, + { MATROSKA_ID_TRACKFLAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTrack, flag_default), { .u = 1 } }, + { MATROSKA_ID_TRACKFLAGFORCED, EBML_UINT, 0, offsetof(MatroskaTrack, flag_forced) }, + { MATROSKA_ID_TRACKVIDEO, EBML_NEST, 0, offsetof(MatroskaTrack, video), { .n = matroska_track_video } }, + { MATROSKA_ID_TRACKAUDIO, EBML_NEST, 0, offsetof(MatroskaTrack, audio), { .n = matroska_track_audio } }, + { MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE }, + { MATROSKA_ID_TRACKFLAGLACING, EBML_NONE }, + { MATROSKA_ID_TRACKMINCACHE, EBML_NONE }, + { MATROSKA_ID_TRACKMAXCACHE, EBML_NONE }, + { MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack, max_block_additional_id) }, + { MATROSKA_ID_CODECNAME, EBML_NONE }, + { MATROSKA_ID_CODECINFOURL, EBML_NONE }, + { MATROSKA_ID_CODECDOWNLOADURL, EBML_NONE }, + { MATROSKA_ID_CODECDECODEALL, EBML_NONE }, + { MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack, seek_preroll) }, + { MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack, operation), { .n = matroska_track_operation } }, + { MATROSKA_ID_TRACKCONTENTENCODINGS, EBML_NEST, 0, 0, { .n = matroska_track_encodings } }, CHILD_OF(matroska_tracks) }; EbmlSyntax matroska_tracks[] = { - { MATROSKA_ID_TRACKENTRY, EBML_NEST, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext, tracks), { .n = matroska_track } }, + { MATROSKA_ID_TRACKENTRY, EBML_NEST, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext, tracks), { .n = matroska_track } }, CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_tagtargets[] = { - { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget, type) }, - { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget, typevalue), { .u = 50 } }, - { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, trackuid) }, - { MATROSKA_ID_TAGTARGETS_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, chapteruid) }, - { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, attachuid) }, + { MATROSKA_ID_TAGTARGETS_TYPE, EBML_STR, 0, offsetof(MatroskaTagTarget, type) }, + { MATROSKA_ID_TAGTARGETS_TYPEVALUE, EBML_UINT, 0, offsetof(MatroskaTagTarget, typevalue), { .u = 50 } }, + { MATROSKA_ID_TAGTARGETS_TRACKUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, trackuid) }, + { MATROSKA_ID_TAGTARGETS_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, chapteruid) }, + { MATROSKA_ID_TAGTARGETS_ATTACHUID, EBML_UINT, 0, offsetof(MatroskaTagTarget, attachuid) }, CHILD_OF(matroska_tag) }; static EbmlSyntax matroska_simpletag[] = { - { MATROSKA_ID_TAGNAME, EBML_UTF8, 0, offsetof(MatroskaTag, name) }, - { MATROSKA_ID_TAGSTRING, EBML_UTF8, 0, offsetof(MatroskaTag, string) }, - { MATROSKA_ID_TAGLANG, EBML_STR, 0, offsetof(MatroskaTag, lang), { .s = "und" } }, - { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, - { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, - { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag, sub), { .n = matroska_simpletag } }, + { MATROSKA_ID_TAGNAME, EBML_UTF8, 0, offsetof(MatroskaTag, name) }, + { MATROSKA_ID_TAGSTRING, EBML_UTF8, 0, offsetof(MatroskaTag, string) }, + { MATROSKA_ID_TAGLANG, EBML_STR, 0, offsetof(MatroskaTag, lang), { .s = "und" } }, + { MATROSKA_ID_TAGDEFAULT, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, + { MATROSKA_ID_TAGDEFAULT_BUG, EBML_UINT, 0, offsetof(MatroskaTag, def), { .u = 1 } }, + { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTag, sub), { .n = matroska_simpletag } }, CHILD_OF(matroska_tag) }; EbmlSyntax matroska_tag[] = { - { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags, tag), { .n = matroska_simpletag } }, - { MATROSKA_ID_TAGTARGETS, EBML_NEST, 0, offsetof(MatroskaTags, target), { .n = matroska_tagtargets } }, + { MATROSKA_ID_SIMPLETAG, EBML_NEST, sizeof(MatroskaTag), offsetof(MatroskaTags, tag), { .n = matroska_simpletag } }, + { MATROSKA_ID_TAGTARGETS, EBML_NEST, 0, offsetof(MatroskaTags, target), { .n = matroska_tagtargets } }, CHILD_OF(matroska_tags) }; EbmlSyntax matroska_tags[] = { - { MATROSKA_ID_TAG, EBML_NEST, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext, tags), { .n = matroska_tag } }, + { MATROSKA_ID_TAG, EBML_NEST, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext, tags), { .n = matroska_tag } }, CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_seekhead_entry[] = { - { MATROSKA_ID_SEEKID, EBML_UINT, 0, offsetof(MatroskaSeekhead, id) }, - { MATROSKA_ID_SEEKPOSITION, EBML_UINT, 0, offsetof(MatroskaSeekhead, pos), { .u = -1 } }, + { MATROSKA_ID_SEEKID, EBML_UINT, 0, offsetof(MatroskaSeekhead, id) }, + { MATROSKA_ID_SEEKPOSITION, EBML_UINT, 0, offsetof(MatroskaSeekhead, pos), { .u = -1 } }, CHILD_OF(matroska_seekhead) }; EbmlSyntax matroska_seekhead[] = { - { MATROSKA_ID_SEEKENTRY, EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext, seekhead), { .n = matroska_seekhead_entry } }, + { MATROSKA_ID_SEEKENTRY, EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext, seekhead), { .n = matroska_seekhead_entry } }, CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_info[] = { - { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext, time_scale), { .u = 1000000 } }, - { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext, duration) }, - { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, title) }, - { MATROSKA_ID_WRITINGAPP, EBML_NONE }, - { MATROSKA_ID_MUXINGAPP, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, muxingapp) }, - { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext, date_utc) }, - { MATROSKA_ID_SEGMENTUID, EBML_NONE }, + { MATROSKA_ID_TIMECODESCALE, EBML_UINT, 0, offsetof(MatroskaDemuxContext, time_scale), { .u = 1000000 } }, + { MATROSKA_ID_DURATION, EBML_FLOAT, 0, offsetof(MatroskaDemuxContext, duration) }, + { MATROSKA_ID_TITLE, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, title) }, + { MATROSKA_ID_WRITINGAPP, EBML_NONE }, + { MATROSKA_ID_MUXINGAPP, EBML_UTF8, 0, offsetof(MatroskaDemuxContext, muxingapp) }, + { MATROSKA_ID_DATEUTC, EBML_BIN, 0, offsetof(MatroskaDemuxContext, date_utc) }, + { MATROSKA_ID_SEGMENTUID, EBML_NONE }, CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_index_pos[] = { - { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos, track) }, - { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos, pos) }, - { MATROSKA_ID_CUERELATIVEPOSITION,EBML_NONE }, - { MATROSKA_ID_CUEDURATION, EBML_NONE }, - { MATROSKA_ID_CUEBLOCKNUMBER, EBML_NONE }, + { MATROSKA_ID_CUETRACK, EBML_UINT, 0, offsetof(MatroskaIndexPos, track) }, + { MATROSKA_ID_CUECLUSTERPOSITION, EBML_UINT, 0, offsetof(MatroskaIndexPos, pos) }, + { MATROSKA_ID_CUERELATIVEPOSITION, EBML_NONE }, + { MATROSKA_ID_CUEDURATION, EBML_NONE }, + { MATROSKA_ID_CUEBLOCKNUMBER, EBML_NONE }, CHILD_OF(matroska_index_entry) }; EbmlSyntax matroska_index_entry[] = { - { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex, time) }, - { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } }, + { MATROSKA_ID_CUETIME, EBML_UINT, 0, offsetof(MatroskaIndex, time) }, + { MATROSKA_ID_CUETRACKPOSITION, EBML_NEST, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } }, CHILD_OF(matroska_index) }; EbmlSyntax matroska_index[] = { - { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } }, + { MATROSKA_ID_POINTENTRY, EBML_NEST, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } }, CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_blockmore[] = { - { MATROSKA_ID_BLOCKADDID, EBML_UINT, 0, offsetof(MatroskaBlock,additional_id), { .u = 1 } }, - { MATROSKA_ID_BLOCKADDITIONAL, EBML_BIN, 0, offsetof(MatroskaBlock,additional) }, + { MATROSKA_ID_BLOCKADDID, EBML_UINT, 0, offsetof(MatroskaBlock, additional_id), { .u = 1 } }, + { MATROSKA_ID_BLOCKADDITIONAL, EBML_BIN, 0, offsetof(MatroskaBlock, additional) }, CHILD_OF(matroska_blockadditions) }; EbmlSyntax matroska_blockadditions[] = { - { MATROSKA_ID_BLOCKMORE, EBML_NEST, 0, 0, {.n = matroska_blockmore} }, + { MATROSKA_ID_BLOCKMORE, EBML_NEST, 0, 0, { .n = matroska_blockmore } }, CHILD_OF(matroska_blockgroup) }; EbmlSyntax matroska_blockgroup[] = { - { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, - { MATROSKA_ID_BLOCKADDITIONS, EBML_NEST, 0, 0, { .n = matroska_blockadditions} }, - { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock, duration) }, - { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock, discard_padding) }, - { MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, reference), { .i = INT64_MIN } }, - { MATROSKA_ID_CODECSTATE, EBML_NONE }, - { 1, EBML_UINT, 0, offsetof(MatroskaBlock, non_simple), { .u = 1 } }, + { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, + { MATROSKA_ID_BLOCKADDITIONS, EBML_NEST, 0, 0, { .n = matroska_blockadditions } }, + { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock, duration) }, + { MATROSKA_ID_DISCARDPADDING, EBML_SINT, 0, offsetof(MatroskaBlock, discard_padding) }, + { MATROSKA_ID_BLOCKREFERENCE, EBML_SINT, 0, offsetof(MatroskaBlock, reference), { .i = INT64_MIN } }, + { MATROSKA_ID_CODECSTATE, EBML_NONE }, + { 1, EBML_UINT, 0, offsetof(MatroskaBlock, non_simple), { .u = 1 } }, CHILD_OF(matroska_cluster_parsing) }; // The following array contains SimpleBlock and BlockGroup twice // in order to reuse the other values for matroska_cluster_enter. EbmlSyntax matroska_cluster_parsing[] = { - { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, - { MATROSKA_ID_BLOCKGROUP, EBML_NEST, 0, 0, { .n = matroska_blockgroup } }, - { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) }, - { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE }, - { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE }, - { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP }, - { MATROSKA_ID_BLOCKGROUP, EBML_STOP }, + { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) }, + { MATROSKA_ID_BLOCKGROUP, EBML_NEST, 0, 0, { .n = matroska_blockgroup } }, + { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) }, + { MATROSKA_ID_CLUSTERPOSITION, EBML_NONE }, + { MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE }, + { MATROSKA_ID_SIMPLEBLOCK, EBML_STOP }, + { MATROSKA_ID_BLOCKGROUP, EBML_STOP }, CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_chapter_display[] = { - { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) }, - { MATROSKA_ID_CHAPLANG, EBML_NONE }, - { MATROSKA_ID_CHAPCOUNTRY, EBML_NONE }, + { MATROSKA_ID_CHAPSTRING, EBML_UTF8, 0, offsetof(MatroskaChapter, title) }, + { MATROSKA_ID_CHAPLANG, EBML_NONE }, + { MATROSKA_ID_CHAPCOUNTRY, EBML_NONE }, CHILD_OF(matroska_chapter_entry) }; EbmlSyntax matroska_chapter_entry[] = { - { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } }, - { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } }, - { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter, uid) }, - { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, { .n = matroska_chapter_display } }, - { MATROSKA_ID_CHAPTERFLAGHIDDEN, EBML_NONE }, - { MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE }, - { MATROSKA_ID_CHAPTERPHYSEQUIV, EBML_NONE }, - { MATROSKA_ID_CHAPTERATOM, EBML_NONE }, + { MATROSKA_ID_CHAPTERTIMESTART, EBML_UINT, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } }, + { MATROSKA_ID_CHAPTERTIMEEND, EBML_UINT, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } }, + { MATROSKA_ID_CHAPTERUID, EBML_UINT, 0, offsetof(MatroskaChapter, uid) }, + { MATROSKA_ID_CHAPTERDISPLAY, EBML_NEST, 0, 0, { .n = matroska_chapter_display } }, + { MATROSKA_ID_CHAPTERFLAGHIDDEN, EBML_NONE }, + { MATROSKA_ID_CHAPTERFLAGENABLED, EBML_NONE }, + { MATROSKA_ID_CHAPTERPHYSEQUIV, EBML_NONE }, + { MATROSKA_ID_CHAPTERATOM, EBML_NONE }, CHILD_OF(matroska_chapter) }; EbmlSyntax matroska_chapter[] = { - { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } }, - { MATROSKA_ID_EDITIONUID, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGHIDDEN, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE }, - { MATROSKA_ID_EDITIONFLAGORDERED, EBML_NONE }, + { MATROSKA_ID_CHAPTERATOM, EBML_NEST, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } }, + { MATROSKA_ID_EDITIONUID, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGHIDDEN, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGDEFAULT, EBML_NONE }, + { MATROSKA_ID_EDITIONFLAGORDERED, EBML_NONE }, CHILD_OF(matroska_chapters) }; EbmlSyntax matroska_chapters[] = { - { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, { .n = matroska_chapter } }, + { MATROSKA_ID_EDITIONENTRY, EBML_NEST, 0, 0, { .n = matroska_chapter } }, CHILD_OF(matroska_segment) }; static EbmlSyntax matroska_attachment[] = { - { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachment, uid) }, - { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) }, - { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) }, - { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) }, - { MATROSKA_ID_FILEDESC, EBML_NONE }, + { MATROSKA_ID_FILEUID, EBML_UINT, 0, offsetof(MatroskaAttachment, uid) }, + { MATROSKA_ID_FILENAME, EBML_UTF8, 0, offsetof(MatroskaAttachment, filename) }, + { MATROSKA_ID_FILEMIMETYPE, EBML_STR, 0, offsetof(MatroskaAttachment, mime) }, + { MATROSKA_ID_FILEDATA, EBML_BIN, 0, offsetof(MatroskaAttachment, bin) }, + { MATROSKA_ID_FILEDESC, EBML_NONE }, CHILD_OF(matroska_attachments) }; EbmlSyntax matroska_attachments[] = { - { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } }, + { MATROSKA_ID_ATTACHEDFILE, EBML_NEST, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } }, CHILD_OF(matroska_segment) }; EbmlSyntax matroska_segment[] = { - { MATROSKA_ID_CLUSTER, EBML_STOP }, - { MATROSKA_ID_INFO, EBML_LEVEL1, 0, 0, { .n = matroska_info } }, - { MATROSKA_ID_TRACKS, EBML_LEVEL1, 0, 0, { .n = matroska_tracks } }, - { MATROSKA_ID_ATTACHMENTS, EBML_LEVEL1, 0, 0, { .n = matroska_attachments } }, - { MATROSKA_ID_CHAPTERS, EBML_LEVEL1, 0, 0, { .n = matroska_chapters } }, - { MATROSKA_ID_CUES, EBML_LEVEL1, 0, 0, { .n = matroska_index } }, - { MATROSKA_ID_TAGS, EBML_LEVEL1, 0, 0, { .n = matroska_tags } }, - { MATROSKA_ID_SEEKHEAD, EBML_LEVEL1, 0, 0, { .n = matroska_seekhead } }, + { MATROSKA_ID_CLUSTER, EBML_STOP }, + { MATROSKA_ID_INFO, EBML_LEVEL1, 0, 0, { .n = matroska_info } }, + { MATROSKA_ID_TRACKS, EBML_LEVEL1, 0, 0, { .n = matroska_tracks } }, + { MATROSKA_ID_ATTACHMENTS, EBML_LEVEL1, 0, 0, { .n = matroska_attachments } }, + { MATROSKA_ID_CHAPTERS, EBML_LEVEL1, 0, 0, { .n = matroska_chapters } }, + { MATROSKA_ID_CUES, EBML_LEVEL1, 0, 0, { .n = matroska_index } }, + { MATROSKA_ID_TAGS, EBML_LEVEL1, 0, 0, { .n = matroska_tags } }, + { MATROSKA_ID_SEEKHEAD, EBML_LEVEL1, 0, 0, { .n = matroska_seekhead } }, { 0 } /* We don't want to go back to level 0, so don't add the parent. */ };