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 = + + + + + + " + + + " + + + } + + + + }, + + + +