]> granicus.if.org Git - libmatroska/commitdiff
KaxSemantic: add KaxChapterSkipType chapter element
authorSteve Lhomme <slhomme@matroska.org>
Sun, 11 Sep 2022 12:48:26 +0000 (14:48 +0200)
committerSteve Lhomme <robux4@ycbcr.xyz>
Sun, 18 Sep 2022 17:05:23 +0000 (19:05 +0200)
Added in https://github.com/ietf-wg-cellar/matroska-specification/pull/318

matroska/KaxSemantic.h
src/KaxSemantic.cpp

index 9d24fc9d8b843132bc0b07293dfd3f0bb7c0e62c..db56910bc2bd88759716ddf9ad7da7a4e0108ac0 100644 (file)
@@ -768,6 +768,9 @@ public:
   virtual bool ValidateSize() const {return IsFiniteSize() && GetSize() == 16;}
 };
 
+DECLARE_MKX_UINTEGER(KaxChapterSkipType)
+};
+
 DECLARE_MKX_UINTEGER(KaxChapterSegmentEditionUID)
 };
 
@@ -1179,6 +1182,22 @@ typedef enum {
   MATROSKA_CONTENTSIGHASHALGO_MD5              = 2,
 } MatroskaContentSigHashAlgo;
 
+/**
+ *Indicate what type of content the ChapterAtom contains and might be skipped. It can be used to automatically skip content based on the type.
+If a `ChapterAtom` is inside a `ChapterAtom` that has a `ChapterSkipType` set, it **MUST NOT** have a `ChapterSkipType` or have a `ChapterSkipType` with the same value as it's parent `ChapterAtom`.
+If the `ChapterAtom` doesn't contain a `ChapterTimeEnd`, the value of the `ChapterSkipType` is only valid until the next `ChapterAtom` with a `ChapterSkipType` value or the end of the file.
+    
+ */
+typedef enum {
+  MATROSKA_CHAPTERSKIPTYPE_NO_SKIPPING      = 0, // Content which should not be skipped.
+  MATROSKA_CHAPTERSKIPTYPE_OPENING_CREDITS  = 1, // Credits usually found at the beginning of the content.
+  MATROSKA_CHAPTERSKIPTYPE_END_CREDITS      = 2, // Credits usually found at the end of the content.
+  MATROSKA_CHAPTERSKIPTYPE_RECAP            = 3, // Recap of previous episodes of the content, usually found around the beginning.
+  MATROSKA_CHAPTERSKIPTYPE_NEXT_PREVIEW     = 4, // Preview of the next episode of the content, usually found around the end. It may contain spoilers the user wants to avoid.
+  MATROSKA_CHAPTERSKIPTYPE_PREVIEW          = 5, // Preview of the current episode of the content, usually found around the beginning. It may contain spoilers the user want to avoid.
+  MATROSKA_CHAPTERSKIPTYPE_ADVERTISEMENT    = 6, // Advertisement within the content.
+} MatroskaChapterSkipType;
+
 /**
  *Defines when the process command **SHOULD** be handled
  */
index 143f9be05cfb14c1c4c64d88a423d1924310b3c7..f90b5e5cc0fa20fa2ebb9fb4863fcd6032425bf6 100644 (file)
@@ -638,6 +638,7 @@ DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTimeEnd)
 DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagHidden)
 DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagEnabled)
 DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSkipType)
 DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentEditionUID)
 DEFINE_SEMANTIC_ITEM(false, true, KaxChapterPhysicalEquiv)
 DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTrack)
@@ -653,6 +654,7 @@ DEFINE_MKX_UINTEGER(KaxChapterTimeEnd, 0x92, 1, KaxChapterAtom, "ChapterTimeEnd"
 DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagHidden, 0x98, 1, KaxChapterAtom, "ChapterFlagHidden", 0)
 DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagEnabled, 0x4598, 2, KaxChapterAtom, "ChapterFlagEnabled", 1)
 DEFINE_MKX_BINARY (KaxChapterSegmentUID, 0x6E67, 2, KaxChapterAtom, "ChapterSegmentUID")
+DEFINE_MKX_UINTEGER(KaxChapterSkipType, 0x4588, 2, KaxChapterAtom, "ChapterSkipType")
 DEFINE_MKX_UINTEGER(KaxChapterSegmentEditionUID, 0x6EBC, 2, KaxChapterAtom, "ChapterSegmentEditionUID")
 DEFINE_MKX_UINTEGER(KaxChapterPhysicalEquiv, 0x63C3, 2, KaxChapterAtom, "ChapterPhysicalEquiv")