react-native-alpha-video 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +908 -2
  3. package/THIRD_PARTY_NOTICES.md +30 -0
  4. package/android/av1/build.gradle +67 -0
  5. package/android/av1/consumer-rules.pro +4 -0
  6. package/android/av1/src/main/cpp/Av1Codec_jni.cpp +8 -0
  7. package/android/av1/src/main/cpp/CMakeLists.txt +34 -0
  8. package/android/av1/src/main/java/dev/mediacache/alphavideo/av1/Av1Codec.java +21 -0
  9. package/android/build.gradle +90 -0
  10. package/android/consumer-rules.pro +2 -0
  11. package/android/gradle.properties +1 -0
  12. package/android/publish.gradle +82 -0
  13. package/android/settings.gradle +5 -0
  14. package/android/src/main/AndroidManifest.xml +1 -0
  15. package/android/src/main/cpp/CMakeLists.txt +59 -0
  16. package/android/src/main/java/dev/mediacache/alphavideo/AlphaVideoCodecs.java +73 -0
  17. package/android/src/main/java/dev/mediacache/alphavideo/AlphaVideoView.java +1982 -0
  18. package/android/src/main/java/dev/mediacache/alphavideo/BufferedDualStreamPlayer.java +978 -0
  19. package/android/src/main/java/dev/mediacache/alphavideo/Fetcher.java +37 -0
  20. package/android/src/main/java/dev/mediacache/alphavideo/HttpFetcher.java +156 -0
  21. package/android/src/main/java/dev/mediacache/alphavideo/MediaCodecColor.java +47 -0
  22. package/android/src/main/java/dev/mediacache/alphavideo/MediaCodecDecoders.java +135 -0
  23. package/android/src/main/java/dev/mediacache/alphavideo/RangeSourceLink.java +54 -0
  24. package/android/src/main/java/dev/mediacache/alphavideo/SourceReader.java +174 -0
  25. package/android/src/main/java/dev/mediacache/alphavideo/SurfaceTextureVideoDecoder.java +802 -0
  26. package/android/src/main/java/dev/mediacache/alphavideo/WebMAlphaPlayerNative.java +95 -0
  27. package/android/src/main/java/dev/mediacache/alphavideo/WebMFrame.java +54 -0
  28. package/android/src/main/java/dev/mediacache/alphavideo/WebMSource.java +160 -0
  29. package/android/src/rangesource/java/dev/mediacache/alphavideo/AppDataSource.java +50 -0
  30. package/android/vpx/build.gradle +67 -0
  31. package/android/vpx/consumer-rules.pro +4 -0
  32. package/android/vpx/src/main/cpp/CMakeLists.txt +34 -0
  33. package/android/vpx/src/main/cpp/VpxCodec_jni.cpp +8 -0
  34. package/android/vpx/src/main/java/dev/mediacache/alphavideo/vpx/VpxCodec.java +21 -0
  35. package/codecs/av1/Dav1dDecoderPlugin.cpp +157 -0
  36. package/codecs/av1/Dav1dDecoderPlugin.h +17 -0
  37. package/codecs/vpx/VpxDecoderPlugin.cpp +103 -0
  38. package/codecs/vpx/VpxDecoderPlugin.h +17 -0
  39. package/cpp/AlphaDemuxer.cpp +984 -0
  40. package/cpp/AlphaDemuxer.h +123 -0
  41. package/cpp/AlphaVideoDecoderPlugin.h +84 -0
  42. package/cpp/Av1SequenceHeader.cpp +175 -0
  43. package/cpp/Av1SequenceHeader.h +25 -0
  44. package/cpp/ByteSource.cpp +116 -0
  45. package/cpp/ByteSource.h +59 -0
  46. package/cpp/RangeSourceClient.h +40 -0
  47. package/cpp/VideoDecoder.cpp +157 -0
  48. package/cpp/VideoDecoder.h +83 -0
  49. package/cpp/WebMAlphaPlayer.cpp +1666 -0
  50. package/cpp/WebMAlphaPlayer.h +389 -0
  51. package/cpp/WebMAlphaPlayer_jni.cpp +1380 -0
  52. package/cpp/YuvToRgb.cpp +39 -0
  53. package/cpp/YuvToRgb.h +40 -0
  54. package/ios/Sources/AlphaVideo/AlphaVideoCodecs.mm +63 -0
  55. package/ios/Sources/AlphaVideo/AlphaVideoInternal.h +70 -0
  56. package/ios/Sources/AlphaVideo/AlphaVideoPlayer.mm +994 -0
  57. package/ios/Sources/AlphaVideo/AlphaVideoSource.mm +476 -0
  58. package/ios/Sources/AlphaVideo/AlphaVideoView.mm +374 -0
  59. package/ios/Sources/AlphaVideo/include/AlphaVideo.h +303 -0
  60. package/ios/Sources/AlphaVideoAV1/AlphaVideoAV1Codec.mm +16 -0
  61. package/ios/Sources/AlphaVideoAV1/include/AlphaVideoAV1.h +18 -0
  62. package/ios/Sources/AlphaVideoVPX/AlphaVideoVPXCodec.mm +16 -0
  63. package/ios/Sources/AlphaVideoVPX/include/AlphaVideoVPX.h +17 -0
  64. package/lib/commonjs/AlphaVideoView.js +187 -0
  65. package/lib/commonjs/AlphaVideoView.js.map +1 -0
  66. package/lib/commonjs/AlphaVideoViewNativeComponent.js +47 -0
  67. package/lib/commonjs/AlphaVideoViewNativeComponent.js.map +1 -0
  68. package/lib/commonjs/AlphaVideoViewNativeComponent.web.js +11 -0
  69. package/lib/commonjs/AlphaVideoViewNativeComponent.web.js.map +1 -0
  70. package/lib/commonjs/NativeAlphaVideoModule.js +10 -0
  71. package/lib/commonjs/NativeAlphaVideoModule.js.map +1 -0
  72. package/lib/commonjs/NativeAlphaVideoModule.web.js +9 -0
  73. package/lib/commonjs/NativeAlphaVideoModule.web.js.map +1 -0
  74. package/lib/commonjs/WebPlayer.js +12 -0
  75. package/lib/commonjs/WebPlayer.js.map +1 -0
  76. package/lib/commonjs/WebPlayer.web.js +115 -0
  77. package/lib/commonjs/WebPlayer.web.js.map +1 -0
  78. package/lib/commonjs/index.js +124 -0
  79. package/lib/commonjs/index.js.map +1 -0
  80. package/lib/module/AlphaVideoView.js +187 -0
  81. package/lib/module/AlphaVideoView.js.map +1 -0
  82. package/lib/module/AlphaVideoViewNativeComponent.js +47 -0
  83. package/lib/module/AlphaVideoViewNativeComponent.js.map +1 -0
  84. package/lib/module/AlphaVideoViewNativeComponent.web.js +11 -0
  85. package/lib/module/AlphaVideoViewNativeComponent.web.js.map +1 -0
  86. package/lib/module/NativeAlphaVideoModule.js +10 -0
  87. package/lib/module/NativeAlphaVideoModule.js.map +1 -0
  88. package/lib/module/NativeAlphaVideoModule.web.js +9 -0
  89. package/lib/module/NativeAlphaVideoModule.web.js.map +1 -0
  90. package/lib/module/WebPlayer.js +12 -0
  91. package/lib/module/WebPlayer.js.map +1 -0
  92. package/lib/module/WebPlayer.web.js +115 -0
  93. package/lib/module/WebPlayer.web.js.map +1 -0
  94. package/lib/module/index.js +124 -0
  95. package/lib/module/index.js.map +1 -0
  96. package/lib/typescript/react-native/src/AlphaVideoView.d.ts +189 -0
  97. package/lib/typescript/react-native/src/AlphaVideoView.d.ts.map +1 -0
  98. package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.d.ts +109 -0
  99. package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.d.ts.map +1 -0
  100. package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.web.d.ts +5 -0
  101. package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.web.d.ts.map +1 -0
  102. package/lib/typescript/react-native/src/NativeAlphaVideoModule.d.ts +21 -0
  103. package/lib/typescript/react-native/src/NativeAlphaVideoModule.d.ts.map +1 -0
  104. package/lib/typescript/react-native/src/NativeAlphaVideoModule.web.d.ts +3 -0
  105. package/lib/typescript/react-native/src/NativeAlphaVideoModule.web.d.ts.map +1 -0
  106. package/lib/typescript/react-native/src/WebPlayer.d.ts +3 -0
  107. package/lib/typescript/react-native/src/WebPlayer.d.ts.map +1 -0
  108. package/lib/typescript/react-native/src/WebPlayer.web.d.ts +9 -0
  109. package/lib/typescript/react-native/src/WebPlayer.web.d.ts.map +1 -0
  110. package/lib/typescript/react-native/src/index.d.ts +77 -0
  111. package/lib/typescript/react-native/src/index.d.ts.map +1 -0
  112. package/licenses/dav1d-COPYING.txt +23 -0
  113. package/licenses/libvpx-LICENSE.txt +31 -0
  114. package/licenses/libvpx-PATENTS.txt +23 -0
  115. package/licenses/libwebm-LICENSE.txt +30 -0
  116. package/licenses/libwebm-PATENTS.txt +23 -0
  117. package/package.json +152 -4
  118. package/prebuilt/android/arm64-v8a/lib/libdav1d.a +0 -0
  119. package/prebuilt/android/arm64-v8a/lib/libvpx.a +0 -0
  120. package/prebuilt/android/armeabi-v7a/lib/libdav1d.a +0 -0
  121. package/prebuilt/android/armeabi-v7a/lib/libvpx.a +0 -0
  122. package/prebuilt/android/x86_64/lib/libdav1d.a +0 -0
  123. package/prebuilt/android/x86_64/lib/libvpx.a +0 -0
  124. package/prebuilt/include/dav1d/common.h +94 -0
  125. package/prebuilt/include/dav1d/data.h +117 -0
  126. package/prebuilt/include/dav1d/dav1d.h +329 -0
  127. package/prebuilt/include/dav1d/headers.h +440 -0
  128. package/prebuilt/include/dav1d/picture.h +157 -0
  129. package/prebuilt/include/dav1d/version.h +50 -0
  130. package/prebuilt/include/vpx/vp8.h +136 -0
  131. package/prebuilt/include/vpx/vp8dx.h +228 -0
  132. package/prebuilt/include/vpx/vpx_codec.h +475 -0
  133. package/prebuilt/include/vpx/vpx_decoder.h +365 -0
  134. package/prebuilt/include/vpx/vpx_frame_buffer.h +83 -0
  135. package/prebuilt/include/vpx/vpx_image.h +209 -0
  136. package/prebuilt/include/vpx/vpx_integer.h +40 -0
  137. package/prebuilt/ios/lib/libdav1d.a +0 -0
  138. package/prebuilt/ios/lib/libvpx.a +0 -0
  139. package/prebuilt/ios-simulator/include/dav1d/common.h +94 -0
  140. package/prebuilt/ios-simulator/include/dav1d/data.h +117 -0
  141. package/prebuilt/ios-simulator/include/dav1d/dav1d.h +329 -0
  142. package/prebuilt/ios-simulator/include/dav1d/headers.h +440 -0
  143. package/prebuilt/ios-simulator/include/dav1d/picture.h +157 -0
  144. package/prebuilt/ios-simulator/include/dav1d/version.h +50 -0
  145. package/prebuilt/ios-simulator/include/vpx/vp8.h +136 -0
  146. package/prebuilt/ios-simulator/include/vpx/vp8dx.h +228 -0
  147. package/prebuilt/ios-simulator/include/vpx/vpx_codec.h +475 -0
  148. package/prebuilt/ios-simulator/include/vpx/vpx_decoder.h +365 -0
  149. package/prebuilt/ios-simulator/include/vpx/vpx_frame_buffer.h +83 -0
  150. package/prebuilt/ios-simulator/include/vpx/vpx_image.h +209 -0
  151. package/prebuilt/ios-simulator/include/vpx/vpx_integer.h +40 -0
  152. package/prebuilt/ios-simulator/lib/libdav1d.a +0 -0
  153. package/prebuilt/ios-simulator/lib/libvpx.a +0 -0
  154. package/react-native/android/CMakeLists.txt +14 -0
  155. package/react-native/android/build.gradle +113 -0
  156. package/react-native/android/src/main/AndroidManifest.xml +1 -0
  157. package/react-native/android/src/main/java/dev/mediacache/alphavideo/reactnative/AlphaVideoModule.java +102 -0
  158. package/react-native/android/src/main/java/dev/mediacache/alphavideo/reactnative/AlphaVideoPackage.java +50 -0
  159. package/react-native/android/src/main/java/dev/mediacache/alphavideo/reactnative/AlphaVideoViewManager.java +317 -0
  160. package/react-native/android/src/newarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoModuleSpec.java +10 -0
  161. package/react-native/android/src/newarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoViewManagerSpec.java +23 -0
  162. package/react-native/android/src/norangesource/java/dev/mediacache/alphavideo/AppDataSource.java +15 -0
  163. package/react-native/android/src/oldarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoModuleSpec.java +30 -0
  164. package/react-native/android/src/oldarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoViewManagerSpec.java +61 -0
  165. package/react-native/ios/RNAlphaVideoViewComponentView.mm +173 -0
  166. package/react-native/ios/RNAlphaVideoViewManager.mm +147 -0
  167. package/react-native/src/AlphaVideoView.tsx +329 -0
  168. package/react-native/src/AlphaVideoViewNativeComponent.ts +132 -0
  169. package/react-native/src/AlphaVideoViewNativeComponent.web.ts +5 -0
  170. package/react-native/src/NativeAlphaVideoModule.ts +22 -0
  171. package/react-native/src/NativeAlphaVideoModule.web.ts +2 -0
  172. package/react-native/src/WebPlayer.tsx +7 -0
  173. package/react-native/src/WebPlayer.web.tsx +87 -0
  174. package/react-native/src/index.tsx +144 -0
  175. package/react-native-alpha-video.podspec +99 -0
  176. package/react-native.config.js +12 -0
  177. package/scripts/build_codecs_android.sh +246 -0
  178. package/scripts/build_codecs_ios.sh +31 -0
  179. package/scripts/build_codecs_ios_device.sh +210 -0
  180. package/scripts/build_codecs_ios_simulator.sh +256 -0
  181. package/scripts/build_wasm.sh +230 -0
  182. package/scripts/build_xcframework.sh +49 -0
  183. package/scripts/fetch-prebuilt.sh +48 -0
  184. package/scripts/package_release.sh +107 -0
  185. package/scripts/publish-android.sh +85 -0
  186. package/scripts/vendor_range_source.sh +47 -0
  187. package/third_party/libwebm/AUTHORS.TXT +5 -0
  188. package/third_party/libwebm/LICENSE.TXT +30 -0
  189. package/third_party/libwebm/PATENTS.TXT +23 -0
  190. package/third_party/libwebm/README.md +7 -0
  191. package/third_party/libwebm/webm_parser/include/webm/buffer_reader.h +138 -0
  192. package/third_party/libwebm/webm_parser/include/webm/callback.h +363 -0
  193. package/third_party/libwebm/webm_parser/include/webm/dom_types.h +1781 -0
  194. package/third_party/libwebm/webm_parser/include/webm/element.h +208 -0
  195. package/third_party/libwebm/webm_parser/include/webm/file_reader.h +103 -0
  196. package/third_party/libwebm/webm_parser/include/webm/id.h +1085 -0
  197. package/third_party/libwebm/webm_parser/include/webm/istream_reader.h +99 -0
  198. package/third_party/libwebm/webm_parser/include/webm/reader.h +94 -0
  199. package/third_party/libwebm/webm_parser/include/webm/status.h +166 -0
  200. package/third_party/libwebm/webm_parser/include/webm/webm_parser.h +133 -0
  201. package/third_party/libwebm/webm_parser/src/ancestory.cc +334 -0
  202. package/third_party/libwebm/webm_parser/src/ancestory.h +83 -0
  203. package/third_party/libwebm/webm_parser/src/audio_parser.h +84 -0
  204. package/third_party/libwebm/webm_parser/src/bit_utils.cc +26 -0
  205. package/third_party/libwebm/webm_parser/src/bit_utils.h +24 -0
  206. package/third_party/libwebm/webm_parser/src/block_additions_parser.h +30 -0
  207. package/third_party/libwebm/webm_parser/src/block_group_parser.h +71 -0
  208. package/third_party/libwebm/webm_parser/src/block_header_parser.cc +76 -0
  209. package/third_party/libwebm/webm_parser/src/block_header_parser.h +65 -0
  210. package/third_party/libwebm/webm_parser/src/block_more_parser.h +32 -0
  211. package/third_party/libwebm/webm_parser/src/block_parser.cc +285 -0
  212. package/third_party/libwebm/webm_parser/src/block_parser.h +126 -0
  213. package/third_party/libwebm/webm_parser/src/bool_parser.h +95 -0
  214. package/third_party/libwebm/webm_parser/src/buffer_reader.cc +110 -0
  215. package/third_party/libwebm/webm_parser/src/byte_parser.h +144 -0
  216. package/third_party/libwebm/webm_parser/src/callback.cc +155 -0
  217. package/third_party/libwebm/webm_parser/src/chapter_atom_parser.h +42 -0
  218. package/third_party/libwebm/webm_parser/src/chapter_display_parser.h +34 -0
  219. package/third_party/libwebm/webm_parser/src/chapters_parser.h +28 -0
  220. package/third_party/libwebm/webm_parser/src/cluster_parser.h +48 -0
  221. package/third_party/libwebm/webm_parser/src/colour_parser.h +55 -0
  222. package/third_party/libwebm/webm_parser/src/content_enc_aes_settings_parser.h +32 -0
  223. package/third_party/libwebm/webm_parser/src/content_encoding_parser.h +38 -0
  224. package/third_party/libwebm/webm_parser/src/content_encodings_parser.h +30 -0
  225. package/third_party/libwebm/webm_parser/src/content_encryption_parser.h +37 -0
  226. package/third_party/libwebm/webm_parser/src/cue_point_parser.h +38 -0
  227. package/third_party/libwebm/webm_parser/src/cue_track_positions_parser.h +39 -0
  228. package/third_party/libwebm/webm_parser/src/cues_parser.h +27 -0
  229. package/third_party/libwebm/webm_parser/src/date_parser.cc +72 -0
  230. package/third_party/libwebm/webm_parser/src/date_parser.h +64 -0
  231. package/third_party/libwebm/webm_parser/src/ebml_parser.h +48 -0
  232. package/third_party/libwebm/webm_parser/src/edition_entry_parser.h +35 -0
  233. package/third_party/libwebm/webm_parser/src/element_parser.h +102 -0
  234. package/third_party/libwebm/webm_parser/src/file_reader.cc +142 -0
  235. package/third_party/libwebm/webm_parser/src/float_parser.cc +77 -0
  236. package/third_party/libwebm/webm_parser/src/float_parser.h +65 -0
  237. package/third_party/libwebm/webm_parser/src/id_element_parser.cc +49 -0
  238. package/third_party/libwebm/webm_parser/src/id_element_parser.h +56 -0
  239. package/third_party/libwebm/webm_parser/src/id_parser.cc +75 -0
  240. package/third_party/libwebm/webm_parser/src/id_parser.h +45 -0
  241. package/third_party/libwebm/webm_parser/src/info_parser.h +44 -0
  242. package/third_party/libwebm/webm_parser/src/int_parser.h +121 -0
  243. package/third_party/libwebm/webm_parser/src/istream_reader.cc +133 -0
  244. package/third_party/libwebm/webm_parser/src/master_parser.cc +298 -0
  245. package/third_party/libwebm/webm_parser/src/master_parser.h +230 -0
  246. package/third_party/libwebm/webm_parser/src/master_value_parser.h +533 -0
  247. package/third_party/libwebm/webm_parser/src/mastering_metadata_parser.h +57 -0
  248. package/third_party/libwebm/webm_parser/src/parser.h +34 -0
  249. package/third_party/libwebm/webm_parser/src/parser_utils.cc +34 -0
  250. package/third_party/libwebm/webm_parser/src/parser_utils.h +64 -0
  251. package/third_party/libwebm/webm_parser/src/projection_parser.h +40 -0
  252. package/third_party/libwebm/webm_parser/src/recursive_parser.h +93 -0
  253. package/third_party/libwebm/webm_parser/src/seek_head_parser.h +27 -0
  254. package/third_party/libwebm/webm_parser/src/seek_parser.h +37 -0
  255. package/third_party/libwebm/webm_parser/src/segment_parser.cc +86 -0
  256. package/third_party/libwebm/webm_parser/src/segment_parser.h +53 -0
  257. package/third_party/libwebm/webm_parser/src/simple_tag_parser.h +37 -0
  258. package/third_party/libwebm/webm_parser/src/size_parser.cc +56 -0
  259. package/third_party/libwebm/webm_parser/src/size_parser.h +43 -0
  260. package/third_party/libwebm/webm_parser/src/skip_callback.h +63 -0
  261. package/third_party/libwebm/webm_parser/src/skip_parser.cc +59 -0
  262. package/third_party/libwebm/webm_parser/src/skip_parser.h +35 -0
  263. package/third_party/libwebm/webm_parser/src/slices_parser.h +30 -0
  264. package/third_party/libwebm/webm_parser/src/tag_parser.h +37 -0
  265. package/third_party/libwebm/webm_parser/src/tags_parser.h +27 -0
  266. package/third_party/libwebm/webm_parser/src/targets_parser.h +35 -0
  267. package/third_party/libwebm/webm_parser/src/time_slice_parser.h +30 -0
  268. package/third_party/libwebm/webm_parser/src/track_entry_parser.h +65 -0
  269. package/third_party/libwebm/webm_parser/src/tracks_parser.h +27 -0
  270. package/third_party/libwebm/webm_parser/src/unknown_parser.cc +49 -0
  271. package/third_party/libwebm/webm_parser/src/unknown_parser.h +38 -0
  272. package/third_party/libwebm/webm_parser/src/var_int_parser.cc +71 -0
  273. package/third_party/libwebm/webm_parser/src/var_int_parser.h +56 -0
  274. package/third_party/libwebm/webm_parser/src/video_parser.h +122 -0
  275. package/third_party/libwebm/webm_parser/src/virtual_block_parser.cc +72 -0
  276. package/third_party/libwebm/webm_parser/src/virtual_block_parser.h +69 -0
  277. package/third_party/libwebm/webm_parser/src/void_parser.cc +49 -0
  278. package/third_party/libwebm/webm_parser/src/void_parser.h +41 -0
  279. package/third_party/libwebm/webm_parser/src/webm_parser.cc +282 -0
  280. package/third_party/range-source/LICENSE +21 -0
  281. package/third_party/range-source/README.md +8 -0
  282. package/third_party/range-source/include/range_source.h +395 -0
  283. package/third_party/range-source/include/range_source_download.h +309 -0
@@ -0,0 +1,1781 @@
1
+ // Copyright (c) 2016 The WebM project authors. All Rights Reserved.
2
+ //
3
+ // Use of this source code is governed by a BSD-style license
4
+ // that can be found in the LICENSE file in the root of the source
5
+ // tree. An additional intellectual property rights grant can be found
6
+ // in the file PATENTS. All contributing project authors may
7
+ // be found in the AUTHORS file in the root of the source tree.
8
+ #ifndef INCLUDE_WEBM_DOM_TYPES_H_
9
+ #define INCLUDE_WEBM_DOM_TYPES_H_
10
+
11
+ #include <cstdint>
12
+ #include <string>
13
+ #include <vector>
14
+
15
+ #include "./element.h"
16
+ #include "./id.h"
17
+
18
+ /**
19
+ \file
20
+ Data structures representing parsed DOM objects.
21
+
22
+ For more information on each type and member, see the WebM specification for
23
+ the element that each type/member represents.
24
+ */
25
+
26
+ namespace webm {
27
+
28
+ /**
29
+ \addtogroup PUBLIC_API
30
+ @{
31
+ */
32
+
33
+ /**
34
+ Metadata for a single frame.
35
+ */
36
+ struct FrameMetadata {
37
+ /**
38
+ Metadata for the EBML element (\WebMID{Block} or \WebMID{SimpleBlock}) that
39
+ contains this frame.
40
+ */
41
+ ElementMetadata parent_element;
42
+
43
+ /**
44
+ Absolute byte position (from the beginning of the byte stream/file) of the
45
+ frame start.
46
+ */
47
+ std::uint64_t position;
48
+
49
+ /**
50
+ Size (in bytes) of the frame.
51
+ */
52
+ std::uint64_t size;
53
+
54
+ /**
55
+ Returns true if every member within the two objects are equal.
56
+ */
57
+ bool operator==(const FrameMetadata& other) const {
58
+ return parent_element == other.parent_element &&
59
+ position == other.position && size == other.size;
60
+ }
61
+ };
62
+
63
+ /**
64
+ A parsed \WebMID{BlockMore} element.
65
+ */
66
+ struct BlockMore {
67
+ /**
68
+ A parsed \WebMID{BlockAddID} element.
69
+ */
70
+ Element<std::uint64_t> id{1};
71
+
72
+ /**
73
+ A parsed \WebMID{BlockAdditional} element.
74
+ */
75
+ Element<std::vector<std::uint8_t>> data;
76
+
77
+ /**
78
+ Returns true if every member within the two objects are equal.
79
+ */
80
+ bool operator==(const BlockMore& other) const {
81
+ return id == other.id && data == other.data;
82
+ }
83
+ };
84
+
85
+ /**
86
+ A parsed \WebMID{BlockAdditions} element.
87
+ */
88
+ struct BlockAdditions {
89
+ /**
90
+ Parsed \WebMID{BlockMore} elements.
91
+ */
92
+ std::vector<Element<BlockMore>> block_mores;
93
+
94
+ /**
95
+ Returns true if every member within the two objects are equal.
96
+ */
97
+ bool operator==(const BlockAdditions& other) const {
98
+ return block_mores == other.block_mores;
99
+ }
100
+ };
101
+
102
+ /**
103
+ A parsed \WebMID{TimeSlice} element (deprecated).
104
+ */
105
+ struct TimeSlice {
106
+ /**
107
+ A parsed \WebMID{LaceNumber} element (deprecated).
108
+ */
109
+ Element<std::uint64_t> lace_number;
110
+
111
+ /**
112
+ Returns true if every member within the two objects are equal.
113
+ */
114
+ bool operator==(const TimeSlice& other) const {
115
+ return lace_number == other.lace_number;
116
+ }
117
+ };
118
+
119
+ /**
120
+ A parsed \WebMID{Slices} element (deprecated).
121
+ */
122
+ struct Slices {
123
+ /**
124
+ Parsed \WebMID{TimeSlice} elements (deprecated).
125
+ */
126
+ std::vector<Element<TimeSlice>> slices;
127
+
128
+ /**
129
+ Returns true if every member within the two objects are equal.
130
+ */
131
+ bool operator==(const Slices& other) const { return slices == other.slices; }
132
+ };
133
+
134
+ /**
135
+ A parsed \WebMID{BlockVirtual} element.
136
+ */
137
+ struct VirtualBlock {
138
+ /**
139
+ The virtual block's track number.
140
+ */
141
+ std::uint64_t track_number;
142
+
143
+ /**
144
+ The timecode of the virtual block.
145
+ */
146
+ std::int16_t timecode;
147
+
148
+ /**
149
+ Returns true if every member within the two objects are equal.
150
+ */
151
+ bool operator==(const VirtualBlock& other) const {
152
+ return track_number == other.track_number && timecode == other.timecode;
153
+ }
154
+ };
155
+
156
+ /**
157
+ The frame lacing used in a block.
158
+ */
159
+ enum class Lacing : std::uint8_t {
160
+ /**
161
+ No lacing is used.
162
+ */
163
+ kNone = 0x00,
164
+
165
+ /**
166
+ Xiph-style lacing is used.
167
+ */
168
+ kXiph = 0x02,
169
+
170
+ /**
171
+ Fixed-lacing is used, where each frame has the same, fixed size.
172
+ */
173
+ kFixed = 0x04,
174
+
175
+ /**
176
+ EBML-style lacing is used.
177
+ */
178
+ kEbml = 0x06,
179
+ };
180
+
181
+ /**
182
+ A parsed \WebMID{Block} element.
183
+ */
184
+ struct Block {
185
+ /**
186
+ The block's track number.
187
+ */
188
+ std::uint64_t track_number;
189
+
190
+ /**
191
+ The number of frames in the block.
192
+ */
193
+ int num_frames;
194
+
195
+ /**
196
+ The timecode of the block (relative to the containing \WebMID{Cluster}'s
197
+ timecode).
198
+ */
199
+ std::int16_t timecode;
200
+
201
+ /**
202
+ The lacing used to store frames in the block.
203
+ */
204
+ Lacing lacing;
205
+
206
+ /**
207
+ True if the frames are visible, false if they are invisible.
208
+ */
209
+ bool is_visible;
210
+
211
+ /**
212
+ Returns true if every member within the two objects are equal.
213
+ */
214
+ bool operator==(const Block& other) const {
215
+ return track_number == other.track_number &&
216
+ num_frames == other.num_frames && timecode == other.timecode &&
217
+ lacing == other.lacing && is_visible == other.is_visible;
218
+ }
219
+ };
220
+
221
+ /**
222
+ A parsed \WebMID{SimpleBlock} element.
223
+ */
224
+ struct SimpleBlock : public Block {
225
+ /**
226
+ True if the frames are all key frames.
227
+ */
228
+ bool is_key_frame;
229
+
230
+ /**
231
+ True if frames can be discarded during playback if needed.
232
+ */
233
+ bool is_discardable;
234
+
235
+ /**
236
+ Returns true if every member within the two objects are equal.
237
+ */
238
+ bool operator==(const SimpleBlock& other) const {
239
+ return Block::operator==(other) && is_key_frame == other.is_key_frame &&
240
+ is_discardable == other.is_discardable;
241
+ }
242
+ };
243
+
244
+ /**
245
+ A parsed \WebMID{BlockGroup} element.
246
+ */
247
+ struct BlockGroup {
248
+ /**
249
+ A parsed \WebMID{Block} element.
250
+ */
251
+ Element<Block> block;
252
+
253
+ /**
254
+ A parsed \WebMID{BlockVirtual} element.
255
+ */
256
+ Element<VirtualBlock> virtual_block;
257
+
258
+ /**
259
+ A parsed \WebMID{BlockAdditions} element.
260
+ */
261
+ Element<BlockAdditions> additions;
262
+
263
+ /**
264
+ A parsed \WebMID{BlockDuration} element.
265
+ */
266
+ Element<std::uint64_t> duration;
267
+
268
+ /**
269
+ Parsed \WebMID{ReferenceBlock} elements.
270
+ */
271
+ std::vector<Element<std::int64_t>> references;
272
+
273
+ /**
274
+ A parsed \WebMID{DiscardPadding} element.
275
+ */
276
+ Element<std::int64_t> discard_padding;
277
+
278
+ /**
279
+ A parsed \WebMID{Slices} element (deprecated).
280
+ */
281
+ Element<Slices> slices;
282
+
283
+ /**
284
+ Returns true if every member within the two objects are equal.
285
+ */
286
+ bool operator==(const BlockGroup& other) const {
287
+ return block == other.block && virtual_block == other.virtual_block &&
288
+ additions == other.additions && duration == other.duration &&
289
+ references == other.references &&
290
+ discard_padding == other.discard_padding && slices == other.slices;
291
+ }
292
+ };
293
+
294
+ /**
295
+ A parsed \WebMID{Cluster} element.
296
+ */
297
+ struct Cluster {
298
+ /**
299
+ A parsed \WebMID{Timecode} element.
300
+ */
301
+ Element<std::uint64_t> timecode;
302
+
303
+ /**
304
+ A parsed \WebMID{PrevSize} element.
305
+ */
306
+ Element<std::uint64_t> previous_size;
307
+
308
+ /**
309
+ Parsed \WebMID{SimpleBlock} elements.
310
+ */
311
+ std::vector<Element<SimpleBlock>> simple_blocks;
312
+
313
+ /**
314
+ Parsed \WebMID{BlockGroup} elements.
315
+ */
316
+ std::vector<Element<BlockGroup>> block_groups;
317
+
318
+ /**
319
+ Returns true if every member within the two objects are equal.
320
+ */
321
+ bool operator==(const Cluster& other) const {
322
+ return timecode == other.timecode && previous_size == other.previous_size &&
323
+ simple_blocks == other.simple_blocks &&
324
+ block_groups == other.block_groups;
325
+ }
326
+ };
327
+
328
+ /**
329
+ A parsed \WebMID{EBML} element.
330
+ */
331
+ struct Ebml {
332
+ /**
333
+ A parsed \WebMID{EBMLVersion} element.
334
+ */
335
+ Element<std::uint64_t> ebml_version{1};
336
+
337
+ /**
338
+ A parsed \WebMID{EBMLReadVersion} element.
339
+ */
340
+ Element<std::uint64_t> ebml_read_version{1};
341
+
342
+ /**
343
+ A parsed \WebMID{EBMLMaxIDLength} element.
344
+ */
345
+ Element<std::uint64_t> ebml_max_id_length{4};
346
+
347
+ /**
348
+ A parsed \WebMID{EBMLMaxSizeLength} element.
349
+ */
350
+ Element<std::uint64_t> ebml_max_size_length{8};
351
+
352
+ /**
353
+ A parsed \WebMID{DocType} element.
354
+ */
355
+ Element<std::string> doc_type{"matroska"};
356
+
357
+ /**
358
+ A parsed \WebMID{DocTypeVersion} element.
359
+ */
360
+ Element<std::uint64_t> doc_type_version{1};
361
+
362
+ /**
363
+ A parsed \WebMID{DocTypeReadVersion} element.
364
+ */
365
+ Element<std::uint64_t> doc_type_read_version{1};
366
+
367
+ /**
368
+ Returns true if every member within the two objects are equal.
369
+ */
370
+ bool operator==(const Ebml& other) const {
371
+ return ebml_version == other.ebml_version &&
372
+ ebml_read_version == other.ebml_read_version &&
373
+ ebml_max_id_length == other.ebml_max_id_length &&
374
+ ebml_max_size_length == other.ebml_max_size_length &&
375
+ doc_type == other.doc_type &&
376
+ doc_type_version == other.doc_type_version &&
377
+ doc_type_read_version == other.doc_type_read_version;
378
+ }
379
+ };
380
+
381
+ /**
382
+ A parsed \WebMID{Info} element.
383
+ */
384
+ struct Info {
385
+ /**
386
+ A parsed \WebMID{TimecodeScale} element.
387
+ */
388
+ Element<std::uint64_t> timecode_scale{1000000};
389
+
390
+ /**
391
+ A parsed \WebMID{Duration} element.
392
+ */
393
+ Element<double> duration;
394
+
395
+ /**
396
+ A parsed \WebMID{DateUTC} element.
397
+ */
398
+ Element<std::int64_t> date_utc;
399
+
400
+ /**
401
+ A parsed \WebMID{Title} element.
402
+ */
403
+ Element<std::string> title;
404
+
405
+ /**
406
+ A parsed \WebMID{MuxingApp} element.
407
+ */
408
+ Element<std::string> muxing_app;
409
+
410
+ /**
411
+ A parsed \WebMID{WritingApp} element.
412
+ */
413
+ Element<std::string> writing_app;
414
+
415
+ /**
416
+ Returns true if every member within the two objects are equal.
417
+ */
418
+ bool operator==(const Info& other) const {
419
+ return timecode_scale == other.timecode_scale &&
420
+ duration == other.duration && date_utc == other.date_utc &&
421
+ title == other.title && muxing_app == other.muxing_app &&
422
+ writing_app == other.writing_app;
423
+ }
424
+ };
425
+
426
+ /**
427
+ A parsed \WebMID{Seek} element.
428
+ */
429
+ struct Seek {
430
+ /**
431
+ A parsed \WebMID{SeekID} element.
432
+ */
433
+ Element<Id> id;
434
+
435
+ /**
436
+ A parsed \WebMID{SeekPosition} element.
437
+ */
438
+ Element<std::uint64_t> position;
439
+
440
+ /**
441
+ Returns true if every member within the two objects are equal.
442
+ */
443
+ bool operator==(const Seek& other) const {
444
+ return id == other.id && position == other.position;
445
+ }
446
+ };
447
+
448
+ /**
449
+ A parsed \WebMID{Audio} element.
450
+ */
451
+ struct Audio {
452
+ /**
453
+ A parsed \WebMID{SamplingFrequency} element.
454
+ */
455
+ Element<double> sampling_frequency{8000};
456
+
457
+ /**
458
+ A parsed \WebMID{OutputSamplingFrequency} element.
459
+ */
460
+ Element<double> output_frequency{8000};
461
+
462
+ /**
463
+ A parsed \WebMID{Channels} element.
464
+ */
465
+ Element<std::uint64_t> channels{1};
466
+
467
+ /**
468
+ A parsed \WebMID{BitDepth} element.
469
+ */
470
+ Element<std::uint64_t> bit_depth;
471
+
472
+ /**
473
+ Returns true if every member within the two objects are equal.
474
+ */
475
+ bool operator==(const Audio& other) const {
476
+ return sampling_frequency == other.sampling_frequency &&
477
+ output_frequency == other.output_frequency &&
478
+ channels == other.channels && bit_depth == other.bit_depth;
479
+ }
480
+ };
481
+
482
+ /**
483
+ A parsed \WebMID{MasteringMetadata} element.
484
+ */
485
+ struct MasteringMetadata {
486
+ /**
487
+ A parsed \WebMID{PrimaryRChromaticityX} element.
488
+ */
489
+ Element<double> primary_r_chromaticity_x;
490
+
491
+ /**
492
+ A parsed \WebMID{PrimaryRChromaticityY} element.
493
+ */
494
+ Element<double> primary_r_chromaticity_y;
495
+
496
+ /**
497
+ A parsed \WebMID{PrimaryGChromaticityX} element.
498
+ */
499
+ Element<double> primary_g_chromaticity_x;
500
+
501
+ /**
502
+ A parsed \WebMID{PrimaryGChromaticityY} element.
503
+ */
504
+ Element<double> primary_g_chromaticity_y;
505
+
506
+ /**
507
+ A parsed \WebMID{PrimaryBChromaticityX} element.
508
+ */
509
+ Element<double> primary_b_chromaticity_x;
510
+
511
+ /**
512
+ A parsed \WebMID{PrimaryBChromaticityY} element.
513
+ */
514
+ Element<double> primary_b_chromaticity_y;
515
+
516
+ /**
517
+ A parsed \WebMID{WhitePointChromaticityX} element.
518
+ */
519
+ Element<double> white_point_chromaticity_x;
520
+
521
+ /**
522
+ A parsed \WebMID{WhitePointChromaticityY} element.
523
+ */
524
+ Element<double> white_point_chromaticity_y;
525
+
526
+ /**
527
+ A parsed \WebMID{LuminanceMax} element.
528
+ */
529
+ Element<double> luminance_max;
530
+
531
+ /**
532
+ A parsed \WebMID{LuminanceMin} element.
533
+ */
534
+ Element<double> luminance_min;
535
+
536
+ /**
537
+ Returns true if every member within the two objects are equal.
538
+ */
539
+ bool operator==(const MasteringMetadata& other) const {
540
+ return primary_r_chromaticity_x == other.primary_r_chromaticity_x &&
541
+ primary_r_chromaticity_y == other.primary_r_chromaticity_y &&
542
+ primary_g_chromaticity_x == other.primary_g_chromaticity_x &&
543
+ primary_g_chromaticity_y == other.primary_g_chromaticity_y &&
544
+ primary_b_chromaticity_x == other.primary_b_chromaticity_x &&
545
+ primary_b_chromaticity_y == other.primary_b_chromaticity_y &&
546
+ white_point_chromaticity_x == other.white_point_chromaticity_x &&
547
+ white_point_chromaticity_y == other.white_point_chromaticity_y &&
548
+ luminance_max == other.luminance_max &&
549
+ luminance_min == other.luminance_min;
550
+ }
551
+ };
552
+
553
+ /**
554
+ A parsed \WebMID{MatrixCoefficients} element.
555
+
556
+ Matroska/WebM adopted these values from Table 4 of ISO/IEC 23001-8:2013/DCOR1.
557
+ See that document for further details.
558
+ */
559
+ enum class MatrixCoefficients : std::uint64_t {
560
+ /**
561
+ The identity matrix.
562
+
563
+ Typically used for GBR (often referred to as RGB); however, may also be used
564
+ for YZX (often referred to as XYZ).
565
+ */
566
+ kRgb = 0,
567
+
568
+ /**
569
+ Rec. ITU-R BT.709-5.
570
+ */
571
+ kBt709 = 1,
572
+
573
+ /**
574
+ Image characteristics are unknown or are determined by the application.
575
+ */
576
+ kUnspecified = 2,
577
+
578
+ /**
579
+ United States Federal Communications Commission Title 47 Code of Federal
580
+ Regulations (2003) 73.682 (a) (20).
581
+ */
582
+ kFcc = 4,
583
+
584
+ /**
585
+ Rec. ITU-R BT.470‑6 System B, G (historical).
586
+ */
587
+ kBt470Bg = 5,
588
+
589
+ /**
590
+ Society of Motion Picture and Television Engineers 170M (2004).
591
+ */
592
+ kSmpte170M = 6,
593
+
594
+ /**
595
+ Society of Motion Picture and Television Engineers 240M (1999).
596
+ */
597
+ kSmpte240M = 7,
598
+
599
+ /**
600
+ YCgCo.
601
+ */
602
+ kYCgCo = 8,
603
+
604
+ /**
605
+ Rec. ITU-R BT.2020 (non-constant luminance).
606
+ */
607
+ kBt2020NonconstantLuminance = 9,
608
+
609
+ /**
610
+ Rec. ITU-R BT.2020 (constant luminance).
611
+ */
612
+ kBt2020ConstantLuminance = 10,
613
+ };
614
+
615
+ /**
616
+ A parsed \WebMID{Range} element.
617
+ */
618
+ enum class Range : std::uint64_t {
619
+ /**
620
+ Unspecified.
621
+ */
622
+ kUnspecified = 0,
623
+
624
+ /**
625
+ Broadcast range.
626
+ */
627
+ kBroadcast = 1,
628
+
629
+ /**
630
+ Full range (no clipping).
631
+ */
632
+ kFull = 2,
633
+
634
+ /**
635
+ Defined by MatrixCoefficients/TransferCharacteristics.
636
+ */
637
+ kDerived = 3,
638
+ };
639
+
640
+ /**
641
+ A parsed \WebMID{TransferCharacteristics} element.
642
+
643
+ Matroska/WebM adopted these values from Table 3 of ISO/IEC 23001-8:2013/DCOR1.
644
+ See that document for further details.
645
+ */
646
+ enum class TransferCharacteristics : std::uint64_t {
647
+ /**
648
+ Rec. ITU-R BT.709-6.
649
+ */
650
+ kBt709 = 1,
651
+
652
+ /**
653
+ Image characteristics are unknown or are determined by the application.
654
+ */
655
+ kUnspecified = 2,
656
+
657
+ /**
658
+ Rec. ITU‑R BT.470‑6 System M (historical) with assumed display gamma 2.2.
659
+ */
660
+ kGamma22curve = 4,
661
+
662
+ /**
663
+ Rec. ITU‑R BT.470-6 System B, G (historical) with assumed display gamma 2.8.
664
+ */
665
+ kGamma28curve = 5,
666
+
667
+ /**
668
+ Society of Motion Picture and Television Engineers 170M (2004).
669
+ */
670
+ kSmpte170M = 6,
671
+
672
+ /**
673
+ Society of Motion Picture and Television Engineers 240M (1999).
674
+ */
675
+ kSmpte240M = 7,
676
+
677
+ /**
678
+ Linear transfer characteristics.
679
+ */
680
+ kLinear = 8,
681
+
682
+ /**
683
+ Logarithmic transfer characteristic (100:1 range).
684
+ */
685
+ kLog = 9,
686
+
687
+ /**
688
+ Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range).
689
+ */
690
+ kLogSqrt = 10,
691
+
692
+ /**
693
+ IEC 61966-2-4.
694
+ */
695
+ kIec6196624 = 11,
696
+
697
+ /**
698
+ Rec. ITU‑R BT.1361-0 extended colour gamut system (historical).
699
+ */
700
+ kBt1361ExtendedColourGamut = 12,
701
+
702
+ /**
703
+ IEC 61966-2-1 sRGB or sYCC.
704
+ */
705
+ kIec6196621 = 13,
706
+
707
+ /**
708
+ Rec. ITU-R BT.2020-2 (10-bit system).
709
+ */
710
+ k10BitBt2020 = 14,
711
+
712
+ /**
713
+ Rec. ITU-R BT.2020-2 (12-bit system).
714
+ */
715
+ k12BitBt2020 = 15,
716
+
717
+ /**
718
+ Society of Motion Picture and Television Engineers ST 2084.
719
+ */
720
+ kSmpteSt2084 = 16,
721
+
722
+ /**
723
+ Society of Motion Picture and Television Engineers ST 428-1.
724
+ */
725
+ kSmpteSt4281 = 17,
726
+
727
+ /**
728
+ Association of Radio Industries and Businesses (ARIB) STD-B67.
729
+ */
730
+ kAribStdB67Hlg = 18,
731
+ };
732
+
733
+ /**
734
+ A parsed \WebMID{Primaries} element.
735
+
736
+ Matroska/WebM adopted these values from Table 2 of ISO/IEC 23001-8:2013/DCOR1.
737
+ See that document for further details.
738
+ */
739
+ enum class Primaries : std::uint64_t {
740
+ /**
741
+ Rec. ITU‑R BT.709-6.
742
+ */
743
+ kBt709 = 1,
744
+
745
+ /**
746
+ Image characteristics are unknown or are determined by the application.
747
+ */
748
+ kUnspecified = 2,
749
+
750
+ /**
751
+ Rec. ITU‑R BT.470‑6 System M (historical).
752
+ */
753
+ kBt470M = 4,
754
+
755
+ /**
756
+ Rec. ITU‑R BT.470‑6 System B, G (historical).
757
+ */
758
+ kBt470Bg = 5,
759
+
760
+ /**
761
+ Society of Motion Picture and Television Engineers 170M (2004).
762
+ */
763
+ kSmpte170M = 6,
764
+
765
+ /**
766
+ Society of Motion Picture and Television Engineers 240M (1999).
767
+ */
768
+ kSmpte240M = 7,
769
+
770
+ /**
771
+ Generic film.
772
+ */
773
+ kFilm = 8,
774
+
775
+ /**
776
+ Rec. ITU-R BT.2020-2.
777
+ */
778
+ kBt2020 = 9,
779
+
780
+ /**
781
+ Society of Motion Picture and Television Engineers ST 428-1.
782
+ */
783
+ kSmpteSt4281 = 10,
784
+
785
+ /**
786
+ Society of Motion Picture and Television Engineers RP 431-2 (a.k.a. DCI-P3).
787
+ */
788
+ kSmpteRp431 = 11,
789
+
790
+ /**
791
+ Society of Motion Picture and Television Engineers EG 432-1
792
+ (a.k.a. DCI-P3 D65).
793
+ */
794
+ kSmpteEg432 = 12,
795
+
796
+ /**
797
+ JEDEC P22 phosphors/EBU Tech. 3213-E (1975).
798
+ */
799
+ kJedecP22Phosphors = 22,
800
+ };
801
+
802
+ /**
803
+ A parsed \WebMID{Colour} element.
804
+ */
805
+ struct Colour {
806
+ /**
807
+ A parsed \WebMID{MatrixCoefficients} element.
808
+ */
809
+ Element<MatrixCoefficients> matrix_coefficients{
810
+ MatrixCoefficients::kUnspecified};
811
+
812
+ /**
813
+ A parsed \WebMID{BitsPerChannel} element.
814
+ */
815
+ Element<std::uint64_t> bits_per_channel{0};
816
+
817
+ /**
818
+ A parsed \WebMID{ChromaSubsamplingHorz} element.
819
+ */
820
+ Element<std::uint64_t> chroma_subsampling_x;
821
+
822
+ /**
823
+ A parsed \WebMID{ChromaSubsamplingVert} element.
824
+ */
825
+ Element<std::uint64_t> chroma_subsampling_y;
826
+
827
+ /**
828
+ A parsed \WebMID{CbSubsamplingHorz} element.
829
+ */
830
+ Element<std::uint64_t> cb_subsampling_x;
831
+
832
+ /**
833
+ A parsed \WebMID{CbSubsamplingVert} element.
834
+ */
835
+ Element<std::uint64_t> cb_subsampling_y;
836
+
837
+ /**
838
+ A parsed \WebMID{ChromaSitingHorz} element.
839
+ */
840
+ Element<std::uint64_t> chroma_siting_x{0};
841
+
842
+ /**
843
+ A parsed \WebMID{ChromaSitingVert} element.
844
+ */
845
+ Element<std::uint64_t> chroma_siting_y{0};
846
+
847
+ /**
848
+ A parsed \WebMID{Range} element.
849
+ */
850
+ Element<Range> range{Range::kUnspecified};
851
+
852
+ /**
853
+ A parsed \WebMID{TransferCharacteristics} element.
854
+ */
855
+ Element<TransferCharacteristics> transfer_characteristics{
856
+ TransferCharacteristics::kUnspecified};
857
+
858
+ /**
859
+ A parsed \WebMID{Primaries} element.
860
+ */
861
+ Element<Primaries> primaries{Primaries::kUnspecified};
862
+
863
+ /**
864
+ A parsed \WebMID{MaxCLL} element.
865
+ */
866
+ Element<std::uint64_t> max_cll;
867
+
868
+ /**
869
+ A parsed \WebMID{MaxFALL} element.
870
+ */
871
+ Element<std::uint64_t> max_fall;
872
+
873
+ /**
874
+ A parsed \WebMID{MasteringMetadata} element.
875
+ */
876
+ Element<MasteringMetadata> mastering_metadata;
877
+
878
+ /**
879
+ Returns true if every member within the two objects are equal.
880
+ */
881
+ bool operator==(const Colour& other) const {
882
+ return matrix_coefficients == other.matrix_coefficients &&
883
+ bits_per_channel == other.bits_per_channel &&
884
+ chroma_subsampling_x == other.chroma_subsampling_x &&
885
+ chroma_subsampling_y == other.chroma_subsampling_y &&
886
+ cb_subsampling_x == other.cb_subsampling_x &&
887
+ cb_subsampling_y == other.cb_subsampling_y &&
888
+ chroma_siting_x == other.chroma_siting_x &&
889
+ chroma_siting_y == other.chroma_siting_y && range == other.range &&
890
+ transfer_characteristics == other.transfer_characteristics &&
891
+ primaries == other.primaries && max_cll == other.max_cll &&
892
+ max_fall == other.max_fall &&
893
+ mastering_metadata == other.mastering_metadata;
894
+ }
895
+ };
896
+
897
+ /**
898
+ A parsed \WebMID{ProjectionType} element.
899
+ */
900
+ enum class ProjectionType : std::uint64_t {
901
+ /**
902
+ Rectangular.
903
+ */
904
+ kRectangular = 0,
905
+
906
+ /**
907
+ Equirectangular.
908
+ */
909
+ kEquirectangular = 1,
910
+
911
+ /**
912
+ Cube map.
913
+ */
914
+ kCubeMap = 2,
915
+
916
+ /**
917
+ Mesh.
918
+ */
919
+ kMesh = 3,
920
+ };
921
+
922
+ /**
923
+ A parsed \WebMID{Projection} element.
924
+ */
925
+ struct Projection {
926
+ /**
927
+ A parsed \WebMID{ProjectionType} element.
928
+ */
929
+ Element<ProjectionType> type;
930
+
931
+ /**
932
+ A parsed \WebMID{ProjectionPrivate} element.
933
+ */
934
+ Element<std::vector<std::uint8_t>> projection_private;
935
+
936
+ /**
937
+ A parsed \WebMID{ProjectionPoseYaw} element.
938
+ */
939
+ Element<double> pose_yaw;
940
+
941
+ /**
942
+ A parsed \WebMID{ProjectionPosePitch} element.
943
+ */
944
+ Element<double> pose_pitch;
945
+
946
+ /**
947
+ A parsed \WebMID{ProjectionPoseRoll} element.
948
+ */
949
+ Element<double> pose_roll;
950
+
951
+ /**
952
+ Returns true if every member within the two objects are equal.
953
+ */
954
+ bool operator==(const Projection& other) const {
955
+ return type == other.type &&
956
+ projection_private == other.projection_private &&
957
+ pose_yaw == other.pose_yaw && pose_pitch == other.pose_pitch &&
958
+ pose_roll == other.pose_roll;
959
+ }
960
+ };
961
+
962
+ /**
963
+ A parsed \WebMID{FlagInterlaced} element.
964
+ */
965
+ enum class FlagInterlaced : std::uint64_t {
966
+ /**
967
+ Unspecified.
968
+ */
969
+ kUnspecified = 0,
970
+
971
+ /**
972
+ Interlaced.
973
+ */
974
+ kInterlaced = 1,
975
+
976
+ /**
977
+ Progressive.
978
+ */
979
+ kProgressive = 2,
980
+ };
981
+
982
+ /**
983
+ A parsed \WebMID{StereoMode} element.
984
+ */
985
+ enum class StereoMode : std::uint64_t {
986
+ /**
987
+ Mono.
988
+ */
989
+ kMono = 0,
990
+
991
+ /**
992
+ Side-by-side, left eye is first.
993
+ */
994
+ kSideBySideLeftFirst = 1,
995
+
996
+ /**
997
+ Top-bottom, right eye is first.
998
+ */
999
+ kTopBottomRightFirst = 2,
1000
+
1001
+ /**
1002
+ Top-bottom, left eye is first.
1003
+ */
1004
+ kTopBottomLeftFirst = 3,
1005
+
1006
+ /**
1007
+ Checkboard, right eye is first.
1008
+ */
1009
+ kCheckboardRightFirst = 4,
1010
+
1011
+ /**
1012
+ Checkboard, left eye is first.
1013
+ */
1014
+ kCheckboardLeftFirst = 5,
1015
+
1016
+ /**
1017
+ Row interleaved, right eye is first.
1018
+ */
1019
+ kRowInterleavedRightFirst = 6,
1020
+
1021
+ /**
1022
+ Row interleaved, left eye is first.
1023
+ */
1024
+ kRowInterleavedLeftFirst = 7,
1025
+
1026
+ /**
1027
+ Column interleaved, right eye is first.
1028
+ */
1029
+ kColumnInterleavedRightFirst = 8,
1030
+
1031
+ /**
1032
+ Column interleaved, left eye is first.
1033
+ */
1034
+ kColumnInterleavedLeftFirst = 9,
1035
+
1036
+ /**
1037
+ Anaglyph (cyan/read).
1038
+ */
1039
+ kAnaglyphCyanRed = 10,
1040
+
1041
+ /**
1042
+ Side-by-side, right eye is first.
1043
+ */
1044
+ kSideBySideRightFirst = 11,
1045
+
1046
+ /**
1047
+ Anaglyph (green/magenta).
1048
+ */
1049
+ kAnaglyphGreenMagenta = 12,
1050
+
1051
+ /**
1052
+ Both eyes are laced in one block, left eye is first.
1053
+ */
1054
+ kBlockLacedLeftFirst = 13,
1055
+
1056
+ /**
1057
+ Both eyes are laced in one block, right eye is first.
1058
+ */
1059
+ kBlockLacedRightFirst = 14,
1060
+
1061
+ /**
1062
+ Stereo, but the layout for the left and right eyes is application dependent
1063
+ and must be determined from other data (like the ProjectionPrivate element).
1064
+ */
1065
+ kStereoCustom = 15,
1066
+ };
1067
+
1068
+ /**
1069
+ A parsed \WebMID{DisplayUnit} element.
1070
+
1071
+ Note that WebM only supports pixel display units. Centimeters, inches, and
1072
+ display aspect ratio aren't supported.
1073
+ */
1074
+ enum class DisplayUnit : std::uint64_t {
1075
+ // The only value legal value in WebM is 0 (pixels).
1076
+ /**
1077
+ Pixels.
1078
+
1079
+ This is the only option supported by WebM.
1080
+ */
1081
+ kPixels = 0,
1082
+
1083
+ /**
1084
+ Centimeters.
1085
+ */
1086
+ kCentimeters = 1,
1087
+
1088
+ /**
1089
+ Inches.
1090
+ */
1091
+ kInches = 2,
1092
+
1093
+ /**
1094
+ Display aspect ratio.
1095
+ */
1096
+ kDisplayAspectRatio = 3,
1097
+ };
1098
+
1099
+ /**
1100
+ A parsed \WebMID{AspectRatioType} element.
1101
+ */
1102
+ enum class AspectRatioType : std::uint64_t {
1103
+ /**
1104
+ Free resizing.
1105
+ */
1106
+ kFreeResizing = 0,
1107
+
1108
+ /**
1109
+ Keep aspect ratio.
1110
+ */
1111
+ kKeep = 1,
1112
+
1113
+ /**
1114
+ Fixed aspect ratio.
1115
+ */
1116
+ kFixed = 2,
1117
+ };
1118
+
1119
+ /**
1120
+ A parsed \WebMID{Video} element.
1121
+ */
1122
+ struct Video {
1123
+ /**
1124
+ A parsed \WebMID{FlagInterlaced} element.
1125
+ */
1126
+ Element<FlagInterlaced> interlaced{FlagInterlaced::kUnspecified};
1127
+
1128
+ /**
1129
+ A parsed \WebMID{StereoMode} element.
1130
+ */
1131
+ Element<StereoMode> stereo_mode{StereoMode::kMono};
1132
+
1133
+ /**
1134
+ A parsed \WebMID{AlphaMode} element.
1135
+ */
1136
+ Element<std::uint64_t> alpha_mode{0};
1137
+
1138
+ /**
1139
+ A parsed \WebMID{PixelWidth} element.
1140
+ */
1141
+ Element<std::uint64_t> pixel_width;
1142
+
1143
+ /**
1144
+ A parsed \WebMID{PixelHeight} element.
1145
+ */
1146
+ Element<std::uint64_t> pixel_height;
1147
+
1148
+ /**
1149
+ A parsed \WebMID{PixelCropBottom} element.
1150
+ */
1151
+ Element<std::uint64_t> pixel_crop_bottom{0};
1152
+
1153
+ /**
1154
+ A parsed \WebMID{PixelCropTop} element.
1155
+ */
1156
+ Element<std::uint64_t> pixel_crop_top{0};
1157
+
1158
+ /**
1159
+ A parsed \WebMID{PixelCropLeft} element.
1160
+ */
1161
+ Element<std::uint64_t> pixel_crop_left{0};
1162
+
1163
+ /**
1164
+ A parsed \WebMID{PixelCropRight} element.
1165
+ */
1166
+ Element<std::uint64_t> pixel_crop_right{0};
1167
+
1168
+ /**
1169
+ A parsed \WebMID{DisplayWidth} element.
1170
+ */
1171
+ Element<std::uint64_t> display_width;
1172
+
1173
+ /**
1174
+ A parsed \WebMID{DisplayHeight} element.
1175
+ */
1176
+ Element<std::uint64_t> display_height;
1177
+
1178
+ /**
1179
+ A parsed \WebMID{DisplayUnit} element.
1180
+ */
1181
+ Element<DisplayUnit> display_unit{DisplayUnit::kPixels};
1182
+
1183
+ /**
1184
+ A parsed \WebMID{AspectRatioType} element.
1185
+ */
1186
+ Element<AspectRatioType> aspect_ratio_type{AspectRatioType::kFreeResizing};
1187
+
1188
+ /**
1189
+ A parsed \WebMID{FrameRate} element (deprecated).
1190
+ */
1191
+ Element<double> frame_rate;
1192
+
1193
+ /**
1194
+ A parsed \WebMID{Colour} element.
1195
+ */
1196
+ Element<Colour> colour;
1197
+
1198
+ /**
1199
+ A parsed \WebMID{Projection} element.
1200
+ */
1201
+ Element<Projection> projection;
1202
+
1203
+ /**
1204
+ Returns true if every member within the two objects are equal.
1205
+ */
1206
+ bool operator==(const Video& other) const {
1207
+ return interlaced == other.interlaced && stereo_mode == other.stereo_mode &&
1208
+ alpha_mode == other.alpha_mode && pixel_width == other.pixel_width &&
1209
+ pixel_height == other.pixel_height &&
1210
+ pixel_crop_bottom == other.pixel_crop_bottom &&
1211
+ pixel_crop_top == other.pixel_crop_top &&
1212
+ pixel_crop_left == other.pixel_crop_left &&
1213
+ pixel_crop_right == other.pixel_crop_right &&
1214
+ display_width == other.display_width &&
1215
+ display_height == other.display_height &&
1216
+ display_unit == other.display_unit &&
1217
+ aspect_ratio_type == other.aspect_ratio_type &&
1218
+ frame_rate == other.frame_rate && colour == other.colour &&
1219
+ projection == other.projection;
1220
+ }
1221
+ };
1222
+
1223
+ /**
1224
+ A parsed \WebMID{AESSettingsCipherMode} element.
1225
+ */
1226
+ enum class AesSettingsCipherMode : std::uint64_t {
1227
+ /**
1228
+ Counter (CTR).
1229
+ */
1230
+ kCtr = 1,
1231
+ };
1232
+
1233
+ /**
1234
+ A parsed \WebMID{ContentEncAESSettings} element.
1235
+ */
1236
+ struct ContentEncAesSettings {
1237
+ /**
1238
+ A parsed \WebMID{AESSettingsCipherMode} element.
1239
+ */
1240
+ Element<AesSettingsCipherMode> aes_settings_cipher_mode{
1241
+ AesSettingsCipherMode::kCtr};
1242
+
1243
+ /**
1244
+ Returns true if every member within the two objects are equal.
1245
+ */
1246
+ bool operator==(const ContentEncAesSettings& other) const {
1247
+ return aes_settings_cipher_mode == other.aes_settings_cipher_mode;
1248
+ }
1249
+ };
1250
+
1251
+ /**
1252
+ A parsed \WebMID{ContentEncAlgo} element.
1253
+ */
1254
+ enum class ContentEncAlgo : std::uint64_t {
1255
+ /**
1256
+ The contents have been signed but not encrypted.
1257
+ */
1258
+ kOnlySigned = 0,
1259
+
1260
+ /**
1261
+ DES encryption.
1262
+ */
1263
+ kDes = 1,
1264
+
1265
+ /**
1266
+ 3DES encryption.
1267
+ */
1268
+ k3Des = 2,
1269
+
1270
+ /**
1271
+ Twofish encryption.
1272
+ */
1273
+ kTwofish = 3,
1274
+
1275
+ /**
1276
+ Blowfish encryption.
1277
+ */
1278
+ kBlowfish = 4,
1279
+
1280
+ /**
1281
+ AES encryption.
1282
+ */
1283
+ kAes = 5,
1284
+ };
1285
+
1286
+ /**
1287
+ A parsed \WebMID{ContentEncryption} element.
1288
+ */
1289
+ struct ContentEncryption {
1290
+ /**
1291
+ A parsed \WebMID{ContentEncAlgo} element.
1292
+ */
1293
+ Element<ContentEncAlgo> algorithm{ContentEncAlgo::kOnlySigned};
1294
+
1295
+ /**
1296
+ A parsed \WebMID{ContentEncKeyID} element.
1297
+ */
1298
+ Element<std::vector<std::uint8_t>> key_id;
1299
+
1300
+ /**
1301
+ A parsed \WebMID{ContentEncAESSettings} element.
1302
+ */
1303
+ Element<ContentEncAesSettings> aes_settings;
1304
+
1305
+ /**
1306
+ Returns true if every member within the two objects are equal.
1307
+ */
1308
+ bool operator==(const ContentEncryption& other) const {
1309
+ return algorithm == other.algorithm && key_id == other.key_id &&
1310
+ aes_settings == other.aes_settings;
1311
+ }
1312
+ };
1313
+
1314
+ /**
1315
+ A parsed \WebMID{ContentEncodingType} element.
1316
+ */
1317
+ enum class ContentEncodingType : std::uint64_t {
1318
+ /**
1319
+ Compression.
1320
+ */
1321
+ kCompression = 0,
1322
+
1323
+ /**
1324
+ Encryption.
1325
+ */
1326
+ kEncryption = 1,
1327
+ };
1328
+
1329
+ /**
1330
+ A parsed \WebMID{ContentEncoding} element.
1331
+ */
1332
+ struct ContentEncoding {
1333
+ /**
1334
+ A parsed \WebMID{ContentEncodingOrder} element.
1335
+ */
1336
+ Element<std::uint64_t> order{0};
1337
+
1338
+ /**
1339
+ A parsed \WebMID{ContentEncodingScope} element.
1340
+ */
1341
+ Element<std::uint64_t> scope{1};
1342
+
1343
+ /**
1344
+ A parsed \WebMID{ContentEncodingType} element.
1345
+ */
1346
+ Element<ContentEncodingType> type{ContentEncodingType::kCompression};
1347
+
1348
+ /**
1349
+ A parsed \WebMID{ContentEncryption} element.
1350
+ */
1351
+ Element<ContentEncryption> encryption;
1352
+
1353
+ /**
1354
+ Returns true if every member within the two objects are equal.
1355
+ */
1356
+ bool operator==(const ContentEncoding& other) const {
1357
+ return order == other.order && scope == other.scope && type == other.type &&
1358
+ encryption == other.encryption;
1359
+ }
1360
+ };
1361
+
1362
+ /**
1363
+ A parsed \WebMID{ContentEncodings} element.
1364
+ */
1365
+ struct ContentEncodings {
1366
+ /**
1367
+ Parsed \WebMID{ContentEncoding} elements.
1368
+ */
1369
+ std::vector<Element<ContentEncoding>> encodings;
1370
+
1371
+ /**
1372
+ Returns true if every member within the two objects are equal.
1373
+ */
1374
+ bool operator==(const ContentEncodings& other) const {
1375
+ return encodings == other.encodings;
1376
+ }
1377
+ };
1378
+
1379
+ /**
1380
+ A parsed \WebMID{TrackType} element.
1381
+ */
1382
+ enum class TrackType : std::uint64_t {
1383
+ /**
1384
+ Video.
1385
+ */
1386
+ kVideo = 0x01,
1387
+
1388
+ /**
1389
+ Audio.
1390
+ */
1391
+ kAudio = 0x02,
1392
+
1393
+ /**
1394
+ Complex.
1395
+ */
1396
+ kComplex = 0x03,
1397
+
1398
+ /**
1399
+ Logo.
1400
+ */
1401
+ kLogo = 0x10,
1402
+
1403
+ /**
1404
+ Subtitle.
1405
+ */
1406
+ kSubtitle = 0x11,
1407
+
1408
+ /**
1409
+ Buttons.
1410
+ */
1411
+ kButtons = 0x12,
1412
+
1413
+ /**
1414
+ Control.
1415
+ */
1416
+ kControl = 0x20,
1417
+ };
1418
+
1419
+ /**
1420
+ A parsed \WebMID{TrackEntry} element.
1421
+ */
1422
+ struct TrackEntry {
1423
+ /**
1424
+ A parsed \WebMID{TrackNumber} element.
1425
+ */
1426
+ Element<std::uint64_t> track_number;
1427
+
1428
+ /**
1429
+ A parsed \WebMID{TrackUID} element.
1430
+ */
1431
+ Element<std::uint64_t> track_uid;
1432
+
1433
+ /**
1434
+ A parsed \WebMID{TrackType} element.
1435
+ */
1436
+ Element<TrackType> track_type;
1437
+
1438
+ /**
1439
+ A parsed \WebMID{FlagEnabled} element.
1440
+ */
1441
+ Element<bool> is_enabled{true};
1442
+
1443
+ /**
1444
+ A parsed \WebMID{FlagDefault} element.
1445
+ */
1446
+ Element<bool> is_default{true};
1447
+
1448
+ /**
1449
+ A parsed \WebMID{FlagForced} element.
1450
+ */
1451
+ Element<bool> is_forced{false};
1452
+
1453
+ /**
1454
+ A parsed \WebMID{FlagLacing} element.
1455
+ */
1456
+ Element<bool> uses_lacing{true};
1457
+
1458
+ /**
1459
+ A parsed \WebMID{DefaultDuration} element.
1460
+ */
1461
+ Element<std::uint64_t> default_duration;
1462
+
1463
+ /**
1464
+ A parsed \WebMID{Name} element.
1465
+ */
1466
+ Element<std::string> name;
1467
+
1468
+ /**
1469
+ A parsed \WebMID{Language} element.
1470
+ */
1471
+ Element<std::string> language{"eng"};
1472
+
1473
+ /**
1474
+ A parsed \WebMID{CodecID} element.
1475
+ */
1476
+ Element<std::string> codec_id;
1477
+
1478
+ /**
1479
+ A parsed \WebMID{CodecPrivate} element.
1480
+ */
1481
+ Element<std::vector<std::uint8_t>> codec_private;
1482
+
1483
+ /**
1484
+ A parsed \WebMID{CodecName} element.
1485
+ */
1486
+ Element<std::string> codec_name;
1487
+
1488
+ /**
1489
+ A parsed \WebMID{CodecDelay} element.
1490
+ */
1491
+ Element<std::uint64_t> codec_delay{0};
1492
+
1493
+ /**
1494
+ A parsed \WebMID{SeekPreRoll} element.
1495
+ */
1496
+ Element<std::uint64_t> seek_pre_roll{0};
1497
+
1498
+ /**
1499
+ A parsed \WebMID{Video} element.
1500
+ */
1501
+ Element<Video> video;
1502
+
1503
+ /**
1504
+ A parsed \WebMID{Audio} element.
1505
+ */
1506
+ Element<Audio> audio;
1507
+
1508
+ /**
1509
+ A parsed \WebMID{ContentEncodings} element.
1510
+ */
1511
+ Element<ContentEncodings> content_encodings;
1512
+
1513
+ /**
1514
+ Returns true if every member within the two objects are equal.
1515
+ */
1516
+ bool operator==(const TrackEntry& other) const {
1517
+ return track_number == other.track_number && track_uid == other.track_uid &&
1518
+ track_type == other.track_type && is_enabled == other.is_enabled &&
1519
+ is_default == other.is_default && is_forced == other.is_forced &&
1520
+ uses_lacing == other.uses_lacing &&
1521
+ default_duration == other.default_duration && name == other.name &&
1522
+ language == other.language && codec_id == other.codec_id &&
1523
+ codec_private == other.codec_private &&
1524
+ codec_name == other.codec_name && codec_delay == other.codec_delay &&
1525
+ seek_pre_roll == other.seek_pre_roll && video == other.video &&
1526
+ audio == other.audio && content_encodings == other.content_encodings;
1527
+ }
1528
+ };
1529
+
1530
+ /**
1531
+ A parsed \WebMID{CueTrackPositions} element.
1532
+ */
1533
+ struct CueTrackPositions {
1534
+ /**
1535
+ A parsed \WebMID{CueTrack} element.
1536
+ */
1537
+ Element<std::uint64_t> track;
1538
+
1539
+ /**
1540
+ A parsed \WebMID{CueClusterPosition} element.
1541
+ */
1542
+ Element<std::uint64_t> cluster_position;
1543
+
1544
+ /**
1545
+ A parsed \WebMID{CueRelativePosition} element.
1546
+ */
1547
+ Element<std::uint64_t> relative_position;
1548
+
1549
+ /**
1550
+ A parsed \WebMID{CueDuration} element.
1551
+ */
1552
+ Element<std::uint64_t> duration;
1553
+
1554
+ /**
1555
+ A parsed \WebMID{CueBlockNumber} element.
1556
+ */
1557
+ Element<std::uint64_t> block_number{1};
1558
+
1559
+ /**
1560
+ Returns true if every member within the two objects are equal.
1561
+ */
1562
+ bool operator==(const CueTrackPositions& other) const {
1563
+ return track == other.track && cluster_position == other.cluster_position &&
1564
+ relative_position == other.relative_position &&
1565
+ duration == other.duration && block_number == other.block_number;
1566
+ }
1567
+ };
1568
+
1569
+ /**
1570
+ A parsed \WebMID{CuePoint} element.
1571
+ */
1572
+ struct CuePoint {
1573
+ /**
1574
+ A parsed \WebMID{CueTime} element.
1575
+ */
1576
+ Element<std::uint64_t> time;
1577
+
1578
+ /**
1579
+ Parsed \WebMID{CueTrackPositions} elements.
1580
+ */
1581
+ std::vector<Element<CueTrackPositions>> cue_track_positions;
1582
+
1583
+ /**
1584
+ Returns true if every member within the two objects are equal.
1585
+ */
1586
+ bool operator==(const CuePoint& other) const {
1587
+ return time == other.time &&
1588
+ cue_track_positions == other.cue_track_positions;
1589
+ }
1590
+ };
1591
+
1592
+ /**
1593
+ A parsed \WebMID{ChapterDisplay} element.
1594
+ */
1595
+ struct ChapterDisplay {
1596
+ /**
1597
+ A parsed \WebMID{ChapString} element.
1598
+ */
1599
+ Element<std::string> string;
1600
+
1601
+ /**
1602
+ Parsed \WebMID{ChapLanguage} elements.
1603
+ */
1604
+ std::vector<Element<std::string>> languages{Element<std::string>{"eng"}};
1605
+
1606
+ /**
1607
+ Parsed \WebMID{ChapCountry} elements.
1608
+ */
1609
+ std::vector<Element<std::string>> countries;
1610
+
1611
+ /**
1612
+ Returns true if every member within the two objects are equal.
1613
+ */
1614
+ bool operator==(const ChapterDisplay& other) const {
1615
+ return string == other.string && languages == other.languages &&
1616
+ countries == other.countries;
1617
+ }
1618
+ };
1619
+
1620
+ /**
1621
+ A parsed \WebMID{ChapterAtom} element.
1622
+ */
1623
+ struct ChapterAtom {
1624
+ /**
1625
+ A parsed \WebMID{ChapterUID} element.
1626
+ */
1627
+ Element<std::uint64_t> uid;
1628
+
1629
+ /**
1630
+ A parsed \WebMID{ChapterStringUID} element.
1631
+ */
1632
+ Element<std::string> string_uid;
1633
+
1634
+ /**
1635
+ A parsed \WebMID{ChapterTimeStart} element.
1636
+ */
1637
+ Element<std::uint64_t> time_start;
1638
+
1639
+ /**
1640
+ A parsed \WebMID{ChapterTimeEnd} element.
1641
+ */
1642
+ Element<std::uint64_t> time_end;
1643
+
1644
+ /**
1645
+ Parsed \WebMID{ChapterDisplay} elements.
1646
+ */
1647
+ std::vector<Element<ChapterDisplay>> displays;
1648
+
1649
+ /**
1650
+ Parsed \WebMID{ChapterAtom} elements.
1651
+ */
1652
+ std::vector<Element<ChapterAtom>> atoms;
1653
+
1654
+ /**
1655
+ Returns true if every member within the two objects are equal.
1656
+ */
1657
+ bool operator==(const ChapterAtom& other) const {
1658
+ return uid == other.uid && string_uid == other.string_uid &&
1659
+ time_start == other.time_start && time_end == other.time_end &&
1660
+ displays == other.displays && atoms == other.atoms;
1661
+ }
1662
+ };
1663
+
1664
+ /**
1665
+ A parsed \WebMID{EditionEntry} element.
1666
+ */
1667
+ struct EditionEntry {
1668
+ /**
1669
+ Parsed \WebMID{ChapterAtom} elements.
1670
+ */
1671
+ std::vector<Element<ChapterAtom>> atoms;
1672
+
1673
+ /**
1674
+ Returns true if every member within the two objects are equal.
1675
+ */
1676
+ bool operator==(const EditionEntry& other) const {
1677
+ return atoms == other.atoms;
1678
+ }
1679
+ };
1680
+
1681
+ /**
1682
+ A parsed \WebMID{SimpleTag} element.
1683
+ */
1684
+ struct SimpleTag {
1685
+ /**
1686
+ A parsed \WebMID{TagName} element.
1687
+ */
1688
+ Element<std::string> name;
1689
+
1690
+ /**
1691
+ A parsed \WebMID{TagLanguage} element.
1692
+ */
1693
+ Element<std::string> language{"und"};
1694
+
1695
+ /**
1696
+ A parsed \WebMID{TagDefault} element.
1697
+ */
1698
+ Element<bool> is_default{true};
1699
+
1700
+ /**
1701
+ A parsed \WebMID{TagString} element.
1702
+ */
1703
+ Element<std::string> string;
1704
+
1705
+ /**
1706
+ A parsed \WebMID{TagBinary} element.
1707
+ */
1708
+ Element<std::vector<std::uint8_t>> binary;
1709
+
1710
+ /**
1711
+ Parsed \WebMID{SimpleTag} elements.
1712
+ */
1713
+ std::vector<Element<SimpleTag>> tags;
1714
+
1715
+ /**
1716
+ Returns true if every member within the two objects are equal.
1717
+ */
1718
+ bool operator==(const SimpleTag& other) const {
1719
+ return name == other.name && language == other.language &&
1720
+ is_default == other.is_default && string == other.string &&
1721
+ binary == other.binary && tags == other.tags;
1722
+ }
1723
+ };
1724
+
1725
+ /**
1726
+ A parsed \WebMID{Targets} element.
1727
+ */
1728
+ struct Targets {
1729
+ /**
1730
+ A parsed \WebMID{TargetTypeValue} element.
1731
+ */
1732
+ Element<std::uint64_t> type_value{50};
1733
+
1734
+ /**
1735
+ A parsed \WebMID{TargetType} element.
1736
+ */
1737
+ Element<std::string> type;
1738
+
1739
+ /**
1740
+ Parsed \WebMID{TagTrackUID} elements.
1741
+ */
1742
+ std::vector<Element<std::uint64_t>> track_uids;
1743
+
1744
+ /**
1745
+ Returns true if every member within the two objects are equal.
1746
+ */
1747
+ bool operator==(const Targets& other) const {
1748
+ return type_value == other.type_value && type == other.type &&
1749
+ track_uids == other.track_uids;
1750
+ }
1751
+ };
1752
+
1753
+ /**
1754
+ A parsed \WebMID{Tag} element.
1755
+ */
1756
+ struct Tag {
1757
+ /**
1758
+ A parsed \WebMID{Targets} element.
1759
+ */
1760
+ Element<Targets> targets;
1761
+
1762
+ /**
1763
+ Parsed \WebMID{SimpleTag} elements.
1764
+ */
1765
+ std::vector<Element<SimpleTag>> tags;
1766
+
1767
+ /**
1768
+ Returns true if every member within the two objects are equal.
1769
+ */
1770
+ bool operator==(const Tag& other) const {
1771
+ return targets == other.targets && tags == other.tags;
1772
+ }
1773
+ };
1774
+
1775
+ /**
1776
+ @}
1777
+ */
1778
+
1779
+ } // namespace webm
1780
+
1781
+ #endif // INCLUDE_WEBM_DOM_TYPES_H_